:root {
    --navy: #17324d;
    --blue: #1558a6;
    --blue-dark: #0d3d79;
    --sky: #eaf3fd;
    --ink-soft: #5b6e82;
    --line: #dce6f0;
    --surface: #ffffff;
    --page: #f5f8fc;
    --success: #16734a;
    --success-bg: #eaf8f0;
    --warning: #9a6100;
    --warning-bg: #fff7df;
    --danger: #a43a3a;
    --danger-bg: #fff0ef;
    --purple: #6e42a3;
    --shadow: 0 15px 35px rgba(23, 50, 77, .08);
}

* { box-sizing: border-box; }
html, body { max-width: 100%; overflow-x: hidden; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--page); color: var(--navy); font: 15px/1.55 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--blue-dark); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 8px; font-size: clamp(28px, 3vw, 40px); line-height: 1.12; letter-spacing: -.025em; }
h2 { margin-bottom: 6px; font-size: 20px; line-height: 1.25; }
h3 { font-size: 16px; }

.topbar { min-height: 72px; padding: 13px clamp(18px, 4vw, 52px); display: flex; align-items: center; justify-content: space-between; gap: 20px; background: var(--surface); border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--navy); }
.brand img { width: 47px; height: 47px; object-fit: contain; }
.brand strong { display: block; color: var(--blue); font-size: 16px; letter-spacing: .015em; }
.brand small { display: block; max-width: 650px; color: var(--ink-soft); font-size: 10px; letter-spacing: .035em; }
.top-user { display: flex; align-items: center; gap: 14px; color: var(--ink-soft); font-size: 13px; }
.page { width: min(1440px, 100%); margin: 0 auto; padding: 30px clamp(16px, 4vw, 52px) 48px; min-height: calc(100vh - 126px); }
.footer { padding: 22px 20px 34px; color: var(--ink-soft); text-align: center; font-size: 12px; }

.app-shell { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 30px; align-items: start; }
.sidebar { position: sticky; top: 22px; min-height: calc(100vh - 140px); padding: 22px 16px; display: flex; flex-direction: column; background: #102c48; border-radius: 18px; color: #fff; box-shadow: var(--shadow); }
.sidebar-label { color: #a8c8e7; font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.side-nav { display: grid; gap: 7px; margin-top: 20px; }
.side-nav a { padding: 12px 13px; border-radius: 10px; color: #dcecfb; font-weight: 650; }
.side-nav a:hover, .side-nav a.active { background: #24598d; color: #fff; }
.sidebar-help { margin-top: auto; padding: 14px 8px 0; display: grid; gap: 6px; color: #b9d3e9; font-size: 11px; }
.sidebar-help small { color: #8fb2d2; line-height: 1.4; }
.content { min-width: 0; }

.page-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 25px; }
.page-heading .lead { max-width: 700px; margin-bottom: 0; }
.lead { color: var(--ink-soft); font-size: 16px; }
.eyebrow { margin-bottom: 8px; color: var(--blue); font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.heading-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 10px; }
.back-link { display: inline-block; margin-bottom: 14px; font-size: 13px; font-weight: 700; }

.card, .stat-card { margin-bottom: 22px; padding: 24px; background: var(--surface); border: 1px solid rgba(220, 230, 240, .9); border-radius: 16px; box-shadow: var(--shadow); }
.card.narrow { max-width: 620px; margin: 20px auto; }
.section-head { display: flex; align-items: start; justify-content: space-between; gap: 14px; margin-bottom: 20px; }
.section-head > *:last-child { flex-shrink: 0; }
.section-head h2 { margin-bottom: 2px; }
.muted { color: var(--ink-soft); }
.count-badge { min-width: 30px; padding: 4px 9px; border-radius: 999px; background: var(--sky); color: var(--blue); text-align: center; font-size: 12px; font-weight: 800; }
.text-link { font-weight: 750; font-size: 13px; }
.text-danger { color: var(--danger); }

.button { display: inline-flex; min-height: 42px; align-items: center; justify-content: center; padding: 10px 16px; border: 1px solid var(--blue); border-radius: 9px; background: var(--blue); color: #fff; font-weight: 750; line-height: 1.2; text-align: center; transition: background .15s ease, transform .15s ease; }
.button:hover { background: var(--blue-dark); color: #fff; transform: translateY(-1px); }
.button.outline { background: #fff; color: var(--blue); }
.button.outline:hover { background: var(--sky); color: var(--blue-dark); }
.button.success-button { border-color: var(--success); background: var(--success); }
.button.danger-button { border-color: var(--danger); background: var(--danger); }
.button.small-button { min-height: 34px; padding: 7px 10px; font-size: 12px; }
.button:disabled { opacity: .5; cursor: not-allowed; transform: none; }

.stats-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 22px; }
.stat-card { margin-bottom: 0; display: grid; gap: 3px; }
.stat-card span, .stat-card small { color: var(--ink-soft); font-size: 12px; }
.stat-card strong { font-size: 34px; line-height: 1.15; }
.two-columns { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(300px, .8fr); gap: 22px; align-items: start; }
.sheet-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(300px, .8fr); gap: 22px; align-items: start; }
.sheet-grid .card { margin-bottom: 22px; }
.meeting-stack { display: grid; gap: 2px; }
.antenna-details { margin-bottom: 22px; padding: 15px 18px; background: #eef6ff; border: 1px solid #c6def6; border-radius: 12px; }
.antenna-details summary { color: var(--blue); cursor: pointer; font-weight: 750; }
.antenna-details[open] summary { margin-bottom: 16px; }

.notice { margin-bottom: 22px; padding: 13px 16px; border: 1px solid transparent; border-radius: 11px; }
.notice.info { background: var(--sky); border-color: #c6def6; color: #22517d; }
.notice.warning { background: var(--warning-bg); border-color: #efd992; color: #7b5300; }
.notice.danger { background: var(--danger-bg); border-color: #f1c6c2; color: #8d3030; }
.notice.success { background: var(--success-bg); border-color: #b9e6ca; color: var(--success); }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 13px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { color: var(--ink-soft); font-size: 11px; letter-spacing: .05em; text-transform: uppercase; white-space: nowrap; }
td { font-size: 13px; }
tbody tr:last-child td { border-bottom: 0; }
.table-link { display: grid; gap: 2px; color: var(--navy); }
.table-link:hover strong { color: var(--blue); }
td small, .table-link small { display: block; color: var(--ink-soft); font-size: 11px; }
.row-warning { background: #fffaf0; }
.warning-label { margin-top: 5px; color: var(--warning); font-weight: 750; }
.icon-link { font-size: 20px; font-weight: 700; }

.status { display: inline-flex; padding: 5px 8px; border-radius: 999px; background: #eef3f7; color: var(--navy); font-size: 11px; font-weight: 800; white-space: nowrap; }
.status.success { background: var(--success-bg); color: var(--success); }
.status.warning { background: var(--warning-bg); color: var(--warning); }
.status.danger { background: var(--danger-bg); color: var(--danger); }
.status.purple { background: #f2ebfb; color: var(--purple); }
.status.info { background: var(--sky); color: var(--blue); }
.progress-mini { display: inline-block; width: 80px; height: 7px; margin-right: 7px; overflow: hidden; vertical-align: middle; border-radius: 99px; background: #e7edf4; }
.progress-mini i { display: block; height: 100%; border-radius: inherit; background: var(--blue); }
.progress-block { margin: 4px 0 21px; }
.progress-head { display: flex; min-width: 0; justify-content: space-between; gap: 15px; margin-bottom: 8px; font-size: 13px; }
.progress-head strong, .progress-head span { min-width: 0; overflow-wrap: anywhere; word-break: break-word; }
.progress-head span { color: var(--ink-soft); text-align: right; }
.progress-track { height: 10px; overflow: hidden; border-radius: 99px; background: #e7edf4; }
.progress-track span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #1970ca, #49a5e8); }

.meeting-row, .meeting-option, .meeting-confirmed, .meeting-detail { display: flex; align-items: center; gap: 13px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.meeting-row:last-child, .meeting-option:last-child { border-bottom: 0; }
.meeting-row > div:last-child, .meeting-option > div:first-child { min-width: 0; display: grid; gap: 2px; }
.meeting-row span, .meeting-row small, .meeting-option span, .meeting-option small, .meeting-confirmed span, .meeting-confirmed small, .meeting-detail span { color: var(--ink-soft); font-size: 12px; }
.meeting-row span, .meeting-row small, .meeting-option span, .meeting-option small, .meeting-confirmed span, .meeting-confirmed small, .meeting-detail span { min-width: 0; overflow-wrap: anywhere; word-break: break-word; white-space: normal; }
.date-tile { width: 48px; height: 52px; display: grid; place-content: center; border-radius: 10px; background: var(--sky); color: var(--blue); text-align: center; }
.date-tile strong { font-size: 20px; line-height: 1; }
.date-tile span { color: var(--blue); font-size: 10px; text-transform: uppercase; }
.meeting-count { display: grid; justify-items: end; color: var(--ink-soft); }
.meeting-count strong { color: var(--blue); font-size: 25px; line-height: 1; }
.meeting-close-form { margin-top: 9px; }
.meeting-option { justify-content: space-between; }
.meeting-confirmed, .meeting-detail { justify-content: space-between; flex-wrap: wrap; padding: 15px; border: 1px solid #c6def6; border-radius: 10px; background: var(--sky); }
.form-note { margin: 15px 0 0; color: var(--ink-soft); font-size: 12px; }

dialog.modal { width: min(760px, calc(100% - 24px)); max-height: 90vh; padding: 0; overflow: auto; border: 0; border-radius: 18px; color: var(--navy); box-shadow: 0 25px 70px rgba(16, 44, 72, .28); }
dialog.modal::backdrop { background: rgba(16, 44, 72, .56); }
.modal-card { padding: 25px; }
.modal-head { display: flex; align-items: start; justify-content: space-between; gap: 18px; margin-bottom: 20px; }
.modal-head h2 { margin-bottom: 4px; }
.modal-close { width: 34px; height: 34px; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: #fff; color: var(--ink-soft); font-size: 22px; line-height: 1; }
.modal-close:hover { background: var(--sky); color: var(--blue); }
.source-stats { display: flex; flex-wrap: wrap; gap: 12px 26px; }
.source-stat { min-width: 185px; display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px; align-items: baseline; }
.source-stat-name { min-width: 0; color: var(--ink-soft); font-size: 13px; overflow-wrap: anywhere; word-break: break-word; }
.source-stat strong { color: var(--blue); font-size: 17px; white-space: nowrap; }
.source-stat small { color: var(--ink-soft); font-size: 12px; white-space: nowrap; }
.source-stat small::before { content: "("; }
.source-stat small::after { content: ")"; }
.antenna-list { display: grid; gap: 12px; }
.antenna-item { padding: 15px; border: 1px solid var(--line); border-radius: 12px; background: #fbfdff; }
.questionnaire-reopen { margin-top: 10px; padding-top: 12px; border-top: 1px solid var(--line); }
.questionnaire-reopen summary { color: var(--blue); cursor: pointer; font-weight: 750; }
.questionnaire-reopen[open] summary { margin-bottom: 18px; }
.archived-meetings { margin-top: 22px; }
.archived-meetings > summary { padding: 14px 16px; border: 1px solid var(--line); border-radius: 11px; background: #fff; color: var(--blue); cursor: pointer; font-weight: 750; }
.archived-meetings[open] > summary { margin-bottom: 14px; }
.archived-meeting-stack { margin-top: 0; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 17px 18px; }
.field, .stack-form label { display: grid; gap: 6px; color: var(--navy); font-size: 13px; font-weight: 750; }
.field.full, .form-actions.full { grid-column: 1 / -1; }
input, select, textarea { width: 100%; padding: 10px 11px; border: 1px solid #cbd8e6; border-radius: 8px; background: #fff; color: var(--navy); outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(21, 88, 166, .12); }
textarea { min-height: 90px; resize: vertical; }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 3px; }
.help { display: block; color: var(--ink-soft); font-size: 11px; font-weight: 450; }
.compact-form { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.stack-form { display: grid; gap: 14px; }
.inline-form { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.inline-form select { width: auto; min-width: 125px; padding: 7px 9px; font-size: 12px; }
.action-bar { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; padding-top: 17px; border-top: 1px solid var(--line); }
.action-bar form { display: inline-flex; }
.subheading { margin-top: 24px; margin-bottom: 11px; }

.document-list { display: grid; gap: 0; }
.document-item { display: flex; align-items: center; justify-content: space-between; gap: 13px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.document-item:last-child { border-bottom: 0; }
.document-item > div { min-width: 0; display: grid; gap: 2px; }
.document-item strong, .document-item span { overflow-wrap: anywhere; word-break: break-word; }
.document-item span { color: var(--ink-soft); font-size: 12px; }
.document-confirmation { display: grid; gap: 12px; margin-top: 18px; padding: 15px; border: 1px solid #c6def6; border-radius: 11px; background: var(--sky); }
.document-confirmation p { margin: 0; overflow-wrap: anywhere; word-break: break-word; }
.documents-card { overflow: hidden; }
.documents-panel { margin-top: 18px; padding: 18px; border: 1px solid var(--line); border-radius: 13px; }
.documents-panel:first-of-type { margin-top: 0; }
.documents-download-panel { background: #f7fbff; border-color: #c6def6; }
.documents-upload-panel { background: #fffaf0; border-color: #efd992; }
.documents-panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; margin-bottom: 14px; }
.documents-panel-head > div { min-width: 0; }
.documents-panel-head h3 { margin-bottom: 3px; color: var(--blue); }
.documents-panel-head p { margin-bottom: 0; overflow-wrap: anywhere; word-break: break-word; }
.document-requirements { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; margin: 0 0 18px; }
.document-requirement-group { padding: 13px; border: 1px solid rgba(215, 196, 133, .85); border-radius: 10px; background: #fff; }
.document-requirement-group h4 { margin: 0 0 9px; color: var(--navy); font-size: 13px; }
.document-requirement-list { display: grid; gap: 7px; margin: 0; padding: 0; list-style: none; }
.document-requirement-list li { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px solid #edf1f5; font-size: 12px; }
.document-requirement-list li:last-child { border-bottom: 0; }
.document-requirement-list li span { min-width: 0; overflow-wrap: anywhere; word-break: break-word; }
.document-requirement-list li small { flex: 0 0 auto; color: var(--warning); font-size: 10px; font-weight: 800; white-space: nowrap; }
.document-requirement-list li.is-complete small { color: var(--success); }
.document-type-message { margin: 8px 0 0; color: var(--warning); font-size: 12px; font-weight: 700; }
.fact-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.fact-grid div { padding: 12px; border-radius: 10px; background: #f7faff; }
.fact-grid span, .candidate-status-line span { display: block; color: var(--ink-soft); font-size: 11px; }
.fact-grid strong { display: block; margin-top: 3px; font-size: 13px; }
.candidate-status-line { display: flex; justify-content: space-between; align-items: center; gap: 15px; margin-top: 15px; }

.answers-list { display: grid; gap: 22px; }
.answer-section { display: grid; gap: 0; }
.answer-section h3 { padding-bottom: 8px; border-bottom: 1px solid var(--line); color: var(--blue); }
.answer { padding: 10px 0; border-bottom: 1px solid #edf1f5; }
.answer dt { color: var(--ink-soft); font-size: 12px; }
.answer dd { margin: 4px 0 0; white-space: normal; }
.timeline { display: grid; gap: 0; margin: 0; padding: 0 0 0 16px; list-style: none; border-left: 2px solid #c9ddf1; }
.timeline li { position: relative; padding: 0 0 17px 17px; }
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before { position: absolute; top: 2px; left: -22px; width: 8px; height: 8px; border: 3px solid #fff; border-radius: 50%; background: var(--blue); box-shadow: 0 0 0 1px #9fc5e6; content: ""; }
.timeline li div { display: flex; justify-content: space-between; gap: 12px; }
.timeline li div span, .timeline li p { color: var(--ink-soft); font-size: 11px; }
.timeline li p { margin: 3px 0 0; }

.empty-state { display: grid; gap: 4px; padding: 26px 10px; color: var(--ink-soft); text-align: center; }
.empty-state strong { color: var(--navy); }
.auth-card { width: min(470px, 100%); margin: 50px auto; padding: 31px; background: #fff; border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); }
.auth-card h1 { font-size: 31px; }
.separator { display: flex; align-items: center; gap: 10px; margin: 23px 0; color: var(--ink-soft); font-size: 12px; }
.separator::before, .separator::after { flex: 1; height: 1px; background: var(--line); content: ""; }
.privacy-note { margin: 22px 0 0; color: var(--ink-soft); font-size: 11px; }
.flash { margin-bottom: 18px; padding: 12px 15px; border-radius: 10px; font-weight: 650; }
.flash.success { background: var(--success-bg); color: var(--success); }
.flash.warning { background: var(--warning-bg); color: var(--warning); }
.flash.error { background: var(--danger-bg); color: var(--danger); }

.candidate-main { width: min(860px, 100%); max-width: 100%; min-width: 0; margin: 0 auto; }
.candidate-main .card, .candidate-main .section-head, .candidate-main .progress-block, .candidate-main .meeting-option, .candidate-main .meeting-confirmed, .candidate-main .document-list, .candidate-main .document-item, .candidate-main .document-confirmation { max-width: 100%; min-width: 0; }
.candidate-hero { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin: 16px 0 23px; }
.candidate-hero p { margin-bottom: 0; color: var(--ink-soft); }
.candidate-ref { padding: 8px 12px; border-radius: 9px; background: var(--sky); color: var(--blue); font-size: 12px; font-weight: 800; }
.candidate-footer { display: flex; justify-content: space-between; gap: 15px; padding: 5px 3px 20px; color: var(--ink-soft); font-size: 12px; }
.section-head > div { min-width: 0; }
.section-head h2, .section-head p, .candidate-main p { overflow-wrap: anywhere; word-break: break-word; }
.questionnaire-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-section-title { grid-column: 1 / -1; margin: 14px 0 -4px; padding-top: 14px; border-top: 1px solid var(--line); color: var(--blue); }
.choice-list { display: grid; gap: 8px; }
.choice { display: flex !important; grid-template-columns: none !important; grid-auto-flow: column; align-items: start; gap: 8px !important; color: var(--navy) !important; font-weight: 500 !important; }
.choice input { width: auto; margin-top: 4px; }

@media (max-width: 1050px) {
    .app-shell { grid-template-columns: 190px minmax(0, 1fr); gap: 20px; }
    .two-columns, .sheet-grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
    .topbar { padding: 10px 14px; }
    .brand { min-width: 0; }
    .brand img { width: 40px; height: 40px; }
    .brand strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
    .brand small { overflow: hidden; font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
    .top-user > span { display: none; }
    .top-user { gap: 0; }
    .logout-button { width: 34px; height: 34px; min-height: 34px; padding: 0; overflow: hidden; font-size: 0; }
    .logout-button::before { color: var(--blue); content: "⎋"; font-size: 21px; line-height: 1; }
    .page { width: 100%; max-width: 100%; padding: 20px 12px 32px; }
    .app-shell { display: block; }
    .sidebar { position: static; min-height: 0; margin-bottom: 18px; padding: 12px; border-radius: 13px; }
    .sidebar-label, .sidebar-help { display: none; }
    .side-nav { display: flex; gap: 5px; margin-top: 0; overflow-x: auto; }
    .side-nav a { padding: 9px 11px; white-space: nowrap; font-size: 12px; }
    .page-heading, .candidate-hero { align-items: start; flex-direction: column; }
    .heading-actions { justify-content: flex-start; }
    .stats-grid { grid-template-columns: 1fr; gap: 10px; }
    .stat-card { padding: 16px; }
    .stat-card strong { font-size: 28px; }
    .card { padding: 17px; border-radius: 13px; }
    .candidate-main { width: 100%; max-width: 100%; overflow: hidden; }
    .candidate-main .card { width: 100%; overflow: hidden; }
    .candidate-main .section-head { align-items: start; flex-wrap: wrap; }
    .candidate-main .section-head > div { width: 100%; flex: 1 1 100%; }
    .candidate-main .section-head > *:last-child { margin-left: 0; }
    .candidate-main .progress-head { align-items: start; flex-wrap: wrap; }
    .candidate-main .progress-head span { flex: 1 1 100%; text-align: left; }
    .form-grid, .questionnaire-form { grid-template-columns: 1fr; }
    .field.full, .form-actions.full, .form-section-title { grid-column: auto; }
    .table-wrap { margin: 0 -5px; }
    th, td { padding: 10px 7px; }
    th:nth-child(4), td:nth-child(4) { display: none; }
    .fact-grid { grid-template-columns: 1fr; }
    .action-bar { display: grid; }
    .action-bar form, .action-bar .button { width: 100%; }
    .action-bar .button { display: flex; }
    .inline-form { align-items: stretch; }
    .inline-form select, .inline-form .button { width: 100%; }
    .inline-form select { min-width: 0; }
    .meeting-option { align-items: start; flex-direction: column; }
    .meeting-option > div:first-child { width: 100%; }
    .meeting-option form, .meeting-option .button { width: 100%; }
    .meeting-option .button { display: flex; }
    .meeting-close-form, .meeting-close-form .button { width: 100%; }
    .documents-panel-head { flex-direction: column; }
    .document-requirements { grid-template-columns: 1fr; }
    .document-item { align-items: flex-start; flex-wrap: wrap; }
    .document-item > div { flex: 1 1 0; }
    .candidate-status-line, .candidate-footer { align-items: start; flex-direction: column; }
    .auth-card { margin: 20px auto; padding: 22px 17px; }
}
