:root {
    --ueu-blue: #087bb8;
    --ueu-deep: #075a88;
    --ueu-orange: #f15a24;
    --paper: #fff;
    --canvas: #e9eef2;
    --ink: #17212b;
    --muted: #61707e;
    --line: #d7e0e7;
    --success: #167c5a;
    --danger: #b33a3a;
    --shadow: 0 20px 50px rgba(23, 33, 43, .12);
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--ink);
    background: #f5f7f9;
}

* { box-sizing: border-box; }
html { min-height: 100%; }
body { margin: 0; min-height: 100vh; background: #f5f7f9; color: var(--ink); }
button, input, select, textarea { font: inherit; }
a { color: var(--ueu-deep); text-decoration: none; }
a:hover { color: var(--ueu-blue); }
button, a, input, select, textarea { outline-offset: 3px; }
:focus-visible { outline: 3px solid rgba(8, 123, 184, .35); }

.app-header {
    height: 72px; padding: 0 30px; display: grid; grid-template-columns: 1fr auto 1fr;
    align-items: center; background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 50;
}
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--ink); width: fit-content; }
.brand img { width: 148px; height: 42px; object-fit: contain; object-position: left center; }
.brand span { border-left: 1px solid var(--line); padding-left: 12px; line-height: 1.05; }
.brand strong, .brand small { display: block; }
.brand strong { letter-spacing: .04em; }
.brand small { color: var(--muted); margin-top: 4px; }
.main-nav { display: flex; gap: 6px; }
.main-nav a { color: #40505e; font-weight: 650; padding: 11px 15px; border-radius: 8px; }
.main-nav a:hover { background: #eef7fb; color: var(--ueu-deep); }
.user-menu { display: flex; justify-content: flex-end; align-items: center; gap: 14px; font-size: 14px; }
.user-menu form { margin: 0; }
.text-button { border: 0; background: none; color: var(--danger); cursor: pointer; padding: 6px; }
.app-main { min-height: calc(100vh - 72px); }

.flash-stack { position: fixed; top: 84px; right: 22px; z-index: 100; display: grid; gap: 8px; width: min(420px, calc(100vw - 32px)); }
.flash { padding: 13px 16px; background: #fff; border-radius: 10px; border: 1px solid var(--line); box-shadow: 0 10px 35px rgba(23, 33, 43, .15); animation: flash-in .2s ease-out; }
.flash-success { border-left: 5px solid var(--success); }
.flash-error { border-left: 5px solid var(--danger); }
.flash-info { border-left: 5px solid var(--ueu-blue); }
@keyframes flash-in { from { transform: translateY(-5px); opacity: 0; } }

.content-wrap { width: min(1180px, calc(100% - 42px)); margin: 0 auto; }
.dashboard-head, .page-heading, .record-hero { display: flex; justify-content: space-between; align-items: end; gap: 32px; padding: 44px 0 26px; }
.eyebrow { margin: 0 0 8px; color: var(--ueu-blue); font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
h1, h2, p { margin-top: 0; }
.dashboard-head h1, .page-heading h1, .record-hero h1 { margin: 0 0 8px; font-size: clamp(28px, 3vw, 42px); letter-spacing: -.035em; }
.muted { color: var(--muted); }
.button { border: 1px solid transparent; border-radius: 9px; min-height: 42px; padding: 10px 16px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-weight: 750; cursor: pointer; transition: background .15s, border-color .15s, transform .15s; }
.button:hover { transform: translateY(-1px); }
.button:disabled { opacity: .4; cursor: not-allowed; transform: none; }
.button-primary { background: var(--ueu-blue); color: #fff; border-color: var(--ueu-blue); }
.button-primary:hover { background: var(--ueu-deep); color: #fff; }
.button-secondary { background: #fff; color: var(--ueu-deep); border-color: #b9cad5; }
.button-secondary:hover { background: #edf6fa; }
.button-save { color: var(--ueu-deep); background: #dceef7; border-color: #b8dbe9; }
.button-danger { color: #fff; background: var(--danger); }
.button-large { min-height: 50px; padding-inline: 21px; }

.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 15px; margin-bottom: 22px; }
.metric-grid article { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 20px; position: relative; overflow: hidden; }
.metric-grid article::before { content: ""; width: 4px; position: absolute; inset: 0 auto 0 0; background: var(--ueu-blue); }
.metric-grid span, .metric-grid small { display: block; color: var(--muted); }
.metric-grid strong { display: block; font-size: 34px; margin: 9px 0 3px; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: 13px; padding: 24px; margin-bottom: 28px; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.panel-heading h2 { margin: 0; font-size: 20px; }
.empty-state { text-align: center; color: var(--muted); padding: 44px 20px; background: #f8fafb; border: 1px dashed #bdcbd4; border-radius: 10px; }
.empty-state strong { color: var(--ink); font-size: 18px; }
.empty-state p { margin: 6px 0 0; }

.table-scroll { overflow-x: auto; }
.data-table, .paper-table { width: 100%; border-collapse: collapse; }
.data-table th { text-align: left; color: #687784; font-size: 12px; letter-spacing: .04em; text-transform: uppercase; padding: 11px 12px; border-bottom: 1px solid var(--line); }
.data-table td { padding: 13px 12px; border-bottom: 1px solid #e8edf0; vertical-align: middle; }
.data-table td small { display: block; margin-top: 3px; color: var(--muted); }
.data-table tbody tr:hover { background: #f7fbfd; }
.row-link { font-weight: 750; }
.status { display: inline-flex; align-items: center; width: fit-content; border-radius: 999px; padding: 5px 9px; font-size: 12px; font-weight: 800; white-space: nowrap; }
.status-draft { background: #fff3dc; color: #85510b; }
.status-complete { background: #e2f1f9; color: #075a88; }
.status-verified { background: #dff3eb; color: #12674b; }
.status-void { background: #f7e3e3; color: #8f2929; }
.filter-panel { padding-block: 18px; }
.filter-form { display: grid; grid-template-columns: minmax(260px, 1fr) 200px auto auto; align-items: end; gap: 14px; }
.filter-form label, .stack-form label, .action-card label { display: grid; gap: 7px; font-size: 13px; font-weight: 750; }
.filter-form input, .filter-form select, .stack-form input, .action-card input { width: 100%; min-height: 43px; border: 1px solid #bdcad3; border-radius: 8px; padding: 9px 11px; background: #fff; }
.text-link { padding: 11px 4px; }
.export-links { display: flex; gap: 8px; }
.export-links a { padding: 7px 11px; background: #edf6fa; border-radius: 7px; font-weight: 750; }
.pagination { display: flex; justify-content: center; gap: 6px; margin-top: 20px; }
.pagination a { width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 7px; }
.pagination a.active { background: var(--ueu-blue); color: #fff; border-color: var(--ueu-blue); }

.cleanup-panel { border-top: 4px solid var(--danger); }
.cleanup-warning { margin: 4px 0 18px; padding: 14px 16px; border: 1px solid #e7c5c5; border-radius: 9px; background: #fff7f7; color: #6f2525; }
.cleanup-warning strong { display: block; margin-bottom: 4px; }
.cleanup-warning p { margin: 0; line-height: 1.45; }
.cleanup-table .select-column { width: 48px; text-align: center; }
.cleanup-table input[type="checkbox"] { width: 19px; height: 19px; accent-color: var(--danger); }
.cleanup-actions { display: grid; grid-template-columns: minmax(180px, .7fr) minmax(250px, 1.5fr) minmax(170px, .7fr) auto; gap: 14px; align-items: end; margin-top: 20px; padding: 18px; border-radius: 10px; background: #f7f9fa; border: 1px solid var(--line); }
.cleanup-actions label { display: grid; gap: 6px; font-size: 12px; font-weight: 800; }
.cleanup-actions input { width: 100%; min-height: 42px; border: 1px solid #bdcad3; border-radius: 8px; padding: 8px 10px; background: #fff; }
.cleanup-selection { display: grid; gap: 4px; }
.cleanup-selection strong { color: var(--danger); }
.cleanup-selection span { color: var(--muted); font-size: 12px; line-height: 1.35; }

/* Login: the five physical pages are the visual identity. */
.login-page { background: var(--ueu-deep); }
.login-page .app-main { min-height: 100vh; }
.login-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(420px, 1.1fr) minmax(390px, .9fr); }
.login-brand-panel { padding: 54px clamp(40px, 7vw, 105px); color: #fff; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; background: linear-gradient(145deg, #064c74 0%, #087bb8 100%); }
.login-brand-panel::after { content: ""; width: 420px; height: 420px; border: 90px solid rgba(255,255,255,.06); border-radius: 50%; position: absolute; right: -180px; bottom: -170px; }
.login-brand-panel img { width: 250px; height: 80px; object-fit: contain; object-position: left; filter: brightness(0) invert(1); }
.login-brand-panel h1 { font-size: clamp(48px, 6vw, 84px); line-height: .95; letter-spacing: -.065em; margin: 0 0 24px; max-width: 700px; }
.login-brand-panel h1 span { display: inline-block; margin-top: .14em; color: #ff9a68; font-size: clamp(34px, 3.8vw, 54px); line-height: .98; letter-spacing: -.045em; white-space: nowrap; }
.login-brand-panel p:not(.eyebrow) { font-size: 18px; line-height: 1.55; max-width: 520px; color: rgba(255,255,255,.82); }
.login-brand-panel .login-punchline { max-width: 470px; margin-bottom: 0; padding-left: 17px; border-left: 3px solid rgba(255,154,104,.9); font-style: italic; }
.login-brand-panel .eyebrow { color: #9fd8f2; }
.page-motif { display: flex; gap: 11px; position: relative; z-index: 1; }
.page-motif i { width: 52px; height: 67px; display: grid; place-items: end start; padding: 7px; background: rgba(255,255,255,.92); color: var(--ueu-deep); font-style: normal; font-weight: 900; box-shadow: 0 9px 20px rgba(0,0,0,.13); }
.page-motif i:nth-child(3), .page-motif i:nth-child(4) { transform: translateY(6px); }
.login-card { display: flex; flex-direction: column; justify-content: center; padding: 70px clamp(42px, 8vw, 120px); background: #fff; }
.login-card h2 { font-size: 36px; letter-spacing: -.04em; margin-bottom: 10px; }
.stack-form { display: grid; gap: 18px; margin-top: 22px; }
.password-wrap { display: grid; grid-template-columns: 1fr auto; }
.password-wrap input { border-radius: 8px 0 0 8px; }
.password-wrap button { border: 1px solid #bdcad3; border-left: 0; border-radius: 0 8px 8px 0; background: #edf3f6; cursor: pointer; padding: 0 13px; }

/* Five-page transcription workspace */
.form-workspace-page { background: var(--canvas); }
.form-workspace-page .app-main { min-height: calc(100vh - 72px); }
.form-workspace { display: grid; grid-template-columns: 220px minmax(0, 1fr); min-height: calc(100vh - 72px); }
.page-rail { background: #112d3d; color: #fff; padding: 25px 18px; position: sticky; top: 72px; height: calc(100vh - 72px); display: flex; flex-direction: column; overflow-y: auto; z-index: 20; }
.rail-back { color: #b5d9e9; font-size: 13px; margin-bottom: 30px; }
.rail-back:hover { color: #fff; }
.rail-title { font-size: 11px; line-height: 1.35; letter-spacing: .2em; font-weight: 850; color: #8eb9cc; margin: 0 0 14px; }
.page-tab { display: grid; grid-template-columns: 34px 1fr 8px; align-items: center; gap: 10px; min-height: 58px; color: #c9dce5; border-left: 3px solid transparent; padding: 8px 8px 8px 10px; margin: 2px 0; border-radius: 0 8px 8px 0; }
.page-tab span { width: 30px; height: 38px; background: #eaf1f4; color: #315464; display: grid; place-items: end start; padding: 4px; font-size: 12px; font-weight: 900; box-shadow: 0 4px 9px rgba(0,0,0,.15); }
.page-tab strong { font-size: 13px; }
.page-tab i { width: 7px; height: 7px; border: 1px solid #6d92a3; border-radius: 50%; }
.page-tab.started i { background: #5ec09a; border-color: #5ec09a; }
.page-tab.active { background: rgba(255,255,255,.1); color: #fff; border-left-color: var(--ueu-orange); }
.page-tab.active span { background: #fff; color: var(--ueu-blue); transform: translateY(-1px); }
.rail-record { margin-top: auto; border-top: 1px solid rgba(255,255,255,.15); padding-top: 17px; display: grid; gap: 7px; }
.rail-record small { color: #8eb9cc; }
.rail-record strong { font-size: 12px; word-break: break-all; }
.form-stage { min-width: 0; padding: 26px 30px 96px; overflow-x: auto; }
.form-stage form { width: max-content; min-width: 100%; }
.document-toolbar { width: 1120px; margin: 0 auto 12px; display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 13px; }
.document-toolbar div:first-child { display: flex; align-items: center; gap: 12px; }
.document-toolbar strong { color: var(--ink); font-size: 15px; }
.save-state { display: flex; align-items: center; gap: 7px; }
.save-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success); }
.correction-banner { width: 1120px; margin: 0 auto 12px; padding: 13px 16px; background: #fff3dc; border: 1px solid #e7c98a; border-radius: 8px; display: flex; align-items: center; gap: 20px; }
.correction-banner label { display: flex; align-items: center; gap: 9px; flex: 1; font-size: 13px; }
.correction-banner input { flex: 1; min-height: 36px; border: 1px solid #ccb37d; border-radius: 6px; padding: 6px 9px; }
.paper-sheet { width: 1120px; min-height: 1485px; margin: 0 auto; background: var(--paper); box-shadow: var(--shadow); padding: 44px 48px 54px; color: #101820; font-family: Arial, Helvetica, sans-serif; position: relative; }
.paper-header { min-height: 80px; display: grid; grid-template-columns: 210px 1fr; align-items: center; gap: 18px; margin-bottom: 26px; }
.paper-header img { width: 190px; height: 64px; object-fit: contain; object-position: left center; }
.paper-header div { text-align: center; padding-right: 210px; }
.paper-header span { color: var(--ueu-blue); font-size: 12px; font-weight: 800; letter-spacing: .1em; }
.paper-header h1 { font-size: 22px; line-height: 1.25; margin: 6px 0 0; text-transform: uppercase; }
.paper-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; }
.paper-column { min-width: 0; }
.paper-section { margin-bottom: 25px; break-inside: avoid; }
.paper-section h2 { font-size: 16px; margin: 0 0 8px; font-weight: 800; }
.paper-section h3 { font-size: 15px; margin: 9px 0 7px; }
.section-intro { margin: 0 0 8px; line-height: 1.4; font-size: 14px; }
.field-row { display: grid; grid-template-columns: minmax(155px, 42%) 1fr; align-items: start; gap: 10px; margin: 7px 0; }
.field-label { font-size: 14px; line-height: 1.35; padding-top: 7px; }
.paper-input { width: 100%; min-height: 34px; border: 0; border-bottom: 1.5px solid #67727a; border-radius: 0; background: #f9fbfc; padding: 5px 7px; color: #0c3950; }
textarea.paper-input { resize: vertical; }
.choice-group { display: flex; flex-wrap: wrap; gap: 5px 13px; min-height: 31px; align-items: center; }
.choice-stacked { display: grid; grid-template-columns: 1fr; gap: 5px; }
.choice { display: inline-flex; align-items: flex-start; gap: 5px; font-size: 13px; line-height: 1.35; cursor: pointer; }
.choice input { width: 16px; height: 16px; margin: 1px 0 0; accent-color: var(--ueu-blue); flex: none; }
.checkbox-grid:not(.choice-stacked) { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; }
.clear-choice { border: 0; background: transparent; color: #7a8790; padding: 2px 0; font-size: 10px; text-decoration: underline; cursor: pointer; }
.single-check { padding-top: 7px; }
.paper-table { font-family: Arial, Helvetica, sans-serif; font-size: 12px; }
.paper-table th, .paper-table td { border: 1px solid #28343b; padding: 5px 6px; vertical-align: middle; }
.paper-table th { font-weight: 800; background: #f2f4f5; }
.compact-table th:first-child, .compact-table td:first-child { text-align: left; width: 58%; }
.compact-table th:not(:first-child), .compact-table td:not(:first-child) { text-align: center; }
.compact-table input[type="radio"], .scale-table input[type="radio"], .consent-table input[type="checkbox"] { width: 17px; height: 17px; accent-color: var(--ueu-blue); }
.table-input { width: 100%; min-width: 55px; min-height: 29px; border: 0; border-bottom: 1px solid #82919a; background: #f8fbfc; padding: 3px 5px; }
.scale-table th:not(:first-child), .scale-table td:not(:first-child) { text-align: center; min-width: 64px; }
.scale-table th:first-child { width: 45%; text-align: left; }
.yes-no-table th:first-child { width: 72%; }
.measurement-table th, .measurement-table td { text-align: center; min-width: 110px; }
.measurement-table .table-input { text-align: center; min-height: 48px; font-size: 16px; }
.consent-copy { font-size: 14px; line-height: 1.5; }
.consent-list { padding-left: 24px; }
.consent-list > li { padding-left: 7px; margin-bottom: 17px; }
.consent-list ol { margin-top: 5px; }
.consent-flow { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr; gap: 8px; align-items: center; margin: 8px 10px 30px; }
.consent-flow span { min-height: 60px; border: 1px solid #4a555c; display: grid; place-items: center; text-align: center; padding: 8px; font-size: 12px; }
.consent-flow span:nth-of-type(n+4) { grid-row: 2; }
.consent-flow b { font-size: 20px; font-weight: 400; }
.consent-table { font-size: 11px; }
.consent-table th:nth-child(1) { width: 4%; }
.consent-table th:nth-child(2) { width: 46%; text-align: left; }
.consent-table th:nth-child(3) { width: 19%; }
.consent-table th:nth-child(4) { width: 5%; }
.consent-table th:nth-child(5) { width: 26%; }
.consent-table td:nth-child(1), .consent-table td:nth-child(3), .consent-table td:nth-child(4) { text-align: center; }
.consent-table .category-row td { font-weight: 800; background: #e5e7e8; text-align: left; }
.table-note { min-width: 160px; }
.paper-page-3, .paper-page-4 { min-height: 1500px; }
.paper-page-5 { min-height: 1100px; }
.paper-page-5 .paper-section { max-width: 900px; margin: 0 auto 38px; }
.paper-page-5 .field-row { max-width: 620px; grid-template-columns: 220px 1fr; }
.form-actions { width: 1120px; margin: 18px auto 0; display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; position: sticky; bottom: 14px; background: rgba(233, 238, 242, .92); backdrop-filter: blur(8px); padding: 10px; border-radius: 11px; box-shadow: 0 10px 30px rgba(23,33,43,.14); z-index: 15; }
.form-actions .button:last-child { justify-self: end; }

/* Record detail */
.back-link { display: inline-block; margin-bottom: 24px; font-weight: 700; }
.record-hero { align-items: center; }
.record-hero h1 { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 28px; letter-spacing: -.02em; }
.record-hero p:last-child { margin: 0; color: var(--muted); }
.record-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.record-grid { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 22px; align-items: start; }
.record-side { display: grid; gap: 18px; }
.record-side .panel { margin: 0; }
.answer-page { border-top: 1px solid var(--line); }
.answer-page:last-child { border-bottom: 1px solid var(--line); }
.answer-page summary { list-style: none; padding: 15px 4px; font-weight: 800; cursor: pointer; display: flex; align-items: center; gap: 10px; }
.answer-page summary::-webkit-details-marker { display: none; }
.answer-page summary span { width: 28px; height: 34px; background: #edf3f6; display: grid; place-items: end start; padding: 4px; color: var(--ueu-deep); }
.answer-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 22px; padding: 0 4px 20px; }
.answer-grid > div { padding: 9px 0; border-bottom: 1px dashed #dce3e8; }
.answer-grid dt { color: var(--muted); font-size: 12px; line-height: 1.35; }
.answer-grid dd { margin: 4px 0 0; font-weight: 650; line-height: 1.4; }
.metadata-card h2, .action-card h2 { font-size: 18px; }
.metadata-card dl { margin: 0; display: grid; gap: 14px; }
.metadata-card dl div { border-bottom: 1px solid var(--line); padding-bottom: 10px; }
.metadata-card dt { color: var(--muted); font-size: 12px; }
.metadata-card dd { margin: 4px 0 0; }
.metadata-card dd small { display: block; color: var(--muted); margin-top: 3px; }
.action-card p { color: var(--muted); font-size: 13px; line-height: 1.5; }
.waiting-card { border-color: #b8dbe9; background: #f4fbfe; }
.confirmation-check { display: grid; grid-template-columns: 20px 1fr; align-items: start; gap: 9px; margin: 13px 0 16px; line-height: 1.4; }
.confirmation-check input { width: 18px; min-height: 18px; margin: 1px 0 0; accent-color: var(--ueu-blue); }
.danger-card { border-color: #e7c5c5; }
.audit-panel { margin-top: 22px; }
.audit-list { list-style: none; padding: 0; margin: 0; }
.audit-list li { display: grid; grid-template-columns: 18px 1fr; gap: 10px; padding: 8px 0; }
.audit-list i { width: 9px; height: 9px; background: var(--ueu-blue); border-radius: 50%; margin-top: 5px; box-shadow: 0 0 0 4px #e5f2f8; }
.audit-list strong { text-transform: capitalize; }
.audit-list span { display: block; color: var(--muted); font-size: 12px; margin-top: 3px; }
.audit-list p { background: #fff5ea; padding: 7px; margin: 6px 0 0; font-size: 12px; }
.narrow-wrap { max-width: 620px; padding-top: 50px; }
.error-panel { border-left: 5px solid var(--ueu-orange); }

/* Account management keeps identity and attribution visible without adding role complexity. */
.account-layout { display: grid; grid-template-columns: minmax(300px, 360px) minmax(0, 1fr); gap: 22px; align-items: start; }
.account-layout .panel { margin-bottom: 22px; }
.account-create-card { position: sticky; top: 94px; }
.account-create-card h2 { margin-bottom: 8px; }
.account-table td { vertical-align: top; }
.account-actions { min-width: 165px; }
.account-actions > form { margin-bottom: 7px; }
.text-action { border: 0; background: none; color: var(--ueu-deep); cursor: pointer; padding: 0; font-weight: 750; }
.text-action.text-danger { color: var(--danger); }
.reset-account summary { color: var(--ueu-deep); cursor: pointer; font-weight: 750; list-style: none; }
.reset-account summary::-webkit-details-marker { display: none; }
.reset-account form { min-width: 250px; display: grid; gap: 10px; padding: 13px; margin-top: 8px; background: #f4f8fa; border: 1px solid var(--line); border-radius: 8px; }
.reset-account label { display: grid; gap: 5px; font-size: 12px; font-weight: 700; }
.reset-account input { min-height: 38px; width: 100%; border: 1px solid #bdcad3; border-radius: 7px; padding: 7px 9px; }
.account-audit-card { margin-top: 2px; }

/* Print output reuses the same five-page form surface. */
.print-document { background: #d9e0e5; padding: 30px 0; }
.print-toolbar { position: fixed; top: 18px; right: 18px; z-index: 100; }
.print-toolbar button { padding: 12px 18px; background: var(--ueu-blue); color: #fff; border: 0; border-radius: 8px; font-weight: 800; box-shadow: 0 8px 30px rgba(0,0,0,.2); cursor: pointer; }
.print-sheet { margin-bottom: 30px; }
.print-sheet fieldset { border: 0; padding: 0; margin: 0; opacity: 1; }
.print-sheet fieldset:disabled { color: inherit; }
.print-sheet input:disabled, .print-sheet textarea:disabled { color: #071820; -webkit-text-fill-color: #071820; opacity: 1; }
.print-record-no { position: absolute; bottom: 18px; right: 30px; color: #60727d; font-size: 10px; }

/* Optional IVA and breast screening: the paper itself remains the interface. */
.iva-workspace-page { background: #dfe5e8; }
.iva-workspace { display: grid; grid-template-columns: 238px minmax(0, 1fr); min-height: calc(100vh - 72px); }
.iva-rail { background: #14272f; color: #fff; position: sticky; top: 72px; height: calc(100vh - 72px); overflow-y: auto; padding: 24px 18px; display: flex; flex-direction: column; gap: 8px; }
.iva-rail > a { color: #b8dbe9; font-size: 13px; margin-bottom: 18px; }
.iva-rail > strong { font: 800 13px ui-monospace, SFMono-Regular, Menlo, monospace; word-break: break-all; }
.iva-rail > span, .iva-rail > small { color: #d4e3e9; line-height: 1.35; }
.iva-rail nav { display: grid; margin: 15px -6px 0; border-top: 1px solid rgba(255,255,255,.14); padding-top: 10px; }
.iva-rail nav a { color: #c9d9df; font-size: 11px; line-height: 1.25; padding: 8px 7px; border-left: 2px solid transparent; }
.iva-rail nav a:hover { color: #fff; border-left-color: var(--ueu-orange); background: rgba(255,255,255,.06); }
.iva-no-validation { margin: auto 0 0; color: #9bc2d2; font-size: 11px; line-height: 1.45; border-top: 1px solid rgba(255,255,255,.14); padding-top: 13px; }
.iva-stage { padding: 24px 28px 100px; min-width: 0; overflow-x: auto; }
.iva-stage form { width: max-content; min-width: 100%; }
.iva-toolbar { width: min(1100px, calc(100vw - 310px)); margin: 0 auto 12px; display: flex; justify-content: space-between; align-items: center; gap: 20px; color: #53656e; font-size: 12px; }
.iva-toolbar > div { display: flex; gap: 10px; align-items: center; }
.iva-toolbar strong { color: var(--ink); font-size: 14px; }
.iva-paper { width: min(1100px, calc(100vw - 310px)); margin: 0 auto; padding: 34px 38px 42px; background: #fff; color: #101416; box-shadow: 0 18px 50px rgba(18,35,43,.15); font-family: Arial, Helvetica, sans-serif; }
.iva-paper-header { display: grid; grid-template-columns: 168px minmax(300px, 1fr) 320px; gap: 18px; align-items: center; border: 2px solid #20282c; padding: 9px 10px; margin-bottom: 9px; }
.iva-paper-header > img { width: 150px; max-height: 58px; object-fit: contain; object-position: left center; filter: grayscale(1); }
.iva-paper-header > div:nth-child(2) { text-align: center; }
.iva-paper-header strong { font-size: 13px; letter-spacing: .03em; }
.iva-paper-header h1 { font-size: 17px; line-height: 1.15; margin: 3px 0 0; }
.iva-header-fields { border-left: 1.5px solid #30383c; padding-left: 10px; }
.iva-header-fields .iva-field { grid-template-columns: 82px 1fr; margin: 2px 0; }
.iva-paper-section { scroll-margin-top: 90px; border: 1.5px solid #263035; border-top-width: 0; padding: 7px 9px 9px; break-inside: avoid; }
.iva-paper-section h2 { margin: 0 -9px 6px; padding: 3px 8px; border-top: 1.5px solid #263035; border-bottom: 1px solid #687278; font-size: 13px; line-height: 1.15; letter-spacing: .015em; }
.iva-section-consent { border: 2px solid #263035; margin: 8px 0; }
.iva-section-consent h2 { text-align: center; border-top: 0; font-size: 12px; }
.iva-section-intro, .iva-consent-copy { margin: 2px 0 7px; font-size: 10.5px; line-height: 1.35; }
.iva-consent-copy { padding: 6px; border: 1px solid #697278; background: #fbfbfa; text-align: justify; }
.iva-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px 18px; }
.iva-section-identitas .iva-fields, .iva-section-riwayat_identitas .iva-fields { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.iva-section-reproduksi .iva-fields, .iva-section-leher_rahim .iva-fields, .iva-section-payudara .iva-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.iva-breast-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 7px 0; }
.iva-breast-pair > div { border: 1px solid #687278; padding: 7px; min-width: 0; }
.iva-breast-pair h3 { margin: -7px -7px 6px; padding: 3px 7px; text-align: center; border-bottom: 1px solid #687278; font-size: 11px; }
.iva-breast-pair .iva-field { grid-template-columns: minmax(110px, 40%) minmax(0, 1fr); }
.iva-breast-pair .iva-field-special { grid-template-columns: 1fr; }
.iva-field { display: grid; grid-template-columns: minmax(115px, 38%) minmax(0, 1fr); align-items: start; gap: 7px; min-width: 0; margin: 2px 0; }
.iva-field-label { font-size: 10.5px; line-height: 1.28; padding-top: 5px; }
.iva-field-control { min-width: 0; }
.iva-field-control > input:not([type="radio"]):not([type="checkbox"]), .iva-field-control textarea { width: 100%; min-height: 27px; border: 0; border-bottom: 1px dotted #343c40; border-radius: 0; background: #f7f9f9; color: #103d50; padding: 3px 5px; font-size: 11px; }
.iva-field-control textarea { border: 1px dotted #5e686d; resize: vertical; }
.iva-choices { display: flex; flex-wrap: wrap; align-items: center; gap: 3px 9px; min-height: 27px; padding: 2px 0; }
.iva-choices label { display: inline-flex; align-items: flex-start; gap: 3px; font-size: 10px; line-height: 1.25; cursor: pointer; }
.iva-choices input { width: 13px; height: 13px; margin: 0; accent-color: #171d20; flex: none; }
.iva-clear { border: 0; background: transparent; color: #77858c; text-decoration: underline; font-size: 8.5px; cursor: pointer; padding: 1px; }
.iva-field-special { grid-column: span 1; grid-template-columns: 1fr; border: 1px solid #6c767b; padding: 6px; margin: 5px 0; }
.iva-field-special .iva-field-label { font-weight: 700; padding: 0; text-align: center; }
.iva-field-special .iva-field-control { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 8px; }
.clinical-diagram { width: 110px; height: 110px; border: 1.5px solid #20282c; border-radius: 50%; position: relative; margin: 2px auto; background: #fff; }
.clinical-diagram::before, .clinical-diagram::after { content: ""; position: absolute; background: #424a4e; }
.clinical-diagram::before { width: 1px; top: 0; bottom: 0; left: 50%; }
.clinical-diagram::after { height: 1px; left: 0; right: 0; top: 50%; }
.clinical-diagram span { position: absolute; width: 20px; height: 20px; border: 1px solid #30383c; border-radius: 50%; inset: calc(50% - 10px); background: #fff; z-index: 2; }
.breast-diagram span { width: 27px; height: 27px; inset: calc(50% - 13.5px); }
.breast-diagram i { position: absolute; width: 8px; height: 8px; background: #fff; border: 1px solid #30383c; border-radius: 50%; inset: calc(50% - 4px); z-index: 3; }
.iva-form-actions { width: min(1100px, calc(100vw - 310px)); margin: 16px auto 0; position: sticky; bottom: 12px; z-index: 15; display: flex; justify-content: flex-end; gap: 9px; padding: 10px; background: rgba(223,229,232,.93); border-radius: 10px; backdrop-filter: blur(8px); box-shadow: 0 10px 30px rgba(23,33,43,.16); }
.iva-start-panel { border-top: 4px solid var(--ueu-orange); }
.iva-candidate-search { grid-template-columns: 1fr auto; margin-bottom: 16px; }
.candidate-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.candidate-grid article { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px; border: 1px solid var(--line); background: #f8fafb; border-radius: 9px; }
.candidate-grid article div { min-width: 0; }
.candidate-grid strong, .candidate-grid span { display: block; }
.candidate-grid span { color: var(--muted); font-size: 12px; margin-top: 3px; overflow-wrap: anywhere; }
.candidate-grid form { flex: none; }
.iva-print-page { background: #dfe5e8; padding: 24px 0; }
.iva-print-page .iva-paper { margin-bottom: 18px; }
.iva-print-meta { width: 1100px; margin: 0 auto; color: #61707e; font: 10px ui-monospace, monospace; }
.iva-paper-print input:disabled, .iva-paper-print textarea:disabled { opacity: 1; color: #101416; -webkit-text-fill-color: #101416; }

@media (max-width: 1280px) {
    .app-header { grid-template-columns: auto 1fr auto; padding-inline: 16px; }
    .main-nav { justify-content: center; gap: 1px; }
    .main-nav a { padding-inline: 8px; font-size: 13px; }
}

@media (max-width: 1000px) {
    .app-header { grid-template-columns: 1fr auto; }
    .main-nav { display: none; }
    .metric-grid { grid-template-columns: repeat(2, 1fr); }
    .record-grid { grid-template-columns: 1fr; }
    .account-layout { grid-template-columns: 1fr; }
    .cleanup-actions { grid-template-columns: 1fr 1fr; }
    .account-create-card { position: static; }
    .iva-workspace { grid-template-columns: 1fr; }
    .iva-rail { position: static; height: auto; padding: 12px 16px; display: grid; grid-template-columns: auto 1fr; align-items: center; }
    .iva-rail > a, .iva-rail .eyebrow, .iva-rail > span, .iva-rail > small, .iva-rail nav, .iva-no-validation { display: none; }
    .candidate-grid { grid-template-columns: 1fr; }
    .login-shell { grid-template-columns: 1fr; }
    .login-brand-panel { min-height: 42vh; padding: 35px; }
    .login-brand-panel h1 { font-size: 52px; }
    .login-card { padding: 48px 35px; }
}

@media (max-width: 760px) {
    .app-header { height: auto; min-height: 65px; padding: 10px 16px; }
    .brand img { width: 112px; }
    .brand span { display: none; }
    .user-menu > a { display: none; }
    .content-wrap { width: min(100% - 24px, 1180px); }
    .dashboard-head, .page-heading, .record-hero { align-items: stretch; flex-direction: column; padding-top: 28px; }
    .metric-grid { grid-template-columns: 1fr 1fr; }
    .filter-form { grid-template-columns: 1fr; }
    .cleanup-actions { grid-template-columns: 1fr; }
    .panel { padding: 16px; }
    .form-workspace { display: block; }
    .page-rail { top: 65px; height: auto; padding: 9px 12px; flex-direction: row; gap: 5px; overflow-x: auto; }
    .rail-back, .rail-title, .rail-record { display: none; }
    .page-tab { min-width: 70px; grid-template-columns: 28px 1fr; padding: 4px; border-left: 0; border-bottom: 3px solid transparent; }
    .page-tab strong { display: none; }
    .page-tab span { width: 28px; height: 34px; }
    .page-tab.active { border-bottom-color: var(--ueu-orange); }
    .form-stage { padding: 15px 10px 90px; }
    .form-stage form, .document-toolbar, .correction-banner, .paper-sheet, .form-actions { width: 100%; min-width: 0; }
    .paper-sheet { min-height: 0; padding: 24px 18px 50px; }
    .paper-header { grid-template-columns: 120px 1fr; }
    .paper-header img { width: 110px; }
    .paper-header div { padding: 0; }
    .paper-header span { display: none; }
    .paper-header h1 { font-size: 15px; }
    .paper-columns { grid-template-columns: 1fr; gap: 0; }
    .field-row { grid-template-columns: 1fr; gap: 2px; }
    .field-label { padding-top: 0; }
    .form-actions { grid-template-columns: 1fr; position: fixed; left: 0; bottom: 0; border-radius: 0; padding: 8px; }
    .form-actions .button { width: 100%; }
    .form-actions .button:first-child { display: none; }
    .form-actions .button:last-child { justify-self: stretch; }
    .answer-grid { grid-template-columns: 1fr; }
    .consent-flow { grid-template-columns: 1fr; }
    .consent-flow b { transform: rotate(90deg); justify-self: center; }
    .consent-flow span:nth-of-type(n+4) { grid-row: auto; }
    .iva-stage { padding: 12px 8px 95px; overflow: visible; }
    .iva-stage form, .iva-toolbar, .iva-paper, .iva-form-actions { width: 100%; min-width: 0; }
    .iva-toolbar { align-items: flex-start; }
    .iva-toolbar > span { text-align: right; }
    .iva-paper { padding: 18px 12px 34px; }
    .iva-paper-header { grid-template-columns: 95px 1fr; }
    .iva-paper-header > img { width: 88px; }
    .iva-paper-header h1 { font-size: 13px; }
    .iva-paper-header strong { font-size: 10px; }
    .iva-header-fields { grid-column: 1 / -1; border-left: 0; border-top: 1px solid #30383c; padding: 5px 0 0; }
    .iva-section-identitas .iva-fields, .iva-section-riwayat_identitas .iva-fields,
    .iva-section-reproduksi .iva-fields, .iva-section-leher_rahim .iva-fields,
    .iva-section-payudara .iva-fields, .iva-fields { grid-template-columns: 1fr; }
    .iva-breast-pair { grid-template-columns: 1fr; }
    .iva-field { grid-template-columns: minmax(105px, 36%) minmax(0, 1fr); }
    .iva-form-actions { position: fixed; left: 0; bottom: 0; margin: 0; border-radius: 0; justify-content: stretch; }
    .iva-form-actions .button { flex: 1; padding-inline: 8px; }
}

@media (max-width: 480px) {
    .login-brand-panel { padding: 30px 24px; }
    .login-brand-panel h1 { font-size: 46px; }
    .login-brand-panel h1 span { font-size: 29px; }
}

@media print {
    @page { size: A4 portrait; margin: 7mm; }
    body, .print-document { background: #fff; padding: 0; }
    .app-header, .flash-stack, .print-toolbar, .page-rail, .document-toolbar, .form-actions { display: none !important; }
    .print-sheet, .paper-sheet { width: 196mm; min-height: 283mm; margin: 0; padding: 8mm 8mm 10mm; box-shadow: none; break-after: page; page-break-after: always; font-size: 8.5pt; }
    .print-sheet:last-child { break-after: auto; page-break-after: auto; }
    .paper-header { min-height: 17mm; margin-bottom: 4mm; grid-template-columns: 40mm 1fr; }
    .paper-header img { width: 38mm; height: 15mm; }
    .paper-header div { padding-right: 40mm; }
    .paper-header h1 { font-size: 12pt; }
    .paper-columns { gap: 7mm; }
    .paper-section { margin-bottom: 3.2mm; }
    .paper-section h2 { font-size: 8.5pt; margin-bottom: 1.3mm; }
    .paper-section h3, .section-intro, .field-label { font-size: 8pt; }
    .field-row { margin: 1mm 0; gap: 2mm; grid-template-columns: minmax(29mm, 42%) 1fr; }
    .paper-input { min-height: 5mm; padding: .5mm 1mm; font-size: 8pt; background: transparent; }
    .choice { font-size: 7.5pt; gap: 1mm; }
    .choice input { width: 3mm; height: 3mm; }
    .clear-choice { display: none; }
    .paper-table { font-size: 6.8pt; }
    .paper-table th, .paper-table td { padding: .7mm 1mm; }
    .table-input { min-height: 4mm; background: transparent; }
    .consent-copy { font-size: 8pt; }
    .consent-list > li { margin-bottom: 2mm; }
    .consent-flow { margin-bottom: 3mm; }
    .consent-flow span { min-height: 12mm; font-size: 6.5pt; padding: 1mm; }
    .consent-table { font-size: 5.8pt; }
    .iva-print-page { background: #fff; padding: 0; }
    .iva-print-page .iva-paper { width: 196mm; margin: 0; padding: 4mm; box-shadow: none; font-size: 6.2pt; }
    .iva-print-meta { width: 196mm; margin: 2mm auto 0; font-size: 5.5pt; }
    .iva-paper-header { grid-template-columns: 29mm 1fr 54mm; gap: 2mm; padding: 1.3mm; margin-bottom: 1.2mm; }
    .iva-paper-header > img { width: 27mm; max-height: 10mm; }
    .iva-paper-header strong { font-size: 6.3pt; }
    .iva-paper-header h1 { font-size: 8pt; }
    .iva-header-fields { padding-left: 1.5mm; }
    .iva-header-fields .iva-field { grid-template-columns: 15mm 1fr; }
    .iva-paper-section { padding: 1mm 1.4mm 1.2mm; break-inside: auto; }
    .iva-paper-section h2 { margin: 0 -1.4mm 1mm; padding: .5mm 1.2mm; font-size: 6.7pt; }
    .iva-section-intro, .iva-consent-copy { font-size: 5.7pt; margin-bottom: .7mm; }
    .iva-consent-copy { padding: 1mm; }
    .iva-fields { gap: .2mm 2.4mm; }
    .iva-breast-pair { gap: 2mm; margin: 1mm 0; }
    .iva-breast-pair > div { padding: 1mm; }
    .iva-breast-pair h3 { margin: -1mm -1mm .8mm; padding: .4mm 1mm; font-size: 5.8pt; }
    .iva-breast-pair .iva-field { grid-template-columns: minmax(18mm, 40%) minmax(0, 1fr); }
    .iva-field { grid-template-columns: minmax(20mm, 38%) minmax(0, 1fr); gap: 1mm; margin: .25mm 0; }
    .iva-field-label { font-size: 5.6pt; padding-top: .5mm; }
    .iva-field-control > input:not([type="radio"]):not([type="checkbox"]), .iva-field-control textarea { min-height: 3.8mm; padding: .3mm .7mm; font-size: 5.7pt; background: transparent; }
    .iva-choices { min-height: 3.8mm; gap: .4mm 1.4mm; padding: .2mm 0; }
    .iva-choices label { font-size: 5.3pt; gap: .5mm; }
    .iva-choices input { width: 2.3mm; height: 2.3mm; }
    .iva-clear { display: none; }
    .iva-field-special { padding: 1mm; margin: .7mm 0; }
    .iva-field-special .iva-field-control { grid-template-columns: 18mm 1fr; gap: 1mm; }
    .clinical-diagram { width: 17mm; height: 17mm; }
    .clinical-diagram span { width: 4mm; height: 4mm; inset: calc(50% - 2mm); }
    .breast-diagram span { width: 5mm; height: 5mm; inset: calc(50% - 2.5mm); }
    .breast-diagram i { width: 1.5mm; height: 1.5mm; inset: calc(50% - .75mm); }
}
