/* RetainerCheck. Identity: an engagement letter on ivory-grey letterhead.
   Plum carries the header and the result panel, brass marks the shared hours
   and the figure that matters. Serif headings, grotesk body, mono for figures only. */

:root {
  --paper: #f1efec;
  --surface: #fbfaf8;
  --tint: #e6e2e1;
  --ink: #241a23;
  --muted: #5f5560;
  --rule: #cdc5ca;
  --plum: #3f1f3a;
  --plum-deep: #2f162b;
  --mauve: #b596ae;
  --brass: #b98a2e;
  --brass-text: #76540c;
  --brass-soft: #efe0b8;
  --link: #5a2a52;
  --danger: #a12a1c;
  --band-bg: #3f1f3a;
  --band-fg: #f6f1ee;
  --panel-bg: #3f1f3a;
  --panel-fg: #f8f3ef;
  --panel-muted: #d8c8d4;
  --panel-rule: #65425f;
  --panel-figure: #f0c869;
  --btn-bg: #3f1f3a;
  --btn-fg: #fbfaf8;
  --input-bg: #fbfaf8;
  --focus: #b98a2e;
  --serif: "Iowan Old Style", Charter, Palatino, Georgia, "Times New Roman", serif;
  --sans: "Avenir Next", "Helvetica Neue", ui-sans-serif, system-ui, -apple-system, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #171016;
    --surface: #22171f;
    --tint: #1c131a;
    --ink: #eee7e8;
    --muted: #b5a8b2;
    --rule: #403039;
    --plum: #c99dc1;
    --plum-deep: #100a0f;
    --mauve: #73536c;
    --brass: #d8ae52;
    --brass-text: #e3bf6c;
    --brass-soft: #3c3214;
    --link: #e2bcda;
    --danger: #f09a8a;
    --band-bg: #100a0f;
    --band-fg: #eee7e8;
    --panel-bg: #3a1f36;
    --panel-fg: #f6efe9;
    --panel-muted: #d0bfcc;
    --panel-rule: #5e4159;
    --panel-figure: #f0c869;
    --btn-bg: #d8ae52;
    --btn-fg: #1a1605;
    --input-bg: #1a1118;
    --focus: #f0c869;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #171016;
  --surface: #22171f;
  --tint: #1c131a;
  --ink: #eee7e8;
  --muted: #b5a8b2;
  --rule: #403039;
  --plum: #c99dc1;
  --plum-deep: #100a0f;
  --mauve: #73536c;
  --brass: #d8ae52;
  --brass-text: #e3bf6c;
  --brass-soft: #3c3214;
  --link: #e2bcda;
  --danger: #f09a8a;
  --band-bg: #100a0f;
  --band-fg: #eee7e8;
  --panel-bg: #3a1f36;
  --panel-fg: #f6efe9;
  --panel-muted: #d0bfcc;
  --panel-rule: #5e4159;
  --panel-figure: #f0c869;
  --btn-bg: #d8ae52;
  --btn-fg: #1a1605;
  --input-bg: #1a1118;
  --focus: #f0c869;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 17px/1.55 var(--sans);
}
[hidden] { display: none !important; }
img, svg { max-width: 100%; }
a { color: var(--link); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 2px; }
/* time inputs: keep the ring on while focus sits on the clock button inside the field */
input[type="time"]:focus { outline: 3px solid var(--focus); outline-offset: 2px; }

.wrap { max-width: 1160px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap { padding: 0 32px; } }

.skip {
  position: absolute; left: 16px; top: -60px;
  background: var(--surface); color: var(--ink);
  padding: 10px 16px; border: 2px solid var(--brass); border-radius: 4px; z-index: 20;
}
.skip:focus { top: 8px; }

h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.15; margin: 0; letter-spacing: -0.01em; }
h1 { font-size: clamp(2rem, 4.4vw, 3.1rem); max-width: 17ch; }
h2 { font-size: clamp(1.6rem, 2.8vw, 2.1rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 16px; }

/* ---------- header band ---------- */
.site-header { background: var(--band-bg); color: var(--band-fg); }
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 8px 24px; flex-wrap: wrap; padding-top: 12px; padding-bottom: 12px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; min-height: 44px; }
.mark { flex: none; }
.mark-arc { stroke: #e0b44f; }
.wordmark { font-family: var(--serif); font-size: 1.4rem; font-weight: 600; letter-spacing: -0.01em; }
.wordmark span { color: #e8c063; font-style: italic; font-weight: 500; }
.site-nav { display: flex; align-items: center; flex-wrap: wrap; gap: 0 4px; margin: 0 -10px; }
.site-nav a, .theme-btn {
  color: inherit; text-decoration: none; font: inherit; font-size: 0.95rem;
  padding: 10px; min-height: 44px; display: inline-flex; align-items: center;
  background: none; border: 0; cursor: pointer; border-radius: 4px;
}
.site-nav a:hover, .theme-btn:hover { text-decoration: underline; text-decoration-color: #e0b44f; text-decoration-thickness: 2px; text-underline-offset: 6px; }
.theme-btn { color: inherit; border: 1px solid #a98ba3; padding: 6px 14px; min-height: 44px; min-width: 44px; margin-left: 10px; font-weight: 600; }
.theme-btn:hover { text-decoration: none; background: #5a3354; }

/* ---------- hero ---------- */
.hero { padding: 40px 0 8px; }
.hero-grid { display: grid; gap: 24px 48px; align-items: end; }
@media (min-width: 900px) { .hero-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); } }
.lede { font-size: 1.15rem; max-width: 34em; margin: 16px 0 0; color: var(--muted); }
.hero-strip { margin: 0; padding: 16px 16px 12px; background: var(--surface); border: 1px solid var(--rule); border-radius: 6px; }
.fig-title { font-family: var(--serif); font-size: 1.05rem; font-weight: 600; margin-bottom: 8px; }
.strip-caption { margin: 8px 0 0; font-size: 0.95rem; color: var(--muted); min-height: 3em; }
.strip-link { margin: 0; font-size: 0.95rem; }

/* ---------- sections ---------- */
.section { padding: 48px 0; }
.section-tint { background: var(--tint); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.section-intro { max-width: 68ch; color: var(--muted); margin: 8px 0 24px; }
.hint { font-size: 0.92rem; color: var(--muted); max-width: 70ch; }
.noscript { padding-top: 16px; color: var(--danger); }

/* ---------- controls ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .seg legend, .ov-side legend { font-weight: 600; font-size: 0.97rem; }
.control { display: flex; align-items: center; gap: 8px; min-width: 0; }
.unit { color: var(--muted); font-size: 0.95rem; white-space: nowrap; }
input[type="number"], input[type="text"], input[type="time"], select, textarea {
  font: inherit; color: var(--ink); background: var(--input-bg);
  border: 1px solid var(--muted); border-radius: 4px;
  min-height: 46px; padding: 8px 12px; width: 100%; min-width: 0;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input[type="number"], input[type="time"] { font-family: var(--mono); font-variant-numeric: tabular-nums; }
textarea { min-height: 112px; resize: vertical; line-height: 1.45; }
select { width: 100%; }
.control > select:not(:only-child) { width: auto; flex: none; }
input:hover, select:hover, textarea:hover { border-color: var(--ink); }
[aria-invalid="true"] { border-color: var(--danger) !important; box-shadow: 0 0 0 1px var(--danger); }
.err { margin: 0; color: var(--danger); font-size: 0.92rem; }

button, .btn {
  font: inherit; font-weight: 600; cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 46px; padding: 8px 18px; border-radius: 4px;
  background: var(--btn-bg); color: var(--btn-fg); border: 1px solid var(--btn-bg);
  transition: background-color 0.15s, color 0.15s, transform 0.15s;
}
button:hover, .btn:hover { filter: brightness(1.12); }
button:active, .btn:active { transform: translateY(1px); }
button.secondary, .btn.secondary { background: transparent; color: var(--ink); border-color: var(--muted); }
button.secondary:hover, .btn.secondary:hover { filter: none; border-color: var(--ink); background: var(--surface); }
button.quiet { min-width: 44px; background: none; border-color: transparent; color: var(--muted); font-weight: 500; padding: 8px 4px; text-decoration: underline; text-underline-offset: 3px; }
button.quiet:hover { color: var(--ink); filter: none; }
button[aria-pressed="true"] { background: var(--brass-soft); color: var(--ink); border-color: var(--brass); }
.form-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin: 16px 0 0; }
.form-foot [role="status"] { font-size: 0.95rem; color: var(--muted); }

/* ---------- calculator ---------- */
.calc-grid { display: grid; gap: 32px; align-items: start; }
@media (min-width: 900px) {
  .calc-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 48px; }
  .result { position: sticky; top: 16px; }
}
.calc-form h3 { margin: 32px 0 16px; }
.fields { display: grid; gap: 16px 20px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.calc-form .hint { margin-top: 12px; }

.seg { border: 0; padding: 0; margin: 0 0 20px; display: flex; flex-wrap: wrap; gap: 0; }
.seg legend { padding: 0; margin-bottom: 6px; }
.seg label { position: relative; flex: 1 1 140px; }
.seg input { font-size: inherit; position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.seg span {
  display: flex; align-items: center; justify-content: center; min-height: 46px; padding: 8px 12px;
  border: 1px solid var(--muted); background: var(--input-bg); font-weight: 600;
  transition: background-color 0.15s, color 0.15s;
}
.seg label:first-of-type span { border-radius: 4px 0 0 4px; }
.seg label:last-of-type span { border-radius: 0 4px 4px 0; margin-left: -1px; }
.seg input:checked + span { background: var(--btn-bg); color: var(--btn-fg); border-color: var(--btn-bg); }
.seg input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }

.result { background: var(--panel-bg); color: var(--panel-fg); border-radius: 6px; padding: 28px 24px; }
@media (min-width: 720px) { .result { padding: 32px; } }
.result p { margin: 0 0 12px; }
.result h3 { font-size: 1.05rem; margin: 24px 0 10px; padding-top: 20px; border-top: 1px solid var(--panel-rule); color: var(--panel-fg); }
.result-label { font-family: var(--serif); font-size: 1.1rem; margin-bottom: 4px !important; }
.result-big { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: clamp(2.4rem, 6vw, 3.4rem); font-weight: 600; line-height: 1.05; color: var(--panel-figure); letter-spacing: -0.03em; }
.result-big small { font: 500 1rem/1.3 var(--sans); color: var(--panel-muted); letter-spacing: 0; white-space: nowrap; }
.result-sub { color: var(--panel-muted); }
.result-warn { border-left: 3px solid var(--panel-figure); padding-left: 12px; }
.result-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 20px 0 0; }
.result-row div { border-top: 2px solid var(--panel-figure); padding-top: 8px; }
.result-row dt { font-size: 0.9rem; color: var(--panel-muted); }
.result-row dd { margin: 0; font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: clamp(1.05rem, 2.6vw, 1.4rem); font-weight: 600; overflow-wrap: anywhere; }

.scale { display: grid; gap: 10px; }
.scale-row { display: grid; grid-template-columns: 8.2em minmax(0, 1fr) 6.2em; gap: 10px; align-items: center; font-size: 0.95rem; }
.scale-track { display: block; height: 14px; border-left: 2px solid var(--panel-muted); border-bottom: 1px solid var(--panel-rule); }
.scale-bar { display: block; height: 13px; background: var(--panel-muted); border-radius: 0 2px 2px 0; transition: width 0.22s ease-out; }
.is-eff .scale-bar { background: var(--panel-figure); }
.is-ft .scale-bar { background: transparent; border: 2px solid var(--panel-muted); border-left: 0; }
.scale-val { font-family: var(--mono); font-variant-numeric: tabular-nums; text-align: right; }
.is-eff .scale-name, .is-eff .scale-val { font-weight: 600; }

.how { margin-top: 24px; border-top: 1px solid var(--panel-rule); padding-top: 12px; font-size: 0.95rem; }
.how summary { cursor: pointer; font-weight: 600; min-height: 44px; display: flex; align-items: center; gap: 8px; list-style: none; }
.how summary::-webkit-details-marker { display: none; }
.how summary::before { content: "+"; font-family: var(--mono); width: 1em; }
.how[open] summary::before { content: "\2212"; }
.how ul { margin: 0 0 12px; padding-left: 20px; }
.how li { margin-bottom: 6px; }
.result :focus-visible { outline-color: var(--panel-figure); }

/* ---------- 24 hour strip ---------- */
.strip-host { width: 100%; }
.strip-host svg { display: block; max-width: 100%; }
.strip-host { min-height: 104px; }
.st-axis { stroke: var(--muted); stroke-width: 1; }
.st-hour { fill: var(--muted); font: 12px var(--mono); }
.st-track { fill: var(--tint); stroke: var(--rule); stroke-width: 1; }
.section-tint .st-track { fill: var(--surface); }
.st-you { fill: var(--plum); }
.st-them { fill: var(--mauve); }
.st-shared { fill: var(--brass); }
.st-bracket { fill: none; stroke: var(--brass); stroke-width: 2; }
.st-label { fill: var(--brass-text); font: 600 12px var(--sans); }
.swatch { display: inline-block; width: 16px; height: 12px; border-radius: 2px; margin-right: 8px; vertical-align: -1px; flex: none; }
.sw-you { background: var(--plum); }
.sw-them { background: var(--mauve); }
.sw-shared { background: var(--brass); }

/* ---------- overlap finder ---------- */
.ov-form { display: grid; gap: 20px; margin-bottom: 28px; }
@media (min-width: 900px) { .ov-form { grid-template-columns: 1fr 1fr; gap: 32px; } }
.ov-side { border: 1px solid var(--rule); border-radius: 6px; background: var(--surface); padding: 12px 16px 16px; margin: 0; min-width: 0; display: grid; gap: 12px 16px; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
.ov-side legend { font-family: var(--serif); font-size: 1.15rem; padding: 0 6px; }
.ov-result { background: var(--surface); border: 1px solid var(--rule); border-radius: 6px; padding: 20px 16px; }
@media (min-width: 720px) { .ov-result { padding: 28px 32px; } }
.ov-big { font-family: var(--mono); font-size: clamp(2rem, 5vw, 2.8rem); font-weight: 600; line-height: 1.1; color: var(--brass-text); margin-bottom: 16px; min-height: 1.2em; letter-spacing: -0.02em; }
.ov-big small { font: 500 1rem/1.3 var(--sans); color: var(--muted); letter-spacing: 0; }
.legend { list-style: none; padding: 0; margin: 12px 0 16px; display: flex; flex-wrap: wrap; gap: 6px 24px; font-size: 0.95rem; }
.legend li { display: flex; align-items: baseline; }
.ov-times { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px 24px; margin: 0 0 8px; min-height: 3.4em; }
.ov-times div { border-top: 2px solid var(--brass); padding-top: 8px; }
.ov-times dt { font-size: 0.92rem; color: var(--muted); }
.ov-times dd { margin: 0; font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 1.1rem; }
.ov-result .hint { margin: 16px 0 0; }

/* ---------- checklist ---------- */
.cl-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 8px 32px; margin-bottom: 8px; }
.cl-progress { margin: 0 0 24px; color: var(--muted); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cl-count { font-family: var(--mono); font-weight: 600; font-size: 1.25rem; color: var(--ink); }
.cl-meter { display: inline-block; width: 140px; height: 10px; border: 1px solid var(--muted); border-radius: 2px; margin-left: 4px; }
.cl-meter span { display: block; height: 100%; width: 0; background: var(--brass); transition: width 0.22s ease-out; }
.cl-name { max-width: 420px; margin-bottom: 24px; }
.cl-groups { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); margin-bottom: 24px; }
.cl-group { border: 0; border-top: 3px solid var(--plum); margin: 0; padding: 12px 0 0; min-width: 0; }
.cl-group legend { font-family: var(--serif); font-size: 1.2rem; font-weight: 600; padding: 0 12px 0 0; float: left; width: 100%; margin-bottom: 4px; }
.cl-group legend .n { font: 500 0.9rem var(--mono); color: var(--muted); float: right; padding-top: 4px; }
.cl-group label { clear: both; display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--rule); cursor: pointer; min-height: 44px; }
.cl-group input { font-size: inherit; flex: none; width: 22px; height: 22px; margin: 2px 0 0; accent-color: var(--plum); }
.cl-group input:checked + span { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--brass); }
.cl-group span { transition: color 0.15s; }

/* ---------- candidate comparison ---------- */
.cmp-grid { display: grid; gap: 28px; align-items: start; }
@media (min-width: 900px) { .cmp-grid { grid-template-columns: minmax(0, 380px) minmax(0, 1fr); gap: 40px; } }
.cand-form { background: var(--surface); border: 1px solid var(--rule); border-radius: 6px; padding: 20px; }
@media (min-width: 900px) { .cand-form { position: sticky; top: 16px; } }
.cand-form h3 { margin: 0 0 16px; }
.cand-fields { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px 16px; }
.f-wide { grid-column: 1 / -1; }
.cand-fields .seg { margin: 0; }
.cand-form .form-foot { margin-top: 20px; }
.form-status { margin: 12px 0 0; color: var(--muted); font-size: 0.95rem; min-height: 1.5em; }
.form-status:empty { margin: 0; min-height: 0; }

.cand-bar { display: flex; justify-content: space-between; align-items: end; gap: 8px 16px; flex-wrap: wrap; margin-bottom: 16px; }
.cand-bar p { margin: 0; color: var(--muted); }
.cand-sort { width: 240px; max-width: 100%; }
.cand-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; outline: none; min-height: 240px; }
.cand { background: var(--surface); border: 1px solid var(--rule); border-left: 4px solid var(--plum); border-radius: 4px; padding: 16px 20px; display: grid; gap: 10px; }
.cand.is-example { border-left-color: var(--mauve); }
.cand.is-editing { outline: 2px solid var(--brass); outline-offset: 2px; }
.cand-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.cand h4 { font-family: var(--serif); font-size: 1.2rem; font-weight: 600; line-height: 1.2; margin: 0; overflow-wrap: anywhere; }
.tag-example { flex: none; font-size: 0.85rem; font-weight: 600; color: var(--muted); border: 1px solid var(--muted); border-radius: 3px; padding: 1px 8px; }
.cand-quote { margin: 0; color: var(--muted); font-size: 0.95rem; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }
.chip { font-size: 0.85rem; font-weight: 600; color: var(--ink); background: var(--brass-soft); border-radius: 3px; padding: 2px 8px; }
.cand-key, .cand-figs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 0; }
.cand-figs { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 420px; }
.cand-key div, .cand-figs div { border-top: 2px solid var(--rule); padding-top: 6px; min-width: 0; }
@media (max-width: 420px) { .cand-key dt { min-height: 2.5em; line-height: 1.25; } }
@media (max-width: 420px) { #field-overage, #field-rollover { grid-column: 1 / -1; } }
.cand-key .fig-main { border-top-color: var(--brass); }
.cand-key dt, .cand-figs dt { font-size: 0.85rem; color: var(--muted); }
.cand-key dd, .cand-figs dd { margin: 0; font-family: var(--mono); font-variant-numeric: tabular-nums; font-weight: 600; font-size: 1.05rem; overflow-wrap: anywhere; }
.cand-key .fig-main dd { font-size: 1.2rem; }
.cand-key .nominal { display: block; font: 500 0.85rem/1.3 var(--sans); color: var(--muted); }
.opt { font-weight: 400; color: var(--muted); }
.extra-hint { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.extra-hint b { color: var(--ink); }
.cand-more { display: grid; gap: 8px; }
.cand-more[open] { gap: 10px; }
.cand-more:not([open]) { display: block; }
.cand-more > summary { cursor: pointer; font-weight: 600; min-height: 44px; display: flex; align-items: center; gap: 8px; list-style: none; color: var(--link); }
.cand-more > summary::-webkit-details-marker { display: none; }
.cand-more > summary::before { content: "+"; font-family: var(--mono); width: 1em; }
.cand-more[open] > summary::before { content: "\2212"; }
@media (min-width: 601px) { .cand-more > summary { display: none; } }
.cand-line { margin: 0; font-size: 0.95rem; color: var(--muted); }
.cand-line b { font-family: var(--mono); color: var(--brass-text); }
.cand-actions { display: flex; flex-wrap: wrap; gap: 8px 12px; margin-top: 4px; }
.cand-actions button { min-height: 44px; padding: 6px 14px; }
.cand-actions button.quiet { padding: 6px 4px; }
.cand-empty { border: 1px dashed var(--muted); border-radius: 4px; background: var(--surface); padding: 16px 20px; }
.cand-empty p { margin: 0; }
.cand-divider { font-family: var(--serif); font-weight: 600; font-size: 1.1rem; padding-top: 8px; }
.cand-note { margin: 16px 0 0; }
.mini svg { display: block; width: 100%; height: 26px; }
.section-tint .cand .st-track { fill: var(--tint); }

/* ---------- guide ---------- */
.prose-wrap { display: grid; gap: 40px 64px; align-items: start; }
@media (min-width: 1000px) { .prose-wrap { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); } }
.prose { max-width: 68ch; }
.prose h3 { margin: 32px 0 10px; font-size: 1.35rem; }
.prose ul, .prose ol { padding-left: 22px; margin: 0 0 16px; }
.prose li { margin-bottom: 8px; }
.glossary { margin: 0; }
.glossary dt { font-weight: 600; margin-top: 12px; }
.glossary dd { margin: 0; color: var(--muted); }
.faq h2 { font-size: 1.5rem; margin-bottom: 12px; }
.faq details { border-top: 1px solid var(--rule); }
.faq details:last-child { border-bottom: 1px solid var(--rule); }
.faq summary { cursor: pointer; font-weight: 600; padding: 14px 28px 14px 0; position: relative; list-style: none; min-height: 44px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 4px; top: 12px; font: 500 1.2rem var(--mono); color: var(--brass-text); }
.faq details[open] summary::after { content: "\2212"; }
.faq details p { margin: 0 0 16px; color: var(--muted); }
@media (min-width: 1000px) { .faq { position: sticky; top: 16px; } }

/* ---------- phone: long lists start short ---------- */
.more-btn { display: none; }
.to-top { display: inline-flex; align-items: center; min-height: 44px; }
@media (max-width: 600px) {
  .more-btn { display: flex; width: 100%; margin: 16px 0 0; }
  .cand-list.is-collapsed .is-extra { display: none; }
  .cand-list { min-height: 0; }
  .cand { padding: 14px 16px; gap: 8px; }
  .fields { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 14px 14px; }
  .calc-form h3 { margin: 24px 0 12px; }
  .section { padding: 28px 0; }
  .section-intro { margin-bottom: 16px; }
  .result { padding: 22px 18px; }
  .hero { padding-top: 28px; }
  .hero-strip { display: none; }
  .ov-times { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; min-height: 0; }
  .ov-times dd { font-size: 1rem; }
  .ov-times .ov-none { grid-column: 1 / -1; }
  .ov-side .field:first-of-type { grid-column: 1 / -1; }
  .cand-note { display: flex; flex-wrap: wrap; align-items: center; gap: 0 12px; }
  .cl-groups { margin-bottom: 8px; }
  #guide-more-btn { margin: 8px 0 0; height: auto; padding-top: 10px; padding-bottom: 10px; text-align: center; }
  .site-nav { margin: 0 -10px; width: calc(100% + 20px); }
  .theme-btn { margin-left: auto; margin-right: 10px; }
}

@media screen and (max-width: 600px) {
  .cl-form.is-collapsed { display: none; }
  #cl-groups-more { margin: 0 0 8px; }
  .guide-more.is-collapsed { display: none; }
}
.fields .f-wide { grid-column: 1 / -1; }
.fields { align-items: end; }

/* ---------- result bar ---------- */
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
body.has-bar { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
html { scroll-padding-bottom: 72px; }
.result-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  background: var(--panel-bg); color: var(--panel-fg);
  border-top: 3px solid var(--panel-figure);
  padding-bottom: env(safe-area-inset-bottom);
  transition: transform 0.2s ease-out, opacity 0.2s ease-out;
}
.result-bar.is-off { transform: translateY(110%); opacity: 0; pointer-events: none; visibility: hidden; transition: transform 0.2s ease-out, opacity 0.2s ease-out, visibility 0s 0.2s; }
.result-bar.at-top { top: 0; bottom: auto; border-top: 0; border-bottom: 3px solid var(--panel-figure); padding-bottom: 0; padding-top: env(safe-area-inset-top); }
.result-bar-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; padding-top: 6px; padding-bottom: 6px; }
.rb-text { margin: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 14px; line-height: 1.25; min-width: 0; }
.rb-line { white-space: nowrap; font-size: 1rem; }
.rb-line b { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 1.45rem; font-weight: 700; color: var(--panel-figure); margin-right: 4px; letter-spacing: -0.02em; }
.rb-sub { font-size: 0.85rem; color: var(--panel-muted); }
.rb-link { flex: none; display: inline-flex; align-items: center; min-height: 44px; min-width: 44px; padding: 0 14px; border: 1px solid var(--panel-muted); border-radius: 4px; color: var(--panel-fg); font-weight: 600; text-decoration: none; }
.rb-link:hover { background: var(--panel-rule); }
.result-bar :focus-visible { outline-color: var(--panel-figure); }
#calc-result, #cand-list, #ov-result, #cand-form { scroll-margin-top: 16px; scroll-margin-bottom: 84px; }
body.has-bar input, body.has-bar select, body.has-bar textarea { scroll-margin-top: 84px; scroll-margin-bottom: 84px; }
@media (max-width: 380px) { .rb-line b { font-size: 1.3rem; } .rb-link { padding: 0 10px; } }

/* ---------- ad slots (hidden until ads.js fills them) ---------- */
.ad-slot { display: block; margin: 32px auto; min-height: 120px; border-top: 1px solid var(--rule); padding-top: 6px; }
.ad-label { margin: 0 0 6px; font-size: 0.8rem; color: var(--muted); }
.ad-slot ins { display: block; }
/* keep the mid slot well clear of the checklist buttons above it */
.ad-slot[data-ad-slot="mid"] { margin-top: 56px; }
@media (max-width: 600px) { .ad-slot { min-height: 280px; } .ad-slot[data-ad-slot="mid"] { margin-top: 124px; } }

/* ---------- bundle links ---------- */
.more-tools { border-top: 1px solid var(--rule); padding: 32px 0 24px; background: var(--paper); }
.more-tools h2 { font-size: 1.35rem; margin-bottom: 8px; }
.more-tools ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.more-tools ul { gap: 4px 32px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.more-tools li { color: var(--muted); }
.more-tools a { display: flex; align-items: center; width: fit-content; min-height: 44px; font-weight: 600; }
.more-tools li span { display: block; margin-top: -6px; }

/* ---------- inner pages ---------- */
.page { padding: 40px 0 56px; }
.page .prose h1 { margin-bottom: 16px; max-width: 22ch; }
.page .prose h2 { font-size: clamp(1.4rem, 2.4vw, 1.7rem); margin: 36px 0 10px; }
.page .prose h3 { font-size: 1.2rem; margin: 24px 0 8px; }
.page .lede { margin-bottom: 24px; }
.crumbs { margin: 0 0 8px; font-size: 0.95rem; color: var(--muted); }
.crumbs a { display: inline-flex; align-items: center; min-height: 44px; }
.byline { color: var(--muted); font-size: 0.95rem; }
.worked { background: var(--surface); border: 1px solid var(--rule); border-left: 4px solid var(--brass); border-radius: 4px; padding: 16px 20px; margin: 0 0 20px; }
.worked p:last-child, .worked ul:last-child { margin-bottom: 0; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.calc-table { width: 100%; border-collapse: collapse; margin: 0 0 20px; font-size: 0.97rem; }
.calc-table th, .calc-table td { text-align: left; padding: 8px 8px 8px 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
.calc-table td.n { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; padding-right: 0; }
.cta-line { margin-top: 28px; }
.data-box { background: var(--surface); border: 1px solid var(--rule); border-radius: 6px; padding: 16px 20px; margin: 0 0 20px; }
.data-box .form-foot { margin-top: 8px; }

/* ---------- footer ---------- */
.site-footer { background: var(--band-bg); color: var(--band-fg); padding: 32px 0; font-size: 0.95rem; }
.site-footer p { margin: 0 0 6px; max-width: 80ch; }
.site-footer a { color: inherit; }
.foot-links { list-style: none; margin: 8px 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 20px; }
.foot-links a { display: inline-flex; align-items: center; min-height: 44px; min-width: 44px; }
.site-footer .copy { color: #d9c9d5; }

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

/* ---------- print: the checklist on its own ---------- */
@media print {
  :root {
    --paper: #fff !important; --surface: #fff !important; --tint: #fff !important; --input-bg: #fff !important;
    --ink: #000 !important; --muted: #333 !important; --rule: #999 !important;
    --plum: #000 !important; --brass: #666 !important; --brass-text: #000 !important;
    color-scheme: light !important;
  }
  body { background: #fff; font-size: 11pt; }
  .result-bar { display: none !important; }
  body.has-bar { padding-bottom: 0; }
  .site-header, .site-footer, .hero, .section:not(#checklist), .more-tools, .ad-slot, .skip, .form-foot, .cl-meter, noscript { display: none !important; }
  .section-tint { background: #fff; border: 0; }
  .section { padding: 0; }
  .cl-groups { grid-template-columns: 1fr 1fr; gap: 12pt 20pt; }
  .more-btn { display: none !important; }
  .cl-group { break-inside: avoid; }
  .cl-group label { padding: 4pt 0; min-height: 0; }
  .cl-group input:checked + span { color: #000; text-decoration: none; }
  input[type="text"], textarea { border: 0; border-bottom: 1px solid #999; border-radius: 0; padding-left: 0; }
}
