:root {
  /* Color tokens live in theme.css (light default; data-theme="dark" reserved). */
}

* { box-sizing: border-box; }

[hidden] {
  display: none !important;
}

html, body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(1100px 520px at 8% -12%, #e7efe9 0%, transparent 55%),
    radial-gradient(900px 480px at 100% 0%, #f0e8dc 0%, transparent 52%),
    linear-gradient(180deg, #f7f4ee 0%, var(--bg) 42%, #efebe3 100%);
  color: var(--text);
  font-family: var(--sans);
}

.shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 1.25rem 1.5rem 3rem;
}

.top {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--line);
}

.brand {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.subtitle {
  color: var(--muted);
  font-size: 0.85rem;
  margin-top: 0.15rem;
}

.controls {
  display: flex;
  gap: 0.75rem;
  align-items: flex-end;
  flex-wrap: wrap;
}

button {
  font: inherit;
  background: var(--btn-bg);
  color: var(--btn-fg);
  border: 0;
  border-radius: 8px;
  padding: 0.6rem 1rem;
  font-weight: 600;
  cursor: pointer;
}

button:hover:not(:disabled) {
  background: var(--btn-bg-hover);
}

button:active:not(:disabled) {
  background: var(--btn-bg-pressed);
}

button:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

button:disabled {
  background: var(--btn-bg-disabled);
  color: var(--btn-fg-disabled);
  cursor: not-allowed;
  opacity: 0.85;
}

.ghost {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
  padding: 0.6rem 0.2rem;
}

.ghost:hover { color: var(--text); }

.ghost.nav-details {
  color: var(--muted);
  font-size: 0.82rem;
}

.hero {
  padding: 2rem 0 1.25rem;
  animation: rise 0.45s ease both;
}

.hero h1 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  font-weight: 600;
}

.meta, .disclaimer, .integrity {
  color: var(--muted);
  margin: 0.35rem 0;
  font-size: 0.92rem;
}

.uncertainty, .next-action {
  margin: 0.55rem 0 0;
  max-width: 46rem;
  line-height: 1.45;
  font-size: 0.98rem;
}

.uncertainty {
  color: var(--watch);
}

.next-action {
  color: var(--text);
  font-weight: 600;
}

.see-details {
  margin: 1.25rem 0 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--bg-elev);
  padding: 0.75rem 1rem 1rem;
}

.see-details > summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.35rem 0;
}

.see-details > summary:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
  border-radius: 4px;
}

.see-details .nested-panel {
  margin-top: 1rem;
  border: 0;
  padding: 0;
  background: transparent;
}

.integrity.qualified { color: var(--watch); }
.integrity.matched { color: var(--good); }

.intent-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}

.intent-grid label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.intent-grid label.wide,
.intent-grid .wide { grid-column: 1 / -1; }

.intent-grid input,
.intent-grid select {
  background: var(--bg-elev);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.55rem 0.7rem;
  font: inherit;
}

.summary {
  margin: 0.75rem 0 0;
  max-width: 46rem;
  line-height: 1.45;
  font-size: 1.05rem;
}

.strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  margin: 1rem 0 1.5rem;
}

.strip article {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1rem;
  animation: rise 0.5s ease both;
}

.strip-label {
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.strip-value {
  font-family: var(--mono);
  font-size: 1.25rem;
  margin-top: 0.35rem;
}

.strip-value.good { color: var(--good); }
.strip-value.watch { color: var(--watch); }
.strip-value.risk { color: var(--risk); }

.strip-sub {
  color: var(--muted);
  font-size: 0.8rem;
  margin-top: 0.35rem;
}

.panel {
  margin: 1.5rem 0;
  padding: 1.25rem 0 0;
  border-top: 1px solid var(--line);
  animation: rise 0.55s ease both;
}

.panel-head h2 {
  margin: 0;
  font-size: 1.15rem;
}

.panel-head p {
  margin: 0.35rem 0 1rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.drivers, .comparisons {
  display: grid;
  gap: 0.75rem;
}

.driver, .comparison {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.9rem 1rem;
}

.driver strong, .comparison strong {
  display: block;
  margin-bottom: 0.25rem;
}

.driver p, .comparison p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.4;
}

.comparison .delta {
  font-family: var(--mono);
  font-size: 0.85rem;
  margin-top: 0.5rem;
  color: var(--accent);
}

.assumptions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
}

.assumptions label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.assumptions label.wide { grid-column: 1 / -1; }

.assumptions label.check {
  flex-direction: row;
  align-items: center;
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.9rem;
  color: var(--text);
}

.assumptions input[type="number"],
.assumptions input[type="text"] {
  background: var(--bg-elev);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.55rem 0.7rem;
  font: inherit;
}

.form-actions {
  grid-column: 1 / -1;
  display: flex;
  gap: 1rem;
  align-items: center;
  margin-top: 0.5rem;
}

.hint { color: var(--muted); font-size: 0.85rem; }

.field-help {
  display: block;
  margin-top: 0.35rem;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 400;
  line-height: 1.35;
}

.insights {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.65rem;
}

.insights li {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.85rem 1rem;
  line-height: 1.4;
  color: var(--muted);
}

@keyframes rise {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

@media (max-width: 900px) {
  .strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .assumptions { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 560px) {
  .strip, .assumptions { grid-template-columns: 1fr; }
  .top { flex-direction: column; align-items: flex-start; }
}
