:root {
  --bg: #f8f8f5;
  --surface: #ffffff;
  --surface-2: #f4f8fb;
  --border: #dce7ed;
  --border-strong: #cdd9e2;
  --text: #07182b;
  --muted: #52616e;
  --accent: #003850;
  --accent-soft: #e6eef3;
  --accent-text: #ffffff;
  --blue: #0757c9;
  --coral: #f25b50;
  --done: #0757c9;
  --warn: #d6453a;
  --shadow: 0 1px 2px rgba(7, 24, 43, 0.04), 0 6px 20px rgba(0, 56, 80, 0.06);
  --radius: 14px;
  --display: "Onest", Arial, sans-serif;
  --body: "Manrope", Arial, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 var(--body);
}
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner, .progress-wrap, .container { max-width: 920px; margin: 0 auto; padding-left: 16px; padding-right: 16px; }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 14px; }
.title-block { display: flex; align-items: center; gap: 12px; min-width: 0; }
.title-block h1 { font-size: 17px; margin: 0; letter-spacing: -0.01em; }
.subtitle { margin: 0; color: var(--muted); font-size: 13px; }
.brand-logo { flex: none; height: 30px; width: auto; display: block; }
.title-divider { flex: none; width: 1px; height: 30px; background: var(--border-strong); }
h1, h2, .section-title { font-family: var(--display); }
.topbar-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.progress-wrap { display: flex; align-items: center; gap: 12px; padding-top: 12px; padding-bottom: 12px; }
.progress-bar { flex: 1; height: 6px; background: var(--border); border-radius: 99px; overflow: hidden; }
.progress-fill { height: 100%; width: 0; background: var(--coral); border-radius: 99px; transition: width .4s ease; }
.progress-label { font-size: 13px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--border-strong); background: var(--surface);
  border-radius: 9px; padding: 8px 14px; cursor: pointer; text-decoration: none;
  font-size: 14px; font-weight: 500; transition: background .15s, border-color .15s;
}
.btn:hover { background: var(--surface-2); border-color: var(--muted); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.btn-primary:hover { background: var(--accent); filter: brightness(1.08); border-color: var(--accent); }
.btn-ghost { border-color: transparent; background: transparent; color: var(--muted); font-size: 13px; padding: 6px 10px; }
.btn-ghost:hover { background: var(--surface); border-color: var(--border); color: var(--text); }
.btn-small { padding: 6px 11px; font-size: 13px; }
.icon-btn {
  flex: none; width: 30px; height: 30px; border-radius: 8px; border: 1px solid transparent;
  background: transparent; color: var(--muted); cursor: pointer; font-size: 18px; line-height: 1;
}
.icon-btn:hover { background: var(--surface-2); border-color: var(--border); color: var(--warn); }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

/* ---------- layout ---------- */
.container { padding-top: 24px; padding-bottom: 80px; }
.intro p { margin: 0 0 18px; color: var(--muted); max-width: 68ch; }
.intro strong { color: var(--text); }
.toolbar { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.toolbar-group { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.toggle { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); cursor: pointer; margin-left: 4px; }
.toggle input { accent-color: var(--blue); }

/* ---------- sections ---------- */
.section {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); margin-bottom: 12px; overflow: hidden;
}
.section-head {
  width: 100%; display: flex; align-items: center; gap: 14px; padding: 16px 18px;
  background: none; border: 0; cursor: pointer; text-align: left;
}
.section-head:hover { background: var(--surface-2); }
.section-letter {
  flex: none; width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: 14px;
}
.section-title { flex: 1; font-weight: 600; font-size: 16px; min-width: 0; }
.section-count {
  font-size: 12px; color: var(--muted); background: var(--surface-2); border: 1px solid var(--border);
  padding: 2px 9px; border-radius: 99px; font-variant-numeric: tabular-nums; white-space: nowrap;
}
.section-count.complete { color: var(--done); border-color: color-mix(in srgb, var(--done) 40%, transparent); background: var(--accent-soft); }
.chevron { display: grid; color: var(--muted); transition: transform .25s ease; }
.section.open .chevron { transform: rotate(180deg); }
.section-body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .3s ease; }
.section.open .section-body { grid-template-rows: 1fr; }
.section-inner { overflow: hidden; }
.section.open .section-inner { border-top: 1px solid var(--border); }

/* ---------- questions ---------- */
.question { padding: 20px 18px 16px; border-bottom: 1px solid var(--border); position: relative; }
.question:last-child { border-bottom: 0; }
.question::before {
  content: ""; position: absolute; left: 0; top: 20px; bottom: 16px; width: 3px; border-radius: 0 3px 3px 0;
  background: transparent; transition: background .2s;
}
.question.answered::before { background: var(--done); }
.q-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.q-code {
  flex: none; font-size: 12px; font-weight: 700; color: var(--accent); background: var(--accent-soft);
  padding: 3px 8px; border-radius: 6px; margin-top: 1px; font-variant-numeric: tabular-nums;
}
.q-text { margin: 0; flex: 1; font-weight: 500; font-size: 18px; line-height: 1.45; }
.q-status { flex: none; font-size: 12px; color: var(--muted); white-space: nowrap; margin-top: 3px; }
.q-status[data-state="saved"] { color: var(--done); }
.q-status[data-state="error"] { color: var(--warn); }
.q-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; padding-left: 46px; }
.field-long, .field-rows, .field-multi, .field-choice { grid-column: 1 / -1; }
.field-label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.q-meta { padding-left: 46px; margin-top: 10px; font-size: 12px; color: var(--muted); min-height: 1em; }

/* ---------- inputs ---------- */
.input {
  width: 100%; background: var(--surface-2); border: 1px solid var(--border); border-radius: 9px;
  padding: 9px 12px; transition: border-color .15s, background .15s, box-shadow .15s;
}
.input:hover { border-color: var(--border-strong); }
.input:focus { outline: none; border-color: var(--blue); background: var(--surface); box-shadow: 0 0 0 3px rgba(7, 87, 201, 0.12); }
.textarea { resize: none; min-height: 78px; line-height: 1.5; overflow: hidden; }
.textarea-short { min-height: 42px; }
.select { appearance: none; padding-right: 30px; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 16px) 52%, calc(100% - 11px) 52%; background-size: 5px 5px; background-repeat: no-repeat; }
.input-suffix { display: flex; align-items: center; gap: 8px; }
.input-suffix .input { max-width: 160px; }
.suffix { color: var(--muted); font-size: 13px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1px solid var(--border-strong); background: var(--surface); border-radius: 99px;
  padding: 6px 14px; font-size: 14px; cursor: pointer; transition: all .15s;
}
.chip:hover { border-color: var(--accent); }
.chip.on { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }

/* ---------- rows ---------- */
.rows-table { display: grid; gap: 8px; }
.row { display: grid; grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr)) 30px; gap: 8px; align-items: start; }
.row > .icon-btn { margin-top: 6px; }
.row-header .cell-head { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.btn-add { margin-top: 10px; }

/* ---------- uploads ---------- */
.upload { padding-left: 46px; margin-top: 14px; }
.dropzone {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px; cursor: pointer;
  border: 1.5px dashed var(--border-strong); border-radius: 11px; color: var(--muted);
  transition: border-color .15s, background .15s;
}
.dropzone:hover, .dropzone.drag { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.dropzone-text { display: grid; }
.dropzone-text strong { color: var(--text); font-weight: 500; font-size: 14px; }
.dropzone-hint { font-size: 12px; }
.file-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.file {
  display: flex; align-items: center; gap: 10px; padding: 6px 6px 6px 12px;
  border: 1px solid var(--border); border-radius: 9px; background: var(--surface-2); font-size: 14px;
}
.file.uploading { color: var(--muted); padding: 10px 12px; }
.file-name { color: var(--blue); text-decoration: none; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.file-name:hover { text-decoration: underline; }
.file-meta { color: var(--muted); font-size: 12px; margin-left: auto; white-space: nowrap; }

/* ---------- modal / toast ---------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(10, 15, 10, 0.45); display: grid; place-items: center; z-index: 50; padding: 16px; }
.modal, .login-card {
  width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; padding: 26px; display: grid; gap: 12px; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18);
}
.modal h2, .login-card h1 { margin: 0; font-size: 19px; }
.modal p, .login-card p { margin: 0; color: var(--muted); font-size: 14px; }
.modal input, .login-card input {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border-strong); border-radius: 9px; background: var(--surface-2);
}
.modal input:focus, .login-card input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(7, 87, 201, 0.12); }
.login-body { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-error { color: var(--warn); font-size: 14px; }
.login-logo { height: 34px; width: auto; justify-self: start; margin-bottom: 8px; }
.login-card { border-top: 4px solid var(--coral); }
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 60;
  background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-size: 14px;
  max-width: calc(100% - 32px); box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
}

/* ---------- mobile ---------- */
@media (max-width: 640px) {
  .q-fields, .q-meta, .upload { padding-left: 0; }
  .q-fields { grid-template-columns: 1fr; }
  .q-head { flex-wrap: wrap; }
  .q-status { order: 3; width: 100%; margin-top: 0; }
  .row { grid-template-columns: 1fr 30px; grid-auto-flow: row dense; }
  .row > .input { grid-column: 1; }
  .row > .icon-btn { grid-column: 2; grid-row: 1; }
  .row-header { display: none; }
  .row:not(.row-header) { padding: 10px; border: 1px solid var(--border); border-radius: 10px; }
  .subtitle { display: none; }
  .brand-logo { height: 22px; }
  .title-block h1 { font-size: 15px; }
  .topbar-actions .btn-ghost { padding: 6px 8px; }
}

/* ---------- guidance text ---------- */
.intro { background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--coral); border-radius: var(--radius); padding: 16px 20px; margin-bottom: 18px; }
.intro h2 { font-size: 16px; margin: 0 0 8px; }
.intro ul { margin: 0; padding-left: 18px; color: var(--muted); display: grid; gap: 4px; }
.intro p { margin: 0; }
.section-intro { margin: 0; padding: 12px 18px; color: var(--muted); font-size: 14px; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.q-note { margin: -6px 0 14px 46px; color: var(--muted); font-size: 14px; }
.field-hint { margin-left: 8px; font-size: 12px; color: var(--blue); font-weight: 500; }
.field-hint::before { content: "· "; color: var(--muted); }
.field-label:empty { display: none; }
@media (max-width: 640px) { .q-note { margin-left: 0; } }
.field-hint.solo { margin-left: 0; }
.field-hint.solo::before { content: none; }
.field:only-child { grid-column: 1 / -1; }

/* ---------- header logos / page title ---------- */
.logos { display: flex; align-items: center; gap: 14px; min-width: 0; }
.logo-ascensus { height: 40px; width: auto; display: block; }
.logos .brand-logo { height: 26px; }
.page-title { margin-bottom: 18px; }
.page-title h1 { font-size: 26px; margin: 0; letter-spacing: -0.02em; }
.page-title p { margin: 2px 0 0; color: var(--muted); }
.login-logos { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.login-logos img:first-child { height: 38px; }
.login-logos img:last-child { height: 22px; }

/* ---------- fields: view / edit ---------- */
.q-fields { grid-template-columns: 1fr; gap: 12px; }
.field { border: 1px solid var(--border); border-radius: 11px; background: var(--surface); transition: border-color .15s, box-shadow .15s; }
.field:hover { border-color: var(--border-strong); }
.field.editing { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(7, 87, 201, 0.10); }
.field.just-saved { animation: saved 1.6s ease; }
@keyframes saved { 0% { box-shadow: 0 0 0 3px rgba(7, 87, 201, 0.25); } 100% { box-shadow: 0 0 0 3px transparent; } }
.field-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px 0 14px; min-height: 38px; }
.field-head .field-label { margin: 0; font-weight: 600; color: var(--text); font-size: 13px; }
.edit-btn {
  display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border); background: var(--surface);
  color: var(--accent); border-radius: 8px; padding: 5px 10px; font-size: 13px; font-weight: 600; cursor: pointer;
}
.edit-btn:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
.field-view { padding: 6px 14px 12px; cursor: text; border-radius: 0 0 11px 11px; }
.field-view:hover .empty-text { color: var(--blue); }
.field-view:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }
.empty-text { color: var(--muted); font-style: italic; font-size: 14px; }
.view-text { white-space: pre-wrap; word-break: break-word; }
.field-edit { padding: 6px 14px 14px; }
.field-actions { display: flex; align-items: center; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.actions-msg { font-size: 13px; color: var(--warn); }
.actions-tip { margin-left: auto; font-size: 12px; color: var(--muted); }
.field-foot:empty { display: none; }
.field-foot { border-top: 1px dashed var(--border); padding: 8px 14px 10px; }
.editors { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-size: 12px; }
.editors-label { color: var(--muted); }
.editor-chip { background: var(--accent-soft); color: var(--accent); border-radius: 99px; padding: 2px 9px; font-weight: 600; }
.link-btn { border: 0; background: none; color: var(--blue); font-size: 12px; cursor: pointer; padding: 2px 4px; margin-left: auto; }
.link-btn:hover { text-decoration: underline; }
.history-log { margin: 6px 0 0; padding-left: 18px; font-size: 12px; color: var(--muted); display: grid; gap: 2px; }
.history-log strong { color: var(--text); font-weight: 600; }

/* ---------- read-only table ---------- */
.view-table-wrap { overflow-x: auto; }
.view-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.view-table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); font-weight: 600; padding: 4px 10px 6px 0; border-bottom: 1px solid var(--border); }
.view-table td { padding: 8px 10px 8px 0; border-bottom: 1px solid var(--border); vertical-align: top; white-space: pre-wrap; word-break: break-word; }
.view-table tr:last-child td { border-bottom: 0; }

/* ---------- conflict ---------- */
.conflict { margin-top: 10px; border: 1px solid #f3c3bd; background: #fff5f3; border-radius: 10px; padding: 12px 14px; }
.conflict-title { margin: 0 0 6px; font-weight: 600; color: var(--warn); }
.conflict-sub { margin: 0 0 4px; font-size: 13px; color: var(--muted); }
.conflict-value { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; margin-bottom: 10px; }
.conflict-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- section notes ---------- */
.question-extra { background: var(--surface-2); }
.question-extra .q-code { background: transparent; border: 1px solid var(--border-strong); color: var(--muted); }

@media (max-width: 640px) {
  .logo-ascensus { height: 30px; }
  .logos .brand-logo { height: 18px; }
  .logos { gap: 10px; }
  .actions-tip { display: none; }
  .page-title h1 { font-size: 21px; }
}
.edit-btn { margin-left: auto; }
.field { position: relative; }
.field.no-label .field-head { position: absolute; top: 0; right: 0; padding: 8px 10px 0 0; }
.field.no-label .field-view { padding-top: 14px; padding-right: 90px; }
.field.no-label.field-rows .field-head { position: static; padding: 8px 10px 0 14px; }
.field.no-label.field-rows .field-view { padding-top: 6px; padding-right: 14px; }
.field.no-label.editing:not(.field-rows) .field-head { display: none; }
.field.no-label .field-edit { padding-top: 14px; }

/* ---------- guide ---------- */
.btn-guide { border-color: var(--accent); color: var(--accent); background: var(--surface); padding: 6px 12px; font-size: 13px; font-weight: 600; }
.btn-guide:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
.guide-layer { position: fixed; inset: 0; z-index: 100; }
.guide-spot {
  position: fixed; border-radius: 12px; pointer-events: none;
  box-shadow: 0 0 0 3px var(--coral), 0 0 0 9999px rgba(7, 24, 43, 0.55);
  transition: left .3s ease, top .3s ease, width .3s ease, height .3s ease;
}
.guide-spot.none { left: 50% !important; top: 50% !important; width: 0 !important; height: 0 !important; box-shadow: 0 0 0 9999px rgba(7, 24, 43, 0.55); }
.guide-card {
  position: fixed; width: 360px; max-width: calc(100vw - 24px); background: var(--surface); border-radius: 14px;
  padding: 18px 18px 14px; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25); border-top: 4px solid var(--coral);
  transition: left .3s ease, top .3s ease;
}
.guide-card.center { left: 50% !important; top: 50% !important; transform: translate(-50%, -50%); width: 420px; }
.guide-count { font-size: 12px; color: var(--muted); font-weight: 600; letter-spacing: 0.02em; }
.guide-title { margin: 4px 0 8px; font-family: var(--display); font-size: 18px; }
.guide-text { color: var(--text); font-size: 14px; line-height: 1.55; }
.guide-demo { display: flex; align-items: center; gap: 6px; margin: 10px 0; padding: 10px; background: var(--surface-2); border: 1px dashed var(--border-strong); border-radius: 9px; }
.guide-btn { border: 1px solid var(--border-strong); border-radius: 7px; padding: 4px 11px; font-size: 13px; font-weight: 600; background: var(--surface); }
.guide-btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.guide-chip { background: var(--accent-soft); color: var(--accent); border-radius: 99px; padding: 2px 9px; font-size: 12px; font-weight: 600; }
.guide-muted { font-size: 12px; color: var(--muted); }
.guide-dots { display: flex; gap: 5px; margin: 14px 0 10px; }
.guide-dots span { width: 6px; height: 6px; border-radius: 99px; background: var(--border-strong); }
.guide-dots span.on { background: var(--coral); width: 18px; }
.guide-nav { display: flex; align-items: center; gap: 8px; }
.guide-skip { margin-right: auto; border: 0; background: none; color: var(--muted); font-size: 13px; cursor: pointer; padding: 4px 0; }
.guide-skip:hover { color: var(--text); text-decoration: underline; }
.guide-nav .btn:disabled { opacity: .45; cursor: default; }
@media (max-width: 640px) {
  .guide-card, .guide-card.center { left: 12px !important; right: 12px; bottom: 12px; top: auto !important; transform: none; width: auto; }
  .btn-guide { padding: 5px 9px; }
}

/* ---------- name picker ---------- */
.name-list-label { margin: 4px 0 0 !important; color: var(--text) !important; font-weight: 600; }
.name-list { display: flex; flex-wrap: wrap; gap: 6px; }
.name-option { border: 1px solid var(--border-strong); background: var(--surface); border-radius: 99px; padding: 6px 12px; font-size: 14px; cursor: pointer; }
.name-option:hover { border-color: var(--accent); background: var(--accent); color: #fff; }

@media (max-width: 640px) {
  .topbar-inner { flex-wrap: wrap; row-gap: 8px; }
  .topbar-actions { width: 100%; justify-content: flex-start; gap: 4px; }
}

/* ---------- identity ---------- */
.identity-step > div { display: grid; gap: 12px; }
.identity-step [hidden] { display: none !important; }
.identity-note { font-size: 13px !important; }
.modal .link-btn { margin: 0 auto; }
.login-error:empty { display: none; }

/* ---------- expectations / unsaved / people ---------- */
.intro-lead { margin: 0 0 12px !important; padding: 10px 14px; background: var(--accent-soft); border-radius: 9px; color: var(--accent) !important; }
.intro-lead strong { color: var(--accent); }
.section-title-box { flex: 1; min-width: 0; display: grid; }
.section-title-box .section-title { flex: none; }
.section-people { font-size: 12px; color: var(--muted); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.section-people:empty { display: none; }
.section-unsaved { font-size: 12px; font-weight: 600; color: #fff; background: var(--coral); border-radius: 99px; padding: 2px 9px; white-space: nowrap; }
.unsaved-bar {
  position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 55;
  display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 16px;
  background: var(--text); color: #fff; border-radius: 12px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  font-size: 14px; max-width: calc(100% - 32px);
}
.unsaved-bar .btn-primary { background: var(--coral); border-color: var(--coral); }
body.has-unsaved .toast { bottom: 84px; }
@media (max-width: 640px) { .section-unsaved { display: none; } }

/* ---------- progress card ---------- */
.progress-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px 16px; margin-bottom: 18px; }
.progress-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.progress-top h2 { margin: 0; font-size: 17px; }
.progress-top p { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
.progress-pct { font-family: var(--display); font-size: 34px; font-weight: 700; line-height: 1; color: var(--accent); font-variant-numeric: tabular-nums; }
.progress-card .progress-bar { height: 14px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 99px; overflow: hidden; }
.progress-card .progress-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--coral), #f7877e); border-radius: 99px; transition: width .5s ease; min-width: 0; }
.progress-sections { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; margin-top: 14px; }
.progress-chip {
  display: grid; grid-template-columns: auto 1fr auto; grid-template-rows: auto auto; column-gap: 8px; row-gap: 6px; align-items: center;
  text-align: left; padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); cursor: pointer;
  transition: border-color .15s, background .15s;
}
.progress-chip:hover { border-color: var(--accent); background: var(--surface); }
.chip-letter { width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; font-size: 12px; font-weight: 700; background: var(--border); color: var(--muted); }
.chip-name { font-size: 12px; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip-count { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.chip-bar { grid-column: 1 / -1; height: 4px; background: var(--border); border-radius: 99px; overflow: hidden; }
.chip-fill { display: block; height: 100%; width: 0; background: var(--muted); transition: width .4s ease; }
.progress-chip[data-state="partial"] .chip-letter { background: rgba(7, 87, 201, 0.12); color: var(--blue); }
.progress-chip[data-state="partial"] .chip-fill { background: var(--blue); }
.progress-chip[data-state="complete"] { border-color: var(--accent); background: var(--accent-soft); }
.progress-chip[data-state="complete"] .chip-letter { background: var(--accent); color: #fff; }
.progress-chip[data-state="complete"] .chip-fill { background: var(--accent); }
.progress-chip[data-state="complete"] .chip-count { color: var(--accent); font-weight: 600; }
.progress-legend { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 10px; font-size: 12px; color: var(--muted); }
.progress-legend span { display: inline-flex; align-items: center; gap: 6px; }
.dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; background: var(--border); }
.dot.partial { background: var(--blue); }
.dot.complete { background: var(--accent); }
.topbar-inner { padding-bottom: 14px; }
@media (max-width: 640px) {
  .progress-sections { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .progress-pct { font-size: 28px; }
}
.progress-sections { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.chip-name { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.3; }
@media (max-width: 640px) { .progress-sections { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- header progress band (only when the card is scrolled away) ---------- */
.mini-progress {
  background: var(--accent); color: #fff;
  max-height: 0; opacity: 0; overflow: hidden; transition: max-height .25s ease, opacity .25s ease;
}
.mini-progress.show { max-height: 80px; opacity: 1; }
.topbar:has(.mini-progress.show) .topbar-inner { padding-bottom: 12px; }
.mini-inner { max-width: 920px; margin: 0 auto; padding: 12px 16px; display: flex; align-items: center; gap: 16px; }
.mini-title { font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; opacity: .85; white-space: nowrap; }
.mini-bar { flex: 1; height: 14px; background: rgba(255, 255, 255, 0.18); border-radius: 99px; overflow: hidden; }
.mini-fill { height: 100%; width: 0; min-width: 14px; background: linear-gradient(90deg, var(--coral), #ff8f86); border-radius: 99px; transition: width .5s ease; }
.mini-pct { font-family: var(--display); font-size: 24px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.mini-label { font-size: 14px; font-weight: 600; white-space: nowrap; opacity: .9; font-variant-numeric: tabular-nums; }
@media (max-width: 640px) {
  .mini-inner { flex-wrap: wrap; gap: 6px 12px; }
  .mini-bar { order: 3; flex-basis: 100%; }
  .mini-title { display: none; }
  .mini-pct { font-size: 20px; }
}
.mini-inner { padding: 14px 16px; }
.mini-bar { height: 16px; }
.mini-pct { font-size: 28px; }
.mini-label { font-size: 15px; }
.mini-title { font-size: 13px; }
@media (max-width: 640px) { .mini-pct { font-size: 22px; } .mini-label { font-size: 14px; } }
