/* Bahi — ledger-green on paper. Sidebar workspace; editor splits form | live A4 preview. */
:root {
  --bg: #F3F4F0;
  --surface: #FFFFFF;
  --surface-2: #F8F9F6;
  --ink: #15201C;
  --muted: #5B6862;
  --faint: #8A958F;
  --line: #DCE1DC;
  --line-strong: #C4CCC6;
  --accent: #0E6B57;
  --accent-ink: #FFFFFF;
  --accent-soft: #E1EFEA;
  --accent-hover: #0A5747;
  --good: #157A3E; --good-soft: #E3F3E8;
  --warn: #A15C07; --warn-soft: #FBF0DC;
  --bad: #B42318; --bad-soft: #FBE7E5;
  --info: #2F5BB7; --info-soft: #E6EDFA;
  --shadow: 0 1px 2px rgba(20,32,28,.06), 0 4px 16px rgba(20,32,28,.06);
  --shadow-lg: 0 12px 40px rgba(20,32,28,.18);
  --font-display: 'Bricolage Grotesque', 'IBM Plex Sans', system-ui, sans-serif;
  --font-body: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, Menlo, monospace;
  --r: 10px;
  --r-sm: 7px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0E1412; --surface: #151D1A; --surface-2: #1A2420; --ink: #E4EBE7; --muted: #9AA8A1; --faint: #6E7C75;
    --line: #26322D; --line-strong: #34433C; --accent: #3DB894; --accent-ink: #062019; --accent-soft: #163128; --accent-hover: #55C9A6;
    --good: #4CC17A; --good-soft: #15301F; --warn: #E3A548; --warn-soft: #33270F; --bad: #F07468; --bad-soft: #3A1A17; --info: #7EA2EC; --info-soft: #18243D;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 4px 16px rgba(0,0,0,.3); --shadow-lg: 0 12px 40px rgba(0,0,0,.55);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0E1412; --surface: #151D1A; --surface-2: #1A2420; --ink: #E4EBE7; --muted: #9AA8A1; --faint: #6E7C75;
  --line: #26322D; --line-strong: #34433C; --accent: #3DB894; --accent-ink: #062019; --accent-soft: #163128; --accent-hover: #55C9A6;
  --good: #4CC17A; --good-soft: #15301F; --warn: #E3A548; --warn-soft: #33270F; --bad: #F07468; --bad-soft: #3A1A17; --info: #7EA2EC; --info-soft: #18243D;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 4px 16px rgba(0,0,0,.3); --shadow-lg: 0 12px 40px rgba(0,0,0,.55);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--bg); color: var(--ink); font: 14px/1.5 var(--font-body); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--font-display); text-wrap: balance; margin: 0; letter-spacing: -.01em; }
h1 { font-size: 26px; font-weight: 700; }
h2 { font-size: 18px; font-weight: 650; }
h3 { font-size: 15px; font-weight: 600; }
.num, td.n, th.n { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.mono { font-family: var(--font-mono); font-size: .92em; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.ic { flex: none; vertical-align: -3px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ── Shell ── */
.app { display: grid; grid-template-columns: 232px 1fr; height: 100%; }
.sidebar { background: var(--surface); border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 18px 12px; gap: 4px; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 18px; }
.brand-mark { width: 34px; height: 34px; border-radius: 9px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font: 700 17px var(--font-display); }
.brand-name { font: 700 19px var(--font-display); line-height: 1; }
.brand-sub { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.nav-btn { display: flex; align-items: center; gap: 11px; width: 100%; border: 0; background: none; padding: 9px 12px; border-radius: 8px; cursor: pointer; color: var(--muted); font-weight: 500; text-align: left; }
.nav-btn:hover { background: var(--surface-2); color: var(--ink); }
.nav-btn.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.nav-sep { height: 1px; background: var(--line); margin: 10px 8px; }
.nav-cta { margin: 4px 0 10px; justify-content: center; }
.side-foot { margin-top: auto; padding: 12px 10px 0; font-size: 12px; color: var(--muted); display: grid; gap: 8px; }
.kbd { font: 11px var(--font-mono); border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 5px; padding: 0 5px; color: var(--muted); background: var(--surface-2); }
.store-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--faint); margin-right: 6px; }
.store-dot.cloud, .store-dot.server { background: var(--good); } .store-dot.local { background: var(--warn); } .store-dot.demo { background: var(--info); }

.main { overflow-y: auto; min-width: 0; height: 100%; display: flex; flex-direction: column; }
.view { padding: 26px 32px 60px; max-width: 1360px; width: 100%; margin: 0 auto; flex: 1; }
.view.wide { max-width: none; padding: 0; display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.banner { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 10px 32px; background: var(--info-soft); color: var(--ink); border-bottom: 1px solid var(--line); font-size: 13.5px; }
.banner strong { color: var(--info); }
.banner .grow { flex: 1; min-width: 220px; }
.banner.warn { background: var(--warn-soft); } .banner.warn strong { color: var(--warn); }

/* ── Controls ── */
.btn { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); padding: 7px 13px; border-radius: 8px; cursor: pointer; font-weight: 500; white-space: nowrap; transition: background .12s, border-color .12s; }
.btn:hover { background: var(--surface-2); border-color: var(--faint); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.danger { color: var(--bad); }
.btn.sm { padding: 4px 9px; font-size: 13px; border-radius: 7px; }
.btn.icon { padding: 6px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: 9px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: none; padding: 5px 11px; border-radius: 6px; cursor: pointer; color: var(--muted); font-weight: 500; font-size: 13px; }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); font-weight: 600; }

label.f { display: grid; align-content: start; gap: 4px; font-size: 12.5px; font-weight: 500; color: var(--muted); min-width: 0; }
.inp, select.inp, textarea.inp { width: 100%; border: 1px solid var(--line-strong); background: var(--surface); border-radius: var(--r-sm); padding: 7px 10px; color: var(--ink); font-size: 14px; min-width: 0; }
.inp:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.inp.bad { border-color: var(--bad); }
textarea.inp { resize: vertical; min-height: 64px; }
.hint { font-size: 12px; color: var(--faint); font-weight: 400; }
.hint.ok { color: var(--good); } .hint.err { color: var(--bad); }
.grid { display: grid; gap: 12px; }
.g2 { grid-template-columns: repeat(2, minmax(0,1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0,1fr)); } .g4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.gauto { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.span2 { grid-column: span 2; } .span3 { grid-column: span 3; } .spanall { grid-column: 1 / -1; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; cursor: pointer; color: var(--ink); }
.check input { width: 16px; height: 16px; accent-color: var(--accent); }

/* ── Cards / tiles ── */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.card-b { padding: 16px 18px; }
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 14px; margin-bottom: 18px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; display: grid; gap: 6px; }
.tile .lbl { font-size: 12.5px; color: var(--muted); font-weight: 500; display: flex; align-items: center; gap: 6px; }
.tile .val { font: 650 26px/1.1 var(--font-display); font-variant-numeric: tabular-nums; }
.tile .sub { font-size: 12.5px; color: var(--muted); }
.tile.alert .val { color: var(--bad); }
.dash-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 18px; }
.stack { display: grid; gap: 18px; align-content: start; }

.chart-wrap { position: relative; padding: 8px 18px 14px; }
.chart-wrap svg { display: block; width: 100%; height: 220px; overflow: visible; }
.chart-wrap .bar { fill: var(--accent); }
.chart-wrap .bar.cur { fill: var(--accent); }
.chart-wrap .bar.past { fill: var(--accent); opacity: .55; }
.chart-wrap .grid-l { stroke: var(--line); stroke-width: 1; }
.chart-wrap text { fill: var(--muted); font-size: 11px; font-family: var(--font-body); }
.chart-wrap .hit { fill: transparent; cursor: default; }
.chart-tip { position: absolute; pointer-events: none; background: var(--ink); color: var(--bg); font-size: 12px; padding: 6px 9px; border-radius: 6px; white-space: nowrap; transform: translate(-50%, -110%); opacity: 0; transition: opacity .1s; }
.chart-tip.on { opacity: 1; }

.due-list { display: grid; gap: 10px; }
.due { display: grid; grid-template-columns: 52px 1fr auto; gap: 12px; align-items: center; }
.due-date { border: 1px solid var(--line); border-radius: 8px; text-align: center; padding: 4px 0; line-height: 1.1; }
.due-date b { display: block; font: 700 18px var(--font-display); }
.due-date span { font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.due .t { font-weight: 600; } .due .s { font-size: 12.5px; color: var(--muted); }

.mini-list { display: grid; }
.mini-row { display: flex; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px dashed var(--line); font-size: 13.5px; }
.mini-row:last-child { border-bottom: 0; }
.bar-mini { height: 6px; border-radius: 3px; background: var(--accent-soft); margin-top: 5px; overflow: hidden; }
.bar-mini i { display: block; height: 100%; background: var(--accent); border-radius: 3px; }

/* ── Tables ── */
.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th { text-align: left; font-weight: 600; font-size: 12px; color: var(--muted); padding: 9px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--surface-2); position: sticky; top: 0; }
.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tbody tr:hover td { background: var(--surface-2); }
.tbl tr.click { cursor: pointer; }
.tbl tfoot td { font-weight: 650; background: var(--surface-2); border-bottom: 0; }
.tbl .acts { display: flex; gap: 2px; justify-content: flex-end; }
.tbl td.wrap { white-space: normal; min-width: 220px; }
.empty { padding: 48px 20px; text-align: center; color: var(--muted); display: grid; gap: 10px; justify-items: center; }
.empty h3 { color: var(--ink); }

.pill { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px 2px 7px; border-radius: 99px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.paid { background: var(--good-soft); color: var(--good); }
.pill.unpaid, .pill.issued { background: var(--info-soft); color: var(--info); }
.pill.partial { background: var(--warn-soft); color: var(--warn); }
.pill.overdue { background: var(--bad-soft); color: var(--bad); }
.pill.draft, .pill.cancelled { background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
.tag { display: inline-block; font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 5px; background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.tag.svc { background: var(--info-soft); color: var(--info); border-color: transparent; }
.tag.gds { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.rate { display: inline-block; min-width: 38px; text-align: center; font-weight: 600; font-size: 12px; padding: 1px 6px; border-radius: 5px; background: var(--surface-2); border: 1px solid var(--line); font-variant-numeric: tabular-nums; }

.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.search { position: relative; flex: 1; min-width: 200px; max-width: 380px; }
.search .ic { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--faint); }
.search .inp { padding-left: 34px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line-strong); background: var(--surface); border-radius: 99px; padding: 4px 11px; font-size: 12.5px; cursor: pointer; color: var(--muted); font-weight: 500; }
.chip.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* ── Editor ── */
.ed-top { display: flex; align-items: center; gap: 12px; padding: 12px 24px; border-bottom: 1px solid var(--line); background: var(--surface); flex-wrap: wrap; position: sticky; top: 0; z-index: 5; }
.ed-top .t { display: flex; align-items: center; gap: 10px; margin-right: auto; }
.ed-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(380px, 42%); flex: 1; min-height: 0; }
.ed-form { padding: 22px 24px 80px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; align-content: start; overflow-y: auto; min-width: 0; }
.ed-prev { background: var(--surface-2); border-left: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.prev-bar { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.prev-scroll { overflow: auto; padding: 22px; flex: 1; }
.paper-holder { margin: 0 auto; position: relative; }
.paper-holder > .inv-doc { transform-origin: top left; position: absolute; top: 0; left: 0; box-shadow: var(--shadow-lg); }
.tpl-row { display: flex; gap: 8px; overflow-x: auto; padding: 2px; }
.tpl-btn { border: 1px solid var(--line-strong); background: var(--surface); border-radius: 8px; padding: 6px 10px; cursor: pointer; font-size: 12.5px; font-weight: 500; color: var(--muted); display: flex; align-items: center; gap: 7px; white-space: nowrap; }
.tpl-btn i { width: 14px; height: 18px; border-radius: 2px; border: 1px solid var(--line-strong); background: linear-gradient(var(--sw, #999) 0 30%, #fff 30%); }
.tpl-btn.on { border-color: var(--accent); color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.swatches { display: flex; gap: 6px; }
.swatch { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--line-strong); cursor: pointer; }
.swatch.on { box-shadow: 0 0 0 2px var(--ink); }

.sec { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.sec-h { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--line); gap: 10px; flex-wrap: wrap; }
.sec-h h3 { display: flex; align-items: center; gap: 8px; }
.sec-b { padding: 14px 16px; display: grid; gap: 12px; }
details.sec > summary { list-style: none; cursor: pointer; }
details.sec > summary::-webkit-details-marker { display: none; }
details.sec > summary .chev { transition: transform .15s; }
details.sec[open] > summary .chev { transform: rotate(90deg); }
details.sec:not([open]) > summary { border-bottom: 0; }

.party-card { border: 1px dashed var(--line-strong); border-radius: 8px; padding: 10px 12px; font-size: 13px; color: var(--muted); display: grid; gap: 2px; }
.party-card b { color: var(--ink); font-size: 14px; }

.lines { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.lines th { font-size: 11.5px; font-weight: 600; color: var(--muted); text-align: left; padding: 0 6px 6px; white-space: nowrap; }
.lines th.n { text-align: right; }
.lines td { padding: 4px 3px; vertical-align: top; }
.lines .inp { padding: 6px 7px; font-size: 13.5px; }
.lines .inp.n { text-align: right; font-variant-numeric: tabular-nums; }
.lines .ln-idx { color: var(--faint); font-size: 12px; padding-top: 11px; text-align: center; width: 22px; }
.lines .ln-amt { padding-top: 10px; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.lines .ln-desc { margin-top: 4px; font-size: 12.5px; color: var(--muted); }
.lines tr.line td { border-bottom: 1px dashed var(--line); padding-bottom: 8px; }
.lines .x { opacity: .4; } .lines tr:hover .x { opacity: 1; }
.add-line { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }

.totals { display: grid; gap: 6px; font-size: 13.5px; }
.totals .r { display: flex; justify-content: space-between; gap: 12px; }
.totals .r span:last-child { font-variant-numeric: tabular-nums; }
.totals .grand { border-top: 1px solid var(--line); padding-top: 10px; margin-top: 4px; font: 700 20px var(--font-display); }
.words { font-size: 12.5px; color: var(--muted); font-style: italic; }
.tot-grid { display: grid; grid-template-columns: minmax(0,1fr) minmax(240px, 300px); gap: 20px; align-items: start; }

.mobile-tabs { display: none; }

/* ── Suggest dropdown ── */
.suggest { position: fixed; z-index: 60; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 9px; box-shadow: var(--shadow-lg); max-height: 320px; overflow-y: auto; min-width: 280px; padding: 4px; }
.sg-item { padding: 7px 10px; border-radius: 6px; cursor: pointer; display: grid; gap: 1px; font-size: 13px; }
.sg-item.on, .sg-item:hover { background: var(--accent-soft); }
.sg-item .a { display: flex; justify-content: space-between; gap: 10px; font-weight: 600; }
.sg-item .b { color: var(--muted); font-size: 12px; }
.sg-head { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); padding: 6px 10px 2px; font-weight: 600; }

/* ── Modal / toast / palette ── */
.overlay { position: fixed; inset: 0; background: rgba(10,18,15,.45); z-index: 50; display: grid; place-items: start center; padding: 6vh 16px; overflow-y: auto; animation: fade .12s; }
.modal { background: var(--surface); border-radius: 14px; box-shadow: var(--shadow-lg); width: 100%; max-width: 640px; border: 1px solid var(--line); }
.modal.lg { max-width: 820px; } .modal.sm { max-width: 440px; }
.modal-h { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); gap: 10px; }
.modal-b { padding: 18px 20px; display: grid; gap: 14px; }
.modal-f { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line); flex-wrap: wrap; }
@keyframes fade { from { opacity: 0; } }
.toasts { position: fixed; bottom: 20px; right: 20px; display: grid; gap: 8px; z-index: 70; }
.toast { background: var(--ink); color: var(--bg); padding: 10px 14px; border-radius: 9px; box-shadow: var(--shadow-lg); font-size: 13.5px; display: flex; align-items: center; gap: 9px; max-width: 380px; animation: fade .15s; }
.toast.err { background: var(--bad); color: #fff; }
.palette-list { max-height: 50vh; overflow-y: auto; display: grid; gap: 2px; }
.pal-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 7px; cursor: pointer; font-size: 13.5px; }
.pal-item.on { background: var(--accent-soft); }
.pal-item .k { margin-left: auto; color: var(--faint); font-size: 12px; }

/* ── Reports ── */
.rep-head { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.rep-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin: 18px 0 16px; overflow-x: auto; }
.rep-tabs button { border: 0; background: none; padding: 9px 14px; font-weight: 500; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.rep-tabs button.on { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.rep-sec { margin-bottom: 18px; }
.rep-sec .tbl td { white-space: nowrap; }
.rep-sec .card-h h3 small { font-weight: 400; color: var(--muted); font-family: var(--font-body); font-size: 12.5px; margin-left: 6px; }
.sumgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin-bottom: 18px; }
.sumcell { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; cursor: pointer; text-align: left; display: grid; gap: 2px; }
.sumcell:hover { border-color: var(--accent); }
.sumcell .k { font-size: 12px; color: var(--muted); font-weight: 600; }
.sumcell .v { font: 650 18px var(--font-display); font-variant-numeric: tabular-nums; }
.sumcell .s { font-size: 12px; color: var(--faint); }
.note { font-size: 12.5px; color: var(--muted); background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; display: flex; gap: 8px; align-items: flex-start; }
.note.warn { background: var(--warn-soft); border-color: transparent; color: var(--ink); }

.logo-drop { border: 1px dashed var(--line-strong); border-radius: 9px; padding: 12px; display: flex; align-items: center; gap: 12px; }
.logo-drop img { max-height: 48px; max-width: 120px; object-fit: contain; background: #fff; border-radius: 4px; }
.settings-grid { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 18px; align-items: start; }

#pdf-stage { position: fixed; left: -12000px; top: 0; pointer-events: none; }

/* ── Responsive ── */
@media (max-width: 1240px) {
  .view.wide { overflow: visible; }
  .ed-split { grid-template-columns: 1fr; }
  .ed-prev { border-left: 0; border-top: 1px solid var(--line); }
  .ed-split[data-mtab="edit"] .ed-prev { display: none; }
  .ed-split[data-mtab="preview"] .ed-form { display: none; }
  .mobile-tabs { display: inline-flex; }
  .ed-form { overflow: visible; }
}
@media (max-width: 1100px) { .tiles { grid-template-columns: repeat(2, minmax(0,1fr)); } .dash-grid, .settings-grid { grid-template-columns: 1fr; } }
@media (max-width: 820px) {
  .app { grid-template-columns: 1fr; grid-template-rows: 1fr auto; }
  .sidebar { order: 2; flex-direction: row; padding: 6px; border-right: 0; border-top: 1px solid var(--line); overflow-x: auto; gap: 2px; }
  .brand, .nav-sep, .side-foot, .nav-cta { display: none; }
  #nav { display: flex !important; gap: 2px; }
  .lines tr.line .inp { width: 100% !important; }
  .nav-btn { flex-direction: column; gap: 2px; font-size: 10.5px; padding: 6px 8px; min-width: 64px; align-items: center; }
  .view { padding: 18px 16px 40px; }
  .banner { padding: 10px 16px; }
  .ed-top, .ed-form { padding-left: 16px; padding-right: 16px; }
  .g3, .g4 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .tot-grid { grid-template-columns: 1fr; }
  .lines thead { display: none; }
  .lines tr.line { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 6px; padding: 10px 0; border-bottom: 1px dashed var(--line); }
  .lines tr.line td { border: 0; padding: 0; }
  .lines tr.line td.c-item { grid-column: 1 / -1; }
  .lines .ln-idx { display: none; }
}
@media (max-width: 480px) { .tiles, .g2, .g3, .g4 { grid-template-columns: 1fr; } .span2, .span3 { grid-column: auto; } }

/* ══════════════ Invoice documents (always printed on white) ══════════════ */
.inv-doc { width: 794px; min-height: 1123px; background: #fff; color: #1b1f1d; font: 12px/1.45 'IBM Plex Sans', Arial, sans-serif; padding: 40px 44px; display: flex; flex-direction: column; gap: 18px; --a: #0E6B57; --as: #E1EFEA; color-scheme: light; }
.inv-doc * { box-sizing: border-box; }
.inv-doc table { width: 100%; border-collapse: collapse; }
.inv-doc .n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.inv-doc .c { text-align: center; }
.inv-doc .lbl { font-size: 9.5px; text-transform: uppercase; letter-spacing: .08em; color: #6b736f; font-weight: 600; }
.inv-doc .d-head { display: flex; justify-content: space-between; gap: 24px; align-items: flex-start; }
.inv-doc .d-brand { display: flex; gap: 14px; align-items: flex-start; max-width: 62%; }
.inv-doc .d-logo { max-height: 60px; max-width: 140px; object-fit: contain; }
.inv-doc .d-seller { font: 700 18px/1.2 'Bricolage Grotesque', Arial, sans-serif; }
.inv-doc .d-addr { color: #4a524e; margin-top: 3px; white-space: pre-line; }
.inv-doc .d-ids { margin-top: 4px; font-weight: 600; }
.inv-doc .d-title { text-align: right; }
.inv-doc .d-type { font: 700 22px/1.1 'Bricolage Grotesque', Arial, sans-serif; letter-spacing: .02em; color: var(--a); }
.inv-doc .d-copy { font-size: 9.5px; letter-spacing: .1em; color: #6b736f; margin-top: 4px; font-weight: 600; }
.inv-doc .d-no { font-weight: 600; margin-top: 6px; font-size: 13px; }
.inv-doc .d-meta { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px 16px; }
.inv-doc .d-meta > div > div:last-child { font-weight: 600; margin-top: 2px; }
.inv-doc .d-parties { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.inv-doc .d-party .nm { font-weight: 700; font-size: 13px; margin-top: 3px; }
.inv-doc .d-party .ad { color: #4a524e; white-space: pre-line; }
.inv-doc .d-items th { font-size: 10px; text-transform: uppercase; letter-spacing: .05em; font-weight: 700; padding: 8px 8px; text-align: left; }
.inv-doc .d-items td { padding: 8px 8px; vertical-align: top; border-bottom: 1px solid #e6e9e7; }
.inv-doc .d-items .it { font-weight: 600; }
.inv-doc .d-items .ds { color: #6b736f; font-size: 11px; }
.inv-doc .d-sum { display: grid; grid-template-columns: 1fr 260px; gap: 24px; align-items: start; }
.inv-doc .d-totals .r { display: flex; justify-content: space-between; padding: 4px 0; }
.inv-doc .d-totals .g { font: 700 16px 'Bricolage Grotesque', Arial, sans-serif; border-top: 2px solid #1b1f1d; margin-top: 6px; padding-top: 8px; }
.inv-doc .d-words { font-style: italic; }
.inv-doc .d-taxtbl th, .inv-doc .d-taxtbl td { border: 1px solid #dfe3e0; padding: 4px 6px; font-size: 10.5px; }
.inv-doc .d-taxtbl th { background: #f5f7f6; font-weight: 600; }
.inv-doc .d-pay { display: flex; gap: 16px; align-items: flex-start; }
.inv-doc .d-qr { width: 92px; text-align: center; font-size: 9px; color: #6b736f; }
.inv-doc .d-qr img { width: 92px; height: 92px; display: block; }
.inv-doc .d-foot { display: grid; grid-template-columns: 1fr 220px; gap: 24px; margin-top: auto; align-items: end; }
.inv-doc .d-terms { white-space: pre-line; color: #4a524e; font-size: 11px; }
.inv-doc .d-sign { text-align: right; }
.inv-doc .d-sign img { max-height: 48px; max-width: 160px; display: block; margin: 6px 0 4px auto; }
.inv-doc .d-sign .sp { height: 50px; }
.inv-doc .d-fine { text-align: center; font-size: 9.5px; color: #8a918e; }
.inv-doc .d-stamp { display: inline-block; border: 2px solid; padding: 2px 10px; border-radius: 4px; font-weight: 700; letter-spacing: .12em; font-size: 11px; transform: rotate(-4deg); margin-top: 8px; }
.inv-doc .d-stamp.paid { color: #157A3E; } .inv-doc .d-stamp.draft { color: #8a918e; } .inv-doc .d-stamp.cancelled { color: #B42318; }
.inv-doc .d-rcm { font-size: 10.5px; font-weight: 600; color: #B42318; }

/* Modern */
.tpl-modern { border-top: 10px solid var(--a); }
.tpl-modern .d-items thead th { background: var(--as); color: #1b1f1d; }
.tpl-modern .d-items thead th:first-child { border-radius: 6px 0 0 6px; } .tpl-modern .d-items thead th:last-child { border-radius: 0 6px 6px 0; }
.tpl-modern .d-meta { background: #f6f8f7; border-radius: 8px; padding: 12px 14px; }
.tpl-modern .d-totals .g { background: var(--a); color: #fff; border: 0; border-radius: 6px; padding: 9px 10px; }

/* Classic GST (boxed, Tally-style) */
.tpl-classic { padding: 28px; gap: 0; font-size: 11.5px; }
.tpl-classic > section, .tpl-classic > header, .tpl-classic > table { border: 1px solid #222; border-top: 0; }
.tpl-classic .d-banner { border: 1px solid #222; text-align: center; padding: 6px; display: flex; justify-content: space-between; align-items: center; }
.tpl-classic .d-banner .d-type { color: #111; font-size: 17px; letter-spacing: .12em; }
.tpl-classic .d-banner .d-copy { margin: 0; }
.tpl-classic .d-head { padding: 12px; }
.tpl-classic .d-title { display: none; }
.tpl-classic .d-brand { max-width: 100%; }
.tpl-classic .d-meta { grid-template-columns: repeat(3, 1fr); gap: 0; }
.tpl-classic .d-meta > div { padding: 6px 10px; border-right: 1px solid #222; border-bottom: 1px solid #222; }
.tpl-classic .d-meta > div:nth-child(3n) { border-right: 0; }
.tpl-classic .d-meta { margin-bottom: -1px; }
.tpl-classic .d-parties { gap: 0; }
.tpl-classic .d-party { padding: 8px 10px; }
.tpl-classic .d-party + .d-party { border-left: 1px solid #222; }
.tpl-classic .d-items th { border-bottom: 1px solid #222; border-right: 1px solid #222; background: #f2f2f2; color: #111; font-size: 9.5px; }
.tpl-classic .d-items td { border-right: 1px solid #222; border-bottom: 0; padding: 5px 8px; }
.tpl-classic .d-items th:last-child, .tpl-classic .d-items td:last-child { border-right: 0; }
.tpl-classic .d-items tr.fill td { height: 60px; }
.tpl-classic .d-items tfoot td { border-top: 1px solid #222; font-weight: 700; }
.tpl-classic .d-sum { padding: 10px; gap: 14px; }
.tpl-classic .d-totals .g { border-top: 1px solid #222; }
.tpl-classic .d-foot { border: 1px solid #222; border-top: 0; padding: 10px; margin-top: 0; }
.tpl-classic .d-fine { margin-top: 8px; }
.tpl-classic .d-taxtbl th, .tpl-classic .d-taxtbl td { border-color: #222; }

/* Minimal */
.tpl-minimal { font-family: 'IBM Plex Serif', Georgia, serif; padding: 56px 60px; gap: 26px; }
.tpl-minimal .d-seller, .tpl-minimal .d-type, .tpl-minimal .d-totals .g { font-family: 'IBM Plex Serif', Georgia, serif; }
.tpl-minimal .d-type { color: #1b1f1d; font-weight: 400; font-size: 28px; letter-spacing: 0; }
.tpl-minimal .lbl { font-family: 'IBM Plex Sans', Arial, sans-serif; }
.tpl-minimal .d-items th { border-bottom: 1px solid #1b1f1d; font-family: 'IBM Plex Sans', Arial, sans-serif; color: #6b736f; }
.tpl-minimal .d-items td { border-bottom: 1px solid #eef0ef; }
.tpl-minimal .d-totals .g { border-top: 1px solid #1b1f1d; font-weight: 600; }
.tpl-minimal .accent-rule { height: 2px; width: 48px; background: var(--a); }

/* Bold */
.tpl-bold { padding: 0 0 36px; }
.tpl-bold > *:not(.d-head) { margin-left: 44px; margin-right: 44px; }
.tpl-bold > table { width: calc(100% - 88px); }
.tpl-bold .d-head { background: #14201c; color: #fff; padding: 34px 44px 28px; }
.tpl-bold .d-head .d-addr, .tpl-bold .d-head .d-copy { color: #c5cfca; }
.tpl-bold .d-type { color: #fff; font-size: 30px; }
.tpl-bold .d-no { color: var(--as); }
.tpl-bold .d-head .d-ids { color: #fff; }
.tpl-bold .d-strip { height: 6px; background: var(--a); margin: -18px 0 0 !important; }
.tpl-bold .d-items thead th { background: #14201c; color: #fff; }
.tpl-bold .d-totals .g { color: var(--a); border-top-color: var(--a); font-size: 20px; }
.tpl-bold .d-logo { background: #fff; padding: 4px; border-radius: 4px; }

/* Professional (letterhead, services-first) */
.tpl-professional { border-left: 14px solid var(--a); padding-left: 48px; }
.tpl-professional .d-type { color: #1b1f1d; font-size: 15px; letter-spacing: .3em; font-weight: 600; }
.tpl-professional .d-head { border-bottom: 1px solid #dfe3e0; padding-bottom: 18px; }
.tpl-professional .d-items thead th { border-bottom: 2px solid var(--a); color: var(--a); }
.tpl-professional .d-items td { padding: 10px 8px; }
.tpl-professional .d-totals .g { border-top-color: var(--a); color: var(--a); }

/* Thermal 80mm */
.inv-doc.tpl-thermal { width: 302px; min-height: 0; padding: 14px 12px 18px; font: 11px/1.4 'IBM Plex Mono', monospace; gap: 8px; }
.tpl-thermal .t-c { text-align: center; }
.tpl-thermal .t-big { font-weight: 700; font-size: 13px; }
.tpl-thermal .t-hr { border-top: 1px dashed #333; }
.tpl-thermal .t-row { display: flex; justify-content: space-between; gap: 8px; }
.tpl-thermal .t-item { display: grid; gap: 1px; }
.tpl-thermal .t-g { font-weight: 700; font-size: 14px; }
.tpl-thermal .d-qr { margin: 4px auto 0; }
.ed-form > * { min-width: 0; }

/* Template gallery */
.modal.xl { max-width: 1100px; }
.tpl-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; }
.tpl-gallery.sm { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.tpl-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; display: flex; flex-direction: column; text-align: left; padding: 0; cursor: default; transition: border-color .12s, box-shadow .12s; }
button.tpl-card { cursor: pointer; }
.tpl-card:hover { border-color: var(--line-strong); }
.tpl-card.on { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.tthumb { position: relative; height: 300px; overflow: hidden; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.tthumb.lg { height: 400px; cursor: zoom-in; }
.tthumb > .inv-doc { box-shadow: var(--shadow-lg); pointer-events: none; }
.tpl-meta { padding: 12px 14px 14px; display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.tpl-meta b { color: var(--ink); font-size: 14.5px; display: flex; gap: 8px; align-items: center; }

/* Colour themes (app UI) */
:root[data-accent="indigo"] { --accent: #3B4FC4; --accent-soft: #E7EAFA; --accent-hover: #2F3FA3; --accent-ink: #fff; }
:root[data-accent="plum"] { --accent: #7B3F9E; --accent-soft: #F1E6F7; --accent-hover: #63307F; --accent-ink: #fff; }
:root[data-accent="saffron"] { --accent: #C2570C; --accent-soft: #FBEADB; --accent-hover: #A04709; --accent-ink: #fff; }
:root[data-accent="ocean"] { --accent: #0B6E99; --accent-soft: #DFF0F7; --accent-hover: #085A7D; --accent-ink: #fff; }
:root[data-accent="graphite"] { --accent: #3A4248; --accent-soft: #E6E9EA; --accent-hover: #2A3035; --accent-ink: #fff; }
@media (prefers-color-scheme: dark) { :root[data-accent="indigo"]:not([data-theme="light"]) { --accent: #8C9BF2; --accent-soft: #1C2348; --accent-hover: #A6B2F6; --accent-ink: #0b0f0e; } }
:root[data-theme="dark"][data-accent="indigo"] { --accent: #8C9BF2; --accent-soft: #1C2348; --accent-hover: #A6B2F6; --accent-ink: #0b0f0e; }
@media (prefers-color-scheme: dark) { :root[data-accent="plum"]:not([data-theme="light"]) { --accent: #C597E0; --accent-soft: #2E1B3A; --accent-hover: #D4AEEA; --accent-ink: #0b0f0e; } }
:root[data-theme="dark"][data-accent="plum"] { --accent: #C597E0; --accent-soft: #2E1B3A; --accent-hover: #D4AEEA; --accent-ink: #0b0f0e; }
@media (prefers-color-scheme: dark) { :root[data-accent="saffron"]:not([data-theme="light"]) { --accent: #F29A55; --accent-soft: #3A2312; --accent-hover: #F6B27E; --accent-ink: #0b0f0e; } }
:root[data-theme="dark"][data-accent="saffron"] { --accent: #F29A55; --accent-soft: #3A2312; --accent-hover: #F6B27E; --accent-ink: #0b0f0e; }
@media (prefers-color-scheme: dark) { :root[data-accent="ocean"]:not([data-theme="light"]) { --accent: #4FB6E0; --accent-soft: #0F2C38; --accent-hover: #77C8E9; --accent-ink: #0b0f0e; } }
:root[data-theme="dark"][data-accent="ocean"] { --accent: #4FB6E0; --accent-soft: #0F2C38; --accent-hover: #77C8E9; --accent-ink: #0b0f0e; }
@media (prefers-color-scheme: dark) { :root[data-accent="graphite"]:not([data-theme="light"]) { --accent: #B5C0C6; --accent-soft: #252B2F; --accent-hover: #CDD5DA; --accent-ink: #0b0f0e; } }
:root[data-theme="dark"][data-accent="graphite"] { --accent: #B5C0C6; --accent-soft: #252B2F; --accent-hover: #CDD5DA; --accent-ink: #0b0f0e; }

.theme-btn { justify-content: flex-start; width: 100%; }
.theme-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.lbl-sm { font-size: 12.5px; font-weight: 600; color: var(--muted); margin-bottom: 8px; }
.theme-modes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.theme-mode { border: 1px solid var(--line-strong); background: var(--surface); border-radius: 10px; padding: 10px; cursor: pointer; display: grid; gap: 3px; text-align: left; font-size: 12px; color: var(--muted); }
.theme-mode b { color: var(--ink); font-size: 13.5px; }
.theme-mode.on { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.tm-prev { height: 46px; border-radius: 6px; display: grid; grid-template-columns: 30% 1fr; grid-template-rows: 1fr 1fr; gap: 4px; padding: 5px; margin-bottom: 4px; border: 1px solid var(--line); }
.tm-prev i:first-child { grid-row: span 2; border-radius: 3px; }
.tm-prev i { border-radius: 3px; }
.tm-light { background: #F3F4F0; } .tm-light i { background: #fff; } .tm-light i:nth-child(2) { background: var(--accent); }
.tm-dark { background: #0E1412; } .tm-dark i { background: #1A2420; } .tm-dark i:nth-child(2) { background: var(--accent); }
.tm-system { background: linear-gradient(135deg, #F3F4F0 50%, #0E1412 50%); } .tm-system i { background: rgba(127,127,127,.35); } .tm-system i:nth-child(2) { background: var(--accent); }
.theme-accents { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.theme-acc { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line-strong); background: var(--surface); border-radius: 9px; padding: 8px 10px; cursor: pointer; font-size: 13px; font-weight: 500; }
.theme-acc span { width: 16px; height: 16px; border-radius: 50%; flex: none; }
.theme-acc.on { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
@media (max-width: 480px) { .theme-modes, .theme-accents { grid-template-columns: 1fr 1fr; } }

/* Report groups */
.rep-groups { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.rep-group { display: flex; align-items: center; gap: 12px; text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: var(--r); padding: 12px 14px; cursor: pointer; color: var(--ink); }
.rep-group:hover { border-color: var(--line-strong); }
.rep-group.on { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.rep-group b { display: block; font-size: 15px; font-family: var(--font-display); }
.rep-group small { color: var(--muted); font-size: 12.5px; }
.rg-n { font: 600 12px var(--font-mono); color: var(--faint); }
.rg-ic { width: 36px; height: 36px; border-radius: 9px; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); flex: none; }
.rep-group.on .rg-ic { background: var(--accent); color: var(--accent-ink); }
@media (max-width: 700px) { .rep-groups { grid-template-columns: 1fr; } }

/* Section tabs, breadcrumb, payment summary */
.sec-tabs { margin: -6px 0 20px; }
.crumb { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); margin-bottom: 4px; }
.vsum { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.vsum > div { background: var(--surface-2); border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px; display: grid; gap: 2px; font-size: 12.5px; color: var(--muted); }
.vsum b { font: 650 17px var(--font-display); color: var(--ink); font-variant-numeric: tabular-nums; }
.vsum .bad { background: var(--bad-soft); } .vsum .bad b { color: var(--bad); }
@media (max-width: 600px) { .vsum { grid-template-columns: 1fr; } }
.qsel { width: auto; padding: 3px 6px; font-size: 12.5px; }
.tbl td.mono { white-space: nowrap; }

/* ── Site, auth and admin pages ── */
.center-page { min-height: 100%; display: grid; place-items: center; padding: 32px 16px; }
.panel { width: 100%; max-width: 440px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 28px; box-shadow: var(--shadow); display: grid; gap: 14px; }
.panel h1 { font-size: 24px; }
.brandline { display: flex; align-items: center; gap: 10px; }
.tag.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.err-msg { color: var(--bad); font-size: 13px; min-height: 18px; }
.ok-msg { color: var(--good); font-size: 13px; }
.site-nav { display: flex; align-items: center; justify-content: space-between; padding: 18px 32px; max-width: 1180px; margin: 0 auto; }
.site-wrap { max-width: 1180px; margin: 0 auto; padding: 8px 32px 64px; }
.hero { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 40px; align-items: start; padding: 28px 0 40px; }
.hero h1 { font-size: 44px; line-height: 1.08; font-weight: 700; }
.hero .lead { font-size: 17px; color: var(--muted); max-width: 54ch; margin: 14px 0 22px; }
.feat { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 22px; margin: 0; padding: 0; list-style: none; }
.feat li { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; }
.feat li .ic { color: var(--accent); margin-top: 2px; }
.plan-card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 22px; box-shadow: var(--shadow); display: grid; gap: 10px; }
.plan-price { font: 700 38px var(--font-display); font-variant-numeric: tabular-nums; }
.plan-price small { font: 500 14px var(--font-body); color: var(--muted); }
.signup { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
.signup h2 { font-size: 20px; }
.signup .step { padding: 20px 22px; border-bottom: 1px solid var(--line); display: grid; gap: 12px; }
.signup .step:last-child { border-bottom: 0; }
.step-n { font: 600 12px var(--font-mono); color: var(--accent); letter-spacing: .06em; text-transform: uppercase; }
.slug-field { display: flex; align-items: stretch; }
.slug-field .inp { border-radius: var(--r-sm) 0 0 var(--r-sm); }
.slug-field span { border: 1px solid var(--line-strong); border-left: 0; background: var(--surface-2); padding: 7px 10px; border-radius: 0 var(--r-sm) var(--r-sm) 0; color: var(--muted); white-space: nowrap; font-size: 14px; }
.steps-flow { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 26px; }
.steps-flow div { border-top: 2px solid var(--accent); padding-top: 10px; font-size: 13.5px; color: var(--muted); }
.steps-flow b { display: block; color: var(--ink); font-size: 14px; margin-bottom: 2px; }
.admin-shell { max-width: 1320px; margin: 0 auto; padding: 22px 28px 60px; }
.admin-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 6px 14px; font-size: 13.5px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; word-break: break-word; }
.copyline { display: flex; gap: 8px; align-items: center; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; font: 12px var(--font-mono); word-break: break-all; }
pre.mail { white-space: pre-wrap; font: 12.5px/1.5 var(--font-mono); background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin: 6px 0 0; }
@media (max-width: 900px) { .hero { grid-template-columns: 1fr; } .hero h1 { font-size: 34px; } .steps-flow, .feat { grid-template-columns: 1fr 1fr; } .site-nav, .site-wrap { padding-left: 16px; padding-right: 16px; } }
@media (max-width: 520px) { .steps-flow, .feat { grid-template-columns: 1fr; } }

a.btn { text-decoration: none; }

/* My Bahi Books: site footer and policy pages */
.site-foot { max-width: 1180px; margin: 40px auto 0; padding: 22px 32px 36px; border-top: 1px solid var(--line); display: flex; gap: 16px; justify-content: space-between; flex-wrap: wrap; color: var(--muted); font-size: 13px; }
.site-foot nav { display: flex; gap: 18px; flex-wrap: wrap; }
.site-foot a, .legal a { color: var(--accent); }
.legal { max-width: 760px; margin: 0 auto; padding: 8px 32px 24px; line-height: 1.65; }
.legal h1 { font-family: var(--font-display); font-size: 30px; margin: 10px 0 4px; }
.legal h2 { font-size: 17px; margin: 26px 0 6px; }
.legal p, .legal li { color: var(--ink-2, var(--ink)); }
.legal .upd { color: var(--muted); font-size: 13px; }
.legal .tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 6px 0 18px; }
.legal .tabs a { padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; font-size: 13px; color: var(--ink); }
.legal .tabs a.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
