:root {
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --page: #f7f7f5;
    --surface: #fff;
    --ink: #181817;
    --muted: #696966;
    --line: #deded8;
    --blue: #2563eb;
    color: var(--ink);
    background: var(--page);
}

* { box-sizing: border-box; }
html { min-height: 100%; }
body { min-height: 100vh; margin: 0; min-width: 1000px; display: flex; flex-direction: column; }

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    min-height: 64px;
    background: rgba(255, 255, 255, 0.96);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 4px 16px rgba(20, 20, 18, 0.035);
}

.header-inner {
    width: min(1240px, calc(100% - 60px));
    min-height: 64px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.header-left,
.primary-nav,
.account-nav {
    display: flex;
    align-items: center;
}

.header-left { gap: 30px; }
.primary-nav,
.account-nav { gap: 20px; }
.site-title { color: var(--ink); white-space: nowrap; }
.site-header a { color: var(--blue); text-decoration: none; }
.site-header a:hover { text-decoration: underline; }
.attention-cue { display: inline-block; transform-origin: center bottom; }
.attention-mark { display: inline-grid; min-width: 1.15em; place-items: center; font-weight: 800; }
.attention-cue.attention-hop { animation: attention-double-pair 2400ms ease-out; }

@keyframes attention-double-pair {
    0%, 12%, 27%, 49%, 62%, 78%, 100% { transform: translateY(0); }
    6%, 55% { transform: translateY(-10px); }
    20%, 70% { transform: translateY(-7px); }
}

main {
    width: 100%;
    flex: 1 0 auto;
    max-width: 1240px;
    margin: 0 auto;
    padding: 28px 24px 60px;
}

.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 24px;
    margin: 16px 0;
    box-shadow: 0 12px 34px rgba(20, 20, 18, 0.05);
}

h1, h2 { color: var(--ink); }
h1 { margin: 6px 0 10px; }
h2 { margin: 0 0 10px; }
p { line-height: 1.55; }

label { display: block; margin: 12px 0 5px; }
input, button, textarea { font: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; }
textarea { width: 100%; resize: vertical; line-height: 1.5; }
button, .button {
    background: var(--blue);
    color: #fff;
    border: 0;
    text-decoration: none;
    display: inline-block;
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
}

.muted { color: var(--muted); }
.error { color: #b42318; }
.ok { color: #087443; }
.button-secondary { background: #ecece8; color: var(--ink); }
.button-secondary:hover { background: #e3e3dd; }
.narrow-card { max-width: 820px; margin-left: auto; margin-right: auto; }
.login-card { max-width: 620px; }
.login-first-time {
    display: grid;
    gap: 5px;
    margin: 20px 0 18px;
    padding: 15px 17px;
    border: 1px solid #ead9a0;
    border-radius: 10px;
    background: #fff9df;
    line-height: 1.45;
}
.login-first-time strong { color: #725814; }
.login-first-time code { padding: 1px 5px; border-radius: 4px; background: #f4e8b8; color: var(--ink); }
.login-help { margin: 22px 0 0; color: var(--muted); font-size: .9rem; text-align: right; }
.login-help a { color: var(--blue); }
.public-guidance {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 28px;
    align-items: center;
}
.public-guidance h2 { margin-bottom: 4px; }
.public-guidance p:last-child { margin: 0; color: var(--muted); }
.public-guidance-actions { display: flex; gap: 10px; align-items: center; }
.public-guidance-actions .button { white-space: nowrap; }
.public-guidance-actions small { margin-left: 4px; opacity: .78; }
.status { font-weight: 650; }
.eyebrow {
    margin: 0 0 8px;
    color: var(--blue);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.workspace-summary {
    display: grid;
    grid-template-columns: minmax(220px, 0.65fr) minmax(460px, 1.35fr);
    gap: 32px;
    align-items: start;
}

.workspace-identity { padding-right: 8px; }
.workspace-action {
    min-width: 0;
    padding-left: 32px;
    border-left: 1px solid var(--line);
}

.workspace-sharing-note {
    grid-column: 1 / -1;
    margin: 2px 0 0;
    padding-top: 18px;
    border-top: 1px solid var(--line);
}
.questionnaire-prompt { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 24px; align-items: center; }
.questionnaire-prompt-copy { min-width: 0; display: flex; align-items: baseline; gap: 12px; }
.questionnaire-prompt-copy span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.questionnaire-prompt-action { display: flex; align-items: center; gap: 9px; }
.questionnaire-attention-arrow { position: relative; display: inline-block; width: 48px; height: 20px; flex: 0 0 48px; overflow: hidden; color: transparent; font-size: 0; animation: questionnaire-attention 10s ease-in-out infinite; }
.questionnaire-attention-arrow::before { content: ""; position: absolute; left: 0; right: 10px; top: 8px; height: 4px; border-radius: 999px; background: #d92d20; }
.questionnaire-attention-arrow::after { content: ""; position: absolute; right: 0; top: 2px; width: 0; height: 0; border-top: 8px solid transparent; border-bottom: 8px solid transparent; border-left: 13px solid #d92d20; }
@keyframes questionnaire-attention {
    0%, 4%, 8%, 12%, 100% { transform: translateX(0); }
    2%, 10% { transform: translateX(7px); }
}
@media (prefers-reduced-motion: reduce) {
    .questionnaire-attention-arrow { animation: none; }
}

.upload-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: end;
    margin-top: 18px;
}

.upload-form .file-label { grid-column: 1 / -1; margin: 0; color: var(--muted); font-size: 0.9rem; }
.upload-form input[type="file"] { min-width: 0; width: 100%; background: var(--surface); }
.upload-form button { white-space: nowrap; }

.versions { display: grid; gap: 12px; }
.version-row {
    min-height: 52px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 24px;
    align-items: center;
    padding: 12px 0;
    border-top: 1px solid var(--line);
}
.versions > .version-row:first-child,
.versions > .practice-version:first-child > summary { border-top: 0; }
.version-name {
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(96px, max-content) 54px minmax(0, 1fr);
    align-items: baseline;
    column-gap: 12px;
}
.version-name > * { min-width: 0; }
.version-name > b { white-space: nowrap; }
.version-date,
.version-file { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.version-file > b { color: var(--text); }
.version-number-spacer,
.version-date-spacer { display: block; }
.practice-version > summary {
    position: relative;
    z-index: 1;
    list-style: none;
    cursor: pointer;
    background: var(--surface);
    transition: box-shadow 180ms ease, border-radius 180ms ease;
}
.practice-version > summary::-webkit-details-marker { display: none; }
.versions > .practice-version:first-child > summary { border-top: 0; }
.practice-version[open] > summary {
    border-radius: 0 0 10px 10px;
    box-shadow: 0 10px 16px -13px rgba(20, 20, 18, 0.42);
}
.practice-toggle { display: inline-flex; align-items: center; gap: 8px; user-select: none; }
.practice-toggle-icon {
    width: 8px;
    height: 8px;
    display: inline-block;
    flex: 0 0 auto;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: translateY(-2px) rotate(45deg);
    transition: transform 180ms ease;
}
.practice-version[open] .practice-toggle-icon { transform: translateY(2px) rotate(225deg); }
.practice-example-list { display: grid; gap: 0; overflow: hidden; }
.practice-example-row { border-top-color: var(--line); }
.version-pending { grid-template-columns: minmax(220px, 0.75fr) minmax(360px, 1.25fr); }
.version-progress { min-width: 0; }
.progress-meta { display: flex; justify-content: space-between; gap: 16px; margin-bottom: 7px; color: var(--muted); font-size: 0.88rem; }
.progress-meta span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.progress-track { height: 9px; overflow: hidden; border-radius: 999px; background: #e7e7e2; }
.progress-track > span { display: block; width: 0; height: 100%; border-radius: inherit; background: hsl(38 78% 48%); transition: width 800ms cubic-bezier(.22,.8,.3,1), background-color 800ms ease; }
.feedback-card { border-left: 4px solid #2457a6; padding: 14px 18px; background: #f8fbff; margin: 12px 0; }
.trace { background: #fff2a8; padding: 1px 3px; border-radius: 3px; }

.consent-card {
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
    padding: 52px 64px 48px;
    border-radius: 8px;
    box-shadow: 0 18px 48px rgba(20, 20, 18, 0.075);
}
.questionnaire-card { max-width: 1040px; margin-left: auto; margin-right: auto; }
.consent-card > h1 { max-width: 720px; font-size: 2rem; line-height: 1.2; }
.consent-summary { max-width: 720px; font-size: 1.05rem; }
.consent-identity { margin: 18px 0 24px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; background: #fafaf8; }
.consent-identity div { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 24px; align-items: baseline; }
.consent-identity div + div { margin-top: 7px; }
.consent-identity dt { color: var(--muted); }
.consent-identity dd { margin: 0; font-weight: 650; text-align: left; }
.consent-section { padding: 16px 0; border-top: 1px solid var(--line); }
.consent-section h2 { font-size: 1.05rem; margin-bottom: 5px; }
.consent-section p { margin: 7px 0; font: 16px/1.72 Georgia, "Times New Roman", serif; }
.consent-end { height: 2px; }
.consent-agreement { display: flex; gap: 12px; align-items: flex-start; padding: 18px; background: #f3f6fb; border: 1px solid #d7e2f2; border-radius: 10px; }
.consent-agreement input { margin-top: 3px; }
.consent-actions,
.questionnaire-actions { display: flex; align-items: center; justify-content: flex-end; gap: 12px; margin-top: 24px; }
.consent-actions button:disabled { opacity: .45; cursor: not-allowed; }

.questionnaire-heading { display: grid; grid-template-columns: minmax(0,1fr) 260px; gap: 24px; align-items: center; margin-bottom: 24px; }
.questionnaire-heading h1 { margin: 0; }
.questionnaire-progress-wrap { display: grid; gap: 7px; }
.questionnaire-progress-label { color: var(--muted); font-size: .8rem; font-weight: 650; text-align: right; }
.questionnaire-progress { height: 8px; border-radius: 999px; overflow: hidden; background: #e7e7e2; }
.questionnaire-progress span { display: block; height: 100%; background: var(--blue); }
.questionnaire-section-title { margin: 0 0 15px; }
.questionnaire-item { min-width: 0; margin: 14px 0; padding: 13px 14px 12px; border: 1px solid var(--line); border-radius: 12px; }
.questionnaire-item legend { max-width: 100%; padding: 0 7px; font-weight: 620; line-height: 1.45; }
.question-number { color: var(--muted); }
.optional-mark { margin-left: 5px; color: var(--muted); font-size: .78rem; font-weight: 500; white-space: nowrap; }
.option-grid { display: grid; gap: 8px; margin-top: 8px; }
.option-grid-2 { grid-template-columns: repeat(2,minmax(0,1fr)); }
.option-grid-6 { grid-template-columns: repeat(6,minmax(0,1fr)); }
.option-grid-7 { grid-template-columns: repeat(7,minmax(0,1fr)); }
.option-grid-11 { grid-template-columns: repeat(11,minmax(0,1fr)); }
.option-choice { display: grid; gap: 4px; justify-items: center; margin: 0; padding: 6px 4px; border: 1px solid var(--line); border-radius: 9px; text-align: center; cursor: pointer; }
.option-choice:hover { border-color: #9eb9e7; background: #f7faff; }
.option-choice:has(input:checked) { border-color: var(--blue); background: #eef4ff; box-shadow: 0 0 0 1px var(--blue); }
.option-choice input { margin: 0; }
.option-choice span { font-size: .82rem; line-height: 1.2; }
.scale-anchors { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 20px; margin-top: 5px; color: var(--muted); font-size: .78rem; line-height: 1.3; }
.scale-anchors span:last-child { text-align: right; }
.submission-note { text-align: right; }
.questionnaire-complete { text-align: center; padding-top: 48px; padding-bottom: 48px; }

.research-footer { flex: 0 0 auto; border-top: 1px solid var(--line); background: #f6f6f2; color: var(--muted); }
.research-footer-inner { max-width: 1440px; margin: 0 auto; padding: 24px 30px; display: grid; grid-template-columns: minmax(0, 2fr) auto auto; gap: 28px; align-items: center; }
.research-footer p { margin: 0; }
.research-footer a { color: var(--blue); }
.research-disclaimer { display: grid; gap: 3px; }
.research-disclaimer strong { color: var(--text); }

@media (max-width: 900px) {
    .research-footer-inner { grid-template-columns: 1fr; gap: 12px; }
}

@media print {
    .site-header, .research-footer, .print-actions { display: none !important; }
    main { max-width: none; padding: 0; }
    .consent-card { border: 0; box-shadow: none; padding: 0; }
}

/* Restricted administrator portal. */
.admin-main { max-width: 1440px; }
.admin-header .header-inner { width: min(1440px, calc(100% - 60px)); }
.admin-header .header-left { gap: 22px; min-width: 0; }
.admin-header .primary-nav { gap: 14px; }
.admin-header .account-nav { flex: 0 0 auto; gap: 14px; margin-left: 22px; }
.admin-header .account-nav span { color: var(--muted); font-size: .9rem; }
.admin-heading { display: flex; justify-content: space-between; gap: 32px; align-items: end; margin: 24px 0; }
.admin-heading h1 { margin-bottom: 6px; }
.admin-heading p:last-child { margin-bottom: 0; max-width: 820px; }
.admin-search { display: flex; gap: 8px; align-items: end; min-width: 390px; }
.admin-search input, .admin-search select { width: 100%; min-height: 42px; background: var(--surface); }
.admin-stat-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 14px; }
.admin-stat { min-height: 116px; padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: 0 8px 24px rgba(20,20,18,.04); display: grid; align-content: space-between; }
.admin-stat span { color: var(--muted); }
.admin-stat strong { font-size: 2rem; }
.admin-condition-row { display: flex; gap: 28px; flex-wrap: wrap; }
.admin-table-wrap { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.admin-table th, .admin-table td { padding: 12px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.admin-table th { color: var(--muted); font-size: .78rem; letter-spacing: .04em; text-transform: uppercase; }
.admin-table tbody tr:hover { background: #fafaf8; }
.admin-action summary { color: var(--blue); cursor: pointer; white-space: nowrap; }
.admin-action form { width: 280px; padding: 10px 0; }
.admin-action input { width: 100%; }
.admin-action-buttons { display: flex; gap: 8px; margin-top: 9px; }
.button-danger { background: #b42318; }
.admin-pagination { display: flex; justify-content: space-between; align-items: center; margin: 18px 0; }
.admin-flash { padding: 12px 15px; border-radius: 9px; background: #eaf7f0; border: 1px solid #b9dfcb; }
.admin-flash.error { background: #fff0ed; border-color: #f0c0b9; }
.admin-export-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; }
.admin-export-grid .card { margin: 0; display: grid; gap: 18px; align-content: space-between; }
.admin-export-grid h2 { font-size: 1rem; }
.admin-definition-list { margin: 0; }
.admin-definition-list div { display: grid; grid-template-columns: 260px minmax(0,1fr); gap: 24px; padding: 10px 0; border-top: 1px solid var(--line); }
.admin-definition-list div:first-child { border-top: 0; }
.admin-definition-list dt { color: var(--muted); }
.admin-definition-list dd { margin: 0; font-weight: 620; }

.guide-intro { padding-bottom: 28px; }
.guide-steps { display: grid; gap: 12px; }
.guide-step {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 16px;
    align-items: start;
    margin: 0;
}
.guide-step p { margin-bottom: 0; }
.step-number {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: #eaf1fb;
    color: #2457a6;
    font-weight: 700;
}
.guide-note ul { line-height: 1.7; padding-left: 22px; }

.guide-images {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-top: 18px;
}

.guide-shot {
    display: block;
    width: 100%;
    padding: 0;
    overflow: hidden;
    border: 1px solid #d9dee7;
    border-radius: 9px;
    background: #fff;
    cursor: zoom-in;
    box-shadow: 0 2px 8px #0000000a;
}

.guide-shot:hover,
.guide-shot:focus-visible { border-color: #2457a6; box-shadow: 0 0 0 3px #2457a61c; }
.guide-shot img { display: block; width: 100%; height: auto; }

.guide-lightbox {
    position: fixed;
    inset: 0;
    z-index: 20000;
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    place-items: center;
    gap: 14px;
    padding: 48px;
    background: rgba(15, 23, 42, 0.88);
}

.guide-lightbox[hidden] { display: none; }
.guide-lightbox img { max-width: min(1500px, 94vw); max-height: calc(100vh - 115px); object-fit: contain; border-radius: 8px; box-shadow: 0 22px 65px #0008; }
.guide-lightbox p { margin: 0; color: #fff; font-weight: 650; }
.guide-lightbox-close { position: fixed; top: 18px; right: 24px; width: 42px; height: 42px; padding: 0; border-radius: 50%; background: #fff; color: #1f2937; font-size: 26px; line-height: 1; }
body.guide-lightbox-open { overflow: hidden; }

.preview-intro { padding-bottom: 28px; }
.preview-player video {
    display: block;
    width: 100%;
    max-height: calc(100vh - 245px);
    border-radius: 10px;
    background: #111;
    box-shadow: 0 12px 34px rgba(15, 23, 42, 0.16);
}
.preview-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }

@media (prefers-reduced-motion: reduce) {
    .attention-cue.attention-hop { animation: none; }
    .progress-track > span { transition: none; }
}
