/* Empirose Reports. A ledger: green binding on the left, white pages, figures set in tabular IBM Plex Sans. */
@font-face { font-family: "Plex"; src: url("/static/fonts/ibm-plex-sans-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; 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: "Plex"; src: url("/static/fonts/ibm-plex-sans-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; 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: "Plex"; src: url("/static/fonts/ibm-plex-sans-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; 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: "Plex"; src: url("/static/fonts/ibm-plex-sans-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; 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: "Plex"; src: url("/static/fonts/ibm-plex-sans-latin-ext-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; 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-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Plex"; src: url("/static/fonts/ibm-plex-sans-latin-ext-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; 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-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Plex"; src: url("/static/fonts/ibm-plex-sans-latin-ext-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; 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-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Plex"; src: url("/static/fonts/ibm-plex-sans-latin-ext-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; 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-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  color-scheme: light;
  --binding: #123b2f;
  --binding-2: #1a4a3b;
  --binding-ink: #e6f0ea;
  --binding-muted: #9db8ab;
  --page: #f1f4f1;
  --surface: #ffffff;
  --surface-2: #f5f7f5;
  --ink: #15211c;
  --ink-2: #48574f;
  --muted: #7a8781;
  --rule: #dfe5e0;
  --grid: #e8ece9;
  --axis: #c3ccc6;
  --hover: #f3f7f4;
  --focus: #2a78d6;
  --brand: #1f6b50;
  --brand-soft: #e2efe7;
  --s1: #2a78d6;
  --s2: #eb6834;
  --up: #006300;
  --down: #b02a2a;
  --good: #0ca30c;
  --warning: #fab219;
  --serious: #ec835a;
  --critical: #d03b3b;
  --st-shipped: #2a78d6;
  --st-scheduled: #86b6ef;
  --st-pending: #c3c2b7;
  --st-deleted: #e1e0d9;
  --shadow-pop: 0 2px 6px rgba(18, 59, 47, 0.08), 0 16px 40px rgba(18, 59, 47, 0.14);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --binding: #0c241d; --binding-2: #143428; --binding-ink: #e1ece5; --binding-muted: #86a497;
    --page: #0e1210; --surface: #171c19; --surface-2: #1d2420; --ink: #eef2ef; --ink-2: #c1cbc5; --muted: #8a968f;
    --rule: #2a332e; --grid: #232b26; --axis: #3a453f; --hover: #1e2622; --focus: #6da7ec;
    --brand: #5fb38d; --brand-soft: #1d3329;
    --s1: #3987e5; --s2: #d95926; --up: #0ca30c; --down: #e66767;
    --st-shipped: #3987e5; --st-scheduled: #184f95; --st-pending: #5d5c57; --st-deleted: #383835;
    --shadow-pop: 0 2px 6px rgba(0, 0, 0, 0.4), 0 16px 40px rgba(0, 0, 0, 0.5);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --binding: #0c241d; --binding-2: #143428; --binding-ink: #e1ece5; --binding-muted: #86a497;
  --page: #0e1210; --surface: #171c19; --surface-2: #1d2420; --ink: #eef2ef; --ink-2: #c1cbc5; --muted: #8a968f;
  --rule: #2a332e; --grid: #232b26; --axis: #3a453f; --hover: #1e2622; --focus: #6da7ec;
  --brand: #5fb38d; --brand-soft: #1d3329;
  --s1: #3987e5; --s2: #d95926; --up: #0ca30c; --down: #e66767;
  --st-shipped: #3987e5; --st-scheduled: #184f95; --st-pending: #5d5c57; --st-deleted: #383835;
  --shadow-pop: 0 2px 6px rgba(0, 0, 0, 0.4), 0 16px 40px rgba(0, 0, 0, 0.5);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--page);
  color: var(--ink);
  font: 400 15px/1.5 "Plex", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}
a { color: var(--brand); }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100vh; }
.shell > div { min-width: 0; }
.rail {
  background: var(--binding); color: var(--binding-ink);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; padding: 20px 14px 16px;
}
.wordmark { display: flex; align-items: center; gap: 10px; color: var(--binding-ink); text-decoration: none; padding: 0 8px; }
.wordmark .mark { width: 28px; height: 28px; border-radius: 7px; background: var(--binding-ink); color: var(--binding); display: grid; place-items: center; font-weight: 700; font-size: 15px; }
.wordmark b { font-weight: 600; font-size: 15px; letter-spacing: -0.005em; }
.book { margin: 26px 8px 10px; }
.book .t { font-size: 17px; font-weight: 600; line-height: 1.25; }
.book .s { font-size: 13px; color: var(--binding-muted); }
.nav { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 8px;
  color: var(--binding-ink); text-decoration: none; font-size: 14.5px; opacity: .82;
}
.nav a svg { flex: none; opacity: .8; }
.nav a:hover { background: var(--binding-2); opacity: 1; }
.nav a[aria-current="page"] { background: var(--binding-ink); color: var(--binding); opacity: 1; font-weight: 600; }
.nav a[aria-current="page"] svg { opacity: 1; }
.nav .sep { height: 1px; background: rgba(255, 255, 255, 0.1); margin: 8px 10px; }
.rail-foot { margin-top: auto; padding: 12px 8px 0; border-top: 1px solid rgba(255, 255, 255, 0.1); font-size: 13px; color: var(--binding-muted); display: grid; gap: 8px; }
.rail-foot .who { color: var(--binding-ink); }
.rail-foot form { margin: 0; }
.rail-foot button { background: none; border: 0; padding: 0; color: var(--binding-muted); text-decoration: underline; text-underline-offset: 3px; }
.rail-foot button:hover { color: var(--binding-ink); }
.fresh { display: flex; align-items: flex-start; gap: 7px; line-height: 1.35; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: none; margin-top: 5px; }
.dot.ok { background: var(--good); }
.dot.warn { background: var(--warning); }
.dot.bad { background: var(--critical); }

.topbar-m { display: none; }

main { padding: 26px 36px 72px; max-width: 1240px; width: 100%; }

/* ---------- view header ---------- */
.vhead { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 6px; }
.vhead h1 { margin: 0; font-size: 28px; line-height: 1.15; font-weight: 600; letter-spacing: -0.015em; }
.vhead .lede { margin: 6px 0 0; color: var(--ink-2); max-width: 62ch; }
.controls { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.context { color: var(--muted); font-size: 13.5px; margin: 14px 0 22px; }
.context b { color: var(--ink-2); font-weight: 500; }

.ctl {
  display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 12px;
  border: 1px solid var(--rule); border-radius: 8px; background: var(--surface); white-space: nowrap; font-size: 14px;
}
.ctl:hover { border-color: var(--axis); }
.ctl .k { color: var(--muted); }
.ctl .caret { margin-left: 2px; color: var(--muted); }
select.ctl { appearance: none; padding-right: 32px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%237a8781' stroke-width='1.5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }

/* ---------- period menu ---------- */
.pp { position: relative; }
.pp-menu {
  position: absolute; right: 0; top: 44px; z-index: 40; background: var(--surface); border: 1px solid var(--rule);
  border-radius: 12px; box-shadow: var(--shadow-pop); min-width: 248px; max-width: calc(100vw - 32px);
}
.pp-menu.left { right: auto; left: 0; }
.pp-list { list-style: none; margin: 0; padding: 6px; }
.pp-list button {
  width: 100%; display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 0; background: none;
  border-radius: 7px; text-align: left; font-size: 14px;
}
.pp-list button:hover { background: var(--hover); }
.pp-list .tick { width: 14px; color: var(--brand); font-weight: 700; }
.pp-list button[aria-checked="true"] { font-weight: 600; }
.pp-list .hint { margin-left: auto; color: var(--muted); font-size: 12.5px; font-weight: 400; }
.pp-list .divider { height: 1px; background: var(--rule); margin: 6px 4px; }
.pp-menu.with-cal { display: flex; }
.pp-menu.with-cal .pp-list { border-right: 1px solid var(--rule); min-width: 200px; }
.pp-cal { padding: 14px 16px 14px; }
.backbtn { display: none; border: 0; background: none; color: var(--brand); padding: 0 0 8px; font-size: 14px; }
.cal-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.cal-nav button { border: 0; background: none; width: 32px; height: 32px; border-radius: 7px; color: var(--ink-2); font-size: 18px; }
.cal-nav button:hover { background: var(--hover); }
.cal-nav button:disabled { opacity: .3; cursor: default; background: none; }
.cal-nav span { font-size: 13px; color: var(--muted); }
.months { display: flex; gap: 22px; }
.month h4 { margin: 0 0 6px; text-align: center; font-size: 13.5px; font-weight: 600; }
.grid7 { display: grid; grid-template-columns: repeat(7, 34px); row-gap: 2px; }
.grid7 .dow { font-size: 11.5px; color: var(--muted); text-align: center; padding: 4px 0; }
.day { height: 32px; border: 0; background: none; font-size: 13px; border-radius: 0; }
.day:hover:not(:disabled) { background: var(--hover); border-radius: 7px; }
.day:disabled { color: var(--muted); opacity: .35; cursor: default; }
.day.in { background: var(--brand-soft); }
.day.edge { background: var(--brand); color: #fff; border-radius: 7px; font-weight: 600; }
.day.edge:hover:not(:disabled) { background: var(--brand); }
.day.in:hover:not(:disabled) { background: var(--brand-soft); border-radius: 0; }
.pp-menu.with-cal .pp-list .hint { display: none; }
.day.today:not(.edge) { box-shadow: inset 0 -2px 0 var(--brand); }
.cal-foot { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.cal-foot .txt { flex: 1; font-size: 13px; color: var(--ink-2); }
.btn { height: 34px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--rule); background: var(--surface); font-size: 14px; }
.btn:hover { background: var(--hover); }
a.btn { display: inline-flex; align-items: center; text-decoration: none; color: var(--ink); }
.btn.primary { background: var(--brand); color: #fff; border-color: var(--brand); }
.btn.primary:disabled { opacity: .4; cursor: default; }

/* ---------- notices ---------- */
.notice { margin: 0 0 22px; padding: 10px 14px; border-left: 3px solid var(--warning); background: var(--surface); border-radius: 0 8px 8px 0; font-size: 13.5px; color: var(--ink-2); }
.notice ul { margin: 0; padding-left: 16px; }
.err { margin: 0 0 22px; padding: 10px 14px; border-left: 3px solid var(--critical); background: var(--surface); border-radius: 0 8px 8px 0; }

/* ---------- panels ---------- */
.panel { background: var(--surface); border: 1px solid var(--rule); border-radius: 12px; padding: 18px 20px; margin-bottom: 18px; min-width: 0; }
.panel > h2, .phead h2 { margin: 0; font-size: 16px; font-weight: 600; }
.phead { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.phead .note { color: var(--muted); font-size: 13px; }
.phead .grow { flex: 1; }
.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.two > .panel { margin-bottom: 0; }
.two + .panel, .two + .two { margin-top: 18px; }
.dtwo { margin-top: 22px; }

/* ---------- the ledger hero (sales) ---------- */
.ledger { background: var(--surface); border: 1px solid var(--rule); border-radius: 12px; padding: 22px 24px 20px; margin-bottom: 18px; }
.ledger-top { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.figure .lab { font-size: 14px; color: var(--ink-2); }
.figure .big { font-size: 44px; line-height: 1.05; font-weight: 600; letter-spacing: -0.025em; margin: 4px 0 4px; }
.figure .sub { color: var(--ink-2); font-size: 14px; }
.figure .chg { font-size: 13px; color: var(--muted); margin-top: 6px; }
.figure.delivered .big { color: var(--brand); }
.pipe { margin-top: 22px; }
.pipe-title { font-size: 13px; color: var(--ink-2); margin-bottom: 8px; }
.pipe-bar { display: flex; gap: 2px; height: 14px; }
.pipe-bar span { display: block; height: 100%; min-width: 3px; }
.pipe-bar span:first-child { border-radius: 4px 0 0 4px; }
.pipe-bar span:last-child { border-radius: 0 4px 4px 0; }
.pipe-bar span:only-child { border-radius: 4px; }
.pipe-key { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 10px; font-size: 13px; color: var(--ink-2); }
.pipe-key i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.pipe-key b { color: var(--ink); font-weight: 600; margin-left: 4px; }
.st-Delivered { background: var(--good); }
.st-Shipped { background: var(--st-shipped); }
.st-Scheduled { background: var(--st-scheduled); }
.st-Pending { background: var(--st-pending); }
.st-Cancelled { background: var(--serious); }
.st-Banned { background: var(--critical); }
.st-Deleted, .st-Other { background: var(--st-deleted); }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; border-top: 1px solid var(--rule); margin-top: 20px; padding-top: 16px; }
.stat { padding-right: 16px; }
.stat + .stat { padding-left: 16px; border-left: 1px solid var(--rule); }
.stat .lab { font-size: 13px; color: var(--ink-2); }
.stat .v { font-size: 22px; font-weight: 600; letter-spacing: -0.01em; margin-top: 2px; }
.stat .chg { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.up { color: var(--up); font-weight: 600; }
.down { color: var(--down); font-weight: 600; }

/* ---------- charts ---------- */
.legend { display: flex; gap: 14px; font-size: 13px; color: var(--ink-2); flex-wrap: wrap; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.legend .l1 { background: var(--s1); }
.legend .l2 { background: var(--s2); }
.legend .ln1, .legend .ln2 { height: 2px; width: 14px; border-radius: 1px; vertical-align: 3px; }
.legend .ln1 { background: var(--s1); }
.legend .ln2 { background: var(--s2); }
.seg { display: inline-flex; border: 1px solid var(--rule); border-radius: 8px; padding: 2px; background: var(--surface); }
.seg button { border: 0; background: none; padding: 5px 11px; border-radius: 6px; font-size: 13px; color: var(--ink-2); }
.seg button[aria-pressed="true"] { background: var(--brand-soft); color: var(--ink); font-weight: 600; }
.chart { position: relative; width: 100%; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.gridline { stroke: var(--grid); stroke-width: 1; }
.baseline { stroke: var(--axis); stroke-width: 1; }
.tick { fill: var(--muted); font-size: 11.5px; font-family: "Plex", system-ui, sans-serif; }
.bar1 { fill: var(--s1); }
.bar2 { fill: var(--s2); }
.line1 { fill: none; stroke: var(--s1); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.line2 { fill: none; stroke: var(--s2); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.pt1 { fill: var(--s1); stroke: var(--surface); stroke-width: 2; }
.pt2 { fill: var(--s2); stroke: var(--surface); stroke-width: 2; }
.cross { stroke: var(--axis); stroke-width: 1; }
.hit { fill: transparent; }
.hit:hover { fill: var(--hover); }
.empty { fill: var(--muted); font-size: 13px; }
.tip {
  position: absolute; pointer-events: none; z-index: 50; background: var(--surface); border: 1px solid var(--rule);
  box-shadow: var(--shadow-pop); border-radius: 9px; padding: 9px 11px; font-size: 13px; min-width: 180px;
}
.tip b { display: block; margin-bottom: 4px; font-weight: 600; }
.tip .row { display: flex; justify-content: space-between; gap: 16px; color: var(--ink-2); }
.tip .row span:last-child { color: var(--ink); }
.tip i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 6px; }
.tip .i1 { background: var(--s1); }
.tip .i2 { background: var(--s2); }

/* horizontal bars (rankings) */
.hbars { display: grid; gap: 9px; }
.hbar { display: grid; grid-template-columns: minmax(90px, 160px) 1fr 96px; align-items: center; gap: 12px; font-size: 13.5px; }
.hbar .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar .track { display: block; height: 10px; background: var(--surface-2); border-radius: 0 4px 4px 0; }
.hbar .fill { display: block; height: 100%; background: var(--s1); border-radius: 0 4px 4px 0; }
.hbar .n { text-align: right; color: var(--ink-2); }

/* ---------- tables ---------- */
.tw { overflow-x: auto; margin: 0 -6px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 9px 8px; text-align: right; white-space: nowrap; border-bottom: 1px solid var(--grid); }
th:first-child, td:first-child, th.l, td.l { text-align: left; }
th { color: var(--muted); font-weight: 500; font-size: 12.5px; user-select: none; }
th button { background: none; border: 0; padding: 0; color: inherit; font: inherit; }
th button:hover { color: var(--ink); }
th[aria-sort="descending"] button::after { content: " ↓"; }
th[aria-sort="ascending"] button::after { content: " ↑"; }
tbody tr.pick { cursor: pointer; }
tbody tr:hover td { background: var(--hover); }
tbody tr[aria-selected="true"] td { background: var(--brand-soft); }
tbody tr[aria-selected="true"] td:first-child { box-shadow: inset 3px 0 0 var(--brand); }
tfoot td { font-weight: 600; border-bottom: 0; border-top: 1px solid var(--axis); }
.rank { color: var(--muted); width: 26px; }
.rate { display: inline-flex; align-items: center; gap: 8px; justify-content: flex-end; }
.meter { width: 60px; height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; display: inline-block; }
.meter > span { display: block; height: 100%; background: var(--brand); border-radius: 3px; }
.tag { display: inline-block; font-size: 12px; padding: 1px 8px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); }
.tag.wa { background: color-mix(in srgb, var(--s2) 16%, var(--surface)); color: var(--ink); }
.more { margin-top: 12px; }
.search { height: 36px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--rule); background: var(--surface); min-width: 240px; }

/* detail (drill-down) */
.detail { border-top: 3px solid var(--brand); }
.minis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; margin: 4px 0 18px; }
.mini .lab { font-size: 12.5px; color: var(--ink-2); }
.mini .v { font-size: 20px; font-weight: 600; }
.mini .chg { font-size: 12px; color: var(--muted); }

/* statements */
details.stmt { border-bottom: 1px solid var(--grid); }
details.stmt summary { list-style: none; display: grid; grid-template-columns: 120px minmax(120px, 1fr) repeat(3, 110px) 20px; gap: 8px; padding: 9px 4px; cursor: pointer; font-size: 14px; }
details.stmt summary::-webkit-details-marker { display: none; }
details.stmt summary:hover { background: var(--hover); }
details.stmt summary .r { text-align: right; }
details.stmt summary .chev { color: var(--muted); transition: transform .15s; }
details.stmt[open] summary .chev { transform: rotate(90deg); }
details.stmt pre { white-space: pre-wrap; font: 13px/1.5 "Plex", system-ui, sans-serif; color: var(--ink-2); background: var(--surface-2); border-radius: 8px; padding: 10px 12px; margin: 0 4px 12px; }
.stmt-head { display: grid; grid-template-columns: 120px minmax(120px, 1fr) repeat(3, 110px) 20px; gap: 8px; padding: 0 4px 6px; font-size: 12.5px; color: var(--muted); border-bottom: 1px solid var(--grid); }
.stmt-head .r { text-align: right; }

/* compare */
.cmp-pick { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; margin-bottom: 18px; }
.cmp-side { display: grid; gap: 6px; }
.cmp-side .lab { font-size: 13px; color: var(--ink-2); display: flex; align-items: center; gap: 7px; }
.cmp-side .lab i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.cmp-side .lab .a { background: var(--s1); }
.cmp-side .lab .b { background: var(--s2); }
.vs { color: var(--muted); padding-bottom: 9px; }
.score td.metric { color: var(--ink-2); }
.score td.win { font-weight: 600; }
.score .diff { color: var(--muted); }

.defs { color: var(--muted); font-size: 13px; line-height: 1.6; max-width: 80ch; margin-top: 26px; }
.defs p { margin: 0 0 8px; }
.defs b { color: var(--ink-2); font-weight: 600; }

body.loading .view { opacity: .5; transition: opacity .12s; }

/* ---------- home + login ---------- */
.home { max-width: 980px; margin: 0 auto; padding: 48px 24px; }
.home-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 30px; }
.home-head .wordmark { color: var(--ink); padding: 0; }
.home-head .wordmark .mark { background: var(--binding); color: var(--binding-ink); }
.home-head form { margin: 0; }
.home-head button { background: none; border: 0; color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; }
.home h1 { font-size: 28px; font-weight: 600; margin: 0 0 6px; letter-spacing: -0.015em; }
.home .lede { color: var(--ink-2); margin: 0 0 24px; }
.books { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.bookcard { display: block; text-decoration: none; color: var(--ink); background: var(--surface); border: 1px solid var(--rule); border-left: 6px solid var(--binding); border-radius: 10px; padding: 18px 20px; }
.bookcard:hover { border-color: var(--axis); border-left-color: var(--brand); }
.bookcard .team { color: var(--muted); font-size: 13px; }
.bookcard h3 { margin: 2px 0 14px; font-size: 20px; font-weight: 600; }
.bookcard .today { display: flex; gap: 22px; font-size: 13px; color: var(--ink-2); }
.bookcard .today b { display: block; font-size: 20px; color: var(--ink); font-weight: 600; }
.home .fresh { color: var(--muted); font-size: 13px; margin-top: 24px; }

.login { min-height: 100vh; display: grid; grid-template-columns: minmax(280px, 420px) 1fr; }
.login-side { background: var(--binding); color: var(--binding-ink); padding: 40px; display: flex; flex-direction: column; justify-content: space-between; }
.login-side .wordmark { padding: 0; }
.login-side p { color: var(--binding-muted); max-width: 30ch; margin: 0; }
.login-main { display: grid; place-items: center; padding: 24px; }
.login form { width: 100%; max-width: 360px; }
.login h1 { font-size: 26px; font-weight: 600; margin: 0 0 6px; letter-spacing: -0.015em; }
.login .lede { color: var(--ink-2); margin: 0 0 22px; }
.login label { display: block; font-size: 13.5px; color: var(--ink-2); margin: 14px 0 6px; }
.login input { width: 100%; height: 42px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--rule); background: var(--surface); }
.login .btn { width: 100%; height: 42px; margin-top: 22px; }
.login .msg { color: var(--down); font-size: 13.5px; margin: 12px 0 0; }
.login .msg:empty { display: none; }

/* ---------- small screens ---------- */
@media (max-width: 1080px) {
  .minis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .rail { display: none; }
  .topbar-m {
    display: flex; align-items: center; gap: 10px; background: var(--binding); color: var(--binding-ink);
    padding: 10px 16px; position: sticky; top: 0; z-index: 30;
  }
  .topbar-m select { flex: 1; min-width: 0; height: 36px; border-radius: 8px; border: 0; background-color: var(--binding-2); color: var(--binding-ink); padding: 0 32px 0 10px; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23e6f0ea' stroke-width='1.5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
  .topbar-m .wordmark b { display: none; }
  main { padding: 18px 16px 56px; }
  .two { grid-template-columns: 1fr; }
  .ledger-top { grid-template-columns: 1fr; gap: 18px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 14px; }
  .stat:nth-child(3) { padding-left: 0; border-left: 0; }
  .months .month:first-child { display: none; }
  .pp-menu { width: calc(100vw - 32px); }
  .pp-menu.with-cal .pp-list { display: none; }
  .backbtn { display: block; }
  .login { grid-template-columns: 1fr; }
  .login-side { padding: 24px; gap: 16px; }
}
@media (max-width: 560px) {
  .vhead h1 { font-size: 23px; }
  .figure .big { font-size: 36px; }
  .controls { width: 100%; }
  .controls .pp, .controls > select { flex: 1; }
  .controls .ctl { width: 100%; justify-content: space-between; }
  .pp-menu { right: auto; left: 0; }
  .grid7 { grid-template-columns: repeat(7, 1fr); }
  .minis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .search { min-width: 0; width: 100%; }
  details.stmt summary, .stmt-head { grid-template-columns: 76px minmax(80px, 1fr) 88px 16px; }
  details.stmt summary .opt, .stmt-head .opt { display: none; }
  .hbar { grid-template-columns: 96px 1fr 54px; }
  .ledger { padding: 18px; }
}

/* remittances */
.small { font-size: 12px; }
select.assign { height: 32px; font-size: 13px; max-width: 220px; }
label.btn { display: inline-flex; align-items: center; cursor: pointer; }
.notice + #bal { margin-top: 12px; }

/* days a partner still owes for */
.tag.part { background: color-mix(in srgb, var(--warning) 22%, var(--surface)); color: var(--ink); }
.tag.ok { background: var(--brand-soft); color: var(--brand); }
details.owe { border-bottom: 1px solid var(--grid); }
details.owe summary, .owe-head { display: grid; grid-template-columns: 82px minmax(140px, 1fr) 100px 100px 110px 96px 16px; gap: 10px; align-items: baseline; padding: 9px 4px; font-size: 14px; }
details.owe summary { list-style: none; cursor: pointer; }
details.owe summary::-webkit-details-marker { display: none; }
details.owe summary:hover { background: var(--hover); }
details.owe summary:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.owe-head { padding-top: 0; padding-bottom: 6px; font-size: 12.5px; color: var(--muted); border-bottom: 1px solid var(--grid); }
details.owe .r, .owe-head .r { text-align: right; font-variant-numeric: tabular-nums; }
details.owe .who { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
details.owe[open] .who { white-space: normal; }
details.owe .acct { color: var(--ink); font-weight: 600; margin-right: 6px; }
details.owe .chev { color: var(--muted); transition: transform .15s; }
details.owe[open] .chev { transform: rotate(90deg); }
.daybody { margin: 0 4px 14px 96px; font-size: 13.5px; color: var(--ink-2); max-width: 78ch; }
.daybody p { margin: 8px 0; }
.daybody pre { white-space: pre-wrap; font: 13px/1.5 "Plex", system-ui, sans-serif; background: var(--surface-2); border-radius: 8px; padding: 10px 12px; margin: 6px 0; }
.daybody ul.orders { list-style: none; margin: 4px 0 10px; padding: 0; }
.daybody ul.orders li { display: flex; flex-wrap: wrap; gap: 4px 10px; padding: 4px 0; border-bottom: 1px dashed var(--grid); }
.daybody ul.orders li b { color: var(--ink); font-weight: 600; }
details.settled { margin-top: 18px; }
details.settled > summary { cursor: pointer; color: var(--ink-2); font-size: 14px; padding: 6px 0; }
#owes .notice { margin: 14px 0 0; }
@media (max-width: 560px) {
  details.owe summary, .owe-head { grid-template-columns: 62px minmax(0, 1fr) 84px 14px; }
  details.owe .opt, .owe-head .opt, details.owe summary > span:nth-child(6), .owe-head > span:nth-child(6) { display: none; }
  .daybody { margin-left: 4px; }
}
.suggest { white-space: normal; margin-top: 6px; padding: 6px 10px; border-left: 3px solid var(--brand); background: var(--brand-soft); border-radius: 0 6px 6px 0; font-size: 13px; color: var(--ink-2); max-width: 70ch; }
.suggest b { color: var(--ink); }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12.5px; margin-left: 6px; }
.daybody .marks { color: var(--muted); }
.daybody .marks .btn.sm:first-of-type { margin-left: 8px; }
