:root {
  --ink: #102a35;
  --muted: #53666f;
  --paper: #fbfdfc;
  --surface: #ffffff;
  --soft: #eaf5f2;
  --teal: #006b63;
  --teal-dark: #004f49;
  --gold: #c89a3d;
  --border: #c8d7d5;
  --danger: #a3212b;
  --danger-soft: #fff0f1;
  --success: #216e45;
  --shadow: 0 18px 45px rgba(16, 42, 53, .10);
  --radius: 18px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.55;
}
* { box-sizing: border-box; }
html { min-height: 100%; }
body { margin: 0; min-height: 100%; background: radial-gradient(circle at top right, #dff2ed 0, transparent 35rem), var(--paper); }
a { color: var(--teal-dark); text-underline-offset: .2em; }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 4px solid #ffbf47; outline-offset: 3px; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
h1, h2, h3 { line-height: 1.18; letter-spacing: -.02em; }
h1 { font-size: clamp(2rem, 4vw, 3.25rem); margin: .2em 0 .5em; }
h2 { margin-top: 1.7em; }
.skip-link { position: fixed; left: 1rem; top: -5rem; padding: .8rem 1rem; background: #000; color: #fff; z-index: 999; }
.skip-link:focus { top: 1rem; }
.site-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem clamp(1rem, 4vw, 4rem); background: rgba(255,255,255,.96); border-bottom: 1px solid var(--border); }
.brand-wrap { display: flex; align-items: center; gap: .85rem; }
.brand-mark { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50% 50% 45% 55%; color: #fff; background: linear-gradient(135deg, var(--teal), var(--teal-dark)); font-weight: 800; letter-spacing: .05em; box-shadow: inset 0 0 0 3px rgba(255,255,255,.35); }
.brand { color: var(--ink); text-decoration: none; font-size: 1.2rem; font-weight: 800; }
.byline { color: var(--muted); font-size: .78rem; }
.header-actions { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.header-actions form { margin: 0; }
.pilot-banner { padding: .7rem 1rem; text-align: center; background: #fff3cd; color: #533f03; border-bottom: 1px solid #e4cb76; font-weight: 700; }
.page-shell { width: min(1180px, calc(100% - 2rem)); margin: 0 auto; padding: clamp(2rem, 5vw, 5rem) 0; min-height: 65vh; }
.site-footer { padding: 2rem clamp(1rem, 4vw, 4rem); border-top: 1px solid var(--border); color: var(--muted); font-size: .92rem; }
.auth-card, .question-card, .success-card, .panel, .info-card, .assessment-card, .review-item { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.auth-card { width: min(620px, 100%); margin: 0 auto; padding: clamp(1.5rem, 5vw, 3rem); }
.success-card { width: min(760px, 100%); margin: 0 auto; text-align: center; padding: 3rem; }
.eyebrow { margin: 0 0 .4rem; color: var(--teal); font-size: .82rem; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; }
.muted { color: var(--muted); font-size: .93rem; }
.stacked-form { display: grid; gap: .7rem; }
label, legend { font-weight: 750; }
input, textarea, select { width: 100%; color: var(--ink); background: var(--surface); border: 2px solid #9db5b1; border-radius: 10px; padding: .8rem .9rem; }
textarea { resize: vertical; min-height: 10rem; }
.check-label { display: grid; grid-template-columns: auto 1fr; align-items: start; gap: .75rem; font-weight: 500; }
.check-label input, .option-card input { width: auto; margin-top: .25rem; transform: scale(1.25); }
.consent-box { margin: 1rem 0; padding: 1rem; border-radius: 12px; background: var(--soft); }
.primary-button, .secondary-button, .quiet-button, .small-button { display: inline-flex; justify-content: center; align-items: center; border-radius: 10px; border: 2px solid transparent; font-weight: 800; min-height: 44px; padding: .7rem 1rem; }
.primary-button { color: #fff; background: var(--teal); border-color: var(--teal); }
.primary-button:hover { background: var(--teal-dark); }
.secondary-button { color: var(--teal-dark); background: #fff; border-color: var(--teal); }
.quiet-button { color: var(--ink); background: transparent; border-color: var(--border); }
.small-button { min-height: 38px; padding: .4rem .7rem; color: var(--teal-dark); background: #fff; border-color: var(--teal); font-size: .88rem; }
.button-link { text-decoration: none; }
.alert { padding: 1rem 1.1rem; margin: 1rem 0; background: #edf6ff; border: 2px solid #6aa4ca; border-radius: 12px; }
.alert-error { color: #74151d; background: var(--danger-soft); border-color: #d46b73; }
.alert-urgent { color: #5e1017; background: #ffe6e8; border-color: var(--danger); font-weight: 750; }
.alert-success { color: #174c31; background: #e7f7ee; border-color: #64a980; }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; }
.info-card { padding: 1.2rem 1.5rem; background: var(--soft); box-shadow: none; }
.info-card h2 { margin-top: 0; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 1rem; }
.assessment-card { padding: 1.4rem; }
.assessment-card .button-link { margin-right: .4rem; margin-top: .5rem; }
.status { display: inline-block; border-radius: 99px; padding: .25rem .65rem; background: #e8eeee; font-size: .78rem; font-weight: 850; text-transform: uppercase; letter-spacing: .05em; }
.status-submitted { color: #174c31; background: #ddf3e6; }
.status-reopened { color: #6a3c02; background: #fff0ce; }
.risk-high { color: #fff; background: var(--danger); }
.risk-medium { color: #5d3d00; background: #ffe4a7; }
progress { width: 100%; height: 1.15rem; accent-color: var(--teal); }
.breadcrumb { display: flex; gap: .55rem; margin-bottom: 1.5rem; }
.question-layout { display: grid; gap: 1rem; }
.progress-panel { padding: 1rem 1.2rem; border-left: 5px solid var(--gold); background: #fffaf0; border-radius: 10px; }
.question-card { padding: clamp(1.4rem, 5vw, 3rem); }
.question-card h1 { font-size: clamp(1.7rem, 3.5vw, 2.6rem); max-width: 28ch; }
.question-number { color: var(--muted); font-size: .83rem; font-weight: 750; letter-spacing: .05em; }
.voice-controls, .form-actions { display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; margin: 1.3rem 0; }
.voice-controls [role="status"] { flex-basis: 100%; color: var(--muted); font-weight: 650; }
.voice-active { color: #fff; background: var(--teal); border-color: var(--teal); }
.transcript-preview { margin: 1rem 0; padding: 1rem 1.1rem; border: 2px solid var(--teal); border-radius: 12px; background: var(--soft); }
.transcript-preview p { margin: .5rem 0 0; color: var(--muted); }
.answer-form fieldset { margin: 1.5rem 0; padding: 0; border: 0; }
.option-card { display: flex; gap: .8rem; align-items: center; margin: .65rem 0; padding: 1rem; border: 2px solid var(--border); border-radius: 12px; cursor: pointer; }
.option-card:has(input:checked) { border-color: var(--teal); background: var(--soft); }
input[type="range"] { accent-color: var(--teal); }
output { display: inline-grid; place-items: center; min-width: 3rem; min-height: 3rem; margin: .5rem; border-radius: 50%; background: var(--teal); color: #fff; font-size: 1.2rem; font-weight: 800; }
.review-list { display: grid; gap: 1rem; margin-top: 1.5rem; }
.review-item { padding: 1.3rem; box-shadow: none; }
.review-item h2 { margin: .25rem 0 .7rem; font-size: 1.2rem; }
.answer-value { padding: .8rem 1rem; margin-bottom: .7rem; white-space: pre-wrap; background: var(--soft); border-radius: 10px; }
.staff-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1rem; }
.panel { padding: 1.5rem; }
.panel h2 { margin-top: 0; }
.staff-section { margin: 2rem 0; }
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 12px; background: #fff; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: .8rem; text-align: left; vertical-align: top; border-bottom: 1px solid var(--border); }
th { background: var(--soft); }
.plain-list { list-style: none; padding: 0; }
.plain-list li { padding: .75rem 0; border-bottom: 1px solid var(--border); }
.text-large { font-size: 118%; }
.high-contrast { --ink: #000; --muted: #1b1b1b; --paper: #fff; --surface: #fff; --soft: #f2f2f2; --teal: #004d40; --teal-dark: #00362d; --border: #000; }
.high-contrast .primary-button { background: #000; border-color: #000; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; } }
@media (max-width: 760px) {
  .site-header, .page-heading { align-items: flex-start; flex-direction: column; }
  .header-actions { width: 100%; }
  .staff-grid { grid-template-columns: 1fr; }
  .page-shell { width: min(100% - 1rem, 1180px); padding-top: 1.5rem; }
  .question-card, .auth-card { border-radius: 12px; }
}
@media (prefers-color-scheme: dark) {
  :root:not(.high-contrast) { --ink: #edf7f5; --muted: #b5c8c4; --paper: #0d1c21; --surface: #14292e; --soft: #19383a; --border: #42615f; --teal: #55c8bb; --teal-dark: #81ddd3; --shadow: none; }
  body { background: var(--paper); }
  .site-header { background: #14292e; }
  .primary-button { color: #071313; }
  .secondary-button, .small-button { background: #14292e; }
  .progress-panel { background: #2d271a; }
  .pilot-banner { background: #4b3b08; color: #fff4c3; }
  .table-wrap, th { background: var(--surface); }
}
