:root {
  --blue: #1e5aa8;
  --blue-dark: #15457f;
  --blue-soft: #e8f0fb;
  --green: #2e7d4f;
  --green-soft: #e5f4ea;
  --amber: #9a5b00;
  --amber-soft: #fff4dc;
  --red: #b42318;
  --red-soft: #fdecea;
  --ink: #1b2330;
  --ink-2: #4a5566;
  --line: #d9dee6;
  --bg: #f5f6f8;
  --card: #fff;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 2px 8px rgba(16, 24, 40, .05);
  --focus: 0 0 0 3px #fff, 0 0 0 6px #1e5aa8;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 18px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
}
h1, h2, h3 { line-height: 1.25; margin: 0 0 .4em; }
h1 { font-size: 1.75rem; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.1rem; }
p { margin: 0 0 1em; }
a { color: var(--blue); }
a:hover { color: var(--blue-dark); }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 6px; }
[hidden] { display: none !important; }
.muted { color: var(--ink-2); }
.small { font-size: .9rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); border: 0; }

.skip-link { position: absolute; left: -999px; top: 8px; background: #fff; padding: 8px 14px; z-index: 100; border-radius: 8px; }
.skip-link:focus { left: 8px; }

/* ---------- top bar & nav ---------- */
.topbar { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.topbar-inner { max-width: 1100px; margin: 0 auto; display: flex; align-items: center; gap: 24px; padding: 10px 20px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 700; font-size: 1.05rem; line-height: 1.15; }
.brand small { display: block; font-weight: 500; color: var(--ink-2); font-size: .8rem; }
.brand svg { flex: none; }
.nav { display: flex; gap: 4px; flex: 1; }
.nav a { position: relative; display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 10px; text-decoration: none; color: var(--ink-2); font-weight: 600; font-size: 1rem; }
.nav a:hover { background: var(--bg); color: var(--ink); }
.nav a[aria-current="page"] { color: var(--blue); background: var(--blue-soft); }
.nav svg { width: 20px; height: 20px; flex: none; }
.count { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--red); color: #fff; font-size: .75rem; font-weight: 700; }
.user-menu { display: flex; align-items: center; gap: 12px; margin-left: auto; font-size: .95rem; color: var(--ink-2); }

@media (max-width: 760px) {
  body.has-tabs { padding-bottom: 76px; }
  .topbar-inner { gap: 12px; padding: 8px 16px; min-height: 56px; }
  .user-menu .who { display: none; }
  .nav.applicant-nav { position: fixed; bottom: 0; left: 0; right: 0; background: #fff; border-top: 1px solid var(--line); justify-content: space-around; padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); z-index: 30; }
  .nav.applicant-nav a { flex-direction: column; gap: 2px; font-size: .75rem; padding: 6px 8px; flex: 1; }
  .nav.applicant-nav .count { position: absolute; top: 0; right: calc(50% - 26px); }
}

/* ---------- layout ---------- */
main { outline: none; }
.container { max-width: 1100px; margin: 0 auto; padding: 28px 20px 48px; }
.container.narrow { max-width: 760px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; }
.card + .card { margin-top: 20px; }
.stack > * + * { margin-top: 16px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.spread { justify-content: space-between; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
@media (max-width: 900px) { .grid-3 { grid-template-columns: 1fr; } }
.page-head { margin-bottom: 24px; }
.page-head p { color: var(--ink-2); margin: 0; }
.back-link { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 12px; font-weight: 600; text-decoration: none; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 10px 22px; border-radius: 10px; border: 2px solid transparent; font: inherit; font-weight: 650; font-size: 1rem; cursor: pointer; text-decoration: none; transition: background .15s, border-color .15s; }
.btn svg { width: 20px; height: 20px; }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-dark); color: #fff; }
.btn-secondary { background: #fff; color: var(--blue); border-color: var(--blue); }
.btn-secondary:hover { background: var(--blue-soft); }
.btn-ghost { background: transparent; color: var(--ink-2); padding: 8px 12px; min-height: 40px; }
.btn-ghost:hover { background: var(--bg); color: var(--ink); }
.btn-success { background: var(--green); color: #fff; }
.btn-success:hover { background: #23633e; color: #fff; }
.btn-danger-ghost { background: transparent; color: var(--red); padding: 8px 12px; min-height: 40px; }
.btn-danger-ghost:hover { background: var(--red-soft); }
.btn-sm { min-height: 38px; padding: 6px 14px; font-size: .92rem; }
.btn-block { width: 100%; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.btn-big { min-height: 56px; font-size: 1.1rem; padding: 12px 28px; }

/* ---------- badges & progress ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 12px; border-radius: 999px; font-size: .85rem; font-weight: 650; white-space: nowrap; }
.badge::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.tone-neutral { background: #eef0f3; color: #3f4a5a; }
.tone-info { background: var(--blue-soft); color: var(--blue-dark); }
.tone-warn { background: var(--amber-soft); color: var(--amber); }
.tone-good { background: var(--green-soft); color: var(--green); }
.tone-bad { background: var(--red-soft); color: var(--red); }

.progress { height: 10px; background: #e7eaef; border-radius: 99px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--green); border-radius: 99px; transition: width .3s; }

/* ---------- dashboard ---------- */
.status-banner { display: flex; gap: 18px; align-items: flex-start; padding: 22px 24px; border-radius: var(--radius); margin-bottom: 24px; border: 1px solid; }
.status-banner .icon { flex: none; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: #fff; }
.status-banner .icon svg { width: 24px; height: 24px; }
.status-banner h2 { margin: 0 0 4px; font-size: 1.2rem; }
.status-banner p { margin: 0; }
.status-banner.tone-neutral { border-color: #d6dbe2; }
.status-banner.tone-info { border-color: #bcd2f0; }
.status-banner.tone-warn { border-color: #f1d49a; }
.status-banner.tone-good { border-color: #b4dcc2; }
.status-banner.tone-bad { border-color: #f2c1bb; }

.step-card { display: flex; flex-direction: column; gap: 12px; }
.step-card .step-num { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; background: var(--blue-soft); color: var(--blue); }
.step-card.done .step-num { background: var(--green); color: #fff; }
.step-card h3 { margin: 0; }
.step-card p { margin: 0; color: var(--ink-2); font-size: .98rem; flex: 1; }
.step-card .btn { align-self: flex-start; }
.step-meta { font-size: .9rem; color: var(--ink-2); display: flex; justify-content: space-between; }

.msg-preview { display: flex; gap: 16px; align-items: center; text-decoration: none; color: inherit; }
.msg-preview:hover .msg-preview-text { color: var(--ink); }
.msg-preview-text { flex: 1; min-width: 0; color: var(--ink-2); }
.msg-preview-text strong { color: var(--ink); }
.msg-preview-text .clip { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.help-card { background: var(--blue-soft); border-color: #cddcf2; }

/* ---------- questionnaire ---------- */
.wizard { display: grid; grid-template-columns: 260px 1fr; gap: 28px; align-items: start; }
@media (max-width: 900px) { .wizard { grid-template-columns: 1fr; gap: 16px; } }
.steps { list-style: none; margin: 0; padding: 8px; position: sticky; top: 84px; }
.steps a { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 10px; text-decoration: none; color: var(--ink-2); font-weight: 600; font-size: .98rem; }
.steps a:hover { background: var(--bg); color: var(--ink); }
.steps a[aria-current="step"] { background: var(--blue-soft); color: var(--blue-dark); }
.steps .dot { flex: none; width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; font-size: .8rem; font-weight: 700; background: #fff; }
.steps a[aria-current="step"] .dot { border-color: var(--blue); color: var(--blue); }
.steps .done .dot { background: var(--green); border-color: var(--green); color: #fff; }
.steps .dot svg { width: 16px; height: 16px; }
@media (max-width: 900px) {
  .steps { position: static; display: flex; overflow-x: auto; gap: 4px; padding: 8px; scrollbar-width: thin; }
  .steps a { white-space: nowrap; padding: 8px 10px; }
  .steps a .label { display: none; }
  .steps a[aria-current="step"] .label { display: inline; }
}
.mobile-step-label { display: none; }
@media (max-width: 900px) { .mobile-step-label { display: block; color: var(--ink-2); font-size: .9rem; font-weight: 600; margin-bottom: 4px; } }

.section-intro { color: var(--ink-2); margin-bottom: 24px; }
.field { margin-bottom: 26px; border: 0; padding: 0; min-width: 0; }
.field > label, .field > legend { display: block; font-weight: 650; margin-bottom: 6px; padding: 0; font-size: 1.02rem; }
.field .optional { font-weight: 400; color: var(--ink-2); font-size: .9rem; }
.help { color: var(--ink-2); font-size: .93rem; margin: -2px 0 8px; }
.input, select.input, textarea.input {
  display: block; width: 100%; min-height: 50px; padding: 11px 14px; font: inherit; color: var(--ink);
  background: #fff; border: 2px solid #b9c1cd; border-radius: 10px; transition: border-color .15s;
}
textarea.input { min-height: 120px; resize: vertical; }
.input:hover { border-color: #8f9aab; }
.input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(30, 90, 168, .2); outline: none; }
.input.short { max-width: 200px; }
select.input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%234a5566' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 44px; max-width: 420px; }
.money { position: relative; max-width: 260px; }
.money::before { content: "$"; position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--ink-2); font-weight: 600; }
.money .input { padding-left: 32px; }
.field.has-error .input { border-color: var(--red); }
.error-text { display: flex; gap: 6px; align-items: center; color: var(--red); font-weight: 600; font-size: .93rem; margin-top: 6px; }
.error-text svg { width: 18px; height: 18px; flex: none; }

.choices { display: grid; gap: 10px; }
.choices.inline { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); max-width: 420px; }
.choice { position: relative; display: flex; gap: 12px; align-items: center; padding: 12px 16px; min-height: 52px; border: 2px solid #c9d0da; border-radius: 10px; background: #fff; cursor: pointer; font-weight: 500; transition: border-color .15s, background .15s; }
.choice:hover { border-color: #8f9aab; }
.choice input { width: 22px; height: 22px; margin: 0; flex: none; accent-color: var(--blue); cursor: pointer; }
.choice:has(input:checked) { border-color: var(--blue); background: var(--blue-soft); }
.choice:has(input:focus-visible) { box-shadow: var(--focus); }
.field.has-error .choice { border-color: #e7a59e; }
.consent { align-items: flex-start; padding: 16px 18px; font-weight: 500; }
.consent input { margin-top: 3px; }

.repeater-row { display: grid; grid-template-columns: 2fr 1.6fr 90px auto; gap: 10px; align-items: end; padding: 14px; background: var(--bg); border-radius: 10px; margin-bottom: 10px; }
.repeater-row label { display: block; font-size: .85rem; font-weight: 600; color: var(--ink-2); margin-bottom: 4px; }
.repeater-row .input { min-height: 46px; }
@media (max-width: 640px) { .repeater-row { grid-template-columns: 1fr 1fr; } .repeater-row > :first-child { grid-column: 1 / -1; } }

.form-actions { display: flex; gap: 12px; justify-content: space-between; align-items: center; flex-wrap: wrap; padding-top: 20px; margin-top: 8px; border-top: 1px solid var(--line); }
.save-state { font-size: .9rem; color: var(--ink-2); display: inline-flex; align-items: center; gap: 6px; }
.save-state svg { width: 16px; height: 16px; color: var(--green); }

.error-summary { border: 2px solid var(--red); background: var(--red-soft); border-radius: 10px; padding: 16px 18px; margin-bottom: 24px; }
.error-summary h2 { font-size: 1.05rem; color: var(--red); margin: 0 0 6px; }
.error-summary ul { margin: 0; padding-left: 20px; }
.error-summary a { color: var(--red); font-weight: 600; }

.notice { display: flex; gap: 12px; padding: 14px 16px; border-radius: 10px; margin-bottom: 20px; }
.notice svg { flex: none; width: 22px; height: 22px; margin-top: 2px; }
.notice p { margin: 0; }

.review-section { border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; margin-bottom: 16px; }
.review-section header { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 10px; }
.review-section h3 { margin: 0; }
dl.answers { margin: 0; display: grid; grid-template-columns: minmax(180px, 2fr) 3fr; gap: 0; }
dl.answers dt, dl.answers dd { padding: 9px 0; border-top: 1px solid #edf0f4; margin: 0; }
dl.answers dt { color: var(--ink-2); font-size: .93rem; padding-right: 16px; }
dl.answers dd { font-weight: 550; overflow-wrap: anywhere; }
dl.answers .missing { color: var(--amber); font-weight: 600; }
@media (max-width: 640px) { dl.answers { grid-template-columns: 1fr; } dl.answers dd { border-top: 0; padding-top: 0; } }

.checklist { list-style: none; padding: 0; margin: 0 0 20px; }
.checklist li { display: flex; gap: 10px; align-items: center; padding: 8px 0; }
.checklist svg { width: 22px; height: 22px; flex: none; }
.checklist .ok svg { color: var(--green); }
.checklist .todo svg { color: var(--amber); }

/* ---------- documents ---------- */
.doc-card { display: grid; grid-template-columns: 1fr; gap: 14px; }
.doc-head { display: flex; gap: 14px; align-items: flex-start; }
.doc-head .status-icon { flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: #eef0f3; color: var(--ink-2); }
.doc-head .status-icon svg { width: 22px; height: 22px; }
.doc-card.complete .status-icon { background: var(--green-soft); color: var(--green); }
.doc-card.attention .status-icon { background: var(--amber-soft); color: var(--amber); }
.doc-head h3 { margin: 0 0 2px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.doc-head p { margin: 0; color: var(--ink-2); font-size: .97rem; }
.tag { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: 2px 8px; border-radius: 6px; background: #eef0f3; color: var(--ink-2); }
.tag.req { background: var(--blue-soft); color: var(--blue-dark); }
.file-list { list-style: none; margin: 0; padding: 0; }
.file { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.file .file-icon { flex: none; width: 36px; height: 36px; border-radius: 8px; background: var(--bg); display: grid; place-items: center; color: var(--ink-2); }
.file .file-icon svg { width: 20px; height: 20px; }
.file .file-info { flex: 1; min-width: 160px; }
.file .file-name { font-weight: 600; overflow-wrap: anywhere; text-decoration: none; }
.file .file-meta { font-size: .85rem; color: var(--ink-2); }
.file .staff-note { flex-basis: 100%; background: var(--amber-soft); color: #6b4000; border-radius: 8px; padding: 8px 12px; font-size: .93rem; }
.dropzone { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 22px; border: 2px dashed #b9c1cd; border-radius: 12px; text-align: center; background: #fafbfc; cursor: pointer; transition: border-color .15s, background .15s; }
.dropzone:hover, .dropzone.dragging { border-color: var(--blue); background: var(--blue-soft); }
.dropzone:focus-within { box-shadow: var(--focus); }
.dropzone svg { width: 30px; height: 30px; color: var(--blue); }
.dropzone strong { color: var(--blue); }
.dropzone input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.dropzone .hint { font-size: .87rem; color: var(--ink-2); }
.upload-progress { display: flex; gap: 12px; align-items: center; font-size: .93rem; }
.upload-progress .progress { flex: 1; }

/* ---------- messages ---------- */
.chat { display: flex; flex-direction: column; height: calc(100vh - 230px); min-height: 420px; padding: 0; overflow: hidden; }
.chat-log { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 14px; background: #fafbfc; }
.bubble-wrap { display: flex; flex-direction: column; max-width: 78%; }
.bubble-wrap.mine { align-self: flex-end; align-items: flex-end; }
.bubble { padding: 12px 16px; border-radius: 16px; background: #fff; border: 1px solid var(--line); white-space: pre-wrap; overflow-wrap: anywhere; }
.mine .bubble { background: var(--blue); color: #fff; border-color: var(--blue); border-bottom-right-radius: 4px; }
.bubble-wrap:not(.mine) .bubble { border-bottom-left-radius: 4px; }
.bubble-meta { font-size: .8rem; color: var(--ink-2); margin: 4px 6px 0; }
.system-msg { align-self: center; font-size: .87rem; color: var(--ink-2); background: #eef0f3; padding: 6px 14px; border-radius: 99px; text-align: center; max-width: 90%; }
.day-divider { align-self: center; font-size: .8rem; font-weight: 600; color: var(--ink-2); text-transform: uppercase; letter-spacing: .05em; }
.composer { display: flex; gap: 10px; padding: 14px; border-top: 1px solid var(--line); background: #fff; align-items: flex-end; }
.composer textarea { flex: 1; min-height: 52px; max-height: 200px; resize: none; }
.empty { text-align: center; color: var(--ink-2); padding: 40px 20px; margin: auto; }
.empty svg { width: 48px; height: 48px; color: #b9c1cd; }
@media (max-width: 760px) { .chat { height: calc(100vh - 250px); } .bubble-wrap { max-width: 90%; } }

/* ---------- auth ---------- */
.auth-wrap { min-height: calc(100vh - 65px); display: grid; grid-template-columns: 1fr 1fr; }
.auth-side { background: linear-gradient(160deg, #1e5aa8, #15457f); color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: center; }
.auth-side h1 { font-size: 2.2rem; }
.auth-side ol { padding: 0; list-style: none; counter-reset: s; margin: 24px 0 0; }
.auth-side li { counter-increment: s; display: flex; gap: 14px; align-items: flex-start; margin-bottom: 18px; }
.auth-side li::before { content: counter(s); flex: none; width: 34px; height: 34px; border-radius: 50%; background: rgba(255, 255, 255, .18); display: grid; place-items: center; font-weight: 700; }
.auth-side li strong { display: block; }
.auth-side li span { opacity: .85; font-size: .95rem; }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 40px 20px; }
.auth-card { width: 100%; max-width: 440px; }
.auth-card .field { margin-bottom: 20px; }
.pw-wrap { position: relative; }
.pw-wrap .input { padding-right: 76px; }
.pw-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); }
.form-error { background: var(--red-soft); color: var(--red); border-radius: 10px; padding: 12px 14px; font-weight: 600; margin-bottom: 18px; }
@media (max-width: 860px) { .auth-wrap { grid-template-columns: 1fr; } .auth-side { padding: 32px 24px; } .auth-side h1 { font-size: 1.6rem; } }

/* ---------- staff ---------- */
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.pill { display: inline-flex; gap: 8px; align-items: center; padding: 8px 14px; border-radius: 99px; border: 1px solid var(--line); background: #fff; font: inherit; font-size: .92rem; font-weight: 600; color: var(--ink-2); cursor: pointer; }
.pill:hover { border-color: #8f9aab; color: var(--ink); }
.pill[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.pill .n { opacity: .75; font-weight: 500; }
.search { max-width: 360px; }
.table-wrap { overflow-x: auto; padding: 0; }
table.list { width: 100%; border-collapse: collapse; font-size: .97rem; }
table.list th { text-align: left; font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-2); padding: 12px 16px; border-bottom: 1px solid var(--line); background: #fafbfc; white-space: nowrap; }
table.list td { padding: 14px 16px; border-bottom: 1px solid #edf0f4; vertical-align: middle; }
table.list tr:last-child td { border-bottom: 0; }
table.list tbody tr { cursor: pointer; }
table.list tbody tr:hover { background: #f8fafd; }
table.list a.row-link { font-weight: 650; text-decoration: none; color: var(--ink); }
table.list .sub { display: block; font-size: .85rem; color: var(--ink-2); }
.mini-progress { display: flex; align-items: center; gap: 8px; font-size: .85rem; color: var(--ink-2); white-space: nowrap; }
.mini-progress .progress { width: 70px; height: 6px; }

.detail-head { display: flex; gap: 20px; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; margin-bottom: 20px; }
.detail-head .contact { color: var(--ink-2); font-size: .95rem; display: flex; gap: 18px; flex-wrap: wrap; }
.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--line); margin-bottom: 20px; overflow-x: auto; }
.tabs a { display: inline-flex; gap: 8px; align-items: center; padding: 12px 16px; text-decoration: none; color: var(--ink-2); font-weight: 650; border-bottom: 3px solid transparent; margin-bottom: -2px; white-space: nowrap; }
.tabs a:hover { color: var(--ink); }
.tabs a[aria-current="page"] { color: var(--blue); border-color: var(--blue); }
.staff-layout { display: grid; grid-template-columns: 1fr 320px; gap: 24px; align-items: start; }
@media (max-width: 980px) { .staff-layout { grid-template-columns: 1fr; } }
.side-panel { position: sticky; top: 84px; }
.side-panel .field { margin-bottom: 14px; }
.side-panel select.input { max-width: none; }
.review-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.note-form { flex-basis: 100%; display: flex; gap: 8px; flex-wrap: wrap; }
.note-form .input { flex: 1; min-width: 200px; min-height: 42px; }

/* ---------- misc ---------- */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 140%); background: var(--ink); color: #fff; padding: 14px 22px; border-radius: 12px; font-weight: 600; box-shadow: 0 8px 24px rgba(0, 0, 0, .2); transition: transform .25s; z-index: 50; max-width: calc(100% - 32px); }
.toast.show { transform: translate(-50%, 0); }
.toast.error { background: var(--red); }
@media (max-width: 760px) { body.has-tabs .toast { bottom: 92px; } }
.loading { display: flex; gap: 12px; align-items: center; justify-content: center; padding: 80px 20px; color: var(--ink-2); }
.spinner { width: 22px; height: 22px; border: 3px solid #d0d6df; border-top-color: var(--blue); border-radius: 50%; animation: spin .8s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation-duration: 1.5s !important; } }

/* ---------- additions ---------- */
hr.divider { border: 0; border-top: 1px solid var(--line); margin: 22px 0; }
.progress-gap { height: 10px; }
.notice.tone-warn, .notice.tone-good, .notice.tone-info { border: 1px solid transparent; }
.notice.tone-warn { border-color: #f1d49a; }
.notice.tone-good { border-color: #b4dcc2; }
.notice.tone-info { border-color: #bcd2f0; }
.notice .checklist { margin: 8px 0 0; }
.notice .checklist li { padding: 4px 0; }
.side-panel h2 { font-size: 1.15rem; }
.side-panel .mini-progress { margin-bottom: 8px; }
.side-panel .mini-progress svg { width: 18px; height: 18px; color: var(--green); }
.page-head.row { align-items: flex-end; }
.card.empty { text-align: center; }
@media (max-width: 860px) { .auth-wrap.form-first .auth-main { order: -1; } }
:where(main, .topbar) svg { width: 20px; height: 20px; flex: none; }
.grid-3 { margin-bottom: 20px; }
.grid-3 > .card { margin-top: 0; }
.msg-preview > svg { color: var(--ink-2); }
.brand svg { width: 36px; height: 36px; }
.toast { opacity: 0; pointer-events: none; transition: transform .25s, opacity .25s; }
.toast.show { opacity: 1; }

/* ---------- account & password reset ---------- */
.auth-single { display: flex; justify-content: center; padding-top: 48px; }
.auth-single .auth-card { max-width: 520px; }
.auth-single h1 { font-size: 1.6rem; }
.big-icon { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; margin-bottom: 16px; }
.big-icon svg { width: 28px; height: 28px; }
.tips { padding-left: 20px; color: var(--ink-2); }
.tips li { margin-bottom: 6px; }
.forgot-link { margin: 14px 0 0; text-align: center; }
.forgot-link a { font-weight: 600; }
.user-menu .btn svg { width: 18px; height: 18px; }
.user-menu a[aria-current="page"] { background: var(--blue-soft); color: var(--blue-dark); }
#pw-form .field { max-width: 440px; }
@media (max-width: 760px) { .acct-label { display: none; } .brand small { display: none; } }
.brand > span, .user-menu .btn, .user-menu .who, .nav a { white-space: nowrap; }
.user-menu { gap: 4px; }
main:focus, main:focus-visible { box-shadow: none; }
@media (max-width: 1200px) { .user-menu .who { display: none; } }
@media (max-width: 1060px) and (min-width: 761px) { .nav a { padding: 10px 10px; } .brand small { display: none; } }
.user-menu .who { display: none; }
@media (max-width: 1100px) { .acct-label { display: none; } .topbar-inner { gap: 12px; } }
@media (max-width: 1000px) and (min-width: 761px) { .nav a svg { display: none; } .nav a { padding: 10px 8px; } }

/* ---------- questionnaire editor (admin) ---------- */
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--blue); text-decoration: underline; cursor: pointer; text-align: left; }
.link-btn:hover { color: var(--blue-dark); }
.btn-icon { min-width: 40px; min-height: 40px; padding: 8px; }
.btn-icon[disabled] { opacity: .3; }
.tag-bad { background: var(--red-soft); color: var(--red); }
.adm-bar { display: flex; gap: 16px; justify-content: space-between; align-items: center; flex-wrap: wrap; padding: 14px 18px; border-radius: 12px; border: 1px solid; margin-bottom: 16px; }
.adm-bar.tone-warn { border-color: #f1d49a; }
.adm-bar.tone-good { border-color: #b4dcc2; }
.adm-bar .save-state svg { color: var(--green); }
.adm-problems ul { margin: 4px 0 0; padding-left: 20px; }
.adm-problems li { margin-bottom: 4px; }
.adm-problems .link-btn { color: #6b4000; }
.adm-hint { margin: 0 0 16px; }
.adm-section .adm-section-head, .adm-doc .adm-section-head { display: flex; gap: 16px; align-items: flex-start; }
.grow { flex: 1; min-width: 0; }
.adm-tools { display: flex; gap: 2px; flex: none; }
.adm-section .field, .adm-doc .field { margin-bottom: 16px; }
textarea.input.adm-short { min-height: 64px; }
.adm-questions { list-style: none; margin: 8px 0 16px; padding: 0; border-top: 1px solid var(--line); }
.adm-q { border-bottom: 1px solid var(--line); }
.adm-q.open { background: #fafbfc; }
.adm-q-row { display: flex; gap: 8px; align-items: center; }
.adm-q-title { flex: 1; min-width: 0; display: flex; gap: 10px; align-items: flex-start; text-align: left; background: none; border: 0; padding: 14px 8px; font: inherit; color: var(--ink); cursor: pointer; border-radius: 8px; }
.adm-q-title:hover { background: var(--bg); }
.adm-q-title > svg { margin-top: 3px; color: var(--ink-2); }
.adm-q-title .q-num { color: var(--ink-2); font-weight: 600; min-width: 26px; }
.adm-q-title .q-text { flex: 1; min-width: 0; }
.adm-q-title .q-label { display: block; font-weight: 600; }
.adm-q-title .q-meta { display: block; font-size: .87rem; color: var(--ink-2); margin-top: 2px; }
.adm-editor { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 24px; padding: 8px 8px 24px 44px; }
@media (max-width: 900px) { .adm-editor { grid-template-columns: 1fr; padding-left: 8px; } }
.adm-editor select.input { max-width: none; }
.adm-editor-preview { position: sticky; top: 84px; align-self: start; }
.adm-preview-label { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-2); margin: 0 0 8px; }
.adm-preview-box { background: #fff; border: 1px dashed #b9c1cd; border-radius: 12px; padding: 20px; }
.adm-preview-box .field { margin-bottom: 0; }
.adm-cond-note { display: flex; gap: 6px; align-items: center; margin: 12px 0 0; }
.adm-cond-note svg { width: 16px; height: 16px; }
.adm-cond-wrap .choices.inline { max-width: none; grid-template-columns: repeat(2, minmax(0, 200px)); margin-bottom: 12px; }
.adm-cond { background: var(--blue-soft); border-radius: 10px; padding: 14px 16px 2px; }
.adm-cond .field { margin-bottom: 12px; }
.adm-cond label { font-weight: 600; font-size: .95rem; }
.adm-cond-values { border: 0; padding: 0; margin: 0 0 12px; display: grid; gap: 6px; }
.choice-sm { min-height: 42px; padding: 8px 12px; font-size: .95rem; }
.adm-minmax { gap: 20px; align-items: flex-start; }
.adm-req { max-width: none; grid-template-columns: repeat(3, minmax(0, 170px)); }
.adm-fixed { background: #fafbfc; }
.adm-fixed h2 { margin-top: 4px; }
.adm-status { border-top: 1px solid var(--line); padding-top: 16px; }
.adm-history { list-style: none; padding: 0; margin: 0; }
.adm-history li { display: flex; justify-content: space-between; gap: 16px; align-items: center; padding: 14px 0; border-top: 1px solid var(--line); }
.adm-summary { margin: 0; padding-left: 20px; }
.adm-summary li { margin-bottom: 6px; }
.adm-preview-banner { position: sticky; top: 76px; z-index: 5; background: var(--blue-soft); }
.adm-step { display: block; }
dialog { border: 0; border-radius: 16px; padding: 28px; max-width: 560px; width: calc(100% - 32px); box-shadow: 0 20px 60px rgba(0, 0, 0, .25); color: var(--ink); }
dialog::backdrop { background: rgba(16, 24, 40, .45); }
dialog h2 { margin-top: 0; }
code { background: #eef0f3; padding: 1px 6px; border-radius: 4px; font-size: .9em; }
.field > label.choice { display: flex; font-weight: 500; margin-bottom: 0; font-size: 1rem; }
@media (max-width: 640px) {
  .admin .card { padding: 16px; }
  .adm-section-head { flex-wrap: wrap; }
  .adm-section-head > .step-num { display: none; }
  .adm-section-head > .grow { flex-basis: 100%; }
  .adm-section-head > .adm-tools { width: 100%; justify-content: flex-end; border-top: 1px solid var(--line); padding-top: 6px; }
  .adm-q-row { flex-wrap: wrap; gap: 0; }
  .adm-q-title { flex-basis: 100%; padding-bottom: 4px; }
  .adm-q-row > .adm-tools { width: 100%; justify-content: flex-end; padding-bottom: 6px; }
  .adm-editor { padding: 8px 0 20px; }
  .adm-cond-wrap .choices.inline, .adm-req { grid-template-columns: 1fr; }
  .page-head.row .row { width: 100%; }
  .page-head.row .row .btn { flex: 1; }
}
.choices.inline.adm-req { max-width: none; grid-template-columns: repeat(3, minmax(0, 170px)); }
@media (max-width: 640px) { .choices.inline.adm-req { grid-template-columns: 1fr; } }
