:root {
  color-scheme: light;
  --bg: #f4f2ee;
  --surface: #ffffff;
  --surface-2: #faf9f6;
  --ink: #1b2230;
  --ink-2: #3c4556;
  --muted: #6b7385;
  --line: #e7e3db;
  --line-2: #d9d3c7;
  --brand: #0f5f4f;
  --brand-2: #127a65;
  --brand-soft: #e2f0eb;
  --amber: #a86b0c;
  --amber-soft: #fff2cf;
  --amber-line: #e3a72f;
  --red: #b42318;
  --red-soft: #fde6dc;
  --violet: #5b4fc4;
  --violet-soft: #ecebfb;
  --blue: #2563eb;
  --desk: #e6e2da;
  --radius: 14px;
  --shadow-sm: 0 1px 2px rgba(27, 34, 48, .06);
  --shadow: 0 1px 2px rgba(27, 34, 48, .05), 0 8px 24px rgba(27, 34, 48, .08);
  --shadow-page: 0 2px 6px rgba(27, 34, 48, .08), 0 18px 40px rgba(27, 34, 48, .14);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Fraunces", Georgia, serif;
  --topbar-h: 64px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
svg { display: block; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  height: var(--topbar-h);
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 24px;
  padding: 0 20px;
  background: rgba(255, 255, 255, .86);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 11px;
  display: grid; place-items: center;
  color: #fff; background: linear-gradient(140deg, var(--brand-2), var(--brand));
  box-shadow: 0 6px 16px rgba(15, 95, 79, .28);
}
.brand-mark svg { width: 22px; height: 22px; }
.brand-title { font-weight: 700; letter-spacing: -.01em; }
.brand-sub { font-size: 12px; color: var(--muted); }
.topbar-center { display: flex; justify-content: center; min-width: 0; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 38px; padding: 0 16px;
  border-radius: 10px; border: 1px solid var(--line-2);
  background: var(--surface); color: var(--ink);
  font-weight: 600; font-size: 13.5px; white-space: nowrap;
  transition: background .15s, border-color .15s, transform .1s, box-shadow .15s;
}
.btn:hover { background: var(--surface-2); border-color: #c9c1b2; }
.btn:active { transform: translateY(1px); }
.btn svg { width: 17px; height: 17px; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 4px 14px rgba(15, 95, 79, .25); }
.btn-primary:hover { background: var(--brand-2); border-color: var(--brand-2); }
.btn-ghost { border-color: transparent; background: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: rgba(27, 34, 48, .05); border-color: transparent; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 9px; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.icon-btn {
  width: 32px; height: 32px; border-radius: 9px; border: 0; background: transparent;
  display: grid; place-items: center; color: var(--muted);
}
.icon-btn:hover { background: rgba(27, 34, 48, .06); color: var(--ink); }
.icon-btn svg { width: 17px; height: 17px; }

/* ---------- progress ring ---------- */
.progress { display: flex; align-items: center; gap: 10px; padding-right: 6px; }
.ring { width: 34px; height: 34px; }
.ring circle { fill: none; stroke-width: 4; }
.ring .track { stroke: var(--line); }
.ring .bar { stroke: var(--brand); stroke-linecap: round; transition: stroke-dashoffset .5s cubic-bezier(.2, .8, .2, 1); }
.progress-text { line-height: 1.2; }
.progress-text b { font-size: 14px; }
.progress-text span { display: block; font-size: 11.5px; color: var(--muted); }

/* ---------- case switcher ---------- */
.case-switch { position: relative; }
.case-btn {
  display: flex; align-items: center; gap: 10px; max-width: 420px;
  height: 42px; padding: 0 12px 0 6px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--surface);
}
.case-btn:hover { border-color: var(--line-2); }
.avatar {
  width: 30px; height: 30px; border-radius: 9px; flex: none;
  display: grid; place-items: center;
  background: var(--brand-soft); color: var(--brand); font-weight: 700; font-size: 12px;
}
.case-btn .meta { min-width: 0; text-align: left; line-height: 1.2; }
.case-btn .meta b { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.case-btn .meta span { font-size: 11.5px; color: var(--muted); }
.case-btn .chev { width: 16px; height: 16px; color: var(--muted); }
.case-menu {
  position: absolute; top: calc(100% + 8px); left: 50%; transform: translateX(-50%);
  width: 380px; padding: 6px; border-radius: 14px;
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow);
}
.case-menu[hidden] { display: none; }
.case-row { display: flex; align-items: center; gap: 2px; }
.case-row .case-item { flex: 1; }
.icon-btn.danger:hover { background: var(--red-soft); color: var(--red); }
.group-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin: 22px 0 10px; padding-bottom: 6px; border-bottom: 1px solid var(--line);
}
.group-head:first-child { margin-top: 4px; }
.group-head b { font-size: 13.5px; color: var(--ink); }
.case-item {
  width: 100%; display: flex; align-items: center; gap: 10px;
  padding: 8px; border: 0; border-radius: 10px; background: transparent; text-align: left;
}
.case-item:hover, .case-item.active { background: var(--surface-2); }
.case-item .meta { flex: 1; min-width: 0; line-height: 1.25; }
.case-item .meta b { display: block; font-size: 13px; }
.case-item .meta span { font-size: 12px; color: var(--muted); }
.case-item .pct { font-size: 12px; font-weight: 600; color: var(--brand); }

/* ---------- landing ---------- */
.landing {
  min-height: calc(100vh - var(--topbar-h));
  display: grid; place-items: center; padding: 48px 20px;
  background:
    radial-gradient(1200px 500px at 50% -10%, rgba(18, 122, 101, .10), transparent 60%),
    radial-gradient(600px 300px at 90% 100%, rgba(227, 167, 47, .10), transparent 60%);
}
.landing-inner { width: min(760px, 100%); text-align: center; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 12px; border-radius: 999px;
  background: var(--brand-soft); color: var(--brand); font-weight: 600; font-size: 12.5px;
}
.eyebrow svg { width: 14px; height: 14px; }
.landing h1 {
  margin: 18px 0 10px;
  font: 600 clamp(30px, 4.4vw, 46px)/1.08 var(--font-display);
  letter-spacing: -.02em;
}
.landing p.lead { margin: 0 auto 32px; max-width: 560px; color: var(--ink-2); font-size: 16px; }
.dropzone {
  position: relative;
  display: grid; place-items: center; gap: 10px;
  padding: 44px 24px; border-radius: 22px;
  border: 2px dashed #cfc7b8; background: rgba(255, 255, 255, .7);
  transition: border-color .2s, background .2s, transform .2s;
  cursor: pointer;
}
.dropzone:hover, .dropzone.over { border-color: var(--brand); background: #fff; transform: translateY(-2px); }
.dropzone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drop-icon {
  width: 60px; height: 60px; border-radius: 18px;
  display: grid; place-items: center;
  background: var(--brand-soft); color: var(--brand);
}
.drop-icon svg { width: 28px; height: 28px; }
.dropzone b { font-size: 17px; }
.dropzone span { color: var(--muted); }
.queue { text-align: left; padding: 18px; border-radius: 22px; background: rgba(255, 255, 255, .85); border: 1px solid var(--line); }
.queue-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; }
.queue-head span { color: var(--muted); font-size: 12.5px; }
.queue .file-row { animation: none; }
.queue-actions { display: flex; justify-content: space-between; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.btn.disabled { opacity: .45; pointer-events: none; }
.add-receipt { margin: 10px 0 14px; cursor: pointer; }
.landing-alt { margin-top: 18px; color: var(--muted); }
.landing-alt button { border: 0; background: none; color: var(--brand); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.flow {
  margin-top: 44px;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; text-align: left;
}
.flow-card { padding: 16px; border-radius: var(--radius); background: rgba(255, 255, 255, .75); border: 1px solid var(--line); }
.flow-card .n { font: 600 22px var(--font-display); color: var(--brand); }
.flow-card b { display: block; margin: 2px 0 4px; }
.flow-card span { font-size: 13px; color: var(--muted); }

/* ---------- processing ---------- */
.processing { width: min(560px, 100%); margin: 0 auto; text-align: left; }
.processing h2 { font: 600 26px var(--font-display); margin: 0 0 6px; text-align: center; }
.processing p { text-align: center; color: var(--muted); margin: 0 0 24px; }
.file-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; margin-bottom: 8px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm);
  animation: rise .35s both;
}
.processing.static .file-row { animation: none; }
.file-row .fi { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: #f3efe7; color: var(--ink-2); flex: none; }
.file-row .fi svg { width: 18px; height: 18px; }
.file-row .meta { flex: 1; min-width: 0; }
.file-row .meta b { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-row .meta span { font-size: 12px; color: var(--muted); }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid var(--line); border-top-color: var(--brand); animation: spin .8s linear infinite; }
.ok-dot { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--brand); color: #fff; }
.ok-dot svg { width: 13px; height: 13px; }
.scan-bar { height: 4px; border-radius: 4px; background: var(--line); overflow: hidden; margin: 18px 0 0; }
.scan-bar i { display: block; height: 100%; width: 40%; background: linear-gradient(90deg, transparent, var(--brand), transparent); animation: scan 1.2s ease-in-out infinite; }

/* ---------- workspace ---------- */
.workspace {
  display: grid; grid-template-columns: 76px 440px 1fr;
  height: calc(100vh - var(--topbar-h));
}
.rail {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 14px 0; background: var(--surface); border-right: 1px solid var(--line);
  overflow-y: auto;
}
.rail-btn {
  position: relative; width: 60px; padding: 8px 0 6px; border: 0; border-radius: 12px;
  display: grid; justify-items: center; gap: 3px;
  background: transparent; color: var(--muted); font-size: 10.5px; font-weight: 600; line-height: 1.15;
}
.rail-btn svg { width: 21px; height: 21px; }
.rail-btn:hover { background: var(--surface-2); color: var(--ink); }
.rail-btn.active { background: var(--brand-soft); color: var(--brand); }
.rail-btn .badge {
  position: absolute; top: 4px; right: 8px; min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 8px; font-size: 10px; line-height: 16px; color: #fff; background: #d0582a;
}
.rail-btn .badge.done { background: var(--brand); }
.rail-btn .badge.done::after { content: "✓"; }

.panel { display: flex; flex-direction: column; min-height: 0; background: var(--surface-2); border-right: 1px solid var(--line); }
.panel-head { padding: 22px 24px 14px; }
.panel-head small { color: var(--muted); font-weight: 600; letter-spacing: .06em; text-transform: uppercase; font-size: 11px; }
.panel-head h2 { margin: 2px 0 0; font: 600 24px/1.2 var(--font-display); letter-spacing: -.01em; }
.panel-body { flex: 1; overflow-y: auto; padding: 4px 24px 28px; }
.panel-foot { display: flex; justify-content: space-between; gap: 10px; padding: 14px 24px; border-top: 1px solid var(--line); background: var(--surface); }

.field { margin-bottom: 16px; animation: rise .3s both; }
.panel-body.static .field { animation: none; }
.field-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.field label { font-weight: 600; font-size: 13px; color: var(--ink-2); }
.occ { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.occ b { color: var(--ink-2); }
.input {
  width: 100%; height: 42px; padding: 0 12px;
  border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface);
  transition: border-color .15s, box-shadow .15s, background .15s;
  outline: none;
}
.input:focus { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(15, 95, 79, .12); }
.input.is-ocr { background: var(--amber-soft); border-color: #ecc66a; }
.input.is-missing { border-color: #f0b49c; }
select.input {
  appearance: none; padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%236b7385' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
.custom-input { margin-top: 8px; animation: rise .2s both; }
.field-meta { display: flex; align-items: center; gap: 8px; margin-top: 6px; min-height: 18px; font-size: 12px; color: var(--muted); }
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600;
  border: 0;
}
.chip svg { width: 12px; height: 12px; }
.chip-ocr { background: var(--amber-soft); color: var(--amber); }
.chip-ok { background: var(--brand-soft); color: var(--brand); }
.chip-edit { background: #eef0f4; color: var(--ink-2); }
.chip-miss { background: var(--red-soft); color: var(--red); }
button.chip:hover { filter: brightness(.96); }
.hint { font-size: 12px; color: var(--muted); }

.evidence {
  margin-top: 8px; border-radius: 10px; overflow: hidden;
  border: 1px solid #ecd9a6; background: #fffaf0;
  animation: rise .25s both;
}
.evidence canvas { display: block; width: 100%; height: auto; }
.evidence .cap { display: flex; justify-content: space-between; padding: 6px 10px; font-size: 11.5px; color: var(--amber); }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.receipt-card { padding: 12px; margin-bottom: 12px; display: grid; grid-template-columns: 96px 1fr; gap: 14px; }
.receipt-thumb { position: relative; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); background: #fff; cursor: zoom-in; }
.receipt-thumb img { display: block; width: 100%; }
.receipt-card h4 { margin: 0 0 2px; font-size: 13.5px; }
.receipt-card .sub { font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.check { display: flex; gap: 7px; align-items: flex-start; font-size: 12.5px; margin: 3px 0; color: var(--ink-2); }
.check svg { width: 15px; height: 15px; flex: none; margin-top: 2px; }
.check.ok svg { color: var(--brand); }
.check.bad svg { color: var(--red); }
.amount { font: 600 18px var(--font-display); color: var(--ink); margin: 4px 0 6px; }

.list-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; margin-bottom: 8px; }
.floor-row { display: grid; grid-template-columns: 112px 1fr 32px; gap: 10px; align-items: center; margin-bottom: 8px; }
.floor-row span { font-size: 13px; color: var(--ink-2); font-weight: 500; }
.with-unit { position: relative; }
.with-unit em { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-style: normal; color: var(--muted); font-size: 12.5px; }
.calc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.calc {
  padding: 10px 12px; border-radius: 12px; background: var(--violet-soft); color: #3a3196;
}
.calc span { display: block; font-size: 11.5px; font-weight: 600; opacity: .8; }
.calc b { font: 600 18px var(--font-display); }
.lien { padding: 12px; margin-bottom: 10px; }
.cert { padding: 14px 14px 2px; margin-bottom: 12px; }
.cert .field { margin-bottom: 12px; }
.item-actions { display: flex; align-items: center; gap: 6px; }
.input.locked { background: var(--surface-2); color: var(--ink-2); font-weight: 600; cursor: default; }
.input.textarea { height: auto; min-height: 92px; padding: 10px 12px; line-height: 1.45; resize: vertical; font-size: 13px; }
.lien-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.lien-head b { font-size: 13px; }
.lien .grid2 { display: grid; grid-template-columns: 110px 1fr; gap: 8px; margin-bottom: 8px; }
.add-btn {
  width: 100%; height: 40px; border-radius: 10px; border: 1.5px dashed var(--line-2);
  background: transparent; color: var(--brand); font-weight: 600;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.add-btn:hover { border-color: var(--brand); background: #fff; }
.add-btn svg { width: 16px; height: 16px; }
.empty-note { padding: 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); color: var(--muted); font-size: 13px; margin-bottom: 10px; }

/* ---------- preview ---------- */
.stage { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--desk); }
.stage-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 16px; background: var(--surface); border-bottom: 1px solid var(--line);
}
.tabs { display: flex; gap: 4px; padding: 4px; border-radius: 12px; background: #f1eee8; }
.tab {
  display: flex; align-items: center; gap: 8px;
  height: 34px; padding: 0 14px; border: 0; border-radius: 9px;
  background: transparent; font-weight: 600; font-size: 13px; color: var(--muted);
}
.tab:hover { color: var(--ink); }
.tab.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.tab .dot { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; font-size: 10.5px; line-height: 18px; background: var(--red-soft); color: var(--red); }
.tab .dot.done { background: var(--brand-soft); color: var(--brand); }
.stage-tools { display: flex; align-items: center; gap: 8px; }
.switch { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink-2); font-weight: 500; cursor: pointer; user-select: none; }
.switch input { display: none; }
.switch i { width: 34px; height: 20px; border-radius: 10px; background: #cfc8bb; position: relative; transition: background .2s; }
.switch i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 2px rgba(0, 0, 0, .2); }
.switch input:checked + i { background: var(--brand); }
.switch input:checked + i::after { transform: translateX(14px); }
.legend { display: flex; gap: 12px; padding: 8px 16px; font-size: 11.5px; color: var(--muted); border-bottom: 1px solid var(--line); background: #f7f5f0; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 14px; height: 10px; border-radius: 3px; }
.stage-scroll { position: relative; flex: 1; overflow: auto; }
.stage-loading {
  position: absolute; top: 12px; right: 16px; z-index: 5;
  display: flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px;
  background: rgba(255, 255, 255, .92); box-shadow: var(--shadow); font-size: 12px; color: var(--muted);
  opacity: 0; transition: opacity .2s; pointer-events: none;
}
.stage-loading.on { opacity: 1; }
.stage-loading .spinner { width: 14px; height: 14px; border-width: 2px; }
#preview-host { padding: 28px 0 60px; }
#preview-host .docx-wrapper { background: transparent !important; padding: 0 !important; display: flex; flex-direction: column; align-items: center; }
#preview-host .docx-wrapper > section.docx {
  box-shadow: var(--shadow-page) !important; margin-bottom: 26px !important; border-radius: 2px;
}

/* field highlights inside the document */
.fx {
  background: rgba(15, 95, 79, .10);
  box-shadow: inset 0 -2px 0 rgba(15, 95, 79, .55);
  border-radius: 2px; cursor: pointer;
  transition: background .2s, box-shadow .2s;
}
.fx:hover { background: rgba(15, 95, 79, .2); }
.fx-ocr { background: var(--amber-soft); box-shadow: inset 0 -2px 0 var(--amber-line); }
.fx-ocr:hover { background: #ffe7a6; }
.fx-calc { background: var(--violet-soft); box-shadow: inset 0 -2px 0 #8b80e0; }
.fx-missing { background: var(--red-soft); color: var(--red) !important; box-shadow: inset 0 -2px 0 #e8754a; font-style: italic; }
.fx-focus { background: #dbe7ff !important; box-shadow: 0 0 0 2px var(--blue), 0 0 0 6px rgba(37, 99, 235, .18) !important; animation: pulse 1.4s ease-out 1; }
.fx-flash { animation: flash 1s ease-out 1; }
.clean .fx, .clean .fx-ocr, .clean .fx-calc { background: none; box-shadow: none; }

.stage-empty { display: grid; place-items: center; height: 100%; color: var(--muted); }

/* ---------- lightbox ---------- */
.lightbox { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 30px; background: rgba(20, 24, 33, .6); backdrop-filter: blur(4px); animation: fade .2s both; }
.lightbox img { max-width: min(900px, 100%); max-height: 100%; border-radius: 10px; box-shadow: var(--shadow-page); background: #fff; }

/* ---------- terms modal ---------- */
.modal { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 24px; background: rgba(20, 24, 33, .55); backdrop-filter: blur(4px); animation: fade .2s both; }
.modal-card { width: min(720px, 100%); max-height: min(86vh, 900px); display: flex; flex-direction: column; border-radius: 18px; background: var(--surface); box-shadow: var(--shadow-page); overflow: hidden; }
.modal-body { overflow-y: auto; padding: 28px 32px 12px; }
.modal-foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 32px; border-top: 1px solid var(--line); background: var(--surface-2); }
.accept { display: flex; align-items: center; gap: 10px; font-weight: 500; cursor: pointer; }
.accept input { width: 18px; height: 18px; accent-color: var(--brand); }
.terms h2 { margin: 0; font: 600 26px/1.2 var(--font-display); }
.terms .terms-version { margin: 4px 0 18px; color: var(--muted); font-size: 12.5px; }
.terms h3 { margin: 20px 0 6px; font-size: 14.5px; }
.terms p, .terms li { color: var(--ink-2); font-size: 13.5px; line-height: 1.6; }
.terms ul { padding-left: 20px; }
.landing-legal { margin: 28px auto 0; max-width: 620px; display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.landing-legal svg { width: 14px; height: 14px; }
.landing-legal button { border: 0; background: none; padding: 0; color: var(--brand); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.case-note { display: flex; gap: 8px; align-items: flex-start; margin: 6px 4px; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); color: var(--muted); font-size: 12px; }
.case-note svg { width: 14px; height: 14px; flex: none; margin-top: 2px; }
@media (max-width: 860px) { .modal-body, .modal-foot { padding-left: 18px; padding-right: 18px; } .modal-foot { flex-direction: column; align-items: stretch; } }

/* ---------- toasts ---------- */
.toast-host { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 70; display: grid; gap: 8px; }
.toast {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px; border-radius: 12px;
  background: #1b2230; color: #fff; font-weight: 500; box-shadow: var(--shadow);
  animation: rise .25s both;
}
.toast svg { width: 17px; height: 17px; color: #7fd8bf; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes scan { 0% { transform: translateX(-100%); } 100% { transform: translateX(250%); } }
@keyframes pulse { 0% { box-shadow: 0 0 0 2px var(--blue), 0 0 0 0 rgba(37, 99, 235, .45); } 100% { box-shadow: 0 0 0 2px var(--blue), 0 0 0 14px rgba(37, 99, 235, 0); } }
@keyframes flash { 0% { background: #bfe6d8; } 100% { } }

@media (max-width: 1180px) {
  .workspace { grid-template-columns: 68px 380px 1fr; }
  .brand-sub, .progress-text span { display: none; }
}
@media (max-width: 860px) {
  .topbar { grid-template-columns: auto minmax(0, 1fr); gap: 10px; padding: 8px 12px; height: auto; min-height: var(--topbar-h); }
  .topbar-center { display: none; }
  .topbar-actions { flex-wrap: wrap; justify-content: flex-end; gap: 4px; min-width: 0; }
  .topbar-actions .btn { height: 32px; padding: 0 10px; font-size: 12.5px; white-space: normal; text-align: right; }
  .topbar-actions .progress-text { display: none; }
  body { overflow-x: hidden; }
  .rail-btn { width: auto; flex: none; padding: 8px 10px 6px; white-space: nowrap; }
  .brand-title { font-size: 13px; }
  .workspace { grid-template-columns: 1fr; height: auto; }
  .rail { flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); padding: 8px; }
  .panel { border-right: 0; }
  .stage { min-height: 80vh; }
  .flow { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
