/* Neutral semantic tokens adapted from shadcn/ui for native Flask controls.
   Reference: https://ui.shadcn.com/docs/theming . No React components installed. */
:root{
  --background:#fafafa;--foreground:#171717;--card:#fff;--primary:#171717;
  --primary-foreground:#fafafa;--secondary:#f5f5f5;--muted-foreground:#525252;
  --accent:#f0f0f0;--border:#dedede;--input:#8a8a8a;--ring:#737373;
  --destructive:#b42318;--radius:.625rem;--line:var(--border);--teal:var(--primary);
  color-scheme:light;color:var(--foreground);background:var(--background);
  scrollbar-color:var(--input) var(--background);
}
:root[data-theme=dark]{
  --background:#171717;--foreground:#fafafa;--card:#212121;--primary:#ededed;
  --primary-foreground:#171717;--secondary:#292929;--muted-foreground:#b5b5b5;
  --accent:#303030;--border:#3c3c3c;--input:#737373;--ring:#a3a3a3;
  --destructive:#ffb4ab;color-scheme:dark;
}
body{color:var(--foreground);background:var(--background)}
.brand-sub,.lede,.hint,footer,nav a,th,#save-status{color:var(--muted-foreground)}
.working-surface{background:var(--card);border-color:var(--border);border-radius:12px}
input,textarea,select,button{color:var(--foreground);background:var(--card);border-color:var(--input);border-radius:6px;caret-color:var(--foreground);accent-color:var(--primary)}
input::placeholder,textarea::placeholder{color:var(--muted-foreground);opacity:1}
button:hover{background:var(--accent)}
.primary,nav a[aria-current]{color:var(--primary-foreground);background:var(--primary);border-color:var(--primary)}
.primary:hover{background:var(--primary);filter:brightness(.88)}
:root[data-theme=dark] .primary:hover{filter:brightness(1.12)}
.checks label{border-color:var(--input);border-radius:6px;background:var(--card)}
.badge{color:var(--foreground);background:var(--secondary)}
.field-error,#form-error{color:var(--destructive)}
a,summary{color:var(--foreground)}a:hover{color:var(--muted-foreground)}
.mark{background:var(--primary);color:var(--primary-foreground);border-radius:8px}
.skip{background:var(--card)}
:focus-visible{outline:2px solid var(--ring);outline-offset:3px}
[aria-invalid=true]{border-color:var(--destructive)}
::selection{background:var(--primary);color:var(--primary-foreground)}
.brand{font-size:18px;gap:10px}.mark{width:40px;height:40px}
.theme-switch{display:inline-flex;gap:2px;padding:3px;border:1px solid var(--border);border-radius:8px;background:var(--card);flex-shrink:0}
.theme-switch button{width:32px;height:32px;min-height:32px;padding:7px;border:0;background:transparent;color:var(--muted-foreground);border-radius:4px}
.theme-switch button:hover,.theme-switch button[aria-pressed=true]{background:var(--accent);color:var(--foreground)}
.theme-switch svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round;display:block}
.form-heading,#enrollment{max-width:740px;margin-left:auto;margin-right:auto}
.form-heading h1{font-size:32px;letter-spacing:-.025em}.form-heading .lede{font-size:16px}
.field-grid{gap:18px 22px}.field-grid input{margin-bottom:0}
input[type=checkbox]{padding:0;min-height:0;border-radius:3px}
.working-surface fieldset{margin-top:28px}.extras h2{margin-top:28px}
.checks label{font-size:14px;padding:10px 13px;min-height:44px}
.header-actions{gap:10px}header{gap:12px;flex-wrap:wrap}
@media(max-width:520px){.brand{font-size:15px;gap:8px}.mark{width:34px;height:34px;font-size:13px}.brand-sub{font-size:12px}.theme-switch button{width:30px;height:30px;min-height:30px;padding:6px}.form-heading h1{font-size:28px}.working-surface{padding:20px}.field-grid{gap:18px}.checks{gap:8px}.checks label{display:inline-flex}.submit-bar{gap:14px}footer{padding-top:32px}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{scroll-behavior:auto!important;animation-duration:.01ms!important;transition-duration:.01ms!important}}
@media print{:root,:root[data-theme=dark]{--background:#fff;--foreground:#000;--card:#fff;--muted-foreground:#333;--border:#aaa;color-scheme:light}.theme-switch,.skip{display:none!important}}
/* Native controls have one geometry independent of their label's font weight. */
input,textarea,select{font-weight:400}
input:not([type=checkbox]):not([type=hidden]):not([type=file]),select{height:44px;padding:9px 12px}
input[type=file]{font-size:14px;padding:9px 12px}
.field-grid{align-items:start;row-gap:20px}
.field-grid>label{margin:0;min-width:0}
.field-grid>button{justify-self:start;align-self:end;grid-column:1/-1}
.field-grid select,.field-grid>label>input{margin-bottom:0}
td{vertical-align:middle;padding:14px 12px}
td details{margin:0}
td summary{padding:0;line-height:24px}
td form,.row-action{margin:0}
td details[open]>summary{margin-bottom:12px}
td .check-line{margin:12px 0}
.cell-secondary{display:block;color:var(--muted-foreground);font-size:12px;margin-top:3px;overflow-wrap:anywhere}
.person-name{font-weight:600}
.response-table{table-layout:fixed;min-width:700px}
.response-table th:nth-child(1){width:26%}.response-table th:nth-child(2){width:24%}.response-table th:nth-child(3){width:20%}.response-table th:nth-child(4){width:30%}
.response-table td{overflow-wrap:anywhere}
.table-details .answer-list{font-size:13px;margin:0}
.answer-list>div{margin-bottom:12px}.answer-list dt{font-size:12px;color:var(--muted-foreground)}.answer-list dd{margin:3px 0 0}
.row-action button{white-space:normal;text-align:center}
.builder-row{align-items:center}.builder-row>label{margin:0}.builder-row input,.builder-row select{margin-bottom:0}.builder-row button{margin-bottom:0}
@media(max-width:760px){.field-grid>button{justify-self:stretch}.response-table{min-width:660px}.response-table th:nth-child(1){width:25%}.response-table th:nth-child(2){width:23%}.response-table th:nth-child(3){width:20%}.response-table th:nth-child(4){width:32%}}
.builder-row{grid-template-columns:minmax(100px,1fr) minmax(140px,1.5fr) minmax(85px,.8fr) 105px auto}
.builder-row .builder-required{display:flex;gap:8px;align-items:center;min-height:44px;padding-top:20px;font-weight:400}
.batch>*{min-width:0;overflow-wrap:anywhere}
@media(max-width:760px){.builder-row{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}}
tr:has(details[open])>td{vertical-align:top}
.scan-notice{padding:14px 16px;border:1px solid var(--border);border-radius:8px;background:var(--secondary);margin:20px 0;line-height:1.5}
.duplicate-decision{padding-bottom:24px;margin-bottom:24px;border-bottom:1px solid var(--border)}
.button{display:inline-flex;align-items:center;justify-content:center;min-height:44px;padding:10px 16px;border:1px solid var(--input);border-radius:6px;background:var(--card);color:var(--foreground);font-size:14px;font-weight:600;text-decoration:none}
.button.primary{background:var(--primary);color:var(--primary-foreground);border-color:var(--primary)}
.print-actions{display:flex;gap:10px;align-items:center;flex-wrap:wrap;margin:16px 0}
.page-title .button{flex-shrink:0}
