/* Shared only by the deviation-score-percentile family. */
body[data-calculator-slug="deviation-score-percentile"] {
  --deviation-error: #b91c1c;
  --deviation-panel: var(--surface);
}
:root.dark body[data-calculator-slug="deviation-score-percentile"] {
  --deviation-error: #fca5a5;
}
.badge { display: inline-block; padding: 8px 14px; border-radius: 999px; background: #0b3b5a; color: #ecfeff; font-weight: 700; }
.layout { display: grid; gap: 16px; }
.two-col { grid-template-columns: repeat(auto-fit, minmax(min(100%, 330px), 1fr)); align-items: start; }
.field-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 12px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.layout > *, .summary-grid > *, .preset-grid > * { min-width: 0; }
.field .input { width: 100%; min-width: 0; box-sizing: border-box; }
.field [aria-invalid="true"] { border-color: var(--deviation-error); outline: 1px solid var(--deviation-error); }
.error-text { color: var(--deviation-error); font-size: 0.95rem; min-height: 1.1em; overflow-wrap: anywhere; }
.tabs { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr)); gap: 8px; margin-bottom: 12px; }
.tab { border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; background: var(--surface); cursor: pointer; font-weight: 700; color: var(--fg); text-align: center; overflow-wrap: anywhere; }
.tab.active { border-color: var(--accent); box-shadow: inset 0 -3px var(--accent); }
.tab:focus-visible, .preset:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.primary-number { font-size: clamp(1.8rem, 5vw, 2.5rem); font-weight: 800; color: var(--fg); line-height: 1.2; overflow-wrap: anywhere; }
.result-shell { background: var(--deviation-panel); border: 1px solid var(--border); border-radius: 18px; padding: 16px; position: sticky; top: 12px; }
.summary-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); gap: 10px; margin-top: 10px; }
.summary-item { background: var(--surface-subtle); color: var(--fg); border-radius: 12px; padding: 12px; border: 1px solid var(--border); }
.summary-label { font-size: 0.95rem; color: var(--muted); overflow-wrap: anywhere; }
.summary-value { font-size: 1.35rem; font-weight: 700; margin-top: 4px; color: var(--fg); overflow-wrap: anywhere; }
.primary-number, .summary-value { unicode-bidi: isolate; direction: ltr; text-align: start; }
.note, .muted, .helper { color: var(--muted); overflow-wrap: anywhere; }
.helper { font-size: 0.95rem; }
.preset-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 10px; margin-top: 10px; }
.preset { background: var(--surface); color: var(--fg); border: 1px solid var(--border); border-radius: 12px; padding: 12px; text-align: start; cursor: pointer; overflow-wrap: anywhere; }
.preset .title { display: block; font-weight: 700; margin-bottom: 6px; }
.preset .desc { display: block; color: var(--muted); font-size: 0.95rem; }
.faq details { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; background: var(--surface); }
.faq details + details { margin-top: 10px; }
.is-hidden, .mode-panel[hidden], .summary-item[hidden], .badge-inline[hidden] { display: none !important; }
.eyebrow { color: var(--fg); font-weight: 800; margin-bottom: 4px; font-size: 0.95rem; }
.badge-inline { display: inline-flex; gap: 6px; align-items: center; background: var(--surface-subtle); color: var(--fg); border: 1px solid var(--border); border-radius: 12px; padding: 4px 8px; font-size: 0.95rem; }
.button-row { display: flex; flex-wrap: wrap; gap: 8px; }
.button-row .button { white-space: normal; overflow-wrap: anywhere; max-width: 100%; }
#results-card[aria-busy="true"] .summary-grid { opacity: 0.55; }
@media (min-width: 1080px) { .two-col { grid-template-columns: minmax(380px, 430px) 1fr; } }
@media (max-width: 767px) { .result-shell { position: static; } }
