:root {
    color-scheme: light;
    --ink: #162329;
    --muted: #4e6169;
    --paper: #fff;
    --canvas: #f2f6f5;
    --surface-quiet: #fcfefd;
    --surface-soft: #f3f8f7;
    --line: #d8e3e1;
    --outline: #b4c7c4;
    --outline-hover: #86a7a2;
    --focus: #1c857c;
    --placeholder: #647575;
    --teal: #07675e;
    --teal-dark: #084b45;
    --teal-soft: #e2f2ed;
    --primary: #07675e;
    --primary-hover: #084b45;
    --on-primary: #fff;
    --danger: #a82e32;
    --danger-soft: #ffeded;
    --danger-line: #f2c6c6;
    --shadow: #133f3610;
    --badge-neutral: #ecf1f3;
    --badge-neutral-text: #40515b;
    --badge-active: #dbf4e9;
    --badge-active-text: #0c5749;
    --badge-submitted: #e3edfa;
    --badge-submitted-text: #214b7a;
    --badge-locked: #fff0d5;
    --badge-locked-text: #734912;
    --badge-archived: #eeeaf5;
    --badge-archived-text: #594179;
    --radius: 16px;
    font-family: "Segoe UI", system-ui, sans-serif;
    font-size: 100%;
}
:root[data-theme="dark"] {
    color-scheme: dark;
    --ink: #e8f0ef;
    --muted: #afc2c4;
    --paper: #19292d;
    --canvas: #101b1e;
    --surface-quiet: #17262a;
    --surface-soft: #203236;
    --line: #34494e;
    --outline: #667f83;
    --outline-hover: #81a29f;
    --focus: #8be0d2;
    --placeholder: #a5babd;
    --teal: #86dfcf;
    --teal-dark: #b1efe5;
    --teal-soft: #244842;
    --primary: #75d8c6;
    --primary-hover: #9ae7d9;
    --on-primary: #102722;
    --danger: #ffaaaa;
    --danger-soft: #432a2e;
    --danger-line: #81555a;
    --shadow: #0005;
    --badge-neutral: #303f46;
    --badge-neutral-text: #d0dce2;
    --badge-active: #23483d;
    --badge-active-text: #a8efd2;
    --badge-submitted: #263e57;
    --badge-submitted-text: #c0ddfb;
    --badge-locked: #463922;
    --badge-locked-text: #f6d29b;
    --badge-archived: #3d324e;
    --badge-archived-text: #ebd9ff;
}
*, *::before, *::after { box-sizing: border-box; }
body { background: var(--canvas); color: var(--ink); margin: 0; line-height: 1.5; }
[hidden] { display: none !important; }
a { color: var(--teal); text-underline-offset: .18em; }
a:hover { color: var(--teal-dark); }
button, input, textarea, select { font: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
p, ul, dl { margin: 0; }
h1, h2, h3 { margin: 0; line-height: 1.18; overflow-wrap: anywhere; }
h1 { font-size: clamp(2rem, 5vw, 3.25rem); letter-spacing: -.055em; font-weight: 740; }
h2 { font-size: clamp(1.18rem, 2.5vw, 1.4rem); letter-spacing: -.025em; }
h3 { font-size: 1.04rem; line-height: 1.4; }
.wrap { width: min(100% - 3rem, 76rem); margin-inline: auto; }
.main { padding-block: 2.25rem 4rem; }
.topbar { background: var(--paper); border-bottom: 1px solid var(--line); }
.header-row { display: flex; align-items: center; gap: 1.5rem; min-height: 4.4rem; }
.brand { display: inline-flex; align-items: center; gap: .65rem; font-size: 1.18rem; font-weight: 770; color: var(--ink); text-decoration: none; letter-spacing: -.04em; }
.brand-accent { color: var(--teal); }
.brand-mark { display: grid; grid-template-columns: repeat(2, 5px); gap: 3px; background: #084b45; padding: 9px; border-radius: 9px; }
.brand-mark i { width: 5px; height: 5px; border-radius: 1px; background: #b5f1dd; }
.brand-mark i:last-child { background: #61cdb2; }
.nav { display: flex; gap: .3rem; margin-inline-start: .6rem; }
.nav a { color: var(--muted); padding: .55rem .87rem; border-radius: 9px; text-decoration: none; font-weight: 650; }
.nav a:hover, .nav a.current { color: var(--teal-dark); background: var(--teal-soft); }
.header-actions { margin-inline-start: auto; display: flex; align-items: center; gap: .45rem; }
.skip { position: absolute; z-index: 5; top: .5rem; left: .5rem; transform: translateY(-200%); padding: .75rem; background: var(--paper); }
.skip:focus { transform: translateY(0); }
.button {
    display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
    min-height: 44px; padding: .55rem 1rem; border: 1px solid transparent; border-radius: 9px;
    text-decoration: none; text-align: center; font-weight: 660; line-height: 1.18; cursor: pointer;
}
.button.primary { background: var(--primary); color: var(--on-primary); }
.button.primary:hover { background: var(--primary-hover); }
.button.secondary { color: var(--teal-dark); background: var(--paper); border-color: var(--outline); }
.button.secondary:hover, .button.ghost:hover { background: var(--teal-soft); }
.button.ghost { color: var(--teal-dark); background: transparent; }
.button.danger, .text-error { color: var(--danger); }
.button.danger:hover { background: var(--danger-soft); }
.button.small { padding: .42rem .7rem; font-size: .9rem; }
.button:disabled { opacity: .52; cursor: default; }
.theme-toggle { flex: none; width: 44px; padding: 0; }
.theme-icon-sun, :root[data-theme="dark"] .theme-icon-moon { display: none; }
:root[data-theme="dark"] .theme-icon-sun { display: block; }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); min-width: 0; }
.panel { padding: clamp(1rem, 3vw, 1.5rem); }
.soft-panel { padding: 1rem; border-radius: 12px; background: var(--surface-soft); }
.stack { display: grid; gap: 1rem; align-content: start; min-width: 0; }
.actions, .section-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: .6rem; }
.section-toolbar { justify-content: space-between; }
.spacer { margin-top: 1.6rem; }
.fine { font-size: .875rem; }
.muted { color: var(--muted); }
.message { min-height: 1.3em; overflow-wrap: anywhere; }
.answer-value { white-space: pre-wrap; overflow-wrap: anywhere; }
.notice { padding: .8rem 1rem; margin-bottom: 1rem; background: var(--teal-soft); border: 1px solid var(--line); border-radius: 10px; color: var(--teal-dark); }
.notice.error { color: var(--danger); background: var(--danger-soft); border-color: var(--danger-line); padding-inline-start: 2rem; }
.empty { padding: 2rem 1.25rem; color: var(--muted); }

.entry-main { padding-block-start: clamp(1.5rem, 7vw, 6rem); }
.entry { display: grid; grid-template-columns: 1.15fr 1fr; max-width: 64rem; margin-inline: auto; background: var(--paper); border: 1px solid var(--line); border-radius: 24px; overflow: hidden; box-shadow: 0 12px 42px var(--shadow); }
.entry-intro { position: relative; isolation: isolate; background: #0a403b; color: #fff; padding: clamp(1.75rem, 5vw, 4rem); min-height: 29rem; display: flex; flex-direction: column; justify-content: center; gap: .9rem; overflow: hidden; }
.entry-intro h1 { font-size: clamp(2.4rem, 5vw, 4rem); max-width: 9ch; }
.entry-intro p { color: #d5ebe5; max-width: 32ch; }
.eyebrow { color: var(--teal); font-size: .85rem; font-weight: 750; letter-spacing: .08em; overflow-wrap: anywhere; }
.entry-intro .eyebrow { color: #a7f2d9; }
.entry-art { position: absolute; inset: auto -5rem -11rem auto; width: 26rem; aspect-ratio: 1; transform: rotate(-18deg); z-index: -1; }
.entry-art i { position: absolute; inset: 0; border: 1px solid #6fb5a5; border-radius: 28%; opacity: .45; }
.entry-art i:nth-child(2) { inset: 10%; }
.entry-art i:nth-child(3) { inset: 20%; }
.entry-panel { padding: clamp(1.65rem, 5vw, 4rem); display: grid; align-content: center; gap: 1rem; min-width: 0; }
.entry-panel h2 { font-size: clamp(1.4rem, 4vw, 1.85rem); }
.entry-panel form { margin-top: .45rem; }
.code-input { font-family: ui-monospace, Consolas, monospace; letter-spacing: .06em; }
.resume-link { margin-top: .2rem; }

label { display: grid; gap: .35rem; font-weight: 630; min-width: 0; }
input:not([type="checkbox"], [type="radio"], [type="file"]), textarea, select {
    display: block; width: 100%; min-width: 0; min-height: 44px; border: 1px solid var(--outline);
    border-radius: 9px; background: var(--paper); color: var(--ink); padding: .56rem .7rem; font-weight: 400;
}
textarea { resize: vertical; }
textarea:read-only { background: var(--surface-soft); }
input::placeholder, textarea::placeholder { color: var(--placeholder); opacity: 1; }
select { appearance: none; padding-inline-end: 2.3rem; background-image: linear-gradient(45deg, transparent 50%, var(--teal) 50%), linear-gradient(135deg, var(--teal) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
.choice { display: inline-flex; align-items: center; gap: .5rem; min-height: 44px; font-weight: 600; }
.choice input { margin: 0; width: 1.12rem; height: 1.12rem; accent-color: var(--primary); flex: none; }
.choice-pill { border: 1px solid var(--line); border-radius: 9px; padding: .4rem .85rem; cursor: pointer; }
.choice-pill:has(:checked) { background: var(--teal-soft); border-color: var(--outline-hover); }
.choices { display: flex; gap: .55rem; flex-wrap: wrap; margin-block: .65rem; }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .85rem; }
.ordered-fields { grid-template-columns: minmax(0, 1fr) minmax(6.5rem, 10rem); }
.form-wide { max-width: 53rem; }

.page-head { display: flex; gap: 1rem; align-items: flex-start; justify-content: space-between; margin-bottom: 1.6rem; }
.page-head > div { display: grid; gap: .45rem; min-width: 0; }
.page-head p { color: var(--muted); max-width: 68ch; }
.client-note { margin: .2rem 0; overflow-wrap: anywhere; }
.page-head .client-note p { color: inherit; }
.page-head > .button, .page-head > .badge { flex: none; margin-top: .25rem; }
.back-link { font-size: .9rem; font-weight: 650; width: fit-content; }
.badge { display: inline-flex; width: fit-content; align-items: center; border-radius: 999px; background: var(--badge-neutral); color: var(--badge-neutral-text); padding: .23rem .65rem; font-size: .875rem; font-weight: 680; }
.badge.active { background: var(--badge-active); color: var(--badge-active-text); }
.badge.submitted { background: var(--badge-submitted); color: var(--badge-submitted-text); }
.badge.locked, .badge.closed, .badge.paused { background: var(--badge-locked); color: var(--badge-locked-text); }
.badge.archived { background: var(--badge-archived); color: var(--badge-archived-text); }
.stats { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: .9rem; margin-bottom: 1.3rem; }
.stat { display: grid; gap: .35rem; padding: .95rem 1rem; color: var(--muted); text-decoration: none; font-size: .9rem; font-weight: 650; }
.stat strong { font-size: 2rem; color: var(--ink); font-weight: 720; line-height: 1.1; }
.stat:hover { border-color: var(--outline-hover); }
.listing { padding: clamp(1rem, 3vw, 1.5rem); display: grid; gap: 1rem; }
.filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .65rem; }
.filters label { flex: 1 1 11rem; max-width: 22rem; font-size: .9rem; }
.filters label :is(input, select) { font-size: 1rem; }
.record { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1.1fr) minmax(0, 1fr) minmax(0, .7fr) auto; gap: .85rem; align-items: center; border-top: 1px solid var(--line); padding: .75rem 0; overflow-wrap: anywhere; }
.record-main p { color: var(--muted); font-size: .9rem; margin-top: .2rem; }
.record-title { text-decoration-thickness: 1px; font-weight: 730; }
.row-label { display: block; color: var(--muted); font-size: .84rem; font-weight: 600; }
code { font-family: ui-monospace, Consolas, monospace; overflow-wrap: anywhere; }
.access-code { background: var(--teal-soft); color: var(--teal-dark); padding: .45rem .65rem; border-radius: 7px; }
.pagination { display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; font-size: .9rem; }
.file-record { grid-template-columns: auto minmax(0, 2fr) minmax(0, 1fr) minmax(0, .55fr) auto; }
.selection { padding-block: .4rem .8rem; }
.split-columns { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
.survey-tile h2 a { color: var(--ink); text-decoration-thickness: 1px; }
.event-list { list-style: none; display: grid; gap: .7rem; }
.event-list time { display: block; color: var(--muted); font-size: .85rem; }
.diagnostic { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: .45rem 1rem; }
.diagnostic dt { font-weight: 650; }
.diagnostic dd { margin: 0; overflow-wrap: anywhere; }

.survey-layout { display: grid; grid-template-columns: 15rem minmax(0, 1fr); gap: 1rem; align-items: start; }
.progress-card { position: sticky; top: 1rem; display: grid; gap: .65rem; padding: 1rem; }
.progress-heading { display: flex; justify-content: space-between; gap: .4rem; }
.progress-heading span { color: var(--teal); font-weight: 750; }
progress { display: block; width: 100%; height: .65rem; accent-color: var(--primary); border: 0; border-radius: 999px; overflow: hidden; background: var(--line); }
progress::-webkit-progress-bar { background: var(--line); }
progress::-webkit-progress-value { background: var(--primary); }
progress::-moz-progress-bar { background: var(--primary); }
summary { cursor: pointer; color: var(--ink); overflow-wrap: anywhere; }
.disclosure > summary { display: flex; gap: .65rem; align-items: center; padding: .8rem 1rem; min-height: 52px; font-weight: 690; }
.disclosure > summary::-webkit-details-marker { display: none; }
.disclosure > summary::before { content: ""; width: .5rem; height: .5rem; border-block-end: 2px solid var(--teal); border-inline-end: 2px solid var(--teal); transform: rotate(-45deg); flex: none; margin-inline-end: .2rem; }
.disclosure[open] > summary::before { transform: rotate(45deg) translateY(-2px); }
.subcount { color: var(--muted); margin-inline-start: auto; font-size: .86rem; font-weight: 570; white-space: nowrap; }
.disclosure-body { padding: .4rem 1rem 1rem; min-width: 0; }
.instructions-list { display: grid; gap: .65rem; margin: 0; padding-inline-start: 1.4rem; }
.question-stack { display: grid; gap: .8rem; }
.question { padding: 1rem; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-quiet); min-width: 0; }
.question label:not(.choice) { font-weight: 600; }
.question-title, legend { font-weight: 690; }
.question fieldset { border: 0; min-width: 0; padding: 0; margin: 0; }
.comment-label { color: var(--muted); font-size: .92rem; }
.comment-label textarea { font-size: 1rem; }
.assessment-control { max-width: 20rem; margin-block: .65rem; }
.inline-disclosure > summary { padding: .52rem .1rem; min-height: 44px; font-weight: 640; color: var(--teal-dark); font-size: .9rem; }
.question-editor { border-bottom: 1px solid var(--line); }
.question-editor > summary { font-size: 1rem; }
.attachments { min-width: 0; }
.file-list { list-style: none; padding: 0; }
.file-list li { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; margin-block: .2rem; overflow-wrap: anywhere; }
.file-dropzone { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .6rem 1rem; padding: .65rem .85rem; border: 1px dashed var(--outline-hover); border-radius: 10px; background: var(--surface-soft); }
.file-dropzone.is-dragging { background: var(--teal-soft); border-color: var(--teal); outline: 2px solid var(--teal); }
.file-dropzone[aria-busy="true"] { opacity: .75; }
.drop-hint { display: block; font-size: .92rem; }
.file-picker { width: fit-content; display: inline-flex; align-items: center; min-height: 44px; padding: .35rem .7rem; border-radius: 9px; border: 1px solid var(--outline); background: var(--paper); color: var(--teal-dark); font-size: .9rem; cursor: pointer; }
.file-picker:focus-within { outline: 3px solid var(--focus); outline-offset: 3px; }
.file-picker input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.file-picker:has(:disabled) { opacity: .6; cursor: default; }
.attachments [data-file-status] { min-height: 0; white-space: pre-line; }
.attachments [data-file-status]:not(:empty) { margin-top: .35rem; }
@media (hover: none) and (pointer: coarse) {
    .drop-hint { display: none; }
}

.report { max-width: 58rem; }
.report-identifier { margin-bottom: .9rem; color: var(--muted); font-size: .875rem; }
.report-overview { display: grid; gap: .55rem; margin-bottom: 1rem; }
.report-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .55rem; }
.report-metrics > div { padding: .55rem .7rem; border: 1px solid var(--line); border-radius: 9px; background: var(--paper); }
.report-metrics dt { color: var(--muted); font-size: .875rem; }
.report-metrics dd { margin: .15rem 0 0; font-size: 1.15rem; font-weight: 700; }
.report-section { margin-block: 1.4rem; padding: 1.2rem; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); }
.report-item { border-top: 1px solid var(--line); margin-top: .8rem; padding-top: .8rem; display: grid; gap: .25rem; }
.report-file-table { width: 100%; table-layout: fixed; border-collapse: collapse; }
.report-file-table :is(th, td) { padding: .4rem .5rem; vertical-align: top; }
.report-file-table th { background: var(--surface-soft); text-align: start; }
.report-file-table td { border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.report-file-table :is(th, td):last-child { width: 6.5rem; text-align: end; }

@media screen {
    .report-pages, .report-pages > :is(thead, tbody), .report-pages > :is(thead, tbody) > tr,
    .report-pages > :is(thead, tbody) > tr > td { display: block; }
    .report-pages > :is(thead, tbody) > tr > td { padding: 0; }
}
@media (max-width: 58rem) {
    .stats { grid-template-columns: repeat(auto-fit, minmax(min(100%, 8rem), 1fr)); }
    .record { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, .9fr) auto; }
    .record:not(.file-record) > :nth-child(4) { grid-column: 2; grid-row: 2; }
    .record:not(.file-record) > :last-child { grid-column: 4; grid-row: 1 / span 2; }
    .file-record { grid-template-columns: auto minmax(0, 1.4fr) minmax(0, 1fr) auto; }
    .file-record > :nth-child(4) { grid-column: 3; grid-row: 2; }
    .file-record > :last-child { grid-column: 4; grid-row: 1 / span 2; }
}
@media (max-width: 43rem) {
    .wrap { width: calc(100% - 1.5rem); }
    .main { padding-block: 1.35rem 2.5rem; }
    .header-row { gap: .15rem .65rem; flex-wrap: wrap; min-height: 3.9rem; padding-block: .35rem; }
    .nav { order: 3; flex: 1 0 100%; margin: 0; justify-content: stretch; }
    .nav a { flex: 1; text-align: center; }
    .entry, .split-columns, .survey-layout { grid-template-columns: minmax(0, 1fr); }
    .entry-intro { min-height: 13rem; }
    .entry-intro h1 { max-width: 14ch; }
    .entry-art { width: 21rem; }
    .progress-card { position: static; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .progress-heading, .progress-card progress, .progress-card p { grid-column: 1 / -1; }
    .page-head { flex-wrap: wrap; margin-bottom: 1.1rem; }
    .record { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: .42rem .65rem; }
    .record-main { grid-column: 1 / -1; }
    .record:not(.file-record) > :nth-child(4) { grid-area: auto; }
    .record:not(.file-record) > :last-child { grid-area: auto; justify-self: end; }
    .file-record { grid-template-columns: auto minmax(0, 1fr) minmax(0, 1fr); }
    .file-record .record-main { grid-column: 2 / -1; }
    .file-record > :nth-child(3) { grid-column: 2; }
    .file-record > :nth-child(4) { grid-area: auto; }
    .file-record > :last-child { grid-area: auto / 2; justify-self: start; }
    .diagnostic { grid-template-columns: minmax(0, 1fr); }
    .diagnostic dd { margin-bottom: .5rem; }
}
@media (max-width: 29rem) {
    .fields { grid-template-columns: minmax(0, 1fr); }
    .filters label { max-width: none; }
    .question { padding: .7rem; }
    .disclosure-body { padding-inline: .65rem; }
    .section-toolbar .actions { gap: .1rem; }
    .report-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 24rem) {
    .header-row { column-gap: .4rem; }
    .brand { font-size: 1rem; gap: .4rem; }
    .brand-mark { padding: 7px; }
    .header-actions { gap: .15rem; }
    .header-actions .small { padding-inline: .35rem; font-size: .85rem; }
}
@media print {
    body {
        color-scheme: light;
        --ink: #000;
        --muted: #333;
        --canvas: #fff;
        --paper: #fff;
        --line: #ccc;
        --teal: #174e48;
    }
    .topbar, .skip, .no-print { display: none !important; }
    .report { width: 100%; padding: 0; font-size: 10.5pt; line-height: 1.35; }
    .report .page-head { margin-bottom: 10pt; }
    .report .page-head > div { gap: 3pt; }
    .report .eyebrow { font-size: 9pt; }
    .report h1 { font-size: 22pt; }
    .report h2 { font-size: 13pt; line-height: 1.25; }
    .report h3 { font-size: 10.5pt; line-height: 1.3; }
    .report .card { padding: 7pt; gap: 3pt; }
    .report-pages { width: 100%; table-layout: fixed; border-collapse: collapse; }
    .report-pages > thead { break-inside: avoid; }
    .report-pages > :is(thead, tbody) > tr > td { padding: 0; vertical-align: top; }
    .report-identifier { margin: 0 0 8pt; padding-bottom: 4pt; border-bottom: 1px solid var(--line); font-size: 9pt; }
    .report-overview { margin-bottom: 8pt; gap: 3pt; break-inside: avoid; }
    .report-metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4pt; }
    .report-metrics > div { padding: 3pt 5pt; border-radius: 0; }
    .report-metrics dt, .report-overview .fine { font-size: 8.5pt; }
    .report-metrics dd { margin-top: 1pt; font-size: 11pt; }
    .report-section { margin-block: 9pt; border: 0; padding: 0; gap: 4pt; }
    .report-section h2 { break-after: avoid; }
    .report-item { display: block; margin-top: 4pt; padding-top: 4pt; }
    .report-item h3 { break-after: avoid; }
    .report-item p { margin-top: 2pt; orphans: 2; widows: 2; }
    .report-attachments { display: block; }
    .report-file-table { margin-top: 4pt; }
    .report-file-table th { background: transparent; border-bottom: 1px solid var(--line); }
    .report-file-table :is(th, td) { padding: 3pt 4pt; }
    .report-file-table tr { break-inside: avoid; }
}
