/* Concepto: cabecera nocturna con la curva del estirón; debajo, un panel de laboratorio
   claro con formulario fijo a la izquierda y resultados teñidos por el color de la fase. */
:root {
  color-scheme: light;
  /* Tipografía */
  --font-display: "Bricolage Grotesque", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --font-body: "Figtree", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  /* Superficies (neutros con sesgo azul) */
  --bg: #eef1f7;
  --surface: #ffffff;
  --surface-2: #f4f6fb;
  --line: #dfe4ef;
  --line-strong: #b9c2d6;
  --text: #0e1630;
  --text-2: #475069;
  --text-3: #6b7390;

  /* Marca */
  --ink: #131c3f;
  --accent: #3550c8;
  --accent-ink: #ffffff;
  --hero-bg: #0d1431;
  --hero-bg-2: #1b2660;
  --hero-ink: #f3f5ff;
  --hero-ink-2: #b9c1e6;
  --hero-glow: #4b6cf0;

  /* Fases */
  --pre: #2a78d6;
  --circa: #eb6834;
  --post: #1baf7a;
  --pre-soft: rgba(42, 120, 214, 0.12);
  --circa-soft: rgba(235, 104, 52, 0.13);
  --post-soft: rgba(27, 175, 122, 0.13);
  --early-soft: rgba(98, 80, 214, 0.16);
  --late-soft: rgba(237, 161, 0, 0.2);
  --ontime-soft: rgba(27, 175, 122, 0.14);

  --curve: #0e1630;
  --grid: #e7ebf3;
  --warn-bg: #fff3d9;
  --warn-ink: #6b4a00;
  --error: #b42f2f;
  --shadow: 0 1px 2px rgba(14, 22, 48, 0.06), 0 8px 24px rgba(14, 22, 48, 0.06);
  --radius: 16px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0b1024;
    --surface: #131a35;
    --surface-2: #1a2243;
    --line: #27305a;
    --line-strong: #3b4677;
    --text: #eef1ff;
    --text-2: #c0c6e4;
    --text-3: #959dc2;
    --ink: #eef1ff;
    --accent: #7d93ff;
    --accent-ink: #0b1024;
    --hero-bg: #070b1d;
    --hero-bg-2: #172056;
    --hero-glow: #4b6cf0;
    --pre: #3987e5;
    --circa: #e5703f;
    --post: #1fb07d;
    --pre-soft: rgba(57, 135, 229, 0.18);
    --circa-soft: rgba(229, 112, 63, 0.18);
    --post-soft: rgba(31, 176, 125, 0.18);
    --early-soft: rgba(144, 133, 233, 0.22);
    --late-soft: rgba(201, 133, 0, 0.25);
    --ontime-soft: rgba(31, 176, 125, 0.18);
    --curve: #eef1ff;
    --grid: #222a50;
    --warn-bg: #3a2f12;
    --warn-ink: #f3d68a;
    --error: #ff8a8a;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 10px 30px rgba(0, 0, 0, 0.25);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b1024;
  --surface: #131a35;
  --surface-2: #1a2243;
  --line: #27305a;
  --line-strong: #3b4677;
  --text: #eef1ff;
  --text-2: #c0c6e4;
  --text-3: #959dc2;
  --ink: #eef1ff;
  --accent: #7d93ff;
  --accent-ink: #0b1024;
  --hero-bg: #070b1d;
  --hero-bg-2: #172056;
  --hero-glow: #4b6cf0;
  --pre: #3987e5;
  --circa: #e5703f;
  --post: #1fb07d;
  --pre-soft: rgba(57, 135, 229, 0.18);
  --circa-soft: rgba(229, 112, 63, 0.18);
  --post-soft: rgba(31, 176, 125, 0.18);
  --early-soft: rgba(144, 133, 233, 0.22);
  --late-soft: rgba(201, 133, 0, 0.25);
  --ontime-soft: rgba(31, 176, 125, 0.18);
  --curve: #eef1ff;
  --grid: #222a50;
  --warn-bg: #3a2f12;
  --warn-ink: #f3d68a;
  --error: #ff8a8a;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 10px 30px rgba(0, 0, 0, 0.25);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.15; margin: 0; text-wrap: balance; letter-spacing: -0.01em; }
h2 { font-size: 1.3rem; font-weight: 700; }
h3 { font-size: 1.08rem; font-weight: 700; }
h3 small { font-family: var(--font-body); font-size: .78rem; font-weight: 600; color: var(--text-3); margin-left: 6px; letter-spacing: 0; }
h4 { font-size: 1rem; font-weight: 700; }
p { margin: 0; }
small { color: var(--text-3); font-weight: 500; }
a { color: var(--accent); }

.wrap { max-width: 1240px; margin: 0 auto; padding-inline: 20px; }
@media (max-width: 520px) { .wrap { padding-inline: 16px; } }

/* ---------- Cabecera ---------- */
.hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(1200px 400px at 50% -10%, var(--hero-bg-2), transparent 70%),
    var(--hero-bg);
  color: var(--hero-ink);
  padding: 64px 20px 150px;
  text-align: center;
}
.hero-curve { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 34%; opacity: .85; }
.hero-inner { position: relative; max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; align-items: center; gap: 18px; }
.eyebrow { font-size: .75rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--hero-ink-2); }
.brand { display: inline-flex; align-items: flex-start; gap: 10px; font-weight: 800; }
.brand-main {
  font-size: clamp(4rem, 13vw, 7.5rem);
  line-height: .9;
  letter-spacing: -0.045em;
  background: linear-gradient(100deg, #ffffff 0%, #dfe5ff 45%, #ffd2bd 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.brand-pro {
  margin-top: .55em;
  font-size: clamp(.9rem, 2.4vw, 1.15rem);
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
  color: var(--hero-bg);
  background: linear-gradient(90deg, var(--pre), var(--circa) 55%, var(--post));
}
.slogan {
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 2.6vw, 1.5rem);
  font-weight: 500;
  line-height: 1.35;
  color: var(--hero-ink);
  max-width: 34ch;
  text-wrap: balance;
}
.chips { list-style: none; padding: 0; margin: 4px 0 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.chips li {
  font-size: .78rem; font-weight: 600; color: var(--hero-ink);
  padding: 5px 12px; border-radius: 999px;
  background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .16);
  backdrop-filter: blur(4px);
}

/* ---------- Estructura ---------- */
.layout {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin-top: -64px;
  position: relative;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
}
.results { display: flex; flex-direction: column; gap: 20px; min-width: 0; scroll-margin-top: calc(16px + env(safe-area-inset-top, 0px)); }
#result-body { display: flex; flex-direction: column; gap: 20px; }
.panel-head { display: flex; flex-direction: column; gap: 4px; margin-bottom: 16px; }
.panel-head p { color: var(--text-3); font-size: .88rem; }
.panel-head.row { flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; }
.duo { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
@media (max-width: 1100px) { .duo { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Formulario ---------- */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 760px) { .form-grid { grid-template-columns: minmax(0, 1fr); } }
fieldset { border: 1px solid var(--line); border-radius: 14px; padding: 16px; margin: 0; min-width: 0; background: var(--surface-2); }
fieldset input[type="text"], fieldset input[type="number"], fieldset input[type="date"] { background: var(--surface); }
fieldset .segmented { background: var(--surface); }
fieldset .segmented input:checked + span { background: var(--accent); color: var(--accent-ink); }
legend { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 700; font-size: 1rem; padding: 0; margin-bottom: 12px; float: left; width: 100%; }
legend + * { clear: both; }
.step {
  display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%;
  font-family: var(--font-body); font-size: .8rem; font-weight: 700;
  color: var(--accent-ink); background: var(--accent);
}
.opt { font-family: var(--font-body); font-style: normal; font-size: .7rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px; }
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; min-width: 0; }
.field label, .label { font-size: .84rem; font-weight: 600; color: var(--text-2); }
input[type="text"], input[type="number"], input[type="date"] {
  font: inherit; font-size: .95rem; color: var(--text); background: var(--surface-2);
  border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; width: 100%; min-width: 0;
  transition: border-color .15s, box-shadow .15s, background .15s;
  font-variant-numeric: tabular-nums;
}
input::placeholder { color: var(--text-3); }
input:hover { border-color: var(--line-strong); }
input:focus-visible { outline: none; border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
input[aria-invalid="true"] { border-color: var(--error); }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 420px) { .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.hint { font-size: .8rem; color: var(--text-3); margin-top: -2px; }

.segmented { display: grid; grid-template-columns: 1fr 1fr; padding: 4px; gap: 4px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; }
.segmented label { position: relative; }
.segmented input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.segmented span { display: block; text-align: center; padding: 7px 12px; font-size: .9rem; font-weight: 600; color: var(--text-2); border-radius: 9px; transition: background .15s, color .15s; }
.segmented input:checked + span { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(14, 22, 48, .14); }
.segmented input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 1px; }

.howto { font-size: .85rem; color: var(--text-2); }
.howto summary { cursor: pointer; color: var(--accent); font-weight: 600; }
.howto p { margin-top: 6px; }

.actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; padding-top: 18px; }
.btn {
  font: inherit; font-size: .92rem; font-weight: 600; padding: 10px 16px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface-2); color: var(--text); cursor: pointer;
  transition: transform .1s, background .15s, border-color .15s;
}
.btn:hover { border-color: var(--line-strong); }
.btn:active { transform: translateY(1px); }
.btn.primary {
  order: 3;
  min-width: 220px;
  border: 0; color: #fff; padding: 12px 18px; font-size: 1rem;
  background: linear-gradient(100deg, var(--pre), #5a4fd8 55%, var(--circa));
  box-shadow: 0 6px 18px color-mix(in srgb, var(--pre) 35%, transparent);
}
.btn.primary:hover { filter: brightness(1.06); }
.btn.ghost { background: transparent; }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.error { color: var(--error); font-size: .9rem; margin-top: 10px; }

/* ---------- Estado vacío ---------- */
.empty { text-align: center; padding: 48px 24px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.empty-art { width: 140px; height: 70px; }
.empty p { color: var(--text-2); max-width: 46ch; }

/* ---------- Tarjeta de fase ---------- */
.phase-hero {
  --phase: var(--text-3);
  --phase-soft: var(--surface-2);
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(600px 220px at 100% 0%, var(--phase-soft), transparent 70%),
    var(--surface);
  border-top: 5px solid var(--phase);
}
.phase-hero[data-phase="pre"] { --phase: var(--pre); --phase-soft: var(--pre-soft); }
.phase-hero[data-phase="circa"] { --phase: var(--circa); --phase-soft: var(--circa-soft); }
.phase-hero[data-phase="post"] { --phase: var(--post); --phase-soft: var(--post-soft); }
.phase-hero-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 18px; }
.eyebrow-sm { font-size: .74rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--text-3); margin-bottom: 6px; }
.phase-name { display: flex; align-items: center; gap: 12px; font-family: var(--font-display); font-size: clamp(2rem, 5vw, 2.8rem); font-weight: 800; letter-spacing: -0.03em; line-height: 1; }
.phase-dot { width: 18px; height: 18px; border-radius: 50%; background: var(--phase); box-shadow: 0 0 0 6px var(--phase-soft); flex: none; }
.phase-tagline { margin-top: 10px; color: var(--text-2); font-weight: 500; }
.offset-ring { flex: none; width: 112px; height: 112px; }
.offset-ring svg { width: 100%; height: 100%; display: block; }
@media (max-width: 520px) { .offset-ring { width: 84px; height: 84px; } }

.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
@media (max-width: 1180px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.kpi { background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.kpi-label { font-size: .74rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--text-3); }
.kpi-value { font-family: var(--font-display); font-size: 1.55rem; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.kpi-value.small { font-size: 1.15rem; line-height: 1.3; padding-block: 4px; }
.kpi-sub { font-size: .8rem; color: var(--text-3); }
.phase-text { color: var(--text-2); max-width: 75ch; }
.phase-text strong { color: var(--text); }
.warnings { list-style: none; padding: 0; margin: 14px 0 0; display: flex; flex-direction: column; gap: 6px; }
.warnings:empty { display: none; }
.warnings li { background: var(--warn-bg); color: var(--warn-ink); padding: 9px 12px; border-radius: 10px; font-size: .87rem; }
.warnings li::before { content: "⚠ "; }

.result-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.result-actions p { font-size: .85rem; color: var(--text-3); }
.result-actions .btn.primary { order: 0; min-width: 0; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.btn:disabled { opacity: .7; cursor: progress; }
@media (max-width: 520px) { .result-actions .btn.primary { width: 100%; } }

/* ---------- Gráfica ---------- */
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: .8rem; color: var(--text-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.swatch { width: 14px; height: 10px; border-radius: 3px; display: inline-block; }
.swatch.line { height: 3px; border-radius: 2px; background: var(--curve); }
.swatch.hatch { background: repeating-linear-gradient(45deg, var(--text-3) 0 1px, transparent 1px 4px); border: 1px solid var(--text-3); }
.swatch.marker { width: 10px; height: 10px; border-radius: 50%; background: var(--text); border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--text); }
.chart-wrap { position: relative; width: 100%; }
.chart-wrap svg { display: block; width: 100%; height: auto; }
.chart-wrap text { font-family: var(--font-body); }
.tooltip {
  position: absolute; pointer-events: none; z-index: 2;
  background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: 10px;
  padding: 8px 11px; font-size: .8rem; box-shadow: var(--shadow); white-space: nowrap; transform: translate(-50%, -115%);
}
.tooltip strong { display: block; font-family: var(--font-display); }
.caption { font-size: .8rem; color: var(--text-3); margin-top: 10px; }

/* ---------- Línea de fases ---------- */
.timeline { display: flex; flex-direction: column; gap: 8px; }
.timeline-bar { position: relative; display: flex; height: 44px; gap: 3px; }
.timeline-bar > div { display: flex; align-items: center; justify-content: center; font-size: .8rem; font-weight: 700; min-width: 0; overflow: hidden; white-space: nowrap; border-radius: 10px; color: var(--text); }
.timeline-bar .seg-pre { background: var(--pre-soft); box-shadow: inset 0 -4px 0 var(--pre); }
.timeline-bar .seg-circa { background: var(--circa-soft); box-shadow: inset 0 -4px 0 var(--circa); }
.timeline-bar .seg-post { background: var(--post-soft); box-shadow: inset 0 -4px 0 var(--post); }
.timeline-marker { position: absolute; top: -6px; bottom: -6px; width: 4px; background: var(--text); border-radius: 2px; transform: translateX(-50%); box-shadow: 0 0 0 2px var(--surface); }
.timeline-marker::after { content: "Hoy"; position: absolute; top: -20px; left: 50%; transform: translateX(-50%); font-size: .7rem; font-weight: 700; color: var(--text); }
.timeline-axis { position: relative; height: 18px; font-size: .74rem; color: var(--text-3); font-variant-numeric: tabular-nums; margin-top: 2px; }
.timeline-axis span { position: absolute; transform: translateX(-50%); }
.timeline-note { font-size: .88rem; color: var(--text-2); margin-top: 4px; }

/* ---------- Edad biológica ---------- */
.bio-top { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 18px; margin-bottom: 30px; }
.bio-top > div { display: flex; flex-direction: column; }
.bio-top .k { font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); }
.bio-num { font-family: var(--font-display); font-size: 2rem; font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.bio-num.accent { color: var(--accent); }
.bio-arrow { font-size: 1.4rem; color: var(--text-3); padding-bottom: 4px; }
.status-pill { margin-left: auto; align-self: center; font-size: .82rem; font-weight: 700; padding: 5px 12px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); }
.status-pill.early { background: var(--early-soft); border-color: transparent; }
.status-pill.late { background: var(--late-soft); border-color: transparent; }
.status-pill.ontime { background: var(--ontime-soft); border-color: transparent; }
.bio-scale { position: relative; padding-top: 22px; }
.bio-track { position: relative; height: 30px; border-radius: 10px; background: linear-gradient(90deg, var(--late-soft), var(--surface-2) 40%, var(--surface-2) 60%, var(--early-soft)); border: 1px solid var(--line); }
.bio-band { position: absolute; top: 0; bottom: 0; background: var(--ontime-soft); border-left: 2px dashed var(--line-strong); border-right: 2px dashed var(--line-strong); display: flex; align-items: center; justify-content: center; font-size: .7rem; font-weight: 600; color: var(--text-2); white-space: nowrap; overflow: hidden; }
.bio-side { position: absolute; top: 50%; transform: translateY(-50%); font-size: .7rem; font-weight: 600; color: var(--text-3); }
.bio-side.left { left: 8px; }
.bio-side.right { right: 8px; }
.bio-pin { position: absolute; top: 0; height: 64px; width: 0; }
.bio-pin::before { content: ""; position: absolute; left: -2px; top: 18px; width: 4px; height: 40px; border-radius: 2px; box-shadow: 0 0 0 2px var(--surface); }
.bio-pin b { position: absolute; top: 0; left: 0; transform: translateX(-50%); font-size: .7rem; white-space: nowrap; }
.bio-pin.chrono::before { background: var(--text-3); }
.bio-pin.chrono b { color: var(--text-2); top: 66px; }
.bio-pin.bio::before { background: var(--accent); }
.bio-pin.bio b { color: var(--accent); }
.bio-scale .timeline-axis { margin-top: 26px; }

/* ---------- Tabla ---------- */
.table-wrap { overflow-x: auto; }
table.methods { width: 100%; border-collapse: collapse; font-size: .9rem; font-variant-numeric: tabular-nums; }
.methods th, .methods td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.methods th { font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); font-weight: 700; }
.methods tbody tr:hover { background: var(--surface-2); }
.methods tr.mean td { font-weight: 700; background: var(--surface-2); border-bottom: 0; }
.methods .dot { margin-right: 6px; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px 2px 8px; border-radius: 999px; font-size: .8rem; font-weight: 600; }
.pill.pre { background: var(--pre-soft); }
.pill.circa { background: var(--circa-soft); }
.pill.post { background: var(--post-soft); }

.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; vertical-align: middle; flex: none; }
.dot.pre { background: var(--pre); }
.dot.circa { background: var(--circa); }
.dot.post { background: var(--post); }

.extras { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.extra { display: flex; flex-direction: column; gap: 4px; padding: 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); }
.extra .v { font-family: var(--font-display); font-size: 1.4rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.extra .d { font-size: .86rem; color: var(--text-2); }
.extra .k { font-size: .74rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--text-3); }

/* ---------- Información ---------- */
.info { margin-top: 56px; display: flex; flex-direction: column; gap: 22px; }
.info-head { max-width: 760px; display: flex; flex-direction: column; gap: 10px; }
.info-head h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
.info p, .info li { color: var(--text-2); }
.formulas { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.formulas article { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px; min-width: 0; display: flex; flex-direction: column; gap: 8px; box-shadow: var(--shadow); }
.formulas p { font-size: .88rem; }
.formulas code { display: block; font-family: var(--font-mono); font-size: .74rem; line-height: 1.6; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 7px 9px; overflow-wrap: anywhere; color: var(--text); }
.info-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; }
@media (max-width: 800px) { .info-grid { grid-template-columns: minmax(0, 1fr); } }
.info-grid h3, .info > h3 { margin-bottom: 10px; }
.phase-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.phase-list li { display: flex; gap: 10px; align-items: baseline; }
.plain { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; }
.refs { font-size: .85rem; margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.footer { margin-top: 48px; padding: 24px 20px 40px; text-align: center; font-size: .82rem; color: var(--text-3); border-top: 1px solid var(--line); }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

@media print {
  .form, .info, .footer, .result-actions, .hero-curve, .chips { display: none !important; }
  .layout { margin-top: 0; }
  .hero { padding: 16px; }
  .panel { box-shadow: none; break-inside: avoid; }
}
