/* Auto AI Ledger - the Signal look (prototype option C, chosen 2026-10-07).
   Every colour and font is a token on :root in the Signal block below, so a later brand
   choice (website BACKLOG A6) is a change to that block, not a redesign.
   IBM Plex Sans is served from here, never Google: no third party on a finance app.
   SIL Open Font License 1.1, in static/fonts/OFL-IBM-Plex-Sans.txt. */

/* latin-ext */
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 400 700;
  font-stretch: 100%;
  font-display: swap;
  src: url(../fonts/ibm-plex-sans-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 400 700;
  font-stretch: 100%;
  font-display: swap;
  src: url(../fonts/ibm-plex-sans-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---------- structure (from the prototype's shared/base.css) ---------- */

:root {
  --bg: #f6f8fb; --surface: #fff; --surface-2: #eef2f7; --ink: #0b1724; --dim: #5b6773; --line: #e2e8f0;
  --accent: #1259c3; --accent-2: #2e8bff; --on-accent: #fff; --accent-soft: rgba(18, 89, 195, .1);
  --good: #13804b; --good-soft: rgba(19, 128, 75, .12); --warn: #a15c00; --warn-soft: rgba(161, 92, 0, .12);
  --bad: #c0392b; --bad-soft: rgba(192, 57, 43, .12);
  --radius: 12px; --radius-sm: 8px; --shadow: 0 1px 2px rgba(11, 23, 36, .06), 0 4px 16px rgba(11, 23, 36, .05);
  --font: "IBM Plex Sans", "Segoe UI", Arial, sans-serif; --font-head: var(--font); --font-num: "IBM Plex Mono", Consolas, ui-monospace, monospace;
  --ch-a: var(--accent); --ch-b: #9fb3c8; --focus: 0 0 0 3px rgba(46, 139, 255, .35);
  --mark-a: var(--ink); --mark-p: #1259c3;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
h1, h2, h3 { font-family: var(--font-head); margin: 0; line-height: 1.2; }
h1 { font-size: 28px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
h2 { font-size: 17px; }
h3 { font-size: 14px; margin: 18px 0 10px; }
code { font-family: var(--font-num); font-size: .9em; background: var(--surface-2); padding: 1px 5px; border-radius: 4px; }
[hidden] { display: none !important; }
.ic { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.ic.big { width: 40px; height: 40px; stroke-width: 1.2; opacity: .5; }
.mark { width: 32px; height: 32px; flex: none; }
.mark-a { stroke: var(--mark-a); }
.mark-p { stroke: var(--mark-p); }
.mono, .num { font-family: var(--font-num); font-variant-numeric: tabular-nums; }
.num { text-align: right; white-space: nowrap; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 6px; }

/* ---------- page furniture ---------- */
#view { padding: 28px 32px 96px; max-width: 1360px; margin: 0 auto; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.eyebrow { margin: 0 0 4px; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); font-weight: 600; }
.lede { margin: 6px 0 0; color: var(--dim); max-width: 64ch; }
.back { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--dim); margin-bottom: 6px; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.fine { font-size: 13px; color: var(--dim); margin: 6px 0; }
.empty { color: var(--dim); padding: 18px 4px; text-align: center; }
.empty.small { padding: 6px 0; text-align: left; font-size: 13px; }
.empty.center { display: grid; place-items: center; min-height: 240px; text-align: center; }
.link { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 500; background: none; border: 0; color: var(--accent); cursor: pointer; padding: 0; font-family: inherit; }
.link .ic { width: 14px; height: 14px; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 40px; padding: 0 16px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: 500 14px var(--font); cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, transform .05s; }
.btn:hover { border-color: var(--accent); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--bad); }
.btn.danger:hover { border-color: var(--bad); }
.btn.small { min-height: 32px; padding: 0 11px; font-size: 13px; }
.btn.tiny { min-height: 28px; padding: 0 9px; font-size: 12px; }
.btn.block { width: 100%; }
.btn .ic { width: 16px; height: 16px; }
.icon-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; border: 0; background: transparent; color: var(--dim); cursor: pointer; }
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.btn-col { display: grid; gap: 8px; margin-top: 14px; }
.btn-row { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; flex-wrap: wrap; }
.btn-row.left { justify-content: flex-start; }

/* ---------- chips ---------- */
.chip { display: inline-flex; align-items: center; height: 24px; padding: 0 9px; border-radius: 999px; font: 600 12px var(--font); white-space: nowrap; background: var(--surface-2); color: var(--dim); }
h1 .chip { font-size: 13px; height: 28px; padding: 0 12px; }
.st-sent, .st-part { background: var(--accent-soft); color: var(--accent); }
.st-overdue { background: var(--bad-soft); color: var(--bad); }
.st-paid { background: var(--good-soft); color: var(--good); }

/* ---------- cards, kpis, grids ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); min-width: 0; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.card > h3:first-child { margin-top: 0; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpis.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kpis.five { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.kpi { display: flex; flex-direction: column; gap: 4px; padding: 18px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); color: var(--ink); min-width: 0; }
a.kpi:hover { border-color: var(--accent); }
.kpi-l { font-size: 12px; color: var(--dim); font-weight: 600; letter-spacing: .03em; text-transform: uppercase; }
.kpi-v { font: 600 clamp(18px, 1.9vw, 26px)/1.15 var(--font-num); font-variant-numeric: tabular-nums; white-space: nowrap; }
.kpi-v.sm { font-size: 18px; }
.kpi-s { font-size: 13px; color: var(--dim); }
.kpi-bad .kpi-v { color: var(--bad); }
.kpi-good .kpi-v { color: var(--good); }
.kpi-accent { border-color: var(--accent); }
.kpi-accent .kpi-v { color: var(--accent); }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-bottom: 18px; }
.grid2.wide-left { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 18px; }
.stat-row { display: flex; gap: 22px; flex-wrap: wrap; }
.stat-row > div { display: flex; flex-direction: column; gap: 2px; }
.stat-v { font: 600 19px var(--font-num); font-variant-numeric: tabular-nums; }

/* ---------- lists ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; gap: 8px 12px; padding: 11px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.list li .row-main { min-width: 180px; }
.list li:first-child { border-top: 0; }
.list.tight li { padding: 7px 0; }
.row-link { display: flex; flex: 1; align-items: center; gap: 12px; color: inherit; min-width: 0; }
.row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.row-main strong { font-family: var(--font-num); font-size: 13px; margin-right: 6px; }
.row-sub { display: block; font-size: 12.5px; color: var(--dim); }
.row-amt { font: 600 14px var(--font-num); font-variant-numeric: tabular-nums; white-space: nowrap; }
.feed { list-style: none; margin: 0 0 16px; padding: 0; }
.feed li { padding: 8px 0; border-top: 1px solid var(--line); font-size: 14px; }
.feed li:first-child { border-top: 0; }
.feed-d { display: block; font-size: 12px; color: var(--dim); }

/* ---------- tables ---------- */
.tablewrap { overflow-x: auto; margin: 0 -2px; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--dim); text-transform: uppercase; letter-spacing: .04em; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tfoot td { font-weight: 600; border-bottom: 0; }
.table th.num { text-align: right; }
.table tr.click { cursor: pointer; }
.table tr.click:hover td { background: var(--accent-soft); }
.table .neg { color: var(--bad); }
.table .pos { color: var(--good); }
.table.edit td { padding: 6px; vertical-align: top; }
.table.edit input { width: 100%; }
.table.edit .sub-in { margin-top: 4px; font-size: 12.5px; color: var(--dim); }
.w-qty { width: 86px; }
.w-rate { width: 130px; }
.phases tr.locked { opacity: .65; }
.phases tr.picked td { background: var(--accent-soft); }
.phases td:first-child { text-align: center; width: 54px; }
[data-calc="pctsum"].bad { color: var(--bad); }

/* ---------- toolbars, segmented, search ---------- */
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: 10px; background: var(--surface-2); flex-wrap: wrap; }
.seg a { display: inline-flex; align-items: center; gap: 7px; padding: 7px 13px; border-radius: 8px; color: var(--dim); font-size: 13.5px; font-weight: 500; }
.seg a.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.seg-n { font: 600 11px var(--font-num); opacity: .7; }
.seg.vertical { flex-direction: column; align-items: stretch; background: transparent; padding: 0; }
.seg.vertical a { padding: 10px 14px; }
.search { display: flex; align-items: center; gap: 8px; padding: 0 12px; height: 40px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); color: var(--dim); min-width: 240px; }
.search input { border: 0; background: transparent; outline: none; flex: 1; font: inherit; color: var(--ink); min-width: 0; height: 100%; padding: 0; }
.search.wide { width: 100%; }
.range { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- forms ---------- */
.form { display: grid; gap: 14px; }
.field { display: grid; gap: 6px; min-width: 0; }
.field-label { font-size: 12.5px; font-weight: 600; color: var(--dim); display: flex; align-items: center; gap: 8px; }
.field-hint { font-size: 12px; color: var(--dim); }
input, select, textarea { font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 9px 11px; min-height: 40px; width: 100%; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus); }
input:disabled { background: var(--surface-2); color: var(--dim); }
input[type="radio"], input[type="checkbox"] { width: auto; min-height: 0; accent-color: var(--accent); }
textarea { resize: vertical; }
.row2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.row3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.sub-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.sub-head h3 { margin: 6px 0; }
.presets { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.kind-body { display: grid; gap: 12px; padding: 16px; border-radius: var(--radius-sm); background: var(--surface-2); }
.kind-body .table.edit input, .kind-body > .field input { background: var(--surface); }
.switch-row { display: flex; align-items: center; gap: 14px; padding: 13px 0; border-top: 1px solid var(--line); cursor: pointer; }
.switch-row:first-child { border-top: 0; }
.switch-row .row-main { flex-direction: column; }
.switch-row .ms { width: 15px; height: 15px; vertical-align: -2px; margin-right: 4px; }
.switches { margin: 4px 0 12px; }
.switch { appearance: none; -webkit-appearance: none; width: 44px !important; height: 26px; min-height: 26px; border-radius: 999px; background: var(--line); border: 0; position: relative; cursor: pointer; transition: background .15s; flex: none; padding: 0; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .15s; }
.switch:checked { background: var(--accent); }
.switch:checked::after { transform: translateX(18px); }
.check { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--dim); }

/* ---------- builder ---------- */
.kinds { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; margin-bottom: 18px; }
.kind { display: flex; flex-direction: column; gap: 4px; text-align: left; padding: 13px 14px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; font-family: inherit; }
.kind strong { font-size: 14px; }
.kind span { font-size: 12px; color: var(--dim); line-height: 1.35; }
.kind:hover { border-color: var(--accent); }
.kind.on { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 380px); gap: 22px; align-items: start; }
.split.builder { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
.side { display: grid; gap: 16px; }
.sticky { position: sticky; top: 18px; }
.paper-label { display: flex; align-items: center; gap: 6px; margin: 0 0 8px; font-size: 12px; color: var(--dim); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- the invoice document (always paper, whatever the theme) ---------- */
.paper-wrap { min-width: 0; }
.doc { --d-ink: #0b1724; --d-dim: #5b6773; --d-line: #e3e8ee; --d-acc: #1259c3;
  position: relative; background: #fff; color: var(--d-ink); font: 12.5px/1.5 "IBM Plex Sans", Arial, sans-serif; padding: 40px 44px 30px; border-radius: 6px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .08), 0 12px 40px rgba(11, 23, 36, .12); overflow: hidden; aspect-ratio: 1 / 1.414; display: flex; flex-direction: column; }
.doc .mark-a { stroke: #0b1724; } .doc .mark-p { stroke: #1259c3; }
.doc-band { display: none; }
.doc-head { display: flex; justify-content: space-between; gap: 18px; align-items: flex-start; }
.doc-brand { display: flex; gap: 12px; align-items: flex-start; }
.doc-mark .mark { width: 40px; height: 40px; }
.doc-logo-img { max-width: 120px; max-height: 48px; object-fit: contain; }
.doc-co { font-weight: 700; font-size: 14px; }
.doc-sub { color: var(--d-dim); font-size: 11px; line-height: 1.5; }
.doc-title { text-align: right; }
.doc-word { font-size: 26px; font-weight: 300; letter-spacing: .02em; text-transform: uppercase; color: var(--d-acc); line-height: 1; }
.doc-no { font: 500 12px "IBM Plex Mono", monospace; margin-top: 6px; color: var(--d-dim); }
.doc-stamp { position: absolute; top: 120px; right: 48px; transform: rotate(-8deg); border: 2px solid #13804b; color: #13804b; font: 700 18px "IBM Plex Mono", monospace; letter-spacing: .15em; text-transform: uppercase; padding: 4px 14px; border-radius: 6px; opacity: .8; }
.doc-meta { display: flex; justify-content: space-between; gap: 18px; margin: 30px 0 22px; }
.doc-k { font-size: 10px; text-transform: uppercase; letter-spacing: .08em; color: var(--d-dim); font-weight: 600; margin-bottom: 3px; }
.doc-v { font-size: 12px; }
.doc-dates { display: grid; gap: 3px; min-width: 190px; }
.doc-dates > div { display: flex; justify-content: space-between; gap: 16px; }
.doc-dates .doc-k { margin: 0; }
.doc-lines { width: 100%; border-collapse: collapse; }
.doc-lines th { font-size: 10px; text-transform: uppercase; letter-spacing: .08em; color: var(--d-dim); text-align: left; padding: 7px 6px; border-bottom: 1.5px solid var(--d-ink); }
.doc-lines td { padding: 9px 6px; border-bottom: 1px solid var(--d-line); vertical-align: top; }
.doc-lines .num { font-family: "IBM Plex Mono", monospace; font-size: 11.5px; }
.doc-lines th.num { text-align: right; }
.doc-note { color: var(--d-dim); font-size: 11px; }
.doc-empty { color: var(--d-dim); text-align: center; padding: 20px !important; }
.doc-totals { margin: 14px 0 0 auto; width: min(290px, 100%); display: grid; gap: 4px; }
.doc-totals > div { display: flex; justify-content: space-between; gap: 12px; font-size: 12px; }
.doc-totals > div span:last-child { font-family: "IBM Plex Mono", monospace; }
.doc-total { border-top: 1.5px solid var(--d-ink); padding-top: 6px; margin-top: 2px; font-weight: 700; font-size: 14px !important; }
.doc-pay { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-top: auto; padding-top: 24px; }
.doc-foot { margin-top: 18px; padding-top: 10px; border-top: 1px solid var(--d-line); font-size: 10px; color: var(--d-dim); text-align: center; }
/* template: band */
.doc.tpl-band { padding-top: 0; }
.tpl-band .doc-band { display: block; height: 8px; margin: 0 -44px 34px; background: linear-gradient(90deg, #1259c3, #2e8bff 55%, #6fb4ff); }
.tpl-band .doc-word { font-weight: 700; color: #0b1724; }
.tpl-band .doc-lines th { border-bottom: 0; background: #eef4fb; }
.tpl-band .doc-total span:last-child { color: #1259c3; }
/* template: minimal */
.doc.tpl-minimal { font-family: "IBM Plex Mono", monospace; font-size: 11.5px; }
.tpl-minimal .doc-word { font: 600 18px "IBM Plex Mono", monospace; color: #0b1724; text-transform: lowercase; }
.tpl-minimal .doc-word::before { content: ">_ "; color: #1259c3; }
.tpl-minimal .doc-lines th { border-bottom: 1px dashed #0b1724; }
.tpl-minimal .doc-lines td { border-bottom: 1px dashed var(--d-line); }
.tpl-minimal .doc-total { border-top: 1px dashed #0b1724; }
/* template thumbnails */
.tpls { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.tpl { display: flex; flex-direction: column; gap: 3px; text-align: left; padding: 10px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); cursor: pointer; color: var(--ink); font-family: inherit; }
.tpl.on { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.tpl span { font-size: 12px; color: var(--dim); }
.tpl-thumb { position: relative; aspect-ratio: 1 / 1.414; overflow: hidden; border-radius: 6px; background: #fff; margin-bottom: 8px; }
.tpl-scale { position: absolute; top: 0; left: 0; width: 800px; transform: scale(.36); transform-origin: top left; pointer-events: none; }
.logo-row { display: flex; gap: 18px; align-items: center; margin-bottom: 8px; }
.logo-row h3 { margin-top: 0; }
.logo-box { width: 96px; height: 96px; border-radius: var(--radius); background: #fff; border: 1px solid var(--line); display: grid; place-items: center; flex: none; }
.logo-box .mark { width: 54px; height: 54px; }
.logo-box .mark-a { stroke: #0b1724; }
.logo-box .doc-logo-img { max-width: 80px; max-height: 80px; }

/* ---------- charts ---------- */
.chart { margin: 0; }
.chart svg { width: 100%; height: auto; display: block; }
.ch-grid { stroke: var(--line); stroke-dasharray: 3 4; }
.ch-base { stroke: var(--line); }
.ch-ax { fill: var(--dim); font: 11px var(--font-num); }
.ch-a { fill: var(--ch-a); }
.ch-b { fill: var(--ch-b); }
.legend, .legend-row { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--dim); margin-top: 8px; flex-wrap: wrap; }
.lg { width: 10px; height: 10px; border-radius: 3px; display: inline-block; margin-left: 8px; }
.lg:first-child { margin-left: 0; }
.lg-a { background: var(--ch-a); } .lg-b { background: var(--ch-b); }
.legend-note { margin-left: auto; }
.hbars { display: grid; gap: 10px; margin: 12px 0 18px; }
.hbar { display: grid; grid-template-columns: minmax(120px, 210px) 1fr auto; gap: 12px; align-items: center; font-size: 13.5px; }
.hbar-s { width: 100%; height: 12px; }
.hbar-t { fill: var(--surface-2); } .hbar-f { fill: var(--ch-a); }
.hbar-v { font-family: var(--font-num); font-size: 13px; }
.phasebar { width: 100%; height: 12px; display: block; margin: 8px 0; }
.ph-paid, .lg.ph-paid { fill: var(--good); background: var(--good); }
.ph-billed, .lg.ph-billed { fill: var(--accent); background: var(--accent); }
.ph-open, .lg.ph-open { fill: var(--line); background: var(--line); }
.proj { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.proj-head { display: flex; justify-content: space-between; gap: 8px; }
.proj-head span { font-family: var(--font-num); }
.phase-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.phase-list li { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 13.5px; }
.phase-list em { color: var(--dim); font-style: normal; font-family: var(--font-num); font-size: 12px; }

/* ---------- timeline ---------- */
.timeline { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 2px; }
.timeline li { display: flex; gap: 12px; padding: 7px 0; position: relative; font-size: 14px; }
.tl-dot { width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--line); background: var(--surface); margin-top: 5px; flex: none; }
.tl-sent .tl-dot { background: var(--accent); border-color: var(--accent); }
.tl-due .tl-dot { border-color: var(--warn); background: var(--warn); }
.tl-skipped { opacity: .5; }

/* ---------- inbox ---------- */
.inbox { display: grid; grid-template-columns: minmax(250px, 300px) minmax(0, 1fr) minmax(300px, 380px); gap: 18px; align-items: start; }
.drop { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; width: 100%; padding: 28px 16px; border: 2px dashed var(--line); border-radius: var(--radius); background: var(--surface); color: var(--dim); cursor: pointer; font: inherit; text-align: center; transition: border-color .15s, background .15s; }
.drop:hover { border-color: var(--accent); background: var(--accent-soft); color: var(--ink); }
.drop strong { color: var(--ink); font-size: 15px; }
.drop span { font-size: 12.5px; }
.drop-ic { width: 30px; height: 30px; color: var(--accent); }
.drop.mini { flex-direction: row; padding: 12px; font-size: 13px; }
.samples { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 10px 0 14px; }
.ib-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.ib-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; text-align: left; font: inherit; }
.ib-item.on { border-color: var(--accent); background: var(--accent-soft); }
.ib-thumb { width: 36px; height: 36px; border-radius: 8px; display: grid; place-items: center; background: var(--surface-2); color: var(--accent); flex: none; }
.ib-name { min-width: 0; font-size: 13px; font-weight: 500; overflow-wrap: anywhere; }
.ib-h { margin-bottom: 14px; }
.ib-fields { display: grid; gap: 12px; }
.conf { font: 600 10px var(--font); text-transform: uppercase; letter-spacing: .06em; padding: 1px 6px; border-radius: 4px; }
.conf.ok { background: var(--good-soft); color: var(--good); }
.conf.check { background: var(--warn-soft); color: var(--warn); }
.file-view { background: var(--surface-2); border-radius: var(--radius-sm); padding: 14px; display: grid; place-items: center; min-height: 360px; overflow: auto; }
.file-img { max-width: 100%; max-height: 70vh; border-radius: 4px; box-shadow: 0 4px 18px rgba(0, 0, 0, .12); background: #fff; }
.file-pdf { width: 100%; height: 70vh; border: 0; border-radius: 4px; background: #fff; }
.file-view .tablewrap { width: 100%; align-self: start; background: var(--surface); border-radius: 6px; }
.file-generic { display: grid; gap: 8px; place-items: center; text-align: center; color: var(--dim); }
.sample-doc { width: min(340px, 100%); background: #fff; color: #222; border-radius: 4px; box-shadow: 0 4px 18px rgba(0, 0, 0, .12); padding: 22px; font: 13px/1.5 Arial, sans-serif; }
.sd-head { font-weight: 700; font-size: 18px; padding-bottom: 8px; border-bottom: 1px solid #eee; }
.sd-k { color: #777; margin: 8px 0 18px; font-size: 12px; }
.sd-line, .sd-total { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; }
.sd-total { border-top: 1px solid #ddd; margin-top: 70px; font-weight: 700; }
.sd-note { color: #777; font-size: 12px; }
.sd-foot { margin-top: 14px; font-size: 10.5px; color: #aaa; text-align: center; overflow-wrap: anywhere; }
.match { display: grid; gap: 6px; }
.match h3 { margin: 4px 0; }
.match-row { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); cursor: pointer; }
.match-row.exact { border-color: var(--good); background: var(--good-soft); }
.path { padding: 12px; border-radius: var(--radius-sm); background: var(--surface-2); }
.path-v { display: flex; flex-wrap: wrap; align-items: center; gap: 3px; font-size: 13px; margin-top: 4px; }
.path-v .ic { width: 13px; height: 13px; color: var(--dim); }
.path-v code { flex-basis: 100%; margin-top: 4px; background: var(--surface); overflow-wrap: anywhere; }
.reading { display: grid; gap: 10px; place-items: center; padding: 30px 0; color: var(--dim); }
.skel { width: 100%; height: 38px; border-radius: 8px; background: linear-gradient(90deg, var(--surface-2), var(--line), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.2s infinite linear; }
.skel.short { width: 60%; }
@keyframes shimmer { to { background-position: -200% 0; } }
.pulse { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); margin-right: 6px; animation: pulse 1s infinite ease-in-out; vertical-align: 1px; }
.pulse.big { width: 16px; height: 16px; margin: 0; }
@keyframes pulse { 50% { opacity: .25; transform: scale(.7); } }
.proto-note { display: flex; gap: 10px; align-items: flex-start; margin-top: 20px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--accent-soft); font-size: 13px; color: var(--ink); }
.proto-note .ic { color: var(--accent); margin-top: 1px; }

/* ---------- documents ---------- */
.docs { display: grid; grid-template-columns: minmax(230px, 290px) minmax(0, 1fr); gap: 18px; align-items: start; }
.tree-wrap { padding: 12px; position: sticky; top: 18px; max-height: calc(100vh - 36px); overflow: auto; }
.tree { list-style: none; margin: 0; padding: 0 0 0 14px; }
.tree.d0 { padding-left: 0; }
.tree-n { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 6px; color: var(--ink); font-size: 13.5px; }
.tree-n:hover { background: var(--surface-2); }
.tree-n.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.tree-n .ic { width: 16px; height: 16px; color: var(--accent); }
.tree-n span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tree-n em { font: normal 11px var(--font-num); color: var(--dim); }
.crumbs { display: flex; align-items: center; gap: 4px; margin: 0; font-weight: 600; flex-wrap: wrap; }
.crumbs .ic { width: 14px; height: 14px; color: var(--dim); }
.file-cell { display: inline-flex; align-items: center; gap: 8px; }
.file-cell .ic { color: var(--accent); }

/* ---------- settings ---------- */
.settings { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 22px; align-items: start; }
.saved { display: inline-flex; align-items: center; gap: 6px; color: var(--good); font-size: 13px; font-weight: 600; opacity: 0; transition: opacity .2s; }
.saved.show { opacity: 1; }
.email-prev { white-space: pre-wrap; font: 13.5px/1.6 var(--font); background: var(--surface-2); padding: 16px; border-radius: var(--radius-sm); margin: 0; }
.sec-addr { display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: var(--radius-sm); background: var(--surface-2); margin-bottom: 8px; }
.sec-addr > div { flex: 1; }
.sec-addr > .ic { color: var(--accent); width: 22px; height: 22px; }
.steps { padding-left: 20px; margin: 0; display: grid; gap: 6px; font-size: 14px; }

/* ---------- modal, toast, palette, overlays ---------- */
#modal { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 16px; }
.modal-back { position: absolute; inset: 0; background: rgba(5, 11, 18, .55); backdrop-filter: blur(3px); }
.modal { position: relative; width: min(540px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: var(--surface); color: var(--ink); border-radius: var(--radius); box-shadow: 0 20px 60px rgba(0, 0, 0, .35); border: 1px solid var(--line); }
.modal.wide { width: min(860px, 100%); }
.modal.palette { align-self: start; margin-top: 12vh; }
.modal-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface); z-index: 1; }
.modal-head h2 { overflow-wrap: anywhere; }
.modal-body { padding: 20px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.pal { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 2px; }
.pal-i { display: flex; justify-content: space-between; align-items: center; width: 100%; padding: 10px 12px; border: 0; border-radius: 8px; background: transparent; color: var(--ink); font: inherit; cursor: pointer; text-align: left; }
.pal-i:hover, .pal-i.on { background: var(--accent-soft); }
.pal-i .ic { width: 15px; height: 15px; color: var(--dim); }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 140%); z-index: 70; display: flex; align-items: center; gap: 10px; max-width: min(560px, calc(100vw - 32px)); padding: 12px 18px; border-radius: 12px; background: #0b1724; color: #eef4fb; box-shadow: 0 10px 40px rgba(0, 0, 0, .3); font-size: 14px; opacity: 0; visibility: hidden; transition: transform .25s ease, opacity .2s, visibility .25s; }
.toast.show { transform: translate(-50%, 0); opacity: 1; visibility: visible; }
.toast .ic { color: #5bd69a; }
.toast.warn .ic { color: #ffb648; }
.drop-overlay { position: fixed; inset: 0; z-index: 80; display: none; place-items: center; background: rgba(18, 89, 195, .18); backdrop-filter: blur(2px); pointer-events: none; }
.drop-overlay > div { display: grid; gap: 6px; place-items: center; padding: 36px 48px; border: 2px dashed var(--accent); border-radius: 18px; background: var(--surface); color: var(--ink); box-shadow: 0 20px 60px rgba(0, 0, 0, .25); }
.drop-overlay .ic { width: 40px; height: 40px; color: var(--accent); }
.drop-overlay span { color: var(--dim); font-size: 13px; }
body.dragging .drop-overlay { display: grid; }
#print-area { display: none; }

/* ---------- login ---------- */
#login { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; position: relative; overflow: hidden; }
.login-bg { position: absolute; inset: 0; z-index: 0; }
.login-card { position: relative; z-index: 1; width: min(420px, 100%); padding: 34px 32px 22px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); box-shadow: 0 24px 70px rgba(0, 0, 0, .18); display: grid; gap: 16px; }
.login-card h1 { font-size: 22px; }
.login-brand { display: flex; align-items: center; gap: 12px; }
.login-mark { width: 44px; height: 44px; }
.login-name { font: 600 17px var(--font-head); }
.login-host { display: flex; align-items: center; gap: 5px; font: 12px var(--font-num); color: var(--good); }
.login-host .ic { width: 13px; height: 13px; }
.ms-btn { width: 100%; min-height: 46px; gap: 10px; font-weight: 600; }
.ms-btn .ms, .ms { width: 18px; height: 18px; }
.or { display: flex; align-items: center; gap: 12px; color: var(--dim); font-size: 12px; text-transform: uppercase; letter-spacing: .1em; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.code-in { font: 600 28px var(--font-num); letter-spacing: .5em; text-align: center; padding: 12px; }
.login-wait { display: grid; gap: 12px; place-items: center; text-align: center; padding: 20px 0; }
.login-foot { margin: 6px 0 0; font-size: 11.5px; color: var(--dim); text-align: center; }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .inbox { grid-template-columns: minmax(230px, 280px) minmax(0, 1fr); }
  .ib-fields { grid-column: 2; }
  .kinds { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .split.builder { grid-template-columns: minmax(0, 1fr); }
  .sticky { position: static; }
}
@media (max-width: 1100px) {
  .grid2, .grid2.wide-left { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 960px) {
  .kpis, .kpis.five { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid2, .grid2.wide-left, .split, .docs, .settings, .inbox { grid-template-columns: minmax(0, 1fr); }
  .ib-fields { grid-column: auto; }
  .tree-wrap { position: static; max-height: 280px; }
  .seg.vertical { flex-direction: row; flex-wrap: wrap; background: var(--surface-2); padding: 3px; }
}
@media (max-width: 860px) {
    .toast { bottom: calc(130px + env(safe-area-inset-bottom)); }
  #view { padding-bottom: 150px; }
}
@media (max-width: 640px) {
  #view { padding: 18px 16px 120px; }
  h1 { font-size: 23px; }
  .kpis.three { grid-template-columns: minmax(0, 1fr); }
  .kpi-v { font-size: 21px; }
  .row2, .row3 { grid-template-columns: minmax(0, 1fr); }
  .kinds { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tpls { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .search { min-width: 0; width: 100%; }
  .head-actions { width: 100%; }
  .head-actions .btn { flex: 1; }
  .doc { padding: 24px 20px 18px; aspect-ratio: auto; font-size: 11.5px; }
  .tpl-band .doc-band { margin: 0 -20px 22px; }
  .doc-meta, .doc-head { flex-direction: column; }
  .doc-title { text-align: left; }
  .doc-pay { grid-template-columns: minmax(0, 1fr); }
  .hbar { grid-template-columns: minmax(0, 1fr) auto; }
  .hbar-s { grid-column: 1 / -1; grid-row: 2; }
  .login-card { padding: 26px 20px 18px; }
}

/* ---------- the Signal look (from the prototype's signal.css) ---------- */
:root {
  color-scheme: light;
  --bg: #f1f6fc; --surface: #fff; --surface-2: #eef4fb; --ink: #0b1724; --dim: #55657a; --line: #d6e3f2;
  --accent: #1259c3; --accent-2: #2e8bff; --on-accent: #fff; --accent-soft: rgba(46, 139, 255, .1);
  --radius: 14px; --radius-sm: 10px; --shadow: 0 1px 2px rgba(6, 18, 38, .05), 0 8px 24px rgba(6, 18, 38, .06);
  --font: "IBM Plex Sans", Arial, sans-serif; --font-head: "IBM Plex Sans", Arial, sans-serif; --font-num: "IBM Plex Mono", Consolas, ui-monospace, monospace;
  --ch-a: #2e8bff; --ch-b: #b9cde4;
  --mark-a: #eef4fb; --mark-p: #6fb4ff;
  --grad: linear-gradient(90deg, #1259c3, #2e8bff 55%, #6fb4ff);
}
h1 { font-weight: 700; letter-spacing: -.02em; }
.eyebrow { color: var(--accent-2); }
.btn.primary { background: var(--grad); border: 0; box-shadow: 0 6px 18px rgba(46, 139, 255, .3); }
.kpi { border: 0; }
.kpi-accent { background: var(--grad); color: #fff; }
.kpi-accent .kpi-l, .kpi-accent .kpi-s, .kpi-accent .kpi-v { color: #fff; }
.card { border: 0; }
.seg { background: #fff; box-shadow: var(--shadow); }
.seg a.on { background: var(--grad); color: #fff; }
.seg.vertical { background: transparent; box-shadow: none; }
.kind.on { background: #fff; box-shadow: inset 0 0 0 2px var(--accent-2), var(--shadow); border-color: transparent; }
.drop { border-color: #b9cde4; background: linear-gradient(180deg, #fff, #f6faff); }
.drop-ic { width: 38px; height: 38px; padding: 8px; border-radius: 12px; background: var(--grad); color: #fff; }
.ib-item.on { background: #fff; border-color: var(--accent-2); box-shadow: inset 3px 0 0 var(--accent-2); }

/* shell */
.shell { display: grid; grid-template-columns: 84px minmax(0, 1fr); min-height: 100vh; }
.rail { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 16px 0; background: #061226; z-index: 30; }
.brand { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; background: rgba(255, 255, 255, .06); margin-bottom: 12px; }
.brand .mark { width: 30px; height: 30px; }
.rail .nav { display: grid; gap: 6px; }
.rail .nav a { position: relative; display: grid; place-items: center; gap: 2px; width: 64px; padding: 9px 0 7px; border-radius: 12px; color: #9db3cc; font-size: 10.5px; font-weight: 500; }
.rail .nav a:hover { color: #fff; background: rgba(255, 255, 255, .06); }
.rail .nav a.on { color: #fff; background: rgba(46, 139, 255, .22); }
.rail .nav a.on::before { content: ""; position: absolute; left: -10px; top: 12px; bottom: 12px; width: 3px; border-radius: 0 3px 3px 0; background: var(--grad); }
.rail .nav .ic { width: 21px; height: 21px; }
.badge { position: absolute; top: 4px; right: 8px; min-width: 17px; height: 17px; padding: 0 5px; border-radius: 9px; background: #6fb4ff; color: #061226; font: 700 10px/17px var(--font-num); text-align: center; }
.badge.bad { background: #ff7b72; color: #fff; }
.rail-out { margin-top: auto; color: #9db3cc; }
.rail-out:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.band { position: sticky; top: 0; z-index: 20; background: #061226; overflow: hidden; }
.band::before { content: ""; position: absolute; inset: 0; background: var(--grad); opacity: .92; }
.band-inner { position: relative; display: flex; align-items: center; gap: 14px; padding: 14px 32px; max-width: 1360px; margin: 0 auto; color: #fff; }
.band-title { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.band-k { font: 500 11px var(--font-num); letter-spacing: .1em; text-transform: uppercase; opacity: .75; }
.band-t { font-weight: 700; font-size: 18px; }
.band-search { display: flex; align-items: center; gap: 10px; height: 38px; padding: 0 8px 0 14px; border: 1px solid rgba(255, 255, 255, .3); border-radius: 10px; background: rgba(255, 255, 255, .14); color: #fff; font: 13.5px var(--font); cursor: pointer; min-width: 300px; }
.band-search:hover { background: rgba(255, 255, 255, .22); }
.band-search .nl { flex: 1; text-align: left; opacity: .9; }
kbd { font: 11px var(--font-num); padding: 2px 6px; border-radius: 4px; background: rgba(255, 255, 255, .2); }
.band-new { display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 14px; border-radius: 10px; background: #fff; color: #0b1724; font-weight: 600; font-size: 14px; box-shadow: 0 6px 16px rgba(6, 18, 38, .2); }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: #061226; color: #fff; font: 600 12px var(--font-num); border: 2px solid rgba(255, 255, 255, .5); }
.band-pulse { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 22px; opacity: .45; }
.band-pulse path { fill: none; stroke: #fff; stroke-width: 1.5; vector-effect: non-scaling-stroke; stroke-dasharray: 1400; stroke-dashoffset: 1400; animation: trace 4s ease-in-out infinite; }
@keyframes trace { 60%, 100% { stroke-dashoffset: 0; } }

/* login */
#login { background: #061226; }
.login-bg { background: radial-gradient(800px 500px at 20% 10%, rgba(46, 139, 255, .45), transparent 65%), radial-gradient(600px 400px at 90% 90%, rgba(111, 180, 255, .25), transparent 60%); }
.login-card { border: 0; }
.login-card::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 6px; border-radius: 18px 18px 0 0; background: var(--grad); }
.login-mark { padding: 8px; border-radius: 12px; background: #061226; }

@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .rail { position: fixed; top: auto; bottom: 0; left: 0; right: 0; height: auto; flex-direction: row; padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); z-index: 40; }
  .rail .brand, .rail-out { display: none; }
  .rail .nav { display: flex; width: 100%; justify-content: space-between; overflow-x: auto; }
  .rail .nav a { width: auto; flex: 1; min-width: 48px; }
  .rail .nav a.on::before { left: 30%; right: 30%; top: -6px; bottom: auto; width: auto; height: 3px; border-radius: 0 0 3px 3px; }
  .band-inner { padding: 12px 16px; gap: 8px; }
  .band-search { min-width: 0; padding: 0 10px; }
  .band-search .nl, .band-search kbd, .band-new .nl, .avatar { display: none; }
  .band-new { padding: 0 10px; }
}

/* ---------- the real build: what the prototype faked in script ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
fieldset.kind-body { display: grid; }
.kind { position: relative; }
.kind:has(input:checked) { background: #fff; box-shadow: inset 0 0 0 2px var(--accent-2), var(--shadow); border-color: transparent; }
.kind:has(input:focus-visible) { box-shadow: var(--focus); }
form.inline { display: inline; }
.band-search input { flex: 1; border: 0; background: transparent; color: #fff; font: inherit; min-height: 0; padding: 0; outline: none; }
.band-search input::placeholder { color: rgba(255, 255, 255, .85); }
.band-search:focus-within { box-shadow: 0 0 0 3px rgba(255, 255, 255, .35); }
.rail-out { border: 0; background: transparent; cursor: pointer; }
.flashes { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 70; display: grid; gap: 8px; width: max-content; max-width: min(620px, calc(100vw - 32px)); }
.flash { display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-radius: 12px; background: #0b1724; color: #eef4fb; box-shadow: 0 10px 40px rgba(0, 0, 0, .3); font-size: 14px; animation: flash-in .25s ease; }
.flash .ic { color: #5bd69a; }
.flash.warn .ic { color: #ffb648; }
.flash.gone { opacity: 0; transform: translateY(12px); transition: opacity .3s, transform .3s; }
.flash button { margin-left: auto; color: #9db3cc; }
@keyframes flash-in { from { opacity: 0; transform: translateY(12px); } }
.problems { margin: 0 0 16px; padding: 12px 16px; border-radius: var(--radius-sm); background: var(--bad-soft); color: var(--bad); font-size: 14px; }
.problems ul { margin: 4px 0 0; padding-left: 18px; }
.problems.soft { background: var(--warn-soft); color: var(--warn); }
.st-void { background: var(--surface-2); color: var(--dim); text-decoration: line-through; }
.st-draft { background: var(--warn-soft); color: var(--warn); }
.later { max-width: 640px; margin: 40px auto; text-align: center; display: grid; gap: 12px; place-items: center; }
.later .ic.big { width: 56px; height: 56px; color: var(--accent); opacity: 1; }
.doc-draft { position: absolute; top: 18px; right: 44px; font: 700 10px var(--font-num); letter-spacing: .12em; color: #a15c00; background: #fff4e5; padding: 3px 8px; border-radius: 4px; }
.doc-pay .doc-v { white-space: pre-line; }
.doc-v.notes { white-space: pre-line; }
.money-list { display: grid; gap: 2px; }
.qr { width: 200px; height: 200px; background: #fff; border-radius: 10px; padding: 6px; justify-self: center; border: 1px solid var(--line); }
.key { font: 600 14px var(--font-num); letter-spacing: .06em; text-align: center; overflow-wrap: anywhere; background: var(--surface-2); padding: 8px; border-radius: 8px; }
.codes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; padding: 0; margin: 0; list-style: none; font: 600 15px var(--font-num); text-align: center; }
.codes li { background: var(--surface-2); padding: 7px; border-radius: 6px; }
.compose textarea { min-height: 220px; font-family: var(--font); }
.attach { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface-2); font-size: 14px; }
.attach .ic { color: var(--accent); }
.payform summary { list-style: none; cursor: pointer; }
.payform summary::-webkit-details-marker { display: none; }
.payform[open] summary { margin-bottom: 12px; }
.danger-zone { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 4px; display: grid; gap: 8px; }
.inline-actions { display: flex; gap: 6px; align-items: center; }
.tpl input { position: absolute; opacity: 0; pointer-events: none; }
.tpl:has(input:checked) { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.tpl { position: relative; }
.switch-row input[type="checkbox"]:not(.switch) { width: auto; }
.list li .row-actions { display: flex; gap: 6px; }
.client .card-head { align-items: flex-start; }
.muted { color: var(--dim); }
.mt { margin-top: 18px; }
.phases tr.locked input { background: var(--surface-2); color: var(--dim); }
.phases td .chip { text-decoration: none; }
.rail-out-form { margin-top: auto; }
.ms-btn.muted { opacity: .65; }
@media (max-width: 860px) { .rail-out-form { display: none; } }
body.uploading, body.uploading * { cursor: progress; }
.range { align-items: center; }
.range input[type="date"] { width: auto; min-width: 150px; }
.chart svg { max-height: 260px; }
