/* FastFab additions on top of the shared FastGRID stylesheet. */

/* Presets above the lab */
.presets { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.presets button { border: 1px solid var(--rule); background: var(--card); color: var(--ink); border-radius: 999px;
  padding: 7px 14px; font: 500 13px var(--sans); cursor: pointer; }
.presets button:hover { border-color: var(--accent); color: var(--accent-ink); }

/* Lab: controls on the left, results on the right */
.feature.lab { grid-template-columns: minmax(300px, 1fr) 2fr; min-height: 0; }
.controls { gap: 12px; }
.controls .eyebrow { margin-top: 10px; }
.controls .eyebrow:first-child { margin-top: 0; }
.ctl { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; font-size: 14px; color: var(--on-night-2); }
.ctl output { font: 500 13px var(--mono); color: var(--on-night); font-variant-numeric: tabular-nums; }
.ctl output.out { color: var(--accent); }
.ctl input { grid-column: 1 / -1; width: 100%; margin: 6px 0 10px; height: 18px; background: none; -webkit-appearance: none; appearance: none; }
.ctl input::-webkit-slider-runnable-track { height: 4px; border-radius: 2px;
  background: linear-gradient(to right, var(--night-line) var(--a), #5d626c var(--a), #5d626c var(--b), var(--night-line) var(--b)); }
.ctl input::-moz-range-track { height: 4px; border-radius: 2px;
  background: linear-gradient(to right, var(--night-line) var(--a), #5d626c var(--a), #5d626c var(--b), var(--night-line) var(--b)); }
.ctl input::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; margin-top: -6px; border-radius: 50%;
  background: var(--on-night); border: 0; }
.ctl input::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: var(--on-night); border: 0; }
.ctl input:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.legend-note { font-size: 12.5px; display: flex; align-items: center; gap: 8px; }
.legend-note .box { width: 22px; height: 4px; border-radius: 2px; background: #5d626c; flex: none; }

.results { background: var(--night-2); padding: 22px; display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.verdict { border-radius: 8px; padding: 14px 16px; border: 1px solid var(--night-line); display: grid; gap: 4px; }
.verdict b { font-family: var(--display); font-size: 22px; font-weight: 500; letter-spacing: -0.03em; color: var(--on-night); }
.verdict span { font-size: 14px; color: var(--on-night-2); }
.verdict.trust { border-color: #2fa37a; background: rgba(47, 163, 122, .1); }
.verdict.trust b::before { content: "● "; color: #2fa37a; }
.verdict.fallback { border-color: var(--accent); background: rgba(255, 106, 43, .1); }
.verdict.fallback b::before { content: "● "; color: var(--accent); }
.chart-box { position: relative; height: 300px; }
table.readout { width: 100%; border-collapse: collapse; font-size: 14px; color: var(--on-night-2); }
table.readout th, table.readout td { text-align: right; padding: 9px 8px; border-bottom: 1px solid var(--night-line); font-variant-numeric: tabular-nums; white-space: nowrap; }
table.readout th:first-child, table.readout td:first-child { text-align: left; }
table.readout th { font: 500 11px var(--mono); letter-spacing: .06em; text-transform: uppercase; }
table.readout td { color: var(--on-night); }
table.readout td.ok { color: #4cc596; }
table.readout td.bad { color: #ff8a55; }
table.readout tr:last-child td { border-bottom: 0; }
@media (max-width: 900px) { .feature.lab { grid-template-columns: 1fr; } .chart-box { height: 260px; } }

/* Validation cards */
.vcard { background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius); padding: 24px; display: grid; gap: 14px; align-content: start; }
.vcard h3 { margin: 0; font-size: 20px; letter-spacing: -0.03em; font-weight: 600; }
.vcard .big { font-family: var(--display); font-size: clamp(40px, 4vw, 56px); font-weight: 500; letter-spacing: -0.05em; line-height: 1; }
.vcard dl { margin: 0; display: grid; grid-template-columns: 1fr auto; gap: 8px 12px; font-size: 14px; }
.vcard dt { color: var(--ink-2); }
.vcard dd { margin: 0; font-variant-numeric: tabular-nums; font-weight: 500; }
@media (max-width: 860px) { .cols-3 { grid-template-columns: 1fr; } }

/* Notes: measured / calculated / assumed */
.notes { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; }
.notes div { min-width: 0; border-top: 2px solid var(--rule); padding-top: 10px; }
.notes b { display: block; font-weight: 600; margin-bottom: 4px; }
.notes p { color: var(--ink-2); font-size: 15px; margin: 0; }
.notes .key { border-top-color: var(--accent); }
.requirement { font-family: var(--display); font-size: clamp(24px, 2.6vw, 36px); line-height: 1.15; letter-spacing: -0.035em;
  font-weight: 500; margin: 0 0 40px; max-width: 30em; border-left: 3px solid var(--accent); padding-left: 22px; text-wrap: pretty; }

/* Figures */
figure.diagram { margin: 0; }
figure.diagram svg { width: 100%; height: auto; display: block; color: var(--ink); }
@media (max-width: 700px) {
  figure.diagram { overflow-x: auto; }
  figure.diagram svg { min-width: 720px; }
  figure.diagram figcaption { position: sticky; left: 0; max-width: calc(100vw - 2 * var(--gutter)); }
}
figure.diagram figcaption { font-size: 14px; color: var(--ink-2); margin-top: 12px; max-width: 52em; }
.chart-light { position: relative; height: 380px; }
.source { font-size: 13px; color: var(--muted); }
.source a { color: var(--accent-ink); }

/* Narrow phones: the header keeps brand, menu and language only (EulerX stays in the footer). */
@media (max-width: 420px) { .site-header .account-link { display: none; } }
