/* Ledgeron - application styles */
:root {
  --ink: #0f1c2a;
  --ink-2: #1b2b3c;
  --ink-3: #2a3d52;
  --brand: #b8632b;        /* copper */
  --brand-soft: #f6e9df;
  --primary: #1f5f6b;      /* deep teal */
  --primary-hover: #184d57;
  --primary-soft: #e3f0f1;
  --bg: #f4f5f7;
  --panel: #ffffff;
  --panel-2: #f9fafb;
  --line: #e2e5ea;
  --line-2: #d3d8df;
  --text: #1c2430;
  --text-2: #4a5566;
  --text-3: #7a8495;
  --ok: #1d7a4c;  --ok-soft: #e4f4ec;
  --warn: #a8670f; --warn-soft: #fdf2df;
  --err: #b4332a;  --err-soft: #fbe7e5;
  --info: #3b5ba9; --info-soft: #e8edf9;
  --input: #1d4ed8; /* blue = input values (Draftworx convention) */
  --radius: 8px;
  --radius-sm: 5px;
  --shadow: 0 1px 2px rgba(15, 28, 42, .06), 0 4px 16px rgba(15, 28, 42, .06);
  --shadow-lg: 0 12px 48px rgba(15, 28, 42, .22);
  --font: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --mono: "Cascadia Mono", "Consolas", ui-monospace, "SFMono-Regular", monospace;
  --paper-font: "Calibri", "Carlito", "Segoe UI", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 13.5px/1.45 var(--font); color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--primary); }
.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.mono { font-family: var(--mono); font-size: 12px; }
.muted { color: var(--text-3); }
.hidden { display: none !important; }
.grow { flex: 1; }
.row { display: flex; align-items: center; gap: 8px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.svg { width: 16px; height: 16px; flex: none; display: inline-block; vertical-align: -3px; }

/* ---------- buttons & inputs ---------- */
.btn { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: var(--radius-sm);
  border: 1px solid var(--line-2); background: var(--panel); cursor: pointer; white-space: nowrap; font-weight: 500; }
.btn:hover { background: var(--panel-2); border-color: #bfc6d0; }
.btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-hover); }
.btn.danger { color: var(--err); }
.btn.danger.solid { background: var(--err); color: #fff; border-color: var(--err); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: rgba(15, 28, 42, .06); }
.btn.sm { height: 26px; padding: 0 8px; font-size: 12.5px; }
.btn.icon { width: 32px; padding: 0; justify-content: center; }
.btn-group { display: inline-flex; }
.btn-group .btn { border-radius: 0; margin-left: -1px; }
.btn-group .btn:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); margin-left: 0; }
.btn-group .btn:last-child { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.btn-group .btn.on { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); z-index: 1; }

.input, select.input, textarea.input { height: 32px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: #fff; min-width: 0; }
textarea.input { height: auto; padding: 8px 10px; resize: vertical; }
.input:focus, .btn:focus-visible, select:focus { outline: 2px solid rgba(31, 95, 107, .35); outline-offset: 0; border-color: var(--primary); }
.field { display: flex; flex-direction: column; gap: 4px; }
.field > label { font-size: 12px; font-weight: 600; color: var(--text-2); }
.field .hint { font-size: 12px; color: var(--text-3); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px 18px; }
.search { position: relative; }
.search .svg { position: absolute; left: 9px; top: 8px; color: var(--text-3); }
.search .input { padding-left: 30px; width: 260px; }

/* ---------- pills / badges ---------- */
.pill { display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 7px; border-radius: 10px; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.err { background: var(--err-soft); color: var(--err); }
.pill.info { background: var(--info-soft); color: var(--info); }
.pill.neutral { background: #eef0f3; color: var(--text-2); }
.pill.brand { background: var(--brand-soft); color: var(--brand); }
.badge { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.badge.warn { background: var(--warn); color: #fff; }
.badge.err { background: var(--err); color: #fff; }
.badge.neutral { background: #dfe3e8; color: var(--text-2); }

/* ---------- top bar ---------- */
.topbar { height: 48px; background: var(--ink); color: #e8edf3; display: flex; align-items: center; gap: 14px; padding: 0 14px; flex: none; }
.brandmark { display: flex; align-items: center; gap: 9px; font-weight: 700; letter-spacing: .02em; color: #fff; text-decoration: none; }
.brandmark .logo { width: 26px; height: 26px; }
.brandmark small { font-weight: 500; color: #8fa1b5; letter-spacing: 0; }
.topbar .sep { width: 1px; height: 24px; background: #2b3e52; }
.topbar .btn.ghost { color: #d5dde6; }
.topbar .btn.ghost:hover { background: #1f3145; }
.topbar .ctx { display: flex; align-items: center; gap: 8px; min-width: 0; }
.topbar .ctx .cname { font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 360px; }
.topbar select.yearsel { background: #1b2b3c; border: 1px solid #2f4357; color: #fff; height: 30px; border-radius: 5px; padding: 0 8px; }
.gotobtn { display: flex; align-items: center; gap: 8px; height: 30px; padding: 0 10px; width: 300px; white-space: nowrap; overflow: hidden; border-radius: 6px; border: 1px solid #2f4357; background: #172636; color: #8fa1b5; cursor: pointer; }
.gotobtn kbd { margin-left: auto; font: 11px var(--font); padding: 1px 5px; border-radius: 4px; background: #24384c; color: #a9b8c8; }
.usermenu { display: flex; align-items: center; gap: 8px; }
.avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--brand); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 12px; }

/* ---------- workspace layout ---------- */
.shell { height: 100vh; display: flex; flex-direction: column; }
.ws { flex: 1; display: grid; grid-template-columns: 250px 1fr 290px; min-height: 0; }
.ws.status-collapsed { grid-template-columns: 250px 1fr 44px; }
.nav { background: var(--panel); border-right: 1px solid var(--line); overflow: auto; padding: 8px 0 16px; }
.nav h4 { margin: 14px 14px 4px; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); display: flex; align-items: center; gap: 6px; }
.nav .item { display: flex; align-items: center; gap: 8px; padding: 5px 12px 5px 16px; cursor: pointer; color: var(--text); border-left: 3px solid transparent; user-select: none; }
.nav .item:hover { background: var(--panel-2); }
.nav .item.active { background: var(--primary-soft); border-left-color: var(--primary); color: var(--primary); font-weight: 600; }
.nav .item .svg { color: var(--text-3); }
.nav .item.active .svg { color: var(--primary); }
.nav .item .label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav .item.future { color: var(--text-3); cursor: default; }
.nav .item.future:hover { background: transparent; }
.nav .item .phase { font-size: 10px; font-weight: 600; color: var(--text-3); border: 1px solid var(--line-2); border-radius: 4px; padding: 0 4px; }
.signoff { display: inline-flex; gap: 1px; }
.signoff i { width: 7px; height: 7px; border-radius: 50%; border: 1.5px solid #c6ccd4; display: inline-block; }
.signoff i.done { background: var(--ok); border-color: var(--ok); }

.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.tabs { display: flex; align-items: flex-end; gap: 2px; padding: 6px 8px 0; background: #eceef2; border-bottom: 1px solid var(--line); overflow-x: auto; flex: none; scrollbar-width: thin; }
.tab { display: flex; align-items: center; gap: 6px; height: 32px; padding: 0 8px 0 12px; border: 1px solid transparent; border-bottom: none; border-radius: 7px 7px 0 0; cursor: pointer; color: var(--text-2); white-space: nowrap; max-width: 240px; }
.tab:hover { background: #e2e5ea; }
.tab.active { background: var(--panel); border-color: var(--line); color: var(--text); font-weight: 600; margin-bottom: -1px; height: 33px; }
.tab .x { width: 20px; height: 20px; border-radius: 4px; display: inline-flex; align-items: center; justify-content: center; color: var(--text-3); }
.tab .x:hover { background: #d9dde3; color: var(--text); }
.doc { flex: 1; overflow: auto; background: var(--panel); position: relative; }
.toolbar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 8px; padding: 10px 16px; background: rgba(255, 255, 255, .96); border-bottom: 1px solid var(--line); backdrop-filter: blur(4px); flex-wrap: wrap; }
.toolbar h2 { margin: 0 8px 0 0; font-size: 15px; font-weight: 650; white-space: nowrap; }
.doc-body { padding: 16px; }

/* ---------- status panel ---------- */
.status { background: var(--panel); border-left: 1px solid var(--line); overflow: auto; display: flex; flex-direction: column; }
.status header { display: flex; align-items: center; gap: 8px; padding: 12px 14px 10px; border-bottom: 1px solid var(--line); }
.status header h3 { margin: 0; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-2); flex: 1; }
.check { display: flex; gap: 10px; padding: 9px 14px; border-bottom: 1px solid #f0f2f5; }
.check.click { cursor: pointer; }
.check.click:hover { background: var(--panel-2); }
.check .ico { width: 20px; height: 20px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; flex: none; margin-top: 1px; }
.check.ok .ico { background: var(--ok-soft); color: var(--ok); }
.check.warn .ico { background: var(--warn-soft); color: var(--warn); }
.check.error .ico { background: var(--err-soft); color: var(--err); }
.check.info .ico { background: var(--info-soft); color: var(--info); }
.check .t { font-weight: 600; font-size: 13px; }
.check .d { font-size: 12px; color: var(--text-2); margin-top: 1px; }
.check .go { margin-left: auto; color: var(--text-3); align-self: center; }
.status .summary { padding: 12px 14px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; border-bottom: 1px solid var(--line); }
.kpi { background: var(--panel-2); border: 1px solid var(--line); border-radius: 6px; padding: 7px 9px; }
.kpi .k { font-size: 11px; color: var(--text-3); text-transform: uppercase; letter-spacing: .04em; }
.kpi .v { font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
.status .sect { padding: 10px 14px 4px; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); font-weight: 600; }
.status.collapsed > :not(header) { display: none; }
.status.collapsed header h3, .status.collapsed header .pill { display: none; }
.status.collapsed header { flex-direction: column; padding: 10px 6px; }

.statusbar { height: 26px; background: var(--ink-2); color: #b6c3d1; font-size: 12px; display: flex; align-items: center; gap: 0; padding: 0 6px; flex: none; }
.statusbar > span { padding: 0 10px; border-right: 1px solid #2c3f53; display: inline-flex; align-items: center; gap: 6px; height: 100%; }
.statusbar b { color: #fff; font-weight: 600; }
.statusbar .dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.dot.ok { background: #3fbf7f; } .dot.warn { background: #f0a43a; } .dot.err { background: #ef5b4f; }

/* ---------- tables ---------- */
table.grid { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
table.grid th { position: sticky; top: var(--sticky-top, 53px); z-index: 2; background: #f3f5f8; text-align: left; font-weight: 600; font-size: 12px; color: var(--text-2); padding: 7px 10px; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
table.grid td { padding: 6px 10px; border-bottom: 1px solid #edf0f3; vertical-align: middle; }
table.grid tr:hover td { background: #fafbfc; }
table.grid tr.sel td { background: var(--primary-soft); }
table.grid tfoot td { position: sticky; bottom: 0; background: #f3f5f8; font-weight: 700; border-top: 1px solid var(--line-2); }
table.grid .num { text-align: right; }
table.grid th.num { text-align: right; }
table.grid td.code { color: var(--text-2); }
.amt-neg { color: var(--text); }
.adj { color: var(--input); font-weight: 600; }
.empty { padding: 48px 24px; text-align: center; color: var(--text-2); }
.empty .big { font-size: 16px; font-weight: 650; color: var(--text); margin-bottom: 6px; }

/* ---------- code picker / popovers ---------- */
.codecell { display: flex; align-items: center; gap: 6px; min-width: 260px; cursor: pointer; border: 1px solid transparent; border-radius: 5px; padding: 3px 6px; }
.codecell:hover { border-color: var(--line-2); background: #fff; }
.codecell .lbl { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.codecell .c { font-family: var(--mono); font-size: 11px; color: var(--text-3); }
.codecell.unmapped .lbl { color: var(--warn); font-weight: 600; }
.popover { position: fixed; z-index: 1000; background: #fff; border: 1px solid var(--line-2); border-radius: 8px; box-shadow: var(--shadow-lg); width: 460px; max-height: 420px; display: flex; flex-direction: column; overflow: hidden; }
.popover .ph { padding: 8px; border-bottom: 1px solid var(--line); }
.popover .ph .input { width: 100%; }
.popover .pl { overflow: auto; padding: 4px 0; }
.popover .grp { padding: 6px 12px 2px; font-size: 11px; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: .04em; }
.popover .opt { display: flex; gap: 10px; padding: 5px 12px; cursor: pointer; align-items: baseline; }
.popover .opt .c { font-family: var(--mono); font-size: 11px; color: var(--text-3); margin-left: auto; white-space: nowrap; }
.popover .opt.hl { background: var(--primary-soft); }
.popover .pf { padding: 6px 10px; border-top: 1px solid var(--line); font-size: 12px; color: var(--text-3); display: flex; gap: 8px; }

.sugg { max-width: 210px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; }
.conf { display: inline-flex; align-items: center; gap: 6px; }
.conf .bar { width: 38px; height: 5px; border-radius: 3px; background: #e6e9ee; overflow: hidden; }
.conf .bar i { display: block; height: 100%; }

/* ---------- modal ---------- */
.overlay { position: fixed; inset: 0; background: rgba(15, 28, 42, .45); z-index: 900; display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px; overflow: auto; animation: fade .12s ease-out; }
.modal { background: #fff; border-radius: 10px; box-shadow: var(--shadow-lg); width: 560px; max-width: 100%; display: flex; flex-direction: column; animation: pop .14s ease-out; }
.modal.wide { width: 1040px; }
.modal.mid { width: 760px; }
.modal header { padding: 16px 20px 12px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.modal header h3 { margin: 0; font-size: 16px; flex: 1; }
.modal .body { padding: 18px 20px; }
.modal footer { padding: 12px 20px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; align-items: center; background: var(--panel-2); border-radius: 0 0 10px 10px; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { transform: translateY(6px) scale(.99); opacity: 0; } }

.steps { display: flex; gap: 6px; align-items: center; font-size: 12px; color: var(--text-3); }
.steps .s { display: inline-flex; align-items: center; gap: 6px; }
.steps .s b { width: 20px; height: 20px; border-radius: 50%; background: #e6e9ee; color: var(--text-2); display: inline-flex; align-items: center; justify-content: center; font-size: 11px; }
.steps .s.on { color: var(--text); font-weight: 600; }
.steps .s.on b { background: var(--primary); color: #fff; }
.steps .s.done b { background: var(--ok); color: #fff; }

.presets { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.preset { border: 1px solid var(--line-2); border-radius: 7px; padding: 10px 12px; cursor: pointer; background: #fff; text-align: left; }
.preset:hover { border-color: var(--primary); }
.preset.on { border-color: var(--primary); background: var(--primary-soft); box-shadow: inset 0 0 0 1px var(--primary); }
.preset .n { font-weight: 650; }
.preset .h { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.drop { border: 2px dashed var(--line-2); border-radius: 10px; padding: 28px; text-align: center; color: var(--text-2); cursor: pointer; background: var(--panel-2); }
.drop.over { border-color: var(--primary); background: var(--primary-soft); }
.drop .big { font-size: 15px; font-weight: 650; color: var(--text); }

.preview-wrap { max-height: 340px; overflow: auto; border: 1px solid var(--line); border-radius: 6px; }
table.preview { border-collapse: collapse; font-size: 12px; min-width: 100%; }
table.preview th { position: sticky; top: 0; background: #fff; padding: 6px; border-bottom: 1px solid var(--line-2); z-index: 1; }
table.preview th select { width: 100%; min-width: 100px; height: 26px; font-size: 12px; border: 1px solid var(--line-2); border-radius: 4px; }
table.preview th select.set { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); font-weight: 600; }
table.preview td { padding: 3px 8px; border-bottom: 1px solid #f0f2f5; white-space: nowrap; max-width: 280px; overflow: hidden; text-overflow: ellipsis; }
table.preview td.rn { color: var(--text-3); background: #fafbfc; text-align: right; font-size: 11px; cursor: pointer; }
table.preview tr.hdr td { background: #fff4e5; font-weight: 700; }
table.preview tr.skip td:not(.rn) { color: #b5bcc6; }
.sumbox { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }

/* ---------- toasts ---------- */
.toasts { position: fixed; bottom: 38px; left: 50%; transform: translateX(-50%); z-index: 2000; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast { background: var(--ink); color: #fff; padding: 9px 14px; border-radius: 7px; box-shadow: var(--shadow-lg); display: flex; gap: 8px; align-items: center; animation: pop .15s ease-out; max-width: 560px; }
.toast.err { background: var(--err); }
.toast.ok .svg { color: #6fe0a6; }

/* ---------- company select ---------- */
.home { flex: 1; overflow: auto; }
.home-inner { max-width: 1180px; margin: 0 auto; padding: 28px 24px 48px; }
.home h1 { font-size: 22px; margin: 0; }
.home .sub { color: var(--text-2); margin: 4px 0 18px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); }
.cards3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 18px; }
.qa { padding: 16px; display: flex; gap: 12px; align-items: flex-start; cursor: pointer; transition: border-color .12s, transform .12s; }
.qa:hover { border-color: var(--primary); transform: translateY(-1px); }
.qa .ic { width: 38px; height: 38px; border-radius: 9px; display: flex; align-items: center; justify-content: center; flex: none; }
.qa .ic .svg { width: 20px; height: 20px; }
.qa .t { font-weight: 650; }
.qa .d { color: var(--text-2); font-size: 12.5px; margin-top: 2px; }
.co-table { --sticky-top: 0px; }
.co-table td { padding: 9px 10px; }
.co-table tr { cursor: pointer; }
.co-name { font-weight: 600; }
.co-code { font-family: var(--mono); font-size: 12px; background: #eef1f4; padding: 2px 6px; border-radius: 4px; }
.actionbar { display: flex; gap: 8px; padding: 12px 14px; border-top: 1px solid var(--line); background: var(--panel-2); border-radius: 0 0 10px 10px; flex-wrap: wrap; align-items: center; }
.tablehead { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }

/* ---------- statements (paper) ---------- */
.paper-wrap { background: #e9ebef; padding: 24px; min-height: 100%; }
.paper { background: #fff; width: 794px; max-width: 100%; margin: 0 auto; padding: 56px 64px 64px; box-shadow: 0 1px 3px rgba(0,0,0,.12), 0 8px 30px rgba(0,0,0,.08); font-family: var(--paper-font); font-size: 13.5px; color: #111; min-height: 1000px; }
.paper .ent { font-size: 15px; font-weight: 700; }
.paper .regno { font-size: 12px; color: #444; }
.paper h1 { font-size: 15.5px; margin: 6px 0 0; font-weight: 700; }
.paper .stsub { font-size: 13px; margin-bottom: 22px; }
.paper .draft { position: relative; }
table.stmt { width: 100%; border-collapse: collapse; }
table.stmt th { font-weight: 700; text-align: right; padding: 3px 0 6px 12px; font-size: 13px; }
table.stmt th.lbl { text-align: left; }
table.stmt td { padding: 3px 0 3px 12px; }
table.stmt td.lbl { padding-left: 0; }
table.stmt td.v { text-align: right; width: 118px; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.stmt td.note { width: 48px; text-align: center; color: #666; }
table.stmt tr.heading td { font-weight: 700; font-size: 14px; padding-top: 14px; }
table.stmt tr.subheading td { font-weight: 700; padding-top: 10px; }
table.stmt tr.subheading.minor td { font-weight: 600; font-style: italic; }
table.stmt tr.line td.lbl { padding-left: 0; }
table.stmt tr.line.detail td.lbl { padding-left: 14px; }
table.stmt tr.line { cursor: pointer; }
table.stmt tr.line:hover td { background: #f3f8f9; }
table.stmt tr.total td.v { border-top: 1px solid #111; font-weight: 700; }
table.stmt tr.total.subtotal td.v { font-weight: 700; }
table.stmt tr.total.grand td { font-weight: 700; }
table.stmt tr.total.grand td.v { border-top: 1px solid #111; border-bottom: 3px double #111; }
table.stmt tr.total td.lbl { font-weight: 700; }
table.stmt tr.flag td { background: #fff6e6; color: #8a5300; }
table.stmt tr.spacer td { height: 8px; }
.paper .codes { font-family: var(--mono); font-size: 10px; color: #8a94a3; margin-left: 6px; }
.paper .foot { margin-top: 36px; padding-top: 8px; border-top: 1px solid #ddd; font-size: 11px; color: #777; display: flex; justify-content: space-between; }
.watermark { position: absolute; top: 260px; left: 0; right: 0; text-align: center; font-size: 110px; font-weight: 800; color: rgba(184, 99, 43, .07); transform: rotate(-24deg); pointer-events: none; letter-spacing: .1em; }

.drill { width: 100%; }
.drill table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.drill td, .drill th { padding: 4px 10px; border-bottom: 1px solid #f0f2f5; }
.drill th { text-align: left; font-size: 11.5px; color: var(--text-3); }

/* ---------- lead sheets ---------- */
.ls { border: 1px solid var(--line); border-radius: 8px; margin-bottom: 10px; background: #fff; overflow: hidden; }
.ls > .h { display: flex; align-items: center; gap: 10px; padding: 9px 12px; cursor: pointer; background: var(--panel-2); }
.ls > .h .t { font-weight: 650; flex: 1; }
.ls > .h .v { width: 130px; text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.ls.open > .h { border-bottom: 1px solid var(--line); }
.ls table.grid th { position: static; }
.ls table.grid td:first-child, .drill td:first-child { min-width: 260px; }
.ls.hl { box-shadow: 0 0 0 2px var(--brand); }

/* ---------- journals ---------- */
.jcard { border: 1px solid var(--line); border-radius: 8px; margin-bottom: 12px; overflow: hidden; }
.jcard.deleted { opacity: .55; }
.jcard .jh { display: flex; gap: 10px; align-items: center; padding: 9px 12px; background: var(--panel-2); border-bottom: 1px solid var(--line); }
.jcard .jno { font-weight: 700; font-family: var(--mono); }
.jcard .jd { flex: 1; color: var(--text-2); }
.jcard table.grid th { position: static; }
.jlines td .input { width: 100%; height: 30px; }
.jlines td.amt .input { text-align: right; font-variant-numeric: tabular-nums; }
.acctpick { display: flex; align-items: center; height: 30px; border: 1px solid var(--line-2); border-radius: 5px; padding: 0 8px; cursor: pointer; background: #fff; gap: 6px; overflow: hidden; white-space: nowrap; }
.acctpick .muted { overflow: hidden; text-overflow: ellipsis; }

/* ---------- forms in docs ---------- */
.form-card { max-width: 900px; }
.section-title { font-size: 13px; font-weight: 700; margin: 22px 0 10px; color: var(--text); display: flex; align-items: center; gap: 8px; }
.section-title:first-child { margin-top: 0; }
.people td .input { width: 100%; height: 30px; }

/* ---------- palette ---------- */
.palette { width: 620px; margin-top: 8vh; }
.palette .input { height: 46px; font-size: 16px; border: none; border-bottom: 1px solid var(--line); border-radius: 10px 10px 0 0; padding: 0 16px; width: 100%; }
.palette .input:focus { outline: none; }
.palette .res { max-height: 420px; overflow: auto; padding: 6px 0; }
.palette .r { display: flex; align-items: center; gap: 10px; padding: 8px 16px; cursor: pointer; }
.palette .r .k { margin-left: auto; font-size: 11.5px; color: var(--text-3); }
.palette .r.hl { background: var(--primary-soft); }

/* ---------- print: statements only ---------- */
@media print {
  @page { size: A4; margin: 14mm; }
  body { background: #fff; }
  .topbar, .nav, .tabs, .status, .statusbar, .toolbar, .toasts { display: none !important; }
  .shell, .ws, .main, .doc { display: block !important; height: auto !important; overflow: visible !important; }
  .paper-wrap { background: #fff; padding: 0; }
  .paper { box-shadow: none; width: auto; padding: 0; min-height: 0; }
  table.stmt tr.line:hover td { background: none; }
}

@media (max-width: 1180px) {
  .ws { grid-template-columns: 220px 1fr 44px; }
  .cards3 { grid-template-columns: 1fr; }
}

/* ---------- AFS documents (screen) ---------- */
.afs-hint { display: flex; gap: 8px; align-items: center; padding: 7px 16px; font-size: 12.5px; color: var(--text-2); background: #f7f9fb; border-bottom: 1px solid var(--line); }
.paper.afs { margin-bottom: 24px; position: relative; min-height: 0; padding-bottom: 48px; }
.paper.afs .watermark { top: 300px; }
.paper.afs.sec-cover { padding: 0; }
.paper.afs.sec-cover .foot { display: none; }
.cover { min-height: 1060px; box-sizing: border-box; display: flex; flex-direction: column; padding: 120px 72px 64px; border-left: 34px solid var(--brand); }
.cover-name { font-size: 30px; font-weight: 700; line-height: 1.15; }
.cover-reg { font-size: 14px; color: #555; margin-top: 10px; }
.cover-mid { margin-top: 170px; }
.cover-t { font-size: 24px; font-weight: 600; }
.cover-y { font-size: 16px; margin-top: 8px; }
.cover-bot { margin-top: auto; font-size: 12.5px; color: #333; display: flex; flex-direction: column; gap: 6px; border-top: 1px solid #bbb; padding-top: 14px; }
.paper h1.afs-title { font-size: 16px; margin: 10px 0 18px; padding-bottom: 6px; border-bottom: 1px solid #111; }
.paper .stsub { margin: -10px 0 16px; font-size: 13px; }
.paper h2.afs-n { font-size: 14.5px; margin: 26px 0 8px; display: flex; gap: 14px; }
.paper h2.afs-n .num, .paper h3.afs-sub .num { min-width: 34px; }
.paper h3.afs-sub { font-size: 14px; margin: 18px 0 6px; display: flex; gap: 14px; }
.paper h3.afs-h { font-size: 13.5px; margin: 14px 0 4px; }
.paper p.afs-p { margin: 0 0 10px; text-align: justify; line-height: 1.5; }
.paper p.afs-p.strong { font-weight: 700; }
.paper .pol p.afs-p, .paper .pol .afs-h, .paper .note p.afs-p, .paper .note .afs-h { padding-left: 48px; }
.paper .note > table, .paper .note .tsub, .paper .note .blk > table { margin-left: 48px; width: calc(100% - 48px); }
.paper .tsub { font-weight: 700; margin: 12px 0 4px; }
.paper table.stmt td.note { width: 54px; }
.paper table.stmt tr.click { cursor: pointer; }
.paper table.stmt tr.click:hover td { background: #f3f8f9; }
.paper table.stmt tr.plain td { font-style: italic; }
.paper table.stmt tr.strong td { font-weight: 700; }
.paper table.stmt th.small { font-size: 11px; font-weight: 600; }
.paper table.stmt th.grp { text-align: center; border-bottom: 1px solid #999; }
.paper table.ppe td.v { width: auto; font-size: 12.5px; }
.paper table.soce th.v { font-size: 12px; }
.paper table.soce tr.soce-sub td.v, .paper table.soce tr.soce-close td.v { border-top: 1px solid #111; font-weight: 700; }
.paper table.soce tr.soce-close td { font-weight: 700; padding-bottom: 12px; }
.paper table.soce tr.soce-close td.v { border-bottom: 3px double #111; }
.paper table.soce tr.soce-warn td { color: var(--err); font-style: italic; }
.paper table.afs-kv { width: 100%; border-collapse: collapse; margin: 4px 0 12px; }
.paper table.afs-kv td, .paper table.afs-kv th { padding: 5px 12px 5px 0; text-align: left; vertical-align: top; }
.paper table.afs-kv th { border-bottom: 1px solid #999; }
.paper table.afs-kv td.k { width: 250px; font-weight: 600; }
.paper table.lives { margin-left: 48px; width: calc(100% - 48px); }
.paper table.lives tr.editable-row { cursor: pointer; }
.paper table.lives tr.editable-row:hover td { background: #f3f8f9; }
.paper table.lives tr.edited-row td { color: var(--input); }
.paper table.idx { width: 100%; border-collapse: collapse; }
.paper table.idx td { padding: 6px 0; border-bottom: 1px dotted #bbb; }
.paper table.idx .v { text-align: right; width: 60px; color: #888; }
.paper .sigs { display: flex; flex-wrap: wrap; gap: 48px; margin-top: 44px; }
.paper .sig { width: 230px; }
.paper .sigline { border-bottom: 1px solid #111; height: 40px; margin-bottom: 6px; width: 230px; }
.paper .csign { margin-top: 36px; line-height: 1.6; }
.paper .letterhead { display: block; max-width: 100%; max-height: 120px; margin: 0 auto 24px; }
.paper .lh-hint { border: 1px dashed var(--line-2); border-radius: 6px; padding: 10px; text-align: center; color: var(--text-3); font-size: 12px; margin-bottom: 18px; font-family: var(--font); }
.paper .muted-p { color: #666; font-size: 12px; }
.paper .pref-s { color: #999; background: #f1f2f4; border-radius: 3px; padding: 0 4px; font-size: 11px; font-family: var(--font); }
.paper .unk { color: var(--err); }
.paper .hint-p { font-family: var(--font); font-size: 12px; color: var(--text-3); text-align: left; }
.paper td.v.auto { color: #6b7280; font-style: italic; cursor: pointer; text-decoration: underline dotted #b8bec8; text-underline-offset: 3px; }
.paper td.v.inp { color: var(--input); font-weight: 700; cursor: pointer; background: #eef3ff; }
.paper td.v.auto:hover, .paper td.v.inp:hover { outline: 1px solid var(--input); }
.swatch { display: inline-block; width: 12px; height: 10px; border-radius: 2px; vertical-align: 0; }
.swatch.auto { background: #e5e7eb; border: 1px dashed #9ca3af; }
.swatch.inp { background: #eef3ff; border: 1px solid var(--input); }
.paper tr.flag td { background: #fff1f0; }

/* editable blocks */
.blk, .blk-note { position: relative; border-radius: 4px; margin: 0 -8px; padding: 1px 8px; }
.blk:hover, .blk-note:hover { background: #f6f9fb; box-shadow: inset 0 0 0 1px #dfe7ec; }
.blk.edited { box-shadow: inset 3px 0 0 var(--input); }
.blk.custom { box-shadow: inset 3px 0 0 var(--brand); }
.blk.conflict { box-shadow: inset 3px 0 0 var(--warn); background: #fffaf0; }
.blk.is-hidden, .blk.is-auto-off, .blk-note.is-hidden { opacity: .45; }
.blk.is-hidden p, .blk.is-hidden h3 { text-decoration: line-through; }
.blk-tag { position: absolute; top: 2px; left: -96px; width: 86px; text-align: right; font: 600 10.5px var(--font); color: var(--text-3); }
.blk-tag.warn { color: var(--warn); }
.blk-tools, .note-tools { position: absolute; top: -12px; right: 4px; display: none; gap: 2px; background: #fff; border: 1px solid var(--line-2); border-radius: 6px; padding: 2px; box-shadow: var(--shadow); z-index: 4; }
.note-tools { top: 18px; }
.blk:hover > .blk-tools, .blk-note:hover > .note-tools { display: flex; }
.blk-note:hover .blk > .blk-tools { display: none; }
.blk-note .blk:hover > .blk-tools { display: flex; }
.bt { width: 26px; height: 24px; border: none; background: none; border-radius: 4px; cursor: pointer; color: var(--text-2); display: inline-flex; align-items: center; justify-content: center; }
.bt:hover { background: var(--primary-soft); color: var(--primary); }
.blk-editor { margin: 6px -8px 12px; padding: 10px; border: 1px solid var(--primary); border-radius: 6px; background: #fff; font-family: var(--font); box-shadow: 0 0 0 3px rgba(31, 95, 107, .12); }
.blk-editor textarea { font: 13.5px/1.5 var(--paper-font); }
.chips { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; margin-top: 6px; font-size: 12px; }
.chip { height: 22px; padding: 0 7px; border-radius: 11px; border: 1px solid var(--line-2); background: #f7f8fa; font: 11.5px var(--mono); cursor: pointer; display: inline-flex; align-items: center; gap: 3px; color: var(--text-2); }
.chip:hover { border-color: var(--primary); color: var(--primary); }
.chip .svg { width: 12px; height: 12px; }

/* output page */
.out-card { display: flex; gap: 14px; align-items: center; padding: 14px 16px; margin-bottom: 10px; }
.out-card .ic { width: 40px; height: 40px; border-radius: 9px; background: var(--primary-soft); color: var(--primary); display: flex; align-items: center; justify-content: center; flex: none; }
.out-card .t { font-weight: 650; }
.out-card .d { color: var(--text-2); font-size: 12.5px; }
.banner { display: flex; gap: 8px; align-items: center; padding: 10px 14px; border-radius: 8px; margin-bottom: 12px; font-weight: 600; }
.banner.ok { background: var(--ok-soft); color: var(--ok); }
.banner.err { background: var(--err-soft); color: var(--err); }
.clip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 460px; color: var(--text-2); }
.lh-preview { border: 1px dashed var(--line-2); border-radius: 8px; padding: 14px; text-align: center; background: #fafbfc; min-height: 60px; display: flex; align-items: center; justify-content: center; }
.lh-preview img { max-width: 100%; max-height: 140px; }

/* ---------- Phase 3: sign-offs, review notes, working papers ---------- */
.nav h4.fold { cursor: pointer; user-select: none; margin-left: 8px; }
.nav h4.fold:hover { color: var(--text); }
.nav h4.fold .svg { width: 13px; height: 13px; }
.nav .item .wpref { font: 600 10.5px var(--mono); color: var(--text-3); width: 34px; flex: none; }
.nav .item.active .wpref { color: var(--primary); }
.signoff { display: inline-flex; gap: 2px; align-items: center; margin-left: 2px; }
.signoff i { width: 7px; height: 7px; border-radius: 50%; border: 1.5px solid #c6ccd4; display: inline-block; }
.signoff i.done { background: var(--ok); border-color: var(--ok); }
.signoff i.stale { background: var(--warn); border-color: var(--warn); }
.signoff .rn-dot { font-size: 10px; min-width: 15px; height: 15px; line-height: 15px; border-radius: 8px; background: #7c3aed; color: #fff; text-align: center; margin-left: 3px; font-weight: 700; }
.so-bar { display: inline-flex; gap: 6px; align-items: center; margin-left: 8px; padding-left: 10px; border-left: 1px solid var(--line); }
.so-pill { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 9px; border-radius: 13px; border: 1px dashed var(--line-2); background: #fff; font-size: 12px; cursor: pointer; color: var(--text-2); white-space: nowrap; }
.so-pill:disabled { opacity: .45; cursor: default; }
.so-pill .so-dot { width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid #b8c0ca; }
.so-pill.so-ok { border-style: solid; border-color: #9fd3b6; background: var(--ok-soft); color: var(--ok); font-weight: 600; }
.so-pill.so-ok .so-dot { background: var(--ok); border-color: var(--ok); }
.so-pill.so-stale { border-style: solid; border-color: #f0c98a; background: var(--warn-soft); color: var(--warn); font-weight: 600; }
.so-pill.so-stale .so-dot { background: var(--warn); border-color: var(--warn); }
.so-pill .so-who { font-weight: 500; opacity: .85; }
.so-notes { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 9px; border-radius: 13px; border: 1px solid var(--line-2); background: #fff; font-size: 12px; cursor: pointer; color: var(--text-2); }
.so-notes.has { background: #f3e8ff; border-color: #c4a6f2; color: #6d28d9; font-weight: 600; }
.so-notes .svg { width: 13px; height: 13px; }
.rn-card { border: 1px solid var(--line); border-left: 4px solid var(--warn); border-radius: 7px; padding: 9px 11px; margin-bottom: 8px; background: #fff; }
.rn-card.rn-cleared { border-left-color: var(--info); }
.rn-card.rn-closed { border-left-color: var(--ok); opacity: .8; }
.rn-text { margin: 6px 0 4px; white-space: pre-wrap; }
.rn-resp { background: var(--panel-2); border-radius: 5px; padding: 6px 8px; font-size: 12.5px; margin-bottom: 4px; white-space: pre-wrap; }
.rn-doc { font-weight: 600; font-size: 12.5px; }
.rn-card textarea { flex: 1 1 260px; min-height: 30px; }
.mini { display: block; height: 4px; background: #e6e9ee; border-radius: 2px; overflow: hidden; margin: 3px 0 2px; width: 100%; }
.mini i { display: block; height: 100%; background: var(--ok); }

.paper.wp { font-family: var(--font); font-size: 13.5px; padding: 40px 48px 56px; min-height: 0; margin-bottom: 24px; }
.wp-head { display: flex; gap: 14px; align-items: flex-start; border-bottom: 2px solid var(--ink); padding-bottom: 12px; margin-bottom: 12px; }
.wp-ref { font: 700 20px var(--mono); color: #fff; background: var(--ink); border-radius: 6px; padding: 6px 10px; }
.wp-title { font-size: 19px; font-weight: 700; }
.wp-client { color: var(--text-2); }
.wp-signs { display: flex; gap: 8px; }
.wp-sign { border: 1px solid var(--line); border-radius: 6px; padding: 4px 8px; font-size: 11.5px; display: flex; flex-direction: column; min-width: 110px; color: var(--text-3); }
.wp-sign b { color: var(--text); font-size: 12.5px; }
.wp-sign.ok { border-color: #9fd3b6; background: var(--ok-soft); }
.wp-sign.stale { border-color: #f0c98a; background: var(--warn-soft); }
.wp-obj { background: var(--panel-2); border: 1px solid var(--line); border-radius: 6px; padding: 9px 12px; color: var(--text-2); margin-bottom: 12px; }
.wp-progress { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--text-2); margin: 6px 0 10px; }
.wp-progress .bar { width: 180px; height: 6px; background: #e6e9ee; border-radius: 3px; overflow: hidden; }
.wp-progress .bar i { display: block; height: 100%; background: var(--primary); }
.wp-h { font-size: 14px; margin: 20px 0 8px; padding-bottom: 4px; border-bottom: 1px solid var(--line); }
.wp-q { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid #f0f2f5; }
.wp-q.is-no { background: #fff8f7; }
.wp-q.na { opacity: .55; }
.wp-qn { width: 26px; flex: none; font-weight: 700; color: var(--text-3); text-align: right; padding-top: 1px; }
.wp-qn.dc-ref { width: 92px; font: 600 11px var(--mono); color: var(--primary); text-align: left; padding-top: 3px; }
.wp-qt { font-weight: 500; display: flex; gap: 6px; align-items: flex-start; }
.wp-help { font-size: 12.5px; color: var(--text-2); background: #f6f8fa; border-left: 3px solid var(--line-2); padding: 6px 10px; margin: 6px 0; }
.wp-t { margin: 10px 0 14px; }
.wp-t .wp-qt { margin-bottom: 6px; }
.wp-c { flex: 1; min-height: 30px; resize: vertical; font-size: 13px; padding: 5px 8px; }
.wp-concl { margin-top: 16px; display: flex; flex-direction: column; gap: 8px; }
.seg { display: inline-flex; flex: none; }
.seg-b { height: 30px; padding: 0 11px; border: 1px solid var(--line-2); background: #fff; cursor: pointer; font-size: 12.5px; font-weight: 600; color: var(--text-2); margin-left: -1px; }
.seg-b:first-child { border-radius: 5px 0 0 5px; margin-left: 0; }
.seg-b:last-child { border-radius: 0 5px 5px 0; }
.seg-b:disabled { cursor: default; opacity: .6; }
.seg-b.on.yes { background: var(--ok); border-color: var(--ok); color: #fff; z-index: 1; }
.seg-b.on.no { background: var(--err); border-color: var(--err); color: #fff; z-index: 1; }
.seg-b.on.na { background: #6b7280; border-color: #6b7280; color: #fff; z-index: 1; }
.ev { display: flex; gap: 6px; align-items: flex-start; font-size: 12.5px; padding: 5px 9px; border-radius: 5px; margin-top: 6px; }
.ev .svg { margin-top: 1px; }
.ev.ok { background: var(--ok-soft); color: var(--ok); }
.ev.bad { background: var(--err-soft); color: var(--err); }
.ev.na { background: #f1f3f5; color: var(--text-2); }
.wp-tab { width: 100%; border-collapse: collapse; }
.wp-tab td { padding: 9px 8px 9px 0; border-bottom: 1px solid #f0f2f5; vertical-align: middle; }
.wp-tab td:last-child { text-align: right; width: 200px; }
.pis-out { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 8px; margin: 14px 0 4px; }
.pis-out .svg { width: 20px; height: 20px; margin-top: 1px; }
.pis-out.ok { background: var(--ok-soft); color: var(--ok); }
.pis-out.bad { background: var(--warn-soft); color: var(--warn); }
.pis-out.na { background: var(--info-soft); color: var(--info); }
.pis-out div div { color: var(--text); margin-top: 2px; }
.paper.wp table.grid th { position: static; }
.wp-an tr.grp td { background: #f3f5f8; font-weight: 700; font-size: 12px; color: var(--text-2); }
.wp-an tr.flag td { background: #fff6e6; }
.wp-an tr.flag-ok td { background: #f2fbf6; }
.flagdot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--warn); margin-right: 7px; }
.wp-an tr.flag-ok .flagdot { background: var(--ok); }
.wp-ratios { max-width: 520px; }
.wp-j { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin-bottom: 10px; }
.wp-j table.grid { margin-top: 6px; }
.comp-list { display: flex; flex-direction: column; gap: 6px; }
.comp-i { display: flex; gap: 10px; align-items: center; padding: 9px 12px; border: 1px solid var(--line); border-radius: 7px; }
.comp-i:hover { background: var(--panel-2); }
.comp-i .ico { width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.comp-i.ok .ico { background: var(--ok-soft); color: var(--ok); }
.comp-i.bad .ico { background: var(--err-soft); color: var(--err); }
.comp-i .t { font-weight: 600; }
.comp-i .d { font-size: 12px; color: var(--text-2); }
.so-cell { font-size: 12px; }
.so-cell.ok { color: var(--ok); font-weight: 600; }
.so-cell.stale { color: var(--warn); font-weight: 600; }
.so-cell.none { color: var(--text-3); }
.paper .afs-p.pre { white-space: pre-line; }
.paper .lsign { margin-top: 30px; line-height: 1.6; }
@media print {
  .paper.wp { padding: 0; }
  .so-bar, .chip, .bt { display: none !important; }
  .wp-q, .comp-i, .wp-j, table.grid tr { break-inside: avoid; }
}

/* ---------- Phase 4: lock banner, roll forward, activity ---------- */
.lockbar { display: flex; align-items: center; gap: 10px; padding: 8px 14px; background: #fff4e0; color: #7a4a06; border-bottom: 1px solid #f0d199; font-size: 13px; flex: none; }
.lockbar .svg { color: var(--warn); }
.rf-box { border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; background: var(--panel-2); }
.rf-box ul { margin: 6px 0 0; padding-left: 18px; color: var(--text-2); }
.rf-box li { margin: 2px 0; }
table.grid tr.undone td { color: var(--text-3); text-decoration: line-through; text-decoration-color: #c3c8cf; }
table.grid tr.undone td:last-child { text-decoration: none; }

.paper th.fin-col { color: var(--input); border-left: 1px dashed var(--line-2); }

/* ---------- help ---------- */
.help-drawer { position: fixed; top: 0; right: 0; bottom: 0; width: 440px; max-width: 100vw; background: #fff; box-shadow: var(--shadow-lg); z-index: 950; display: flex; flex-direction: column; transform: translateX(105%); transition: transform .18s ease-out; }
.help-drawer.open { transform: none; }
.help-drawer header { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.help-drawer header .svg { color: var(--primary); }
.help-drawer .help-body { flex: 1; overflow: auto; padding: 6px 20px 20px; }
.help-drawer footer { padding: 10px 14px; border-top: 1px solid var(--line); font-size: 12.5px; background: var(--panel-2); }
.md { line-height: 1.55; }
.md h1 { font-size: 18px; margin: 14px 0 10px; }
.md h2 { font-size: 15px; margin: 18px 0 6px; }
.md h3 { font-size: 13.5px; margin: 14px 0 4px; }
.md p { margin: 0 0 10px; }
.md ul, .md ol { margin: 0 0 10px; padding-left: 20px; }
.md li { margin: 3px 0; }
.md table { border-collapse: collapse; width: 100%; margin: 6px 0 12px; font-size: 12.5px; }
.md th, .md td { border-bottom: 1px solid var(--line); padding: 5px 6px; text-align: left; vertical-align: top; }
.md th { background: var(--panel-2); }
.md code { font: 12px var(--mono); background: #f1f3f5; padding: 1px 4px; border-radius: 3px; }
.help-centre { display: grid; grid-template-columns: 260px 1fr; gap: 20px; align-items: start; }
.help-nav h4 { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); margin: 16px 0 4px; }
.help-nav a { display: block; padding: 4px 8px; border-radius: 5px; color: var(--text); text-decoration: none; font-size: 13px; }
.help-nav a:hover { background: var(--panel); }
.help-nav a.on { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.help-content { padding: 8px 28px 24px; max-width: 760px; }
.toolbar .help-q b { font-size: 14px; color: var(--text-2); }
@media (max-width: 900px) { .help-centre { grid-template-columns: 1fr; } }
table.afs-kv.sys td { padding: 8px 12px 8px 0; border-bottom: 1px solid #f0f2f5; }
table.afs-kv.sys td.k { width: 190px; font-weight: 600; color: var(--text-2); }

/* v1.1: statement line rename, matrix note tables, preparer input grids */
.paper .line-ren { border: 0; background: none; padding: 0 2px; margin-left: 6px; cursor: pointer; color: var(--text-3); opacity: 0; vertical-align: -2px; }
.paper .line-ren svg { width: 13px; height: 13px; }
.paper tr.line:hover .line-ren { opacity: 1; }
.paper .line-edited { color: var(--input); margin-left: 4px; font-weight: 700; }
.paper table.matrix td.lbl { width: 27%; }
.paper table.matrix td.v, .paper table.matrix th.v { width: auto; }
.paper table.matrix th.v.small { white-space: normal; line-height: 1.2; vertical-align: bottom; }
.paper .input-grid { margin-top: 10px; padding: 8px 10px; border: 1px dashed var(--input); border-radius: 6px; background: #f8faff; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .paper .input-grid { background: transparent; } }

.dt-t { width: 100%; table-layout: fixed; }
table.grid.dt-t th { white-space: normal; vertical-align: bottom; line-height: 1.25; }
.dt-t th:nth-child(1) { width: 32%; } .dt-t th:nth-child(2) { width: 11%; } .dt-t th.num { width: 14.5%; }
.dt-t td { vertical-align: top; overflow-wrap: anywhere; }
.dt-t td.num { white-space: nowrap; }
.dt-t .dt-in { width: 100%; max-width: 130px; text-align: right; height: 28px; }
.dt-t tr.dt-default .dt-in { font-style: italic; }
.dt-t tfoot td { font-weight: 700; border-top: 1px solid var(--line); }

.topbar .practice-name { color: #dfe6ee; font-weight: 600; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; }
/* operator console */
.admin-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.admin-h { font-size: 14px; margin: 18px 0 8px; }
.kpis { display: flex; gap: 10px; flex-wrap: wrap; }
.kpis .kpi { min-width: 130px; }
table.admin-t th { position: static; }
table.admin-t td { vertical-align: top; }
tr.lead-new td { background: #fffaf0; }
a.btn { text-decoration: none; }

/* --- client preview (LEDGERON_PREVIEW=1): locked modules ------------------------------------- */
.soon-tag { margin-left: auto; font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); border: 1px solid var(--line-2); border-radius: 4px; padding: 0 5px; }
.popover .opt.soon { color: var(--text-3); cursor: default; }
.popover .opt.soon:hover { background: transparent; }
.nav .item.soon { color: var(--text-3); }
.nav .item.soon .label { opacity: .75; }
.nav .item.soon > .svg:last-child { margin-left: auto; width: 12px; height: 12px; opacity: .7; }
.tab.soon { color: var(--text-3); }
.card.qa.soon { cursor: default; opacity: .6; }
.card.qa.soon .t { display: flex; align-items: center; gap: 8px; }
.card.qa.soon .soon-tag { margin-left: 0; }
.check.soon { opacity: .7; }
.soon-page { position: relative; max-width: 760px; margin: 40px auto; padding: 0 16px; }
.soon-card { position: relative; z-index: 1; background: var(--panel); border: 1px solid var(--line-2); border-radius: 12px; padding: 32px; text-align: center; box-shadow: 0 8px 30px rgba(15, 23, 42, .08); max-width: 520px; margin: 0 auto; }
.soon-card h2 { margin: 12px 0 6px; font-size: 20px; }
.soon-card ul { list-style: none; padding: 0; margin: 18px auto; display: inline-flex; flex-direction: column; gap: 8px; text-align: left; }
.soon-card li { display: flex; gap: 8px; align-items: center; }
.soon-card li .svg { color: var(--ok); }
.soon-ic { width: 52px; height: 52px; border-radius: 50%; margin: 0 auto 12px; display: flex; align-items: center; justify-content: center; background: var(--bg); color: var(--text-3); }
.soon-ic .svg { width: 24px; height: 24px; }
.soon-skeleton { margin-top: -60px; padding: 90px 32px 32px; border-radius: 12px; background: var(--panel); border: 1px dashed var(--line-2); display: flex; flex-direction: column; gap: 14px; opacity: .55; filter: blur(.5px); }
.sk-bar { height: 12px; border-radius: 6px; background: linear-gradient(90deg, var(--line-2), var(--bg)); }

/* --- user editor: section and company access ---------------------------------------------- */
.acc { border-top: 1px solid var(--line); padding-top: 12px; }
.acc.hidden, .acc-partner.hidden, .acc-co.hidden { display: none; }
.acc-bar { display: flex; align-items: center; gap: 10px; margin: 6px 0 8px; }
.acc-bar h4 { margin: 0; font-size: 13px; }
.acc-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; margin-bottom: 14px; }
.acc-group { border: 1px solid var(--line-2); border-radius: 8px; padding: 8px 10px; background: var(--panel-2); }
.acc-head { display: flex; gap: 8px; align-items: center; padding-bottom: 6px; border-bottom: 1px solid var(--line); margin-bottom: 6px; cursor: pointer; }
.acc-items { display: flex; flex-direction: column; gap: 3px; }
.acc-item { display: flex; gap: 8px; align-items: center; font-size: 12.5px; cursor: pointer; }
.acc-item .wpref { font-family: var(--mono); font-size: 10.5px; color: var(--text-3); min-width: 30px; }
.acc-co { max-height: 180px; overflow: auto; padding: 6px 4px 0 24px; }
.acc-partner { display: flex; gap: 8px; align-items: center; padding: 10px 12px; background: var(--primary-soft); border-radius: 8px; font-size: 13px; }

/* --- Ask Claude: top-centre button and right-hand terminal panel ------------------------------------ */
.askbtn { display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 14px; border-radius: 999px; border: 1px solid rgba(240, 164, 107, .55);
  background: rgba(240, 164, 107, .12); color: #f6c39b; font-weight: 600; cursor: pointer; white-space: nowrap; }
.askbtn:hover, .askbtn.on { background: #f0a46b; color: #10202f; border-color: #f0a46b; }
.askdrawer { position: fixed; top: 0; right: 0; bottom: 0; width: var(--ask-w, 560px); max-width: 100vw; z-index: 60; display: none; flex-direction: column;
  background: #0d1b2a; color: #dbe7f3; border-left: 1px solid #22384f; box-shadow: -12px 0 30px rgba(0, 0, 0, .25); }
body.ask-open .askdrawer { display: flex; }
body.ask-open #app { margin-right: var(--ask-w, 560px); }
.askdrawer header { display: flex; align-items: center; gap: 6px; height: 48px; padding: 0 10px 0 14px; border-bottom: 1px solid #22384f; }
.askdrawer header .btn { color: #c6d4e3; }
.askdrawer header .btn:hover { background: rgba(255, 255, 255, .08); }
.ask-title { display: flex; align-items: center; gap: 8px; }
.ask-title .svg { color: #f0a46b; }
.askdrawer .dot { width: 8px; height: 8px; border-radius: 50%; background: #64748b; }
.askdrawer .dot.on { background: #34d399; }
.askdrawer .dot.off { background: #f87171; }
.askdrawer .muted { color: #8ba0b6; }
.ask-seesbar { display: flex; gap: 6px; align-items: center; padding: 7px 14px; font-size: 12.5px; background: #12263a; color: #a9bdd1; border-bottom: 1px solid #22384f; white-space: nowrap; overflow: hidden; }
.ask-seesbar .ask-sees { color: #f6c39b; overflow: hidden; text-overflow: ellipsis; }
.ask-term { flex: 1; min-height: 0; padding: 8px 4px 4px 10px; }
.askdrawer footer { display: flex; gap: 8px; padding: 7px 14px; font-size: 11.5px; border-top: 1px solid #22384f; }
@media (max-width: 1100px) { .askdrawer { --ask-w: 100vw; } body.ask-open #app { margin-right: 0; } }
