/* Ledgerwell AP Desk. Graphite rail, white working surface, the clerk's highlighter and red pencil. */
@font-face { font-family: 'Libre Franklin'; font-style: normal; font-weight: 400 700; font-display: swap; src: url(../fonts/libre-franklin-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Libre Franklin'; font-style: normal; font-weight: 400 700; font-display: swap; src: url(../fonts/libre-franklin-latin-ext.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Libre Franklin'; font-style: italic; font-weight: 400; font-display: swap; src: url(../fonts/libre-franklin-italic-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+2000-206F; }
@font-face { font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 400; font-display: swap; src: url(../fonts/ibm-plex-mono-latin-400-normal.woff2) format('woff2'); }
@font-face { font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 500 600; font-display: swap; src: url(../fonts/ibm-plex-mono-latin-500-normal.woff2) format('woff2'); }

:root {
  --rail: #1E242B; --rail-ink: #B8C0C9;
  --desk: #E7E5DF; --desk-2: #F4F3EF; --wash: #FAF9F6; --surface: #FFFFFF;
  --ink: #1A1D21; --ink-2: #4A5058; --ink-3: #636A73;
  --line: #E6E3DC; --line-2: #D2CEC5;
  --hl: #F2D13A; --hl-edge: #E2BC16; --hl-wash: #FCF4D2;
  --red: #B23A2C; --red-wash: #FBEDEA;
  --amber: #C2860C; --amber-ink: #835800;
  --blue: #2F5FA8; --teal: #1E766E; --brown: #8A5A2B; --grey: #8E959E;
  --focus: #2F5FA8;
  --sans: 'Libre Franklin', 'Franklin Gothic Medium', 'Helvetica Neue', Arial, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  --bar: 56px; --rail-w: 80px;
  --ease: cubic-bezier(.2, .7, .3, 1);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--surface); color: var(--ink); font: 400 14.5px/1.5 var(--sans); font-variant-numeric: lining-nums; -webkit-font-smoothing: antialiased; }
h1, h2, h3 { margin: 0; font-weight: 650; line-height: 1.25; text-wrap: balance; }
p { margin: 0; }
a { color: var(--blue); text-underline-offset: 2px; text-decoration-thickness: 1px; }
a:hover { color: #1D4580; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; background: var(--ink); color: #fff; padding: 8px 12px; z-index: 90; border-radius: 6px; }
.skip:focus { top: 8px; }
.num { text-align: right; font-variant-numeric: tabular-nums lining-nums; white-space: nowrap; }
.muted { color: var(--ink-3); }
.ref { font-variant-numeric: tabular-nums lining-nums; }
.ref.sub { color: var(--ink-3); font-size: 13px; }
.line-sub { display: block; color: var(--ink-3); font-size: 13px; font-weight: 400; }
.hint { color: var(--ink-3); font-size: 13px; margin-top: 8px; }
.bad { color: var(--red); }
kbd { font: 500 12px/1 var(--mono); display: inline-flex; align-items: center; min-height: 20px; padding: 0 5px; border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 4px; background: var(--surface); color: var(--ink-2); }
.ic { flex: none; }

/* ---------- controls ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 38px; padding: 0 15px; border: 1px solid var(--ink); border-radius: 7px; background: var(--ink); color: #fff; font: 600 14px/1 var(--sans); text-decoration: none; cursor: pointer; white-space: nowrap; transition: background-color .15s, border-color .15s, color .15s; }
.btn:hover { background: #343A41; border-color: #343A41; color: #fff; }
.btn kbd { background: transparent; border-color: rgba(255, 255, 255, .35); color: rgba(255, 255, 255, .85); }
.btn.sm { height: 32px; padding: 0 11px; font-size: 13.5px; gap: 6px; }
.btn.quiet { background: var(--surface); color: var(--ink); border-color: var(--line-2); }
.btn.quiet:hover { background: var(--desk-2); border-color: var(--ink-3); color: var(--ink); }
.btn.quiet kbd { border-color: var(--line-2); color: var(--ink-3); }
.btn.danger { background: var(--surface); color: var(--red); border-color: #E1B4AD; }
.btn.danger:hover { background: var(--red-wash); border-color: var(--red); }
.btn[disabled], .btn[disabled]:hover { opacity: .42; cursor: not-allowed; }
.btn.quiet[disabled], .btn.danger[disabled] { background: var(--surface); }
.icon-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; flex: none; border: 0; border-radius: 7px; background: transparent; color: var(--ink-2); cursor: pointer; transition: background-color .15s, color .15s; }
.icon-btn:hover { background: var(--desk-2); color: var(--ink); }
.icon-btn[aria-pressed="true"] { background: #E6E3DA; color: var(--ink); }
.link-btn { border: 0; background: none; padding: 2px 0; margin-left: 10px; color: var(--blue); font: 600 13.5px var(--sans); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(47, 95, 168, .35); }
.link-btn:hover { text-decoration-color: currentColor; }
.link-btn[disabled] { color: var(--ink-3); cursor: not-allowed; text-decoration: none; }
input, select, textarea { font: inherit; color: var(--ink); }
input[type="text"], input[type="search"], input[type="number"], select, textarea { height: 36px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: 7px; background: var(--surface); transition: border-color .15s, box-shadow .15s; }
textarea { height: auto; padding: 8px 10px; resize: vertical; line-height: 1.45; width: 100%; }
input:hover, select:hover, textarea:hover { border-color: #B6B1A6; }
input:focus, select:focus, textarea:focus { border-color: var(--focus); box-shadow: 0 0 0 3px rgba(47, 95, 168, .16); outline: none; }
input[disabled], select[disabled], textarea[disabled] { background: var(--desk-2); color: var(--ink-3); cursor: not-allowed; }
select { appearance: none; padding-right: 30px; background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='m6 8 4 4 4-4' fill='none' stroke='%23636A73' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 8px center / 16px; cursor: pointer; }
input[type="search"]::-webkit-search-cancel-button { cursor: pointer; }
input[type="checkbox"] { width: 17px; height: 17px; accent-color: var(--ink); cursor: pointer; margin: 0; }
input[type="range"] { accent-color: var(--ink); width: 220px; }
.inline { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.check { display: inline-flex; gap: 10px; align-items: center; cursor: pointer; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: var(--rail-w) minmax(0, 1fr); background: linear-gradient(90deg, var(--rail) var(--rail-w), transparent 0); }
.shell > .bar, .shell > main { grid-column: 2; margin-left: 0; }
.rail { position: fixed; inset: 0 auto 0 0; width: var(--rail-w); z-index: 40; background: var(--rail); color: var(--rail-ink); display: flex; flex-direction: column; align-items: center; padding: 12px 0; }
.rail-logo { display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: 14px; color: #fff; border-radius: 10px; }
.rail-logo:focus-visible, .rail a:focus-visible, .rail button:focus-visible { outline-color: #fff; }
.rail-main { list-style: none; margin: 0; padding: 0 8px; width: 100%; display: flex; flex-direction: column; gap: 2px; }
.rail-main a, .rail-main button { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; width: 100%; padding: 9px 2px 8px; border: 0; border-radius: 9px; background: none; color: inherit; text-decoration: none; font: 600 12px/1.1 var(--sans); cursor: pointer; transition: background-color .15s, color .15s; }
.rail-main a:hover, .rail-main button:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.rail-main a[aria-current="page"], .rail-main button[data-current] { background: rgba(255, 255, 255, .11); color: #fff; }
.rail-main a[aria-current="page"]::before { content: ''; position: absolute; left: -8px; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: var(--hl); }
.rail-n { position: absolute; top: 4px; right: 9px; min-width: 18px; height: 17px; padding: 0 5px; border-radius: 9px; background: var(--hl); color: var(--rail); font: 700 11px/17px var(--sans); text-align: center; font-variant-numeric: tabular-nums; }
.rail-n:empty { display: none; }
.rail-gap { margin-top: 16px; padding-top: 14px; border-top: 1px solid rgba(255, 255, 255, .09); }
.rail-more { display: none; }
@media (min-width: 768px) { .rail { position: sticky; inset: 0 auto auto 0; align-self: start; grid-column: 1; grid-row: 1 / span 2; height: calc(100vh - var(--concept-bar)); } }

.bar { position: sticky; top: 0; z-index: 30; height: var(--bar); margin-left: var(--rail-w); display: flex; align-items: center; gap: 10px; padding: 0 18px 0 14px; background: var(--surface); border-bottom: 1px solid var(--line); }
.org { display: flex; align-items: center; gap: 9px; height: 40px; padding: 0 8px; border: 0; border-radius: 8px; background: none; color: var(--ink); cursor: pointer; text-align: left; }
.org:hover { background: var(--desk-2); }
.org-mark { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 7px; background: var(--rail); color: #fff; font: 700 11.5px var(--sans); letter-spacing: .02em; }
.org-name { font-weight: 650; font-size: 14.5px; }
.org-sub { color: var(--ink-3); font-size: 13px; }
.org .ic { color: var(--ink-3); }
.search { display: flex; align-items: center; gap: 9px; height: 38px; width: min(460px, 34vw); margin-left: 14px; padding: 0 8px 0 12px; border: 1px solid var(--line-2); border-radius: 9px; background: var(--desk-2); color: var(--ink-3); font: 14px var(--sans); cursor: pointer; transition: border-color .15s, background-color .15s; }
.search:hover { border-color: #B6B1A6; background: var(--surface); }
.search-l { flex: 1; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-sp, .phead-sp { flex: 1; }
.bar-btn { display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 11px; border: 1px solid transparent; border-radius: 8px; background: none; color: var(--ink-2); font: 600 13.5px var(--sans); cursor: pointer; }
.bar-btn:hover, .bar-btn[aria-expanded="true"] { background: var(--desk-2); color: var(--ink); }
.ro-tag { padding: 3px 9px; border-radius: 999px; background: #ECEAE4; color: var(--ink-2); font-size: 12.5px; font-weight: 600; }
.me { display: flex; align-items: center; gap: 9px; height: 44px; padding: 0 6px 0 4px; border: 0; border-radius: 9px; background: none; color: var(--ink); cursor: pointer; text-align: left; }
.me:hover, .me[aria-expanded="true"] { background: var(--desk-2); }
.me-t { display: flex; flex-direction: column; line-height: 1.2; }
.me-n { font-weight: 650; font-size: 13.5px; }
.me-r { color: var(--ink-3); font-size: 12.5px; }
.me .ic { color: var(--ink-3); }
main { margin-left: var(--rail-w); min-height: calc(100vh - var(--bar) - var(--concept-bar)); outline: none; }
.noscript { padding: 40px; }

/* avatars and monograms */
.av { display: inline-grid; place-items: center; width: 26px; height: 26px; flex: none; border-radius: 50%; font: 700 11px/1 var(--sans); letter-spacing: .02em; background: #E3E0D8; color: var(--ink-2); }
.av.lg { width: 32px; height: 32px; font-size: 12px; }
.av.u-ananya { background: #EBDCC4; color: #5C3D0E; }
.av.u-vikram { background: #D6E1EE; color: #1E3A60; }
.av.u-lakshmi { background: #D9E8E1; color: #1E5040; }
.av.u-farah { background: #E7E2D6; color: #4B4636; }
.av.empty { background: none; border: 1.5px dashed var(--line-2); }
.av.sys { background: var(--desk-2); color: var(--ink-3); }
.mg { display: inline-grid; place-items: center; width: 30px; height: 30px; flex: none; border-radius: 7px; font: 700 12px/1 var(--sans); letter-spacing: .02em; }
.mg.lg { width: 40px; height: 40px; border-radius: 9px; font-size: 14px; }
.hue-0 { background: #E2E8F1; color: #2A4468; } .hue-1 { background: #EFE5D6; color: #6B4A16; } .hue-2 { background: #E4ECE6; color: #2D5640; } .hue-3 { background: #F0E2DF; color: #7A3328; }
.hue-4 { background: #E6E9EC; color: #3B4652; } .hue-5 { background: #F3EBCF; color: #6A5308; } .hue-6 { background: #DFECEC; color: #245B5B; } .hue-7 { background: #ECE4EA; color: #5E3E55; }
.chan { display: inline-flex; color: var(--ink-3); }

/* status: dot and word */
.st { display: inline-flex; align-items: center; gap: 7px; font-weight: 550; white-space: nowrap; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--grey); flex: none; }
.tone-amber .dot { background: var(--amber); } .tone-red .dot { background: var(--red); } .tone-blue .dot { background: var(--blue); }
.tone-teal .dot { background: var(--teal); } .tone-brown .dot { background: var(--brown); } .tone-dark .dot { background: #3A3F45; }
.tone-idle .dot { background: none; box-shadow: inset 0 0 0 1.5px var(--grey); }
.st-d { color: var(--ink-3); font-size: 13.5px; margin-left: 10px; white-space: nowrap; }

/* page header and toolbars */
.phead { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 14px; padding: 20px 24px 10px; }
.phead h1 { font-size: 21px; letter-spacing: -.01em; outline: none; }
.phead-n { color: var(--ink-3); font-size: 16px; font-weight: 500; font-variant-numeric: tabular-nums; margin-left: 8px; }
.phead-meta { color: var(--ink-3); font-size: 13.5px; }
.tools { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 8px 24px 10px; }
.tools h2 { font-size: 16px; margin-right: 10px; }
.tool-search { position: relative; display: inline-flex; align-items: center; }
.tool-search .ic { position: absolute; left: 10px; color: var(--ink-3); pointer-events: none; }
.tool-search input { padding-left: 34px; width: 260px; }
.tool-clear { font-size: 13.5px; font-weight: 600; padding: 0 4px; }
.tools.bulk { background: var(--hl-wash); box-shadow: inset 0 -1px 0 #EBDDA4; }
.tools.bulk strong { margin-right: 8px; }
.pager { display: inline-flex; align-items: center; gap: 2px; }
.pg-range { color: var(--ink-2); font-size: 13.5px; margin-right: 8px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pg-btn { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 7px; color: var(--ink); }
.pg-btn:hover { background: var(--desk-2); }
.pg-btn.off { color: #C4C0B7; }
.tabs { display: flex; gap: 2px; margin-left: 18px; align-self: stretch; }
.tab { display: inline-flex; align-items: center; gap: 7px; padding: 6px 11px; border-radius: 7px; color: var(--ink-2); font-weight: 600; font-size: 14px; text-decoration: none; white-space: nowrap; transition: background-color .15s, color .15s; }
.tab:hover { background: var(--desk-2); color: var(--ink); }
.tab[aria-current="page"] { background: var(--ink); color: #fff; }
.tab-n { font-weight: 500; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.tab[aria-current="page"] .tab-n { color: #C9CDD2; }
.seg { display: inline-flex; padding: 2px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--surface); }
.seg a { padding: 5px 11px; border-radius: 6px; color: var(--ink-2); font-size: 13.5px; font-weight: 600; text-decoration: none; }
.seg a:hover { color: var(--ink); background: var(--desk-2); }
.seg a[aria-current] { background: var(--ink); color: #fff; }
.pill { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 999px; background: #ECEAE4; color: var(--ink); font-size: 13.5px; font-weight: 600; text-decoration: none; }
.pill:hover { background: #E1DED6; color: var(--ink); }
.empty-row { padding: 36px 24px; color: var(--ink-2); }
.empty-row p { margin-bottom: 6px; font-size: 15px; color: var(--ink); }
.empty-state { max-width: 520px; margin: 64px auto; padding: 0 24px; text-align: center; }
.empty-state h1, .empty-state h2 { font-size: 19px; margin-bottom: 8px; outline: none; }
.empty-state p { color: var(--ink-2); margin-bottom: 14px; }

/* tables */
.tablewrap { overflow-x: auto; }
table.grid { width: 100%; border-collapse: collapse; font-size: 14px; }
.grid th, .grid td { padding: 9px 10px; text-align: left; vertical-align: middle; border-bottom: 1px solid var(--line); }
.grid thead th { padding-top: 8px; padding-bottom: 8px; color: var(--ink-3); font-size: 13px; font-weight: 600; white-space: nowrap; border-bottom-color: var(--line-2); }
.grid tbody th { font-weight: 500; }
.grid .num { text-align: right; }
.grid tfoot th, .grid tfoot td { border-bottom: 0; font-weight: 650; }
.grid td.dbl { border-bottom: 3px double var(--ink); }
.th-sort { display: inline-flex; align-items: center; gap: 4px; border: 0; background: none; padding: 2px 0; color: inherit; font: inherit; cursor: pointer; }
.th-sort:hover, .th-sort.on { color: var(--ink); }
.th-dir { font-size: 12px; }
.line-desc { display: block; }

/* ---------- inbox ---------- */
.ib.has-pv { display: grid; grid-template-columns: minmax(0, 1fr) 420px; }
.ib-list { min-width: 0; }
.ib .phead { padding-bottom: 8px; }
.inbox { table-layout: fixed; }
.inbox th, .inbox td { height: 50px; padding-top: 0; padding-bottom: 0; }
.inbox thead th { height: 38px; position: sticky; top: var(--bar); z-index: 2; background: var(--surface); }
.inbox .c-cb { width: 52px; padding-left: 24px; padding-right: 0; }
.inbox .c-v { width: auto; }
.inbox .c-ch { width: 40px; padding: 0 4px; }
.inbox .c-st { width: 34%; }
.inbox .c-own { width: 46px; padding: 0 4px; }
.inbox .c-age { width: 74px; color: var(--ink-2); font-size: 13.5px; }
.inbox .c-amt { width: 136px; padding-right: 24px; font-weight: 600; }
.c-vw { display: flex; align-items: center; gap: 11px; min-width: 0; }
.c-vt { display: flex; align-items: baseline; gap: 10px; min-width: 0; overflow: hidden; }
.row-link { color: var(--ink); font-weight: 600; text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-link:hover { text-decoration: underline; color: var(--ink); }
.c-vt .ref { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.c-st { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inbox tbody tr { cursor: pointer; transition: background-color .12s; }
.inbox tbody tr:hover { background: var(--wash); }
.inbox tbody tr.is-picked { background: #F1F3F6; }
.inbox tbody tr.is-sel { background: var(--hl-wash); box-shadow: inset 3px 0 0 var(--hl-edge); }
.inbox tbody tr.is-cur { box-shadow: inset 3px 0 0 var(--ink); }
.inbox tbody tr.is-sel.is-cur { box-shadow: inset 3px 0 0 var(--hl-edge); }
.inbox tbody tr.r-posted .row-link, .inbox tbody tr.r-rejected .row-link { font-weight: 500; }
.inbox tbody tr.r-rejected .c-amt { color: var(--ink-3); text-decoration: line-through; font-weight: 500; }
.inbox .r-empty { cursor: default; }
.inbox .r-empty:hover { background: none; }
.inbox .r-empty td { height: auto; }
.ib-scroll { overflow: visible; }
.f-toggle { display: none !important; }
.inbox.with-pv .c-st { width: 26%; }
.inbox.with-pv .st-d { display: none; }
.inbox.with-pv .c-vt { flex-direction: column; gap: 0; line-height: 1.3; }
.org-name, .me-n, .me-r { white-space: nowrap; }
.inbox.with-pv .c-ch { width: 32px; }
.fsel select { max-width: 190px; }
.ib-foot { display: flex; justify-content: flex-end; padding: 10px 24px 28px; }

.pv { position: sticky; top: var(--bar); height: calc(100vh - var(--bar) - var(--concept-bar)); overflow: auto; display: flex; flex-direction: column; gap: 16px; padding: 18px 22px 0; background: var(--wash); border-left: 1px solid var(--line); animation: slide-in .2s var(--ease); }
@keyframes slide-in { from { opacity: 0; transform: translateX(12px); } }
.pv-h { display: flex; align-items: center; gap: 12px; }
.pv-t { flex: 1; min-width: 0; }
.pv-t h2 { font-size: 16px; }
.pv-t p { color: var(--ink-3); font-size: 13px; }
.pv-amt { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; }
.pv-n { font-size: 26px; font-weight: 650; letter-spacing: -.01em; margin-right: 4px; }
.pv-amt .st-d { margin-left: 0; }
.pv-doc { display: block; flex: none; height: 300px; overflow: hidden; padding: 14px 14px 0; border-radius: 8px; background: var(--desk); }
.pv-svg { display: block; width: 100%; height: auto; box-shadow: 0 1px 2px rgba(0, 0, 0, .12), 0 6px 18px rgba(0, 0, 0, .08); transition: transform .2s var(--ease); }
.pv-doc:hover .pv-svg { transform: translateY(-2px); }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; margin: 0; }
.facts dt { color: var(--ink-3); font-size: 13px; }
.facts dd { margin: 1px 0 0; font-size: 14px; overflow-wrap: anywhere; }
.pv-log h3 { font-size: 14px; margin-bottom: 6px; }
.pv-log ol { list-style: none; margin: 0; padding: 0; font-size: 13.5px; }
.pv-log li { display: grid; grid-template-columns: 112px 1fr; gap: 8px; padding: 5px 0; border-bottom: 1px solid var(--line); }
.pv-when { color: var(--ink-3); font-variant-numeric: tabular-nums; }
.pv-act { position: sticky; bottom: 0; display: flex; gap: 8px; margin: auto -22px 0; padding: 12px 22px; background: var(--wash); border-top: 1px solid var(--line); }
.pv-act .btn:first-child { flex: 1; }

/* ---------- review ---------- */
.rv { display: grid; grid-template-rows: 52px minmax(0, 1fr); height: calc(100vh - var(--bar) - var(--concept-bar)); height: calc(100dvh - var(--bar) - var(--concept-bar)); }
.rv-bar { display: flex; align-items: center; gap: 10px; padding: 0 12px 0 10px; border-bottom: 1px solid var(--line); min-width: 0; }
.rv-title { display: flex; align-items: baseline; gap: 10px; min-width: 0; overflow: hidden; }
.rv-title h1 { font-size: 17px; white-space: nowrap; outline: none; }
.rv-title .ref { color: var(--ink-2); white-space: nowrap; }
.rv-id { color: var(--ink-3); font-size: 13px; white-space: nowrap; }
.rv-bar > .st { margin-left: 6px; }
.rv-q { display: inline-flex; align-items: center; gap: 2px; }
.rv-qn { color: var(--ink-2); font-size: 13.5px; margin-right: 6px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rv-body { display: grid; grid-template-columns: minmax(0, 1fr) clamp(380px, 32vw, 460px); min-height: 0; }
.viewer { display: grid; grid-template-rows: 46px minmax(0, 1fr); min-height: 0; min-width: 0; background: var(--desk); }
.vw-tools { display: flex; align-items: center; gap: 2px; padding: 0 10px 0 14px; background: var(--desk-2); border-bottom: 1px solid var(--line); }
.vw-src { display: inline-flex; align-items: center; gap: 7px; color: var(--ink-2); font-size: 13.5px; }
.vw-z { min-width: 46px; text-align: center; font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.vw-sep { width: 1px; height: 20px; background: var(--line-2); margin: 0 6px; }
.vw-main { display: grid; grid-template-columns: 96px minmax(0, 1fr); min-height: 0; }
.thumbs { display: flex; flex-direction: column; gap: 14px; padding: 14px 10px; overflow: auto; border-right: 1px solid #DAD7CF; background: #EEECE6; }
.thumb { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 0; border: 0; background: none; color: var(--ink-2); font: 600 12.5px var(--sans); cursor: pointer; }
.th-img { display: grid; place-items: center; width: 100%; aspect-ratio: 600 / 840; background: #fff; overflow: hidden; border-radius: 2px; box-shadow: 0 1px 2px rgba(0, 0, 0, .14); outline: 2px solid transparent; outline-offset: 2px; transition: outline-color .15s; }
.th-img svg:not(.ic) { width: 100%; height: auto; }
.th-src { background: var(--surface); color: var(--ink-3); }
.thumb[aria-pressed="true"] { color: var(--ink); }
.thumb[aria-pressed="true"] .th-img { outline-color: var(--ink); }
.vw-canvas { position: relative; overflow: auto; padding: 12px; outline: none; }
.vw-canvas:focus-visible { box-shadow: inset 0 0 0 2px var(--focus); }
.vw-page { margin: 0 auto; width: 100%; }
.vw-page svg { display: block; width: 100%; height: auto; box-shadow: 0 1px 2px rgba(0, 0, 0, .14), 0 10px 30px rgba(0, 0, 0, .09); }
.doc-hl { fill: var(--hl); fill-opacity: .55; mix-blend-mode: multiply; stroke: none; transition: x .18s var(--ease), y .18s var(--ease), width .18s var(--ease), height .18s var(--ease); }
.stamp rect { fill: none; stroke: #B23A2C; stroke-width: 2.6; opacity: .8; }
.stamp rect.thin { stroke-width: 1; }
.stamp text { fill: #B23A2C; opacity: .85; font: 600 11px var(--mono); letter-spacing: 1px; }
.stamp text.big { font-size: 25px; letter-spacing: 4px; }
.doc-none { position: absolute; top: 18px; right: 18px; padding: 5px 10px; border-radius: 6px; background: var(--ink); color: #fff; font-size: 13px; }
.src { max-width: 600px; margin: 8px auto; padding: 28px 30px; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .14); font-size: 14.5px; line-height: 1.6; }
.src p { margin-bottom: 12px; }
.src dl { display: grid; gap: 4px; margin: 0 0 20px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.src dl div { display: grid; grid-template-columns: 84px 1fr; gap: 10px; }
.src dt { color: var(--ink-3); }
.src dd { margin: 0; overflow-wrap: anywhere; }
.src-att { display: inline-flex !important; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid var(--line-2); border-radius: 8px; }
.src-wa { background: #EFEAE0; }
.src-from { font-weight: 650; }
.bubble { position: relative; max-width: 360px; padding: 10px 12px 22px; border-radius: 10px; background: #fff; box-shadow: 0 1px 1px rgba(0, 0, 0, .08); }
.bubble-t { position: absolute; right: 10px; bottom: 5px; color: var(--ink-3); font-size: 12px; }

.rv-side { display: grid; grid-template-rows: minmax(0, 1fr) auto; min-height: 0; border-left: 1px solid var(--line); background: var(--surface); }
.panel { overflow: auto; padding-bottom: 18px; }
.pn-h { display: flex; align-items: baseline; gap: 10px; padding: 16px 20px 8px; }
.pn-h h2 { font-size: 15.5px; }
.pn-meta { color: var(--ink-3); font-size: 13.5px; }
.pn-h .ro-tag { margin-left: auto; }
.pn-sub { font-size: 14px; padding: 20px 20px 6px; }
.f-row { display: grid; grid-template-columns: 112px minmax(0, 1fr) 60px 32px; align-items: center; gap: 6px; padding: 4px 16px 4px 17px; border-left: 3px solid transparent; transition: background-color .15s; }
.f-row:focus-within { background: var(--hl-wash); border-left-color: var(--hl-edge); }
.f-label { color: var(--ink-2); font-size: 13.5px; line-height: 1.25; }
.f-row.low .f-label { color: var(--ink); font-weight: 600; }
.f-in { width: 100%; height: 36px; padding: 0 9px; border: 1px solid transparent !important; border-radius: 6px; background: transparent; font-size: 14.5px; box-shadow: none !important; }
.f-in.num { text-align: right; font-variant-numeric: tabular-nums; }
.f-in.mono { font-variant-numeric: tabular-nums lining-nums; }
.f-in:hover { border-color: var(--line-2) !important; }
.f-in:focus { border-color: var(--ink-3) !important; background: #fff; }
.f-in[readonly] { cursor: default; }
.f-in[readonly]:hover { border-color: transparent !important; }
.f-row.low .f-in { border-color: #E6CF7A !important; background: #FFFCF1; }
.f-in[aria-invalid="true"] { border-color: var(--red) !important; }
.f-mark { display: flex; justify-content: flex-end; align-items: center; }
.f-ok { width: 5px; height: 5px; border-radius: 50%; background: #CBCFD4; margin-right: 8px; }
.cm { display: inline-flex; align-items: center; gap: 6px; }
.cm-bar { position: relative; width: 24px; height: 4px; border-radius: 2px; background: #EAE4D0; }
.cm-bar > span:first-child { display: block; height: 100%; border-radius: 2px; background: var(--amber); }
.cm-th { position: absolute; top: -3px; width: 1.5px; height: 10px; background: var(--ink); }
.cm-n { color: var(--amber-ink); font-size: 13px; font-weight: 650; font-variant-numeric: tabular-nums; }
.tick { display: inline-flex; color: var(--red); margin-right: 4px; }
.agree { display: inline-grid; place-items: center; width: 30px; height: 30px; border: 1px solid #E2C35A; border-radius: 7px; background: #FFF6D6; color: var(--amber-ink); cursor: pointer; transition: background-color .15s; }
.agree:hover { background: #F7E8AA; }
.f-err { grid-column: 2 / -1; color: var(--red); font-size: 13px; }
.f-err:empty { display: none; }
.rv-lines { font-size: 13.5px; }
.rv-lines th, .rv-lines td { padding: 8px 10px; }
.rv-lines thead th:first-child, .rv-lines tbody th { padding-left: 20px; }
.rv-lines td:last-child, .rv-lines th:last-child { padding-right: 20px; }
.rv-lines tbody tr { cursor: default; outline: none; }
.rv-lines tbody tr:hover, .rv-lines tbody tr:focus { background: var(--hl-wash); }
.line-bad { display: flex; align-items: center; gap: 4px; color: var(--red); font-size: 13px; font-weight: 600; margin-top: 2px; }
.row-bad th, .row-bad td { background: #FFF9F8; }
.checks { list-style: none; margin: 0; padding: 0 20px; }
.checks li { display: grid; grid-template-columns: 20px 1fr; column-gap: 8px; padding: 5px 0; font-size: 14px; }
.ck-mark { display: inline-grid; place-items: center; width: 18px; height: 18px; margin-top: 1px; border-radius: 50%; color: var(--teal); background: #E3F0EE; }
.checks .bad .ck-mark { color: #fff; background: var(--red); }
.checks .ovr .ck-mark { color: var(--amber-ink); background: #F5EAC6; }
.checks .ok .ck-label { color: var(--ink-2); }
.checks .bad .ck-label { font-weight: 600; }
.ck-detail { grid-column: 2; color: var(--red); font-size: 13px; }
.checks .ovr .ck-detail { color: var(--amber-ink); }
.totals { margin: 16px 20px 0; padding: 10px 0 0; border-top: 1px solid var(--line); }
.totals div { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; }
.totals dt { color: var(--ink-2); }
.totals dd { margin: 0; }
.totals .grand { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--ink); border-bottom: 3px double var(--ink); font-weight: 650; font-size: 15px; }
.totals .grand dt { color: var(--ink); }
.rv-act { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-top: 1px solid var(--line); background: var(--surface); }
.rv-state { flex: 1; color: var(--ink-2); font-size: 13.5px; line-height: 1.35; }
.rv-state strong { color: var(--ink); }
.rv-state .bad strong { color: var(--red); }

/* ---------- exceptions ---------- */
.ex { display: grid; grid-template-columns: 360px minmax(0, 1fr); min-height: calc(100vh - var(--bar) - var(--concept-bar)); }
.ex-q { position: sticky; top: var(--bar); height: calc(100vh - var(--bar) - var(--concept-bar)); overflow: auto; border-right: 1px solid var(--line); background: var(--wash); padding-bottom: 24px; }
.ex-q .phead { padding: 18px 16px 10px; }
.ex-q .seg { margin: 0 16px 6px; }
.q-group h2 { display: flex; justify-content: space-between; padding: 16px 16px 6px; color: var(--ink-3); font-size: 13px; font-weight: 600; }
.q-group ul { list-style: none; margin: 0; padding: 0; }
.q-item { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 10px 16px 10px 13px; border-left: 3px solid transparent; color: var(--ink); text-decoration: none; transition: background-color .12s; }
.q-item:hover { background: #F2F0EA; color: var(--ink); }
.q-item[aria-current] { background: var(--hl-wash); border-left-color: var(--hl-edge); }
.q-main { display: flex; flex-direction: column; min-width: 0; }
.q-v { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.q-sub { color: var(--ink-3); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.q-side { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; font-size: 14px; }
.q-tags { display: inline-flex; align-items: center; gap: 6px; }
.q-tags .av { width: 22px; height: 22px; font-size: 10px; }
.q-hold { display: inline-flex; align-items: center; gap: 3px; color: var(--brown); font-size: 12.5px; font-weight: 600; }
.case { padding: 22px 32px 48px; max-width: 1080px; min-width: 0; animation: fade .18s var(--ease); }
@keyframes fade { from { opacity: 0; } }
.case-empty { display: grid; place-items: center; color: var(--ink-3); max-width: none; }
.case-h { display: flex; align-items: center; gap: 12px; }
.case-back { display: none; }
.case-t { min-width: 0; }
.case-v { font-size: 16px; font-weight: 650; }
.case-ids { color: var(--ink-3); font-size: 13.5px; }
.case-amt { margin-left: auto; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.case-amt .num { font-size: 22px; font-weight: 650; }
.case-hl { margin-top: 24px; font-size: 22px; font-weight: 500; line-height: 1.35; letter-spacing: -.01em; outline: none; max-width: 46ch; }
.case-hl b { font-weight: 700; }
.case-sub { margin-top: 6px; color: var(--ink-2); font-size: 15px; max-width: 70ch; }
.case-hold { display: inline-flex; align-items: center; gap: 8px; margin-top: 14px; padding: 8px 12px; border-radius: 7px; background: #F5EEE4; color: #6B4420; font-size: 14px; }
.case .compare, .dec .compare { margin-top: 18px; }
.compare th:first-child { padding-left: 0; }
.compare td:last-child, .compare th:last-child { padding-right: 0; }
.compare td.diff { color: var(--red); font-weight: 650; }
.m-ok, .m-bad { display: inline-flex; align-items: center; gap: 5px; font-weight: 600; font-size: 13.5px; white-space: nowrap; }
.m-ok { color: var(--teal); }
.m-bad { color: var(--red); }
.compare .row-bad th, .compare .row-bad td { background: none; }
.case-cols { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 40px; margin-top: 28px; }
.case-cols h3, .thread h3, .decide h3 { font-size: 14.5px; margin-bottom: 10px; }
.case-cols .checks { padding: 0; }
.case-link { margin-top: 12px; }
.case-link a { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 14px; }
.case-own select { width: 100%; }
.case-own .totals { margin: 16px 0 0; }
.thread { margin-top: 32px; }
.thread ol { list-style: none; margin: 0; padding: 0; }
.thread li { display: grid; grid-template-columns: 28px 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.t-meta { color: var(--ink-3); font-size: 13px; }
.t-meta b { color: var(--ink); font-weight: 600; }
.t-text { font-size: 14.5px; }
.t-event .t-text { color: var(--ink-2); font-size: 14px; }
.composer { display: flex; gap: 10px; align-items: flex-start; margin-top: 12px; }
.decide { margin-top: 28px; padding: 18px; border-radius: 10px; background: var(--wash); border: 1px solid var(--line); }
.decide-b { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.decide-po { display: inline-flex; gap: 6px; margin-right: 6px; }
.decide-po select { max-width: 260px; height: 32px; }

/* ---------- approvals ---------- */
.ap { padding-bottom: 0; }
.ap-queue { overflow-x: auto; padding: 0 24px 6px; scrollbar-width: thin; }
.ap-queue ol { display: flex; gap: 8px; list-style: none; margin: 0; padding: 2px 0 8px; }
.apq { display: grid; gap: 2px; min-width: 172px; padding: 10px 13px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink); text-decoration: none; background: var(--surface); transition: border-color .15s, background-color .15s; }
.apq:hover { border-color: var(--line-2); background: var(--wash); color: var(--ink); }
.apq[aria-current] { border-color: var(--hl-edge); background: var(--hl-wash); box-shadow: inset 0 -3px 0 var(--hl-edge); }
.apq-v { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 190px; }
.apq.mine .apq-v::after { content: ''; display: inline-block; width: 7px; height: 7px; margin-left: 6px; border-radius: 50%; background: var(--blue); vertical-align: middle; }
.apq-a { text-align: left; font-size: 15px; font-weight: 650; }
.apq-s { color: var(--ink-3); font-size: 13px; }
.dec { padding: 18px 24px 0; max-width: 1180px; animation: fade .18s var(--ease); }
.dec-h { display: flex; align-items: center; gap: 14px; }
.dec-t { min-width: 0; }
.dec-t h2 { font-size: 19px; outline: none; }
.dec-t p { color: var(--ink-3); font-size: 13.5px; }
.dec-amt { margin-left: auto; text-align: right; }
.dec-amt .num { display: block; font-size: 28px; font-weight: 650; letter-spacing: -.01em; }
.dec-why { color: var(--ink-3); font-size: 13.5px; }
.chain { display: flex; flex-wrap: wrap; list-style: none; margin: 18px 0 0; padding: 0; }
.chain li { display: flex; align-items: center; gap: 9px; padding: 6px 0; }
.chain li + li::before { content: ''; width: 34px; height: 1.5px; margin: 0 12px 0 10px; background: var(--line-2); }
.chain li.done + li::before { background: var(--teal); }
.ch-l { display: flex; flex-direction: column; font-size: 13px; line-height: 1.3; color: var(--ink-3); }
.ch-l b { color: var(--ink); font-size: 13.5px; font-weight: 600; }
.chain li.wait .ch-l b { color: var(--ink-2); }
.dec-sub { font-size: 14.5px; margin: 26px 0 0; }
.dec-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px; }
.dec-cols .checks { padding: 0; margin-top: 10px; }
.dec-cols .journal { margin-top: 10px; }
.journal { font-size: 13.5px; }
.journal th:first-child { padding-left: 0; }
.journal td:last-child, .journal th:last-child { padding-right: 0; }
.dec-bar { position: sticky; bottom: 0; z-index: 3; display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin: 28px -24px 0; padding: 12px 24px; background: var(--surface); border-top: 1px solid var(--line); box-shadow: 0 -6px 18px rgba(26, 29, 33, .04); }
.dec-bar textarea { flex: 0 1 420px; height: 38px; min-height: 38px; resize: none; padding-top: 8px; }
.block-note { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); font-size: 13.5px; }

/* ---------- posting ---------- */
.po { padding-bottom: 40px; }
.erp { display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; font-weight: 600; margin-right: 6px; }
.erp .muted { font-weight: 400; }
.erp-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 0 3px #DCEDEA; }
.erp-dot.bad { background: var(--red); box-shadow: 0 0 0 3px var(--red-wash); }
.po-q { padding: 4px 24px 0; }
.po-q h2 { font-size: 16px; margin: 8px 0 4px; }
.po-q .grid th:first-child { padding-left: 0; }
.po-q .grid td:last-child { padding-right: 0; text-align: right; }
.po .ref.sub { margin-left: 8px; }
.po-q .row-bad th, .po-q .row-bad td { background: #FFF8F6; }
.po-q .st-d { display: block; margin: 2px 0 0; white-space: normal; }
.po-reg { margin-top: 26px; }
.register .c-tog { width: 52px; padding-left: 20px; padding-right: 0; }
.register td:last-child, .register th:last-child { padding-right: 24px; }
.register .c-date { color: var(--ink-2); white-space: nowrap; }
.register tr.is-open td, .register tr.is-open th { border-bottom-color: transparent; background: var(--wash); }
.jv-row td { background: var(--wash); padding: 2px 24px 16px 62px; }
.jv-row .journal { max-width: 680px; }
.po .empty-row { padding: 20px 0; }

/* ---------- audit ---------- */
.au { padding-bottom: 40px; }
.chain-st { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 600; }
.chain-st.ok { color: var(--teal); }
.chain-st.bad { color: var(--red); }
.audit { font-size: 13.5px; }
.audit td, .audit th { padding-top: 8px; padding-bottom: 8px; }
.audit .c-seq { width: 70px; padding-left: 24px; color: var(--ink-3); }
.audit .c-when { width: 178px; white-space: nowrap; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.audit .c-inv { width: 92px; white-space: nowrap; }
.audit .c-who { width: 190px; }
.who-w { display: inline-flex; align-items: center; gap: 8px; vertical-align: middle; }
.audit .c-who .av { width: 24px; height: 24px; font-size: 10px; }
.who-n { white-space: nowrap; }
.audit .c-act { width: 22%; }
.audit .c-chg { overflow-wrap: anywhere; }
.chg-f { color: var(--ink-3); margin-right: 8px; }
.audit del { color: #8E3A2E; text-decoration-color: rgba(142, 58, 46, .6); }
.audit ins { text-decoration: none; background: #EAF3EE; color: #1F5A43; padding: 0 3px; border-radius: 3px; }
.arrow { color: var(--ink-3); margin: 0 6px; }
.audit .c-hash { width: 110px; padding-right: 24px; color: var(--ink-3); }

/* ---------- insights ---------- */
.dash { padding: 0 24px 48px; }
.dash .phead { padding-left: 0; padding-right: 0; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); margin: 8px 0 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.kpi { padding: 16px 20px 16px 0; }
.kpi + .kpi { padding-left: 20px; border-left: 1px solid var(--line); }
.kpi dt { color: var(--ink-3); font-size: 13.5px; }
.kpi dd { margin: 0; }
.kpi-v { text-align: left; font-size: 26px; font-weight: 650; letter-spacing: -.01em; margin: 4px 0 2px !important; }
.kpi-s { color: var(--ink-2); font-size: 13.5px; }
.charts { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 36px 48px; margin-top: 30px; }
.card-c { min-width: 0; }
.wide, .wide-2 { grid-column: 1 / -1; }
.c-h { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; margin-bottom: 12px; }
.c-h h2 { font-size: 15.5px; }
.c-meta { color: var(--ink-3); font-size: 13.5px; }
.legend { display: flex; gap: 16px; list-style: none; margin: 0 0 0 auto; padding: 0; font-size: 13.5px; color: var(--ink-2); }
.legend li { display: inline-flex; align-items: center; gap: 6px; }
.sw { width: 10px; height: 10px; border-radius: 2px; }
.chart { display: block; width: 100%; height: auto; }
.c-grid { stroke: #ECE9E2; }
.c-axis { stroke: #B9B5AB; }
.c-tick { fill: var(--ink-3); font: 12px var(--sans); font-variant-numeric: tabular-nums; }
.c-email { fill: #3B5B86; background: #3B5B86; } .c-whatsapp { fill: #2E8A73; background: #2E8A73; } .c-upload { fill: #C99012; background: #C99012; }
.hb { list-style: none; margin: 0; padding: 0; }
.hb li { display: grid; grid-template-columns: minmax(110px, 190px) minmax(60px, 1fr) 96px 56px; align-items: center; gap: 12px; padding: 6px 0; border-bottom: 1px solid #F0EEE8; font-size: 14px; }
.hb-l { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hb-t { height: 12px; border-radius: 2px; background: #F1EFE9; overflow: hidden; }
.hb-f { display: block; height: 100%; border-radius: 2px; background: #3B5B86; transform-origin: left; animation: grow .4s var(--ease); }
@keyframes grow { from { transform: scaleX(0); } }
.hb.red .hb-f { background: #B95446; }
.hb.age .hb-f { background: #C99012; }
.hb-v { font-weight: 650; }
.hb-s { color: var(--ink-3); font-size: 13px; }
.numbers { margin-top: 10px; }
.numbers summary { display: inline-block; color: var(--ink-2); font-size: 13.5px; font-weight: 600; cursor: pointer; }
.numbers .grid { margin-top: 8px; font-size: 13.5px; }

/* ---------- rules ---------- */
.rules { min-height: calc(100vh - var(--bar)); display: flex; flex-direction: column; }
.rules-grid { flex: 1; display: grid; grid-template-columns: 170px minmax(0, 1fr) 300px; gap: 36px; padding: 6px 24px 40px; align-items: start; }
.set-nav { position: sticky; top: calc(var(--bar) + 16px); }
.set-nav ol { list-style: none; margin: 0; padding: 0; }
.set-nav a { display: block; padding: 7px 10px; border-radius: 7px; color: var(--ink-2); font-size: 14px; font-weight: 600; text-decoration: none; }
.set-nav a:hover { background: var(--desk-2); color: var(--ink); }
.set-row { display: grid; grid-template-columns: minmax(200px, 300px) minmax(0, 1fr); gap: 28px; padding: 22px 0; border-bottom: 1px solid var(--line); scroll-margin-top: calc(var(--bar) + 16px); }
.set-row:first-child { padding-top: 6px; }
.set-l h3 { font-size: 15px; }
.set-l p { color: var(--ink-2); font-size: 13.5px; margin-top: 4px; max-width: 44ch; }
.rules-form, .set-c, .set-l { min-width: 0; }
.set-c input[type="number"] { width: 92px; }
.matrix { font-size: 14px; }
.matrix th { white-space: nowrap; }
.matrix .inline { flex-wrap: nowrap; white-space: nowrap; }
.set-row.stack { grid-template-columns: 1fr; gap: 12px; }
.set-row.stack .set-l p { max-width: 70ch; }
.matrix th:first-child { padding-left: 0; }
.matrix input[type="number"] { width: 140px; }
.impact { position: sticky; top: calc(var(--bar) + 16px); padding: 18px; border-radius: 10px; background: var(--wash); border: 1px solid var(--line); }
.impact h2 { font-size: 15px; margin-bottom: 10px; }
.imp-n { font-size: 14.5px; margin-bottom: 10px; }
.imp-n .num { font-size: 22px; font-weight: 650; }
.moves { list-style: none; margin: 0; padding: 0; font-size: 13.5px; max-height: 320px; overflow: auto; }
.moves li { display: flex; justify-content: space-between; gap: 10px; padding: 5px 0; border-bottom: 1px solid var(--line); }
.save-bar { position: sticky; bottom: 0; z-index: 3; display: flex; align-items: center; gap: 10px; padding: 12px 24px; background: var(--surface); border-top: 1px solid var(--line); color: var(--ink-3); font-size: 14px; transition: background-color .2s; }
.save-bar.on { background: var(--hl-wash); color: var(--ink); font-weight: 600; }
.f-err:not(:empty) { margin-top: 12px; }

/* ---------- overlays ---------- */
.pop { position: fixed; z-index: 80; min-width: 250px; max-width: calc(100vw - 16px); padding: 6px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--surface); box-shadow: 0 10px 32px rgba(20, 22, 26, .16), 0 1px 3px rgba(20, 22, 26, .08); animation: pop-in .14s var(--ease); }
@keyframes pop-in { from { opacity: 0; transform: translateY(-4px); } }
.pop-head { padding: 7px 10px 5px; color: var(--ink-3); font-size: 13px; font-weight: 600; }
.pop-item { display: grid; grid-template-columns: 20px 1fr auto; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 7px; background: none; color: var(--ink); font: 14px var(--sans); text-align: left; cursor: pointer; }
.pop-item:hover, .pop-item:focus { background: var(--desk-2); outline: none; }
.pop-item:focus-visible { box-shadow: inset 0 0 0 2px var(--focus); }
.pop-item[disabled] { color: var(--ink-3); cursor: not-allowed; }
.pop-item .ic { color: var(--ink-2); }
.pop-ic { display: inline-flex; width: 16px; }
.pop-l { display: flex; flex-direction: column; }
.pop-sub { color: var(--ink-3); font-size: 13px; }
.pop-sep { height: 1px; margin: 6px 4px; background: var(--line); }

dialog { border: 0; padding: 0; color: var(--ink); background: var(--surface); }
dialog::backdrop { background: rgba(22, 25, 29, .38); }
dialog[open] { animation: pop-in .16s var(--ease); }
.sheet { width: min(540px, calc(100vw - 24px)); border-radius: 12px; padding-bottom: 20px; box-shadow: 0 24px 60px rgba(20, 22, 26, .25); }
.sheet-h { display: flex; align-items: center; gap: 10px; padding: 18px 20px 10px 22px; }
.sheet-h h2 { flex: 1; font-size: 18px; }
.sheet-p { padding: 0 22px 14px; color: var(--ink-2); }
.sheet-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 6px 22px 0; }
.about-list { margin: 0; padding: 0 22px 14px 40px; color: var(--ink-2); }
.about-list li { margin-bottom: 8px; }
.choices { display: grid; gap: 10px; padding: 0 22px; }
.choice { display: grid; gap: 3px; padding: 14px 16px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--surface); color: var(--ink); font: inherit; text-align: left; cursor: pointer; transition: border-color .15s, background-color .15s; }
.choice:hover { border-color: var(--ink); background: var(--wash); }
.choice strong { font-size: 15px; }
.choice span:last-child { color: var(--ink-2); font-size: 14px; }
.choice-n { color: var(--ink-3); font-size: 13px; }
.keys-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px 28px; padding: 0 22px; }
.keys-grid h3 { font-size: 14px; margin-bottom: 6px; }
.keys-grid dl { margin: 0; }
.keys-grid dl div { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 4px 0; font-size: 14px; border-bottom: 1px solid var(--line); }
.keys-grid dt { display: inline-flex; gap: 3px; }
.keys-grid dd { margin: 0; color: var(--ink-2); text-align: right; }
#keys { width: min(760px, calc(100vw - 24px)); }

.palette { width: min(660px, calc(100vw - 24px)); margin-top: 11vh; border-radius: 12px; box-shadow: 0 24px 60px rgba(20, 22, 26, .28); overflow: hidden; }
.pal-in { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); color: var(--ink-3); }
.pal-in input { flex: 1; height: 34px; border: 0 !important; box-shadow: none !important; padding: 0; font-size: 16px; color: var(--ink); background: transparent; }
.pal-in:focus-within { box-shadow: inset 0 -2px 0 var(--focus); }
#pal-list { list-style: none; margin: 0; padding: 6px; max-height: min(56vh, 460px); overflow: auto; }
.pal-group { padding: 10px 10px 4px; color: var(--ink-3); font-size: 13px; font-weight: 600; }
.pal-item { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 8px; cursor: pointer; font-size: 14.5px; }
.pal-item[aria-selected="true"] { background: var(--hl-wash); }
.pal-l { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pal-sub { margin-left: 10px; color: var(--ink-3); font: 13px var(--sans); font-variant-numeric: tabular-nums; }
.pal-amt { font-size: 14px; font-weight: 600; }
.pal-empty { padding: 22px 10px; color: var(--ink-2); }

.toast { position: fixed; left: 50%; bottom: 22px; z-index: 85; display: flex; align-items: center; gap: 9px; max-width: min(560px, calc(100vw - 24px)); padding: 10px 16px; border-radius: 9px; background: var(--rail); color: #F3F1EC; font-size: 14px; transform: translateX(-50%); box-shadow: 0 10px 30px rgba(20, 22, 26, .22); animation: toast-in .18s var(--ease); }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 8px); } }
.toast[data-kind="error"] { background: #8C2C22; }
.player { position: fixed; left: calc(50% + var(--rail-w) / 2); bottom: 16px; z-index: 75; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 18px; align-items: center; width: min(820px, calc(100vw - var(--rail-w) - 32px)); padding: 12px 16px; border-radius: 12px; background: var(--rail); color: #F1EFEA; transform: translateX(-50%); box-shadow: 0 16px 40px rgba(20, 22, 26, .3); }
.pl-meta { display: flex; gap: 12px; color: #AEB5BD; font-size: 13px; }
.pl-meta span:first-child { color: #fff; font-weight: 600; }
.pl-say { grid-column: 1; font-size: 15px; line-height: 1.45; min-height: 2.9em; }
.pl-buttons { grid-column: 2; grid-row: 1 / 3; display: flex; gap: 6px; }
.btn.inv { background: transparent; color: #fff; border-color: #4C5660; }
.btn.inv:hover { background: rgba(255, 255, 255, .08); border-color: #7B858F; color: #fff; }
.btn.inv-primary { background: #fff; color: var(--ink); border-color: #fff; }
.btn.inv-primary:hover { background: #E8E6E0; color: var(--ink); }
.player :focus-visible { outline-color: #fff; }
body.running main { padding-bottom: 150px; }
body.running .toast { display: none; } /* the caption already says it */
@media (min-width: 1024px) { body.running main[data-screen="review"] { padding-bottom: 0; } }
.tour { position: fixed; right: 20px; bottom: 20px; z-index: 76; width: min(360px, calc(100vw - 24px)); padding: 16px 18px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line-2); box-shadow: 0 16px 40px rgba(20, 22, 26, .2); }
.tour-n { color: var(--ink-3); font-size: 13px; }
.tour h2 { font-size: 17px; margin: 2px 0 6px; outline: none; }
.tour p:not(.tour-n) { color: var(--ink-2); font-size: 14.5px; }
.tour-buttons { display: flex; gap: 6px; margin-top: 14px; }
.ring { position: fixed; z-index: 70; pointer-events: none; border: 2px solid var(--hl-edge); border-radius: 9px; box-shadow: 0 0 0 4px rgba(242, 209, 58, .38); transition: left .2s var(--ease), top .2s var(--ease), width .2s var(--ease), height .2s var(--ease); }

/* ---------- self-test page ---------- */
body.plain { background: var(--desk-2); }
.selftest { max-width: 900px; margin: 0 auto; padding: 32px 20px; }
.selftest h1 { font-size: 22px; margin-bottom: 8px; }
.selftest ol { font: 13.5px/1.7 var(--mono); padding-left: 24px; margin: 16px 0; }
.selftest li.pass { color: var(--teal); }
.selftest li.fail { color: var(--red); font-weight: 600; }
#status[data-status="pass"] { color: var(--teal); }
#status[data-status="fail"] { color: var(--red); }

/* ---------- responsive ---------- */
@media (max-width: 1365px) {
  .org-sub { display: none; }
}
@media (max-width: 1279px) {
  .ib.has-pv { grid-template-columns: minmax(0, 1fr) 380px; }
  .inbox .c-st { width: 30%; }
  .rules-grid { grid-template-columns: minmax(0, 1fr) 280px; }
  .set-nav { display: none; }
}
@media (max-width: 1199px) {
  .ib.has-pv { display: block; }
  .ex { grid-template-columns: 320px minmax(0, 1fr); }
  .case-cols { grid-template-columns: 1fr; gap: 24px; }
  .rv-body { grid-template-columns: minmax(0, 1fr) 380px; }
  .vw-main { grid-template-columns: 76px minmax(0, 1fr); }
  .tabs { margin-left: 0; width: 100%; order: 3; overflow-x: auto; }
  .st-d { display: none; }
  .inbox .c-st { width: 136px; }
}
@media (max-width: 1023px) {
  .ex { display: block; }
  .ex-q { position: static; height: auto; border-right: 0; background: none; }
  .ex.has-case .ex-q { display: none; }
  .case-back { display: inline-grid; margin-left: -8px; }
  .case { padding: 16px 24px 40px; }
  .dec-cols { grid-template-columns: 1fr; gap: 0; }
  .rules-grid { grid-template-columns: 1fr; }
  .impact { position: static; }
  .rv { height: auto; display: block; }
  .rv-bar { position: sticky; top: var(--bar); z-index: 5; background: var(--surface); height: 52px; }
  .rv-body { display: block; }
  .viewer { position: sticky; top: calc(var(--bar) + 52px); z-index: 4; grid-template-rows: 44px auto; border-bottom: 1px solid var(--line-2); }
  .vw-main { display: block; }
  .thumbs { display: none; }
  .vw-canvas { max-height: 44vh; }
  .rv-side { display: block; border-left: 0; }
  .panel { overflow: visible; }
  .rv-act { position: sticky; bottom: 0; z-index: 4; }
  .search { width: auto; flex: 0 1 300px; min-width: 0; }
  .me-t, .me .ic { display: none; }
  .org-name { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
@media (max-width: 767px) {
  :root { --bar: 54px; --rail-w: 0px; }
  body { font-size: 15px; }
  .rail { inset: auto 0 0 0; width: 100%; height: calc(62px + env(safe-area-inset-bottom)); padding: 4px 4px env(safe-area-inset-bottom); flex-direction: row; border-top: 1px solid #000; }
  .rail-logo, .rail-more-hide { display: none; }
  .rail-main { flex-direction: row; padding: 0; gap: 0; }
  .rail-main li { flex: 1; }
  .rail-more { display: block; }
  .rail-main a, .rail-main button { padding: 8px 0 6px; }
  .rail-main a[aria-current="page"]::before { left: 30%; right: 30%; top: -4px; bottom: auto; width: auto; height: 3px; border-radius: 0 0 3px 3px; }
  .rail-n { right: calc(50% - 24px); }
  .bar { padding: 0 8px; gap: 4px; }
  .org { padding: 0 4px; }
  .org-name, .org-sub, .org .ic, .me-t, .me .ic, .search-l, .search-k, .bar-btn span:last-child { display: none; }
  .search { width: 38px; flex: none; margin-left: auto; padding: 0; justify-content: center; background: none; border-color: transparent; }
  .bar-sp { display: none; }
  .bar-btn { padding: 0 9px; }
  main { padding-bottom: 72px; min-height: calc(100vh - var(--bar) - var(--concept-bar)); }
  .phead { padding: 16px 16px 8px; }
  .phead h1 { font-size: 20px; }
  .tools { padding: 8px 16px 10px; }
  .tool-search { flex: 1; } .tool-search input { width: 100%; }
  .f-toggle { display: inline-flex !important; height: 36px; }
  .ib .tools:not(.f-open) .fsel, .ib .tools:not(.f-open) .tool-clear { display: none; }
  #vw-out, #vw-z, #vw-in, #vw-fitw, #vw-fitp, .vw-sep { display: none; }
  .case-h .mg, .dec-h .mg { display: none; }
  .chain { flex-direction: column; }
  .chain li + li::before { display: none; }
  .tools .fsel { flex: 1 1 40%; }
  .tools .fsel select { width: 100%; }
  .tools .pager { width: 100%; justify-content: space-between; }
  .tabs { padding-bottom: 2px; }
  /* inbox rows as two-line cards */
  .inbox, .inbox tbody, .inbox tr, .inbox td, .inbox th { display: block; }
  .inbox thead { display: none; }
  .inbox tbody tr { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; grid-template-areas: 'm v a' 'm s t'; column-gap: 12px; row-gap: 3px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
  .inbox td, .inbox th { border: 0; height: auto !important; padding: 0 !important; width: auto !important; }
  .inbox .c-cb, .inbox .c-ch, .inbox .c-own { display: none; }
  .inbox th.c-v, .inbox .c-vw { display: contents; }
  .inbox .c-vw .mg { grid-area: m; align-self: start; }
  .inbox .c-vt { grid-area: v; flex-direction: column; gap: 0; }
  .inbox .c-st { grid-area: s; font-size: 14px; }
  .inbox .c-age { grid-area: t; text-align: right; }
  .inbox .c-amt { grid-area: a; text-align: right; font-size: 15px; }
  .inbox .r-empty { display: block; padding: 0; }
  .st-d { display: inline; margin-left: 8px; font-size: 13.5px; }
  .ib-foot { padding: 12px 16px 24px; }
  /* review: the loupe follows the field */
  .rv-bar { top: var(--bar); padding: 0 6px; gap: 6px; }
  .rv-bar > .st, .rv-id, .rv-keys, .rv-bar .mg { display: none; }
  .rv-title { flex-direction: column; gap: 0; }
  .rv-title h1 { font-size: 15.5px; }
  .rv-title .ref { font-size: 12.5px; }
  .vw-tools { padding: 0 6px 0 12px; }
  .vw-src { font-size: 13px; }
  .vw-canvas { padding: 8px; max-height: 34vh; }
  .vw-page svg { box-shadow: 0 1px 2px rgba(0, 0, 0, .18); }
  .f-row { grid-template-columns: minmax(0, 1fr) auto 36px; grid-template-areas: 'l l l' 'i m a'; row-gap: 2px; padding: 8px 12px 8px 13px; }
  .f-label { grid-area: l; font-size: 13.5px; }
  .f-in { grid-area: i; font-size: 16px; height: 40px; }
  .f-in.mono { font-size: 15px; }
  .f-mark { grid-area: m; }
  .agree, .agree-sp { grid-area: a; width: 36px; height: 36px; }
  .f-err { grid-column: 1 / -1; }
  .rv-act { bottom: calc(62px + env(safe-area-inset-bottom)); padding: 10px 14px; }
  .rv-act .btn kbd { display: none; }
  .pn-h, .pn-sub { padding-left: 14px; padding-right: 14px; }
  .checks { padding: 0 14px; }
  .totals { margin: 16px 14px 0; }
  .rv-lines thead th:first-child, .rv-lines tbody th { padding-left: 14px; }
  .rv-lines td:last-child, .rv-lines th:last-child { padding-right: 14px; }
  /* exceptions, approvals */
  .case { padding: 12px 16px 32px; }
  .case-h { flex-wrap: wrap; }
  .case-amt { margin-left: 0; width: 100%; flex-direction: row; justify-content: space-between; align-items: center; }
  .case-hl { font-size: 19px; margin-top: 16px; }
  /* tables restacked as entries: no sideways scrolling on phone */
  .compare, .compare tbody, .compare tr, .compare th, .compare td,
  .audit, .audit tbody, .audit tr, .audit th, .audit td,
  .register, .register tbody, .register tr, .register th, .register td,
  .matrix, .matrix tbody, .matrix tr, .matrix th, .matrix td { display: block; }
  .compare thead, .audit thead, .register thead, .matrix thead { display: none; }
  .compare td, .compare th, .audit td, .audit th, .register td, .register th, .matrix td, .matrix th { border: 0; padding: 0; width: auto !important; text-align: left; }
  .compare tr { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
  .compare tbody th { grid-column: 1 / -1; }
  .compare td[data-label]::before, .matrix td[data-label]::before { content: attr(data-label); display: block; color: var(--ink-3); font-size: 12.5px; font-weight: 600; }
  .compare td.num { text-align: left; }
  .compare .c-amt { grid-column: 1 / 3; font-weight: 650; }
  .compare .m-cell { align-self: end; justify-self: end; }
  .audit tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: 'who when' 'act act' 'chg chg' 'inv hash'; gap: 3px 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
  .audit .c-seq { display: none; }
  .audit .c-when { grid-area: when; text-align: right; font-size: 13px; color: var(--ink-3); }
  .audit .c-who { grid-area: who; font-weight: 600; }
  .audit .c-act { grid-area: act; font-size: 14.5px; }
  .audit .c-chg { grid-area: chg; font-size: 14px; }
  .audit .c-chg:empty { display: none; }
  .audit .c-inv { grid-area: inv; font-size: 13.5px; }
  .audit .c-hash { grid-area: hash; text-align: right; font-size: 13px; }
  .audit .empty-row { padding: 24px 16px; }
  .register tr { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; grid-template-areas: 'tog jv pay' 'tog ven date'; gap: 2px 10px; padding: 10px 16px 10px 6px; border-bottom: 1px solid var(--line); align-items: center; }
  .register .c-tog { grid-area: tog; }
  .register tbody th { grid-area: jv; }
  .register .c-date { grid-area: date; text-align: right; font-size: 13px; }
  .register .c-ven { grid-area: ven; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .register .c-tx, .register .c-gst, .register .c-tds { display: none; }
  .register .c-pay { grid-area: pay; text-align: right; font-weight: 650; }
  .register tr.is-open, .register tr.jv-row { background: var(--wash); }
  .register tr.is-open td, .register tr.is-open th { background: none; }
  .register tr.jv-row { display: block; padding: 0 16px 14px; }
  .register .jv-row td { padding: 0; }
  .register .jv-row .journal, .register .jv-row .journal * { display: revert; }
  .register .jv-row .journal thead { display: table-header-group; }
  .register .jv-row .journal th, .register .jv-row .journal td { padding: 7px 8px 7px 0; border-bottom: 1px solid var(--line); }
  .register .jv-row .journal td:last-child, .register .jv-row .journal th:last-child { padding-right: 0; }
  .matrix tr { display: grid; grid-template-columns: 1fr; gap: 6px; padding: 12px 0; border-bottom: 1px solid var(--line); }
  .matrix tbody th { font-weight: 650; }
  .matrix select { width: 100%; }
  .ap-queue { padding: 0 16px 6px; }
  .dec { padding: 12px 16px 0; }
  .dec-h { flex-wrap: wrap; }
  .dec-amt { margin-left: 0; width: 100%; text-align: left; }
  .chain li + li::before { width: 18px; margin: 0 8px; }
  .dec-bar { margin: 20px -16px 0; padding: 10px 16px; bottom: calc(62px + env(safe-area-inset-bottom)); }
  .dec-bar textarea { flex: 1 1 100%; }
  .dec-bar .phead-sp { display: none; }
  .dec-bar .btn { flex: 1; }
  .po-q { padding: 4px 16px 0; }
  .po-q .grid thead { display: none; }
  .po-q .grid, .po-q .grid tbody { display: block; }
  .po-q .grid tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: 'inv amt' 'st by' 'act act'; gap: 2px 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
  .po-q .grid td, .po-q .grid th { display: block; border: 0; padding: 0; min-width: 0; }
  .po-q .grid tbody th { grid-area: inv; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .po-q .grid td:nth-child(2) { grid-area: by; text-align: right; color: var(--ink-2); font-size: 13.5px; }
  .po-q .grid td:nth-child(3) { grid-area: st; }
  .po-q .grid td:nth-child(4) { grid-area: amt; font-weight: 650; }
  .po-q .grid .c-act { grid-area: act; text-align: left !important; }
  .po-q .grid .c-act:empty { display: none; }
  .numbers .grid { table-layout: fixed; }
  .numbers .grid th, .numbers .grid td { padding: 7px 4px; white-space: normal; font-size: 13px; overflow-wrap: anywhere; }
  .dash { padding: 0 16px 32px; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .kpi { padding: 14px 12px 14px 0 !important; border-left: 0 !important; border-bottom: 1px solid var(--line); }
  .kpi:nth-child(even) { padding-left: 14px !important; border-left: 1px solid var(--line) !important; }
  .kpi-v { font-size: 22px; }
  .charts { grid-template-columns: 1fr; gap: 30px; }
  .legend { margin-left: 0; width: 100%; }
  .c-tick { font-size: 13px; }
  .hb li { grid-template-columns: minmax(0, 1fr) 84px 50px; grid-template-areas: 'l v s' 't t t'; row-gap: 5px; }
  .hb-l { grid-area: l; } .hb-t { grid-area: t; } .hb-v { grid-area: v; } .hb-s { grid-area: s; }
  .rules-grid { padding: 0 16px 24px; gap: 20px; }
  .set-row { grid-template-columns: 1fr; gap: 12px; }
  .matrix input[type="number"] { width: 110px; }
  .save-bar { bottom: calc(62px + env(safe-area-inset-bottom)); padding: 10px 16px; }
  .toast { bottom: 82px; }
  .player { left: 50%; width: calc(100vw - 16px); bottom: calc(68px + env(safe-area-inset-bottom)); grid-template-columns: 1fr; padding: 10px 12px; }
  .pl-buttons { grid-column: 1; grid-row: auto; margin-top: 8px; }
  .pl-buttons .btn { flex: 1; }
  .pl-say { font-size: 14px; min-height: 0; }
  body.running main { padding-bottom: 240px; }
  .tour { right: 8px; left: 8px; width: auto; bottom: calc(70px + env(safe-area-inset-bottom)); }
  .pop { min-width: 0; width: calc(100vw - 16px); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
