/* 1265 check app: upload, review the lines, the answer.
   Loaded after 1265.css on check/index.html only. */

.page-check .site-footer { margin-top: 0; }

/* ---------- States ---------- */
.check .state { display: none; padding-block: var(--space-7) var(--space-8); }
.check[data-state="upload"] [data-state-panel="upload"],
.check[data-state="review"] [data-state-panel="review"],
.check[data-state="answer"] [data-state-panel="answer"] { display: block; animation: state-in var(--dur-3) var(--ease-out) both; }
@keyframes state-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.print-only { display: none; }

/* ---------- Stepper ---------- */
.stepper-bar { border-bottom: 1px solid var(--line); background: var(--bg); }
.stepper { list-style: none; margin: 0; padding: 0; display: flex; gap: var(--space-2); min-height: 56px; align-items: center; }
.stepper li { display: flex; align-items: center; gap: var(--space-2); font-size: var(--step--1); color: var(--muted); font-weight: 550; }
.stepper li + li::before { content: ""; width: clamp(16px, 5vw, 56px); height: 1px; background: var(--line-strong); margin-right: var(--space-2); }
.stepper-dot { width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center; border: 1.5px solid var(--line-strong); font: 600 var(--step--2)/1 var(--font-mono); background: var(--surface); }
.stepper li.is-done { color: var(--ink-2); }
.stepper li.is-done .stepper-dot { background: var(--ink); border-color: var(--ink); color: transparent; position: relative; }
.stepper li.is-done .stepper-dot::after { content: ""; position: absolute; width: 9px; height: 5px; border-left: 2px solid var(--bg); border-bottom: 2px solid var(--bg); transform: rotate(-45deg) translate(1px, -1px); }
.stepper li[aria-current="step"] { color: var(--ink); }
.stepper li[aria-current="step"] .stepper-dot { background: var(--mark); border-color: var(--mark); color: #111315; }
@media (max-width: 520px) { .stepper { gap: 6px; } .stepper li { gap: 6px; } .stepper li + li::before { width: 12px; margin-right: 0; } }

/* ---------- Upload ---------- */
.upload-head { max-width: 760px; }
.upload-head h1 { margin-bottom: var(--space-4); }
.dropzone-app { margin-top: var(--space-6); min-height: 260px; }
.upload-note { font-size: var(--step--1); margin: var(--space-4) var(--space-2) 0; }
.start-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-4); margin-top: var(--space-7); }
.start-card {
  display: flex; flex-direction: column; gap: var(--space-2); text-align: left; padding: var(--space-5);
  border-radius: var(--radius-l); border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  font: inherit; cursor: pointer; text-decoration: none;
  transition: transform var(--dur-2) var(--ease-out), border-color var(--dur-2), box-shadow var(--dur-2);
}
.start-card:hover { transform: translateY(-3px); border-color: var(--ink); box-shadow: var(--shadow-2); }
.start-card-art { display: block; height: 84px; margin-bottom: var(--space-3); padding: var(--space-3); border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; }
.start-card-art .year-grid svg { height: 58px; width: auto; }
.start-card-art-blank svg { height: 100%; width: auto; }
.start-card-title { font-family: var(--font-display); font-weight: 700; font-size: var(--step-1); letter-spacing: -0.01em; }
.start-card-text { font-size: var(--step--1); color: var(--ink-2); line-height: 1.5; }
@media (max-width: 860px) { .start-options { grid-template-columns: 1fr; } }
.trust-compact { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: var(--space-7); }
.trust-compact b { display: block; font-size: var(--step-0); }
@media (max-width: 960px) { .trust-compact li:last-child { grid-column: auto; padding-left: var(--space-4); border-left: 1px solid var(--line); border-bottom: 0; } .trust-compact li:nth-child(3) { border-bottom: 0; } }

/* Reading progress */
.reading-panel { margin-top: var(--space-5); padding: var(--space-5); border-radius: var(--radius-l); background: var(--surface); border: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: var(--space-5); box-shadow: var(--shadow-1); }
.reading-file { display: flex; align-items: center; gap: var(--space-4); min-width: 0; }
.reading-name { font-weight: 650; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reading-msg { margin: 0; font-size: var(--step--1); }
.file-badge { display: inline-grid; place-items: center; min-width: 46px; height: 46px; padding: 0 8px; border-radius: 10px; background: var(--ink); color: var(--bg); font: 600 var(--step--2)/1 var(--font-mono); letter-spacing: 0.04em; flex: none; }
.reading-cells { display: grid; grid-template-columns: repeat(6, 10px); gap: 4px; flex: none; }
.reading-cells i { width: 10px; height: 10px; border-radius: 2px; background: var(--cell-empty); animation: cell-pulse 1.2s var(--ease-in-out) infinite; }
.reading-cells i:nth-child(n+7) { animation-delay: 0.6s; }
.reading-cells i:nth-child(6n+2) { animation-delay: 0.1s; } .reading-cells i:nth-child(6n+3) { animation-delay: 0.2s; }
.reading-cells i:nth-child(6n+4) { animation-delay: 0.3s; } .reading-cells i:nth-child(6n+5) { animation-delay: 0.4s; } .reading-cells i:nth-child(6n) { animation-delay: 0.5s; }
@keyframes cell-pulse { 0%, 100% { background: var(--cell-empty); } 40% { background: var(--cell-fill); } 60% { background: var(--cell-band); } }

.alert { margin-top: var(--space-5); padding: var(--space-5); border-radius: var(--radius-l); border: 1px solid var(--line); background: var(--surface); }
.alert-error { border-color: color-mix(in srgb, var(--over) 45%, var(--line)); background: var(--over-soft); }
.alert-title { font-weight: 700; margin-bottom: var(--space-2); }
.alert-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }

/* ---------- Consent dialog ---------- */
.consent { border: 0; padding: 0; border-radius: 24px; background: var(--surface); color: var(--ink); width: min(560px, calc(100vw - 32px)); box-shadow: 0 30px 80px rgb(0 0 0 / 30%); }
.consent::backdrop { background: rgb(14 16 18 / 55%); backdrop-filter: blur(4px); }
.consent[open] { animation: dialog-in var(--dur-3) var(--ease-out); }
@keyframes dialog-in { from { opacity: 0; transform: translateY(16px) scale(0.98); } }
.consent-inner { padding: var(--space-6); }
.consent-icon { width: 52px; height: 52px; border-radius: 14px; background: var(--mark); color: #111315; display: grid; place-items: center; margin-bottom: var(--space-4); }
.consent-icon svg { width: 28px; height: 28px; }
.consent h2 { font-size: var(--step-3); margin-bottom: var(--space-3); }
.consent-file { display: flex; align-items: center; gap: var(--space-3); font-weight: 600; margin-bottom: var(--space-4); }
.consent-file .file-badge { height: 32px; min-width: 40px; border-radius: 8px; }
.consent-text { padding: var(--space-4); border-radius: var(--radius); background: var(--mark-soft); border-left: 4px solid var(--mark); font-size: var(--step-1); line-height: 1.45; }
.consent-points { margin: var(--space-4) 0 var(--space-5); padding-left: 1.2em; color: var(--ink-2); font-size: var(--step--1); }
.consent-points li { margin-bottom: var(--space-1); }
.consent-actions { display: flex; gap: var(--space-3); justify-content: flex-end; flex-wrap: wrap; }
.consent-more { margin: var(--space-4) 0 0; font-size: var(--step--1); text-align: right; }
@media (max-width: 520px) { .consent-actions .btn { width: 100%; } .consent-inner { padding: var(--space-5); } }

/* ---------- Review ---------- */
.review-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--space-6); align-items: end; margin-bottom: var(--space-6); }
.review-head h1 { margin-bottom: var(--space-3); }
.review-head .lede { margin: 0; }
.source-chip { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) var(--space-3) var(--space-3) var(--space-3); border-radius: var(--radius-l); background: var(--surface); border: 1px solid var(--line); max-width: 560px; }
.source-chip .file-badge { height: 40px; min-width: 44px; }
.source-name { margin: 0; font-weight: 650; font-size: var(--step--1); overflow-wrap: anywhere; line-height: 1.35; }
.source-meta { margin: 0; font-size: var(--step--2); color: var(--muted); font-family: var(--font-mono); }
.source-chip > div { min-width: 0; flex: 1; }
@media (max-width: 860px) { .review-head { grid-template-columns: minmax(0, 1fr); } .source-chip { max-width: none; } }

.review-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: var(--space-6); align-items: start; }
@media (max-width: 1080px) { .review-layout { grid-template-columns: 1fr; } }
.review-school { display: flex; gap: var(--space-4); flex-wrap: wrap; margin-bottom: var(--space-4); }
.field { display: flex; flex-direction: column; gap: 4px; font-size: var(--step--1); color: var(--muted); font-weight: 550; }
.field-inline { flex-direction: row; align-items: center; gap: var(--space-3); }
.field-inline span { white-space: nowrap; }
.field input, .q input, .lines input, .lines select {
  font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 8px;
  padding: 8px 10px; min-height: 40px; width: 100%;
}
.field input { min-width: 0; width: auto; font-weight: 600; }
.field input:focus-visible, .q input:focus-visible, .lines input:focus-visible, .lines select:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; border-color: transparent; }

.lines-wrap { border: 1px solid var(--line); border-radius: var(--radius-l); background: var(--surface); overflow: hidden; }
.lines { width: 100%; border-collapse: collapse; font-size: var(--step--1); }
.lines thead th { font: 600 var(--step--2)/1.3 var(--font-mono); text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); text-align: left; padding: var(--space-3) var(--space-3); border-bottom: 1px solid var(--line); background: var(--surface-2); }
.lines td { padding: 6px var(--space-2); border-bottom: 1px solid var(--line); vertical-align: top; }
.lines td:first-child, .lines th:first-child { padding-left: var(--space-4); }
.lines input, .lines select { border-color: transparent; background: transparent; padding: 7px 8px; min-height: 38px; }
.lines input:hover, .lines select:hover { border-color: var(--line-strong); background: var(--surface); }
.lines .c-num { width: 104px; }
.lines .c-num input { text-align: right; font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.lines .c-who { width: 168px; }
.lines .c-hrs { width: 104px; text-align: right; padding-top: 15px; padding-right: var(--space-3); font-weight: 600; white-space: nowrap; }
.lines th.c-hrs, .lines th.c-num { text-align: right; }
.lines .c-x { width: 44px; text-align: center; }
.lines .c-act input, .lines .c-act textarea { font-weight: 600; }
/* Activity names wrap rather than being cut off mid-word. */
.lines textarea[data-field="name"] { display: block; width: 100%; resize: none; overflow: hidden; field-sizing: content; min-height: 38px; padding: 7px 8px; border: 1px solid transparent; border-radius: var(--radius-s, 8px); background: transparent; color: inherit; font: inherit; font-weight: 600; line-height: 1.4; }
.lines textarea[data-field="name"]:hover { border-color: var(--line-strong); background: var(--surface); }
.line-note { display: block; font-size: var(--step--2); color: var(--ink-2); padding: 0 8px 6px; line-height: 1.4; }
.line-note .badge { font-size: 10px; padding: 3px 6px; margin-right: 4px; }
.line.is-unsure { background: color-mix(in srgb, var(--mark) 13%, var(--surface)); }
.line.is-unsure td:first-child { box-shadow: inset 4px 0 0 var(--mark); }
.line.is-unsure td { border-bottom-color: transparent; }
.line.is-edited .c-hrs { color: var(--mark-ink); }
.fix-row td { background: color-mix(in srgb, var(--mark) 13%, var(--surface)); padding: 0 var(--space-4) var(--space-4); box-shadow: inset 4px 0 0 var(--mark); }
.fix { display: flex; flex-direction: column; gap: var(--space-2); padding: var(--space-3) var(--space-4); border-radius: var(--radius); background: var(--surface); border: 1px solid color-mix(in srgb, var(--mark) 55%, var(--line)); }
.fix-q { margin: 0; font-weight: 600; font-size: var(--step--1); }
.fix-options { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }
.fix-rule { font-size: var(--step--2); font-family: var(--font-mono); margin-left: auto; color: var(--muted); }
.fix-row.is-resolved { display: none; }
.icon-btn { width: 34px; height: 34px; border-radius: 8px; border: 0; background: transparent; color: var(--muted); cursor: pointer; display: inline-grid; place-items: center; margin-top: 3px; }
.icon-btn:hover { background: var(--bg-tint); color: var(--over); }
.icon-btn svg { width: 14px; height: 14px; }
.lines-foot { display: flex; justify-content: space-between; align-items: center; gap: var(--space-3); flex-wrap: wrap; padding: var(--space-3) var(--space-4); background: var(--surface-2); }
.lines-foot p { margin: 0; font-size: var(--step--1); }
.lines-foot .btn svg { width: 14px; height: 14px; }

/* Lines table becomes cards on narrow screens */
@media (max-width: 720px) {
  .lines thead { display: none; }
  .lines, .lines tbody, .lines tr, .lines td { display: block; width: 100%; }
  .lines tr.line { display: grid; grid-template-columns: 1fr 1fr; gap: 0 var(--space-2); padding: var(--space-3) var(--space-3) var(--space-3) var(--space-4); border-bottom: 1px solid var(--line); position: relative; }
  .lines tr.line td { border: 0; padding: 2px 0; width: auto; }
  .lines tr.line .c-act { grid-column: 1 / -1; padding-right: 40px; }
  .lines tr.line .c-who { grid-column: 1 / -1; }
  .lines tr.line .c-num::before, .lines tr.line .c-who::before, .lines tr.line .c-hrs::before { content: attr(data-label); display: block; font: 600 10px/1.4 var(--font-mono); text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); padding: 4px 8px 0; }
  .lines tr.line .c-num input { text-align: left; border-color: var(--line); }
  .lines tr.line .c-who select { border-color: var(--line); }
  .lines tr.line .c-hrs { grid-column: 1 / -1; text-align: left; padding: 6px 8px 0; display: flex; justify-content: space-between; align-items: baseline; }
  .lines tr.line .c-hrs::before { padding: 0; }
  .lines tr.line .c-x { position: absolute; right: var(--space-2); top: var(--space-3); width: auto; }
  .lines tr.line.is-unsure { box-shadow: inset 4px 0 0 var(--mark); }
  .lines tr.line.is-unsure td:first-child { box-shadow: none; }
  .fix-row td { padding: 0 var(--space-3) var(--space-3) var(--space-4); }
  .fix-rule { margin-left: 0; }
  .review-school .field-inline { flex: 1 1 100%; }
  .review-school .field input { flex: 1; }
}

/* Basics questions */
.review-side { position: sticky; top: 84px; display: flex; flex-direction: column; gap: var(--space-4); }
@media (max-width: 1080px) { .review-side { position: static; } }
.basics { padding: var(--space-5); }
.basics h2 { font-size: var(--step-2); margin-bottom: 2px; }
.basics-sub { font-size: var(--step--1); margin-bottom: var(--space-4); }
.q { border: 0; margin: 0; padding: var(--space-4) 0; border-top: 1px solid var(--line); min-width: 0; }
.q legend { float: left; width: 100%; padding: 0; font-weight: 600; font-size: var(--step--1); margin-bottom: var(--space-2); display: flex; gap: var(--space-2); align-items: flex-start; }
.q legend::before { content: ""; flex: none; width: 16px; height: 16px; margin-top: 2px; border-radius: 5px; border: 1.5px solid var(--line-strong); background: var(--surface); }
.q.is-open legend::before { border-color: var(--mark); background: var(--mark-soft); }
.q.is-done legend::before { background: var(--under) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.5l2.5 2.5L12 5.5' fill='none' stroke='white' stroke-width='2'/%3E%3C/svg%3E") center/12px no-repeat; border-color: var(--under); }
.q-row { clear: both; display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; padding-left: 24px; }
.q-row input[type="time"] { width: 116px; font-family: var(--font-mono); min-height: 40px; }
.q-to { color: var(--muted); font-size: var(--step--1); }
.q-unit { display: inline-flex; align-items: center; gap: var(--space-2); font-size: var(--step--1); color: var(--muted); }
.q-unit input { width: 78px; font-family: var(--font-mono); text-align: right; min-height: 40px; }
.q-chips { clear: both; display: flex; flex-wrap: wrap; gap: 6px; padding-left: 24px; }
.q-hint { clear: both; margin: var(--space-2) 0 0 24px; font-size: var(--step--2); color: var(--muted); font-family: var(--font-mono); }
.review-live { padding: var(--space-5); border-radius: var(--radius-l); background: var(--ink); color: var(--bg); }
.review-live .headline-role { color: color-mix(in srgb, var(--bg) 65%, var(--ink)); }
.review-live-range { font-size: var(--step-3); font-weight: 600; margin: 0; letter-spacing: -0.02em; }
.review-live .gauge { --ink: var(--bg); padding-bottom: 0; }
.review-live .gauge-track { background: color-mix(in srgb, var(--bg) 14%, var(--ink)); border-color: transparent; }
.review-live .gauge-band { border-color: var(--bg); }
.review-live .gauge-limit { background: var(--bg); }
.review-live .gauge-limit::before { color: var(--bg); }

.action-bar { position: sticky; bottom: 0; z-index: 10; margin-top: var(--space-6); padding: var(--space-4) var(--space-5); display: flex; justify-content: space-between; align-items: center; gap: var(--space-4); flex-wrap: wrap; border-radius: var(--radius-l); background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border: 1px solid var(--line); box-shadow: var(--shadow-2); }
.action-bar-text { margin: 0; font-size: var(--step--1); color: var(--ink-2); }
@media (max-width: 600px) { .action-bar { border-radius: 16px 16px 0 0; margin-inline: calc(-1 * var(--gutter)); } .action-bar .btn { width: 100%; } }
.btn svg path { vector-effect: non-scaling-stroke; }

/* ---------- Answer ---------- */
.report-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--space-5); align-items: end; padding-bottom: var(--space-5); border-bottom: 2px solid var(--ink); }
.report-head h1 { font-size: var(--step-4); margin-bottom: var(--space-3); }
.report-meta { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-4); margin: 0; font: 500 var(--step--2)/1.6 var(--font-mono); color: var(--muted); align-items: center; }
.report-tools { display: flex; flex-direction: column; align-items: flex-end; gap: var(--space-3); }
.report-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); justify-content: flex-end; }
.segmented { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--bg-tint); border: 1px solid var(--line); }
.segmented button { border: 0; background: transparent; color: var(--ink-2); font: 600 var(--step--1)/1 var(--font-body); padding: 9px 16px; border-radius: 999px; cursor: pointer; min-height: 36px; }
.segmented button[aria-checked="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); }
@media (max-width: 900px) { .report-head { grid-template-columns: 1fr; } .report-tools { align-items: flex-start; } .report-actions { justify-content: flex-start; } }

.answer-summary { font-family: var(--font-display); font-size: var(--step-2); line-height: 1.3; letter-spacing: -0.015em; max-width: 46ch; margin: var(--space-6) 0; }

.answer-hero { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: var(--space-5); align-items: stretch; }
@media (max-width: 1080px) { .answer-hero { grid-template-columns: 1fr; } }
.role-feature { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: var(--space-6); padding: var(--space-6); border-radius: 24px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-2); }
@media (max-width: 760px) { .role-feature { grid-template-columns: 1fr; padding: var(--space-5); } }
.role-feature .headline-range { font-size: var(--step-5); }
.role-feature-note { font-size: var(--step--1); }
.role-feature-grid { display: flex; flex-direction: column; justify-content: center; }
.role-feature-grid .yg-legend { font-size: var(--step--2); gap: var(--space-2) var(--space-4); }

.role-list { display: flex; flex-direction: column; gap: var(--space-2); }
.role-tab { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "name badge" "range range" "gauge gauge"; gap: 2px var(--space-3); text-align: left; padding: var(--space-4); border-radius: var(--radius-l); border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; cursor: pointer; transition: border-color var(--dur-1), box-shadow var(--dur-2), transform var(--dur-2) var(--ease-out); }
.role-tab:hover { border-color: var(--line-strong); transform: translateX(2px); }
.role-tab[aria-selected="true"] { border-color: var(--ink); box-shadow: inset 4px 0 0 var(--mark), var(--shadow-1); }
.role-tab-name { grid-area: name; font-weight: 650; font-size: var(--step--1); }
.role-tab-range { grid-area: range; font-size: var(--step-1); font-weight: 600; }
.role-tab .badge { grid-area: badge; align-self: start; }
.role-tab-gauge { grid-area: gauge; }
.role-list-note { font-size: var(--step--2); margin: var(--space-2) var(--space-2) 0; }
.gauge-xs { padding: 6px 0 0; display: block; }
.gauge-xs .gauge-track { height: 8px; display: block; }
.gauge-xs .gauge-band { border-width: 1px; display: block; }
.gauge-xs .gauge-limit { top: 2px; bottom: -4px; display: block; }
.gauge-xs .gauge-limit::before { display: none; }
.gauge-sm { padding-top: 26px; padding-bottom: 0; }
.gauge-sm .gauge-track { height: 12px; }
.gauge-sm .gauge-limit { top: 18px; bottom: -4px; }

.answer-block { margin-top: var(--space-8); }
.block-head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-2) var(--space-5); flex-wrap: wrap; margin-bottom: var(--space-5); padding-bottom: var(--space-3); border-bottom: 1px solid var(--line); }
.block-head h2 { font-size: var(--step-3); margin: 0; display: flex; align-items: center; gap: var(--space-3); }
.block-head p { margin: 0; font-size: var(--step--1); max-width: 56ch; }
.count { font: 600 var(--step--1)/1 var(--font-mono); background: var(--ink); color: var(--bg); padding: 5px 8px; border-radius: 6px; letter-spacing: 0; }

/* Drivers: horizontal bars, low solid, band hatched */
.drivers { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-2); --scale: 1000; }
.drivers li { display: grid; grid-template-columns: minmax(120px, 220px) minmax(0, 1fr) 110px; gap: var(--space-4); align-items: center; font-size: var(--step--1); }
.drv-name { font-weight: 550; }
.drv-bar { position: relative; height: 14px; border-radius: 4px; background: var(--bg-tint); overflow: hidden; }
.drv-bar i, .drv-bar b { position: absolute; top: 0; bottom: 0; left: 0; display: block; transform-origin: left center; animation: gauge-in var(--dur-3) var(--ease-out) both 120ms; }
.drv-bar i { width: calc(max(var(--low), var(--scale) * 0.004) / var(--scale) * 100%); background: var(--cell-fill); border-radius: 4px 0 0 4px; z-index: 1; }
.drv-bar b { width: calc(var(--high) / var(--scale) * 100%); background: repeating-linear-gradient(-45deg, var(--mark) 0 4px, color-mix(in srgb, var(--mark) 70%, var(--bg)) 4px 8px); border-radius: 4px; }
.drv-val { text-align: right; color: var(--ink-2); white-space: nowrap; }
@media (max-width: 640px) {
  .drivers li { grid-template-columns: 1fr auto; gap: 4px var(--space-3); }
  .drv-bar { grid-column: 1 / -1; grid-row: 2; }
}
.all-lines { margin-top: var(--space-5); }
.all-lines summary { cursor: pointer; font-weight: 600; font-size: var(--step--1); padding: var(--space-2) 0; }
.all-lines .table-scroll { margin-top: var(--space-3); }
.compare .r { text-align: right; }

/* Issues */
.issues { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-3); }
.issue { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: var(--space-4); padding: var(--space-5); border-radius: var(--radius-l); background: var(--surface); border: 1px solid var(--line); }
.issue h3 { font-size: var(--step-1); margin: 0 0 var(--space-2); letter-spacing: -0.01em; }
.issue p { margin: 0; color: var(--ink-2); font-size: var(--step--1); }
.issue-meta { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-4); margin-top: var(--space-3) !important; font: 500 var(--step--2)/1.4 var(--font-mono); }
.issue-meta a { color: var(--ink); font-weight: 600; }
.issue-meta span { color: var(--muted); }
.issue .sev { margin-top: 8px; }
.issue-hrs { text-align: right; font-size: var(--step-1); font-weight: 600; color: var(--over); white-space: nowrap; display: flex; flex-direction: column; }
.issue-hrs small { font: 500 var(--step--2)/1.4 var(--font-mono); color: var(--muted); }
.issue[data-severity="band"] .issue-hrs { color: var(--band); }
.issue-hrs.is-down, .issue[data-severity="under"] .issue-hrs { color: var(--under); }
@media (max-width: 640px) {
  .issue { grid-template-columns: auto minmax(0, 1fr); padding: var(--space-4); }
  .issue-hrs { grid-column: 2; text-align: left; flex-direction: row; gap: var(--space-2); align-items: baseline; }
}

/* Fixes */
.fixes { list-style: none; margin: 0; padding: 0; counter-reset: fx; display: grid; gap: var(--space-3); --max: 25; }
.fix-item { counter-increment: fx; display: grid; grid-template-columns: 44px minmax(0, 1fr) minmax(200px, 280px); gap: var(--space-4); align-items: center; padding: var(--space-4) var(--space-5); border-radius: var(--radius-l); background: var(--surface); border: 1px solid var(--line); }
.fix-item::before { content: counter(fx); width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--ink); color: var(--bg); font: 600 var(--step--1)/1 var(--font-mono); }
.fix-item.fix-cost::before { background: var(--bg-tint); color: var(--ink-2); border: 1px solid var(--line-strong); }
.fix-text h3 { font-size: var(--step-0); margin: 0 0 4px; letter-spacing: -0.005em; font-family: var(--font-body); font-weight: 650; line-height: 1.35; }
.fix-text p { margin: 0; color: var(--ink-2); font-size: var(--step--1); }
.fix-hours { display: grid; grid-template-columns: 1fr 1fr; gap: 4px var(--space-3); font-size: var(--step--1); }
.fix-hours .fix-bar { grid-column: 1 / -1; position: relative; height: 10px; border-radius: 999px; background: var(--bg-tint); overflow: hidden; }
.fix-bar b, .fix-bar i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 999px; transform-origin: left; animation: gauge-in var(--dur-3) var(--ease-out) both 160ms; }
.fix-bar b { width: calc(var(--full) / var(--max) * 100%); background: var(--under); opacity: 0.35; }
.fix-bar i { width: calc(var(--this) / var(--max) * 100%); background: var(--under); z-index: 1; }
.fix-cost .fix-bar b, .fix-cost .fix-bar i { background: var(--line-strong); opacity: 1; }
.fix-hours strong { font-weight: 650; color: var(--ink); }
@media (max-width: 760px) {
  .fix-item { grid-template-columns: 36px minmax(0, 1fr); padding: var(--space-4); }
  .fix-hours { grid-column: 1 / -1; }
}
.after-fixes { margin-top: var(--space-5); padding: var(--space-5) var(--space-6); border-radius: var(--radius-l); border: 1.5px solid var(--ink); }
.after-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-4); margin: var(--space-3) 0; }
.after-grid div { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.after-grid span:first-child { font-size: var(--step--1); color: var(--ink-2); }
.after-grid b { font-size: var(--step-3); font-weight: 600; letter-spacing: -0.02em; }
.after-note { font-size: var(--step--1); margin: 0; }
@media (max-width: 640px) { .after-grid { grid-template-columns: 1fr; } .after-grid div { flex-direction: row; align-items: baseline; flex-wrap: wrap; gap: var(--space-3); } .after-grid span:first-child { flex: 1 1 100%; } }

/* Questions */
.questions { margin: 0; padding: 0; list-style: none; counter-reset: q; border: 1px solid var(--line); border-radius: var(--radius-l); background: var(--surface); }
.questions li { counter-increment: q; display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: var(--space-3); align-items: baseline; padding: var(--space-4) var(--space-5) var(--space-4) var(--space-4); border-bottom: 1px solid var(--line); }
.questions li:last-child { border-bottom: 0; }
.questions li::before { content: "Q" counter(q); font: 600 var(--step--1)/1 var(--font-mono); color: var(--mark-ink); }
.questions p { margin: 0; font-size: var(--step-0); }
.questions .num { font-size: var(--step--2); color: var(--muted); white-space: nowrap; }
@media (max-width: 600px) { .questions li { grid-template-columns: 36px minmax(0, 1fr); } .questions .num { grid-column: 2; } }

.report-foot { margin-top: var(--space-8); padding-top: var(--space-5); border-top: 2px solid var(--ink); font-size: var(--step--1); color: var(--ink-2); max-width: 80ch; }
.answer-again { display: flex; gap: var(--space-3); flex-wrap: wrap; margin-top: var(--space-6); }

/* Toast */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 90; background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: 16px; width: max-content; text-align: center; font-weight: 600; font-size: var(--step--1); box-shadow: var(--shadow-2); animation: toast-in var(--dur-3) var(--ease-out); max-width: calc(100vw - 32px); }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 12px); } }

/* ---------- Refinements ---------- */
.review-head h1 { font-size: var(--step-4); }
.review-school .field input { min-width: 280px; }
@media (max-width: 720px) { .review-school .field input { min-width: 0; } }
.role-feature { grid-template-columns: 1fr; gap: var(--space-5); }
.role-feature-text { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-2) var(--space-6); align-items: end; }
.role-feature-text > .headline-role, .role-feature-text > .headline-range { grid-column: 1 / -1; }
.role-feature-text > .headline-verdict, .role-feature-text > .role-feature-note { grid-column: 1; margin-bottom: 0; }
.role-feature-text > .gauge { grid-column: 2; grid-row: 3 / span 2; align-self: center; }
.role-feature .headline-range { margin-bottom: var(--space-2); }
@media (max-width: 760px) {
  .role-feature-text { grid-template-columns: 1fr; }
  .role-feature-text > .gauge { grid-column: 1; grid-row: auto; }
  .role-feature .headline-range { font-size: var(--step-4); }
}
.role-feature-grid { padding-top: var(--space-5); border-top: 1px solid var(--line); }
.drivers-base { display: flex; justify-content: space-between; gap: var(--space-4); font-size: var(--step--1); padding: var(--space-3) var(--space-4); border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); margin-bottom: var(--space-4); }
.drivers-base span:first-child { font-weight: 600; }
.drivers-base span:last-child { white-space: nowrap; }


/* ---------- Review fixes (29 Nov) ---------- */
/* Basics show their status as a dot and a word, not a checkbox: they are not something to click. */
.q legend::before { border-radius: 50%; width: 10px; height: 10px; margin-top: 5px; border: 0; background: var(--line-strong); }
.q.is-open legend::before { background: var(--mark); border: 0; box-shadow: 0 0 0 3px var(--mark-soft); }
.q.is-done legend::before { background: var(--under); border: 0; }
.q.is-done legend::after { content: "Answered"; margin-left: auto; font: 600 10px/1.6 var(--font-mono); text-transform: uppercase; letter-spacing: 0.05em; color: var(--under-ink, var(--under)); white-space: nowrap; }
/* Rule links are real targets on a phone (WCAG 2.5.8). */
.fix-rule, .fix-text a, .issue-meta a { display: inline-flex; align-items: center; min-height: 24px; min-width: 24px; padding: 2px 6px; margin: -2px -6px; }
.fix-text a { margin: 0 0 0 2px; }
/* Headings that take focus after a step change: no ring for a heading that is not a control. */
h1[tabindex="-1"]:focus, h2[tabindex="-1"]:focus, h1[tabindex="-1"]:focus-visible, h2[tabindex="-1"]:focus-visible { outline: none; }
/* Keyboard focus stays clear of the sticky action bar. */
html:has(main[data-state="review"]) { scroll-padding-bottom: 140px; }
.fix-group-head { list-style: none; margin-top: var(--space-4); font: 600 var(--step--2)/1.4 var(--font-mono); text-transform: uppercase; letter-spacing: 0.05em; }
.action-bar-live { display: none; margin: 0; font: 600 var(--step--1)/1.35 var(--font-body); color: var(--ink); width: 100%; }
@media (max-width: 600px) {
  .trust-compact { grid-template-columns: 1fr 1fr; }
  .trust-compact li, .trust-compact li + li { padding: var(--space-4) var(--space-3) var(--space-4) 0; border-left: 0; border-bottom: 1px solid var(--line); }
  .trust-compact li:nth-child(even) { padding-left: var(--space-4); border-left: 1px solid var(--line); }
  .trust-compact li:nth-last-child(-n+2) { border-bottom: 0; }
  .trust-compact b { word-break: normal; overflow-wrap: normal; hyphens: none; }
  /* On a phone the open basics come before the lines. */
  .review-layout { display: flex; flex-direction: column; }
  .review-side { order: -1; }
  .review-side .review-live { display: none; }
  .action-bar-live { display: block; }
}
.report-actions-below { margin: var(--space-5) 0 0; justify-content: flex-start; }

/* The answer leads with one sentence per role and the questions that would settle most. */
.answer-lead { display: grid; gap: var(--space-4); margin: 0 0 var(--space-6); }
.answer-roles { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-2); }
.answer-roles li { padding-left: var(--space-4); border-left: 3px solid var(--line-strong); }
.answer-roles li.is-over { border-left-color: var(--over, #c0392b); }
.answer-roles li.is-under { border-left-color: var(--under, #2e7d32); }
.answer-roles li.is-band { border-left-color: var(--mark); }
.answer-roles b { font-weight: 650; }
.answer-topq { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--space-4) var(--space-5); }
.answer-topq-title { font-size: var(--step-0); margin: 0 0 var(--space-2); }
.answer-topq ol { margin: 0 0 var(--space-3); padding-left: 1.4em; display: grid; gap: var(--space-2); }
.answer-topq .num { color: var(--muted); white-space: nowrap; }
.readings-gloss { font-size: var(--step--1); color: var(--ink-2); max-width: 70ch; margin: 0; }
.readings-gloss b { color: var(--ink); font-weight: 650; }
