:root {
  color-scheme: light;
  --ink: #17211b;
  --muted: #647067;
  --line: #d9dfd8;
  --paper: #f7f5ef;
  --panel: #fffdf7;
  --field: #ffffff;
  --accent: #0f6b57;
  --accent-strong: #094c3e;
  --amber: #c87916;
  --red: #b7352d;
  --green: #19734d;
  --blue: #205d92;
  --shadow: 0 18px 50px rgba(23, 33, 27, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Aptos", "Segoe UI", sans-serif;
  background:
    linear-gradient(135deg, rgba(15, 107, 87, 0.14), transparent 32%),
    linear-gradient(315deg, rgba(200, 121, 22, 0.14), transparent 28%),
    repeating-linear-gradient(90deg, rgba(23, 33, 27, 0.035) 0 1px, transparent 1px 72px),
    var(--paper);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.shell {
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 56px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 24px;
  align-items: end;
  margin-bottom: 24px;
}

.hero h1 {
  max-width: 820px;
  margin: 8px 0 10px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.25rem, 5vw, 5rem);
  line-height: 0.95;
  letter-spacing: 0;
}

.lede {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
  font-size: 1.05rem;
}

.eyebrow {
  margin: 0;
  color: var(--accent-strong);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.status-panel,
.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 247, 0.9);
  box-shadow: var(--shadow);
}

.status-panel {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 16px;
}

.status-panel span:last-child {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.9rem;
}

.dot {
  width: 13px;
  height: 13px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--amber);
}

.dot-ok {
  background: var(--green);
}

.dot-error {
  background: var(--red);
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 24px;
}

.panel {
  padding: 22px;
}

.panel-primary {
  min-height: 620px;
}

.panel-heading,
.result-topline,
.result-meta,
.evidence-header,
.actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

h2,
h3 {
  margin: 5px 0 0;
}

h2 {
  font-size: 1.35rem;
}

h3 {
  margin-bottom: 12px;
  font-size: 1rem;
}

.docs-link,
.ghost-button,
.secondary-button,
.primary-button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 14px;
  text-decoration: none;
  font-weight: 750;
}

.docs-link,
.ghost-button,
.secondary-button {
  color: var(--ink);
  background: #fffaf0;
}

.primary-button {
  min-width: 140px;
  border-color: var(--accent);
  color: white;
  background: var(--accent);
}

.primary-button:disabled {
  cursor: wait;
  opacity: 0.68;
}

.full {
  width: 100%;
}

.field {
  display: grid;
  gap: 8px;
  margin-top: 18px;
}

.field span,
.evidence-header span {
  font-weight: 800;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--field);
  color: var(--ink);
  outline: none;
}

.field input,
.field select {
  height: 46px;
  padding: 0 12px;
}

.field textarea {
  min-height: 210px;
  resize: vertical;
  padding: 12px;
  line-height: 1.45;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15, 107, 87, 0.14);
}

.mode-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 18px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #efeee6;
}

.mode-switch label {
  position: relative;
}

.mode-switch input {
  position: absolute;
  opacity: 0;
}

.mode-switch span {
  display: grid;
  min-height: 40px;
  place-items: center;
  border-radius: 6px;
  font-weight: 800;
}

.mode-switch input:checked + span {
  color: white;
  background: var(--ink);
}

.hidden {
  display: none !important;
}

.evidence-header {
  margin-top: 20px;
}

.evidence-header small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
}

.evidence-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.check-row {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 18px;
  font-weight: 800;
}

.check-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.evidence-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  gap: 8px;
}

.icon-button {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fffaf0;
  color: var(--red);
  font-weight: 900;
}

.evidence-row input {
  height: 42px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 12px;
}

.actions {
  justify-content: flex-start;
  margin-top: 22px;
}

.side-column {
  display: grid;
  gap: 24px;
  align-content: start;
}

.compact {
  box-shadow: none;
}

.capabilities {
  margin: 16px 0 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.55;
}

.providers-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.provider-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}

.provider-row strong,
.provider-row span {
  display: block;
}

.provider-status {
  margin-top: 4px;
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 900;
}

.provider-row p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.35;
}

.result {
  margin-top: 24px;
}

.result-topline {
  align-items: start;
}

.result-topline h2 {
  font-size: 2rem;
}

.confidence {
  min-width: 112px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  text-align: center;
  background: #fffaf0;
}

.confidence span {
  display: block;
  font-size: 1.45rem;
  font-weight: 900;
}

.confidence small,
.result-meta,
.muted {
  color: var(--muted);
}

.result-meta {
  margin-top: 16px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
  overflow-wrap: anywhere;
}

.result-grid,
.notes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  margin-top: 22px;
}

.dimension-panel,
.review-box {
  margin-top: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: #fffaf0;
}

.dimensions-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.dimension-row {
  display: grid;
  gap: 6px;
}

.dimension-row div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.9rem;
}

.dimension-row strong {
  color: var(--ink);
}

.dimension-row meter {
  width: 100%;
  height: 10px;
}

.graph-list,
.certificate-box {
  min-height: 160px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fff;
  overflow: auto;
}

.certificate-box {
  margin-bottom: 12px;
}

.certificate-box code,
.certificate-box pre {
  display: block;
  max-width: 100%;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.graph-summary {
  display: grid;
  grid-template-columns: auto 1fr auto 1fr;
  gap: 7px;
  align-items: baseline;
  margin-bottom: 12px;
}

.graph-summary strong {
  font-size: 1.35rem;
}

.graph-list p {
  margin: 7px 0;
  color: var(--muted);
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.84rem;
  overflow-wrap: anywhere;
}

.review-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.review-box .primary-button {
  margin: 14px 0;
}

.stack {
  display: grid;
  gap: 10px;
}

.item-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fff;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 0 9px;
  color: white;
  font-size: 0.75rem;
  font-weight: 900;
}

.badge.SUPPORTED,
.badge.FETCHED {
  background: var(--green);
}

.badge.CONTRADICTED,
.badge.FAILED {
  background: var(--red);
}

.badge.MIXED {
  background: var(--blue);
}

.badge.INSUFFICIENT_EVIDENCE {
  background: var(--amber);
}

.metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.9rem;
}

.notes ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.55;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  max-width: min(420px, calc(100% - 40px));
  border-radius: 8px;
  padding: 14px 16px;
  color: white;
  background: var(--ink);
  box-shadow: var(--shadow);
}

@media (max-width: 880px) {
  .shell {
    width: min(100% - 20px, 680px);
    padding-top: 18px;
  }

  .hero,
  .workspace,
  .result-grid,
  .notes,
  .dimensions-list,
  .review-grid {
    grid-template-columns: 1fr;
  }

  .panel-heading,
  .result-topline,
  .result-meta,
  .actions {
    align-items: stretch;
    flex-direction: column;
  }

  .docs-link,
  .primary-button,
  .secondary-button {
    display: grid;
    width: 100%;
    place-items: center;
  }
}
