/* Fire Palace Back Office.
   The kiosk's colors: warm ivory, midnight navy, burnished gold, and ember for the one thing that matters on each view.
   Navy carries the frame (sidebar, bars, buttons), gold supports, ember is the accent. Green and red only mean good and bad.
   Type: the Fire Palace serif for titles, the system face for everything else, figures in tabular numerals. */
:root {
  --bg: #fbf6ec; --bg-2: #f4ead6; --surface: #ffffff; --surface-2: #fbf7ef;
  --ink: #14213d; --ink-2: #47516b; --ink-3: #5f677c;
  --line: #e7d8b4; --line-2: #f0e5cb;
  --gold: #8a5a0e; --gold-2: #d99a27; --ember: #c2301a; --ember-2: #e0522b;
  --good: #1a7343; --bad: #b42318; --good-bg: #e3f2e8; --bad-bg: #fbe7e3; --money-bg: #fbeed3;
  --side: #14213d; --side-2: #22325a; --side-ink: #f7efdc; --side-ink-2: #b9c1d4;
  --scrim: rgba(10, 16, 32, .48);
  --serif: Georgia, "Iowan Old Style", "Palatino Linotype", "Times New Roman", serif;
  --sans: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --r: 16px; --r-sm: 10px;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0b1120; --bg-2: #101a2e; --surface: #131c31; --surface-2: #18233c;
  --ink: #f4ecd9; --ink-2: #c6cbd8; --ink-3: #a1a8ba;
  --line: #27324f; --line-2: #1e2842;
  --gold: #e8bb68; --gold-2: #e0a640; --ember: #ff7b52; --ember-2: #ff7b52;
  --good: #5ccd94; --bad: #ff8172; --good-bg: #123222; --bad-bg: #3c1814; --money-bg: #35280e;
  --side: #070c18; --side-2: #18233c; --side-ink: #f4ecd9; --side-ink-2: #a1a8ba;
  --scrim: rgba(0, 0, 0, .6);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1120; --bg-2: #101a2e; --surface: #131c31; --surface-2: #18233c;
    --ink: #f4ecd9; --ink-2: #c6cbd8; --ink-3: #a1a8ba;
    --line: #27324f; --line-2: #1e2842;
    --gold: #e8bb68; --gold-2: #e0a640; --ember: #ff7b52; --ember-2: #ff7b52;
    --good: #5ccd94; --bad: #ff8172; --good-bg: #123222; --bad-bg: #3c1814; --money-bg: #35280e;
    --side: #070c18; --side-2: #18233c; --side-ink: #f4ecd9; --side-ink-2: #a1a8ba;
    --scrim: rgba(0, 0, 0, .6);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { background: var(--bg); -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--ink); font: 16px/1.5 var(--sans); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
img { display: block; max-width: 100%; }
:focus-visible { outline: 3px solid var(--gold-2); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
.up { color: var(--good); } .down { color: var(--bad); }
.muted { color: var(--ink-3); }
.num, .tab { font-variant-numeric: tabular-nums; }
.only-phone { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- frame ---------- */
.app { display: grid; grid-template-columns: 256px minmax(0, 1fr); min-height: 100vh; background: linear-gradient(90deg, var(--side) 256px, transparent 256px); }
.side { position: sticky; top: 0; height: 100vh; overflow-y: auto; background: var(--side); color: var(--side-ink); display: flex; flex-direction: column; padding: 18px 14px 14px; z-index: 40; }
.side-brand { display: flex; align-items: center; gap: 12px; text-decoration: none; padding: 4px 8px 16px; }
.side-brand img { width: 44px; height: 44px; border-radius: 12px; object-fit: cover; }
.side-brand b { display: block; font: 700 19px/1.1 var(--serif); letter-spacing: .02em; }
.side-brand small { display: block; color: var(--gold-2); font-size: 13px; font-weight: 600; margin-top: 2px; }
.side-search { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 42px; padding: 0 12px; border-radius: 12px; border: 1px solid rgba(255, 255, 255, .14); background: rgba(255, 255, 255, .05); color: var(--side-ink-2); font-size: 15px; text-align: left; }
.side-search span { flex: 1; }
kbd { font: 600 13px var(--sans); border: 1px solid rgba(255, 255, 255, .2); border-radius: 6px; padding: 1px 6px; }
.side nav { display: flex; flex-direction: column; gap: 2px; margin-top: 14px; }
.side nav a { display: flex; align-items: center; gap: 12px; padding: 0 12px; min-height: 40px; border-radius: 10px; color: var(--side-ink-2); text-decoration: none; font-weight: 600; font-size: 15px; }
.side nav a svg { flex: none; opacity: .9; }
.side nav a:hover { background: rgba(255, 255, 255, .06); color: var(--side-ink); }
.side nav a[aria-current="page"] { background: var(--side-2); color: var(--side-ink); box-shadow: inset 3px 0 0 var(--gold-2); }
.side nav a .count { margin-left: auto; min-width: 22px; height: 22px; border-radius: 11px; background: var(--ember); color: #fff; font-size: 13px; font-weight: 700; display: grid; place-items: center; padding: 0 6px; }
.nav-group { margin: 18px 12px 4px; font-size: 13px; font-weight: 600; color: var(--side-ink-2); opacity: .75; }
.side-foot { margin-top: auto; padding-top: 16px; }
.who-card { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border-radius: 12px; border: 1px solid rgba(255, 255, 255, .1); background: transparent; color: var(--side-ink); text-align: left; text-decoration: none; }
.who-card .avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--gold-2); color: #14213d; display: grid; place-items: center; font-weight: 800; flex: none; }
.who-card span { min-width: 0; }
.who-card b { display: block; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who-card small { display: block; font-size: 13px; color: var(--side-ink-2); }
.scrim { display: none; }

.main { min-width: 0; display: flex; flex-direction: column; }
.top { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 14px; padding: 12px 32px; min-height: 66px; background: var(--bg); background: color-mix(in srgb, var(--bg) 90%, transparent); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.menu-btn { display: none; width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); place-items: center; }
.crumbs { flex: none; font-weight: 700; font-size: 16px; white-space: nowrap; }
.crumbs small { color: var(--ink-3); font-weight: 600; }
.toolbar { margin-left: auto; display: flex; align-items: center; justify-content: flex-end; flex: 1 1 auto; min-width: 0; }
.tb-full { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.sample-band { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; margin: 16px 32px 0; padding: 10px 16px; border-radius: 12px; background: var(--money-bg); color: var(--ink); font-size: 15px; }
.sample-band b { color: var(--gold); }
.sb-short { display: none; }
.page { width: 100%; max-width: 1340px; margin: 0 auto; padding: 26px 32px 72px; }
.page:focus { outline: none; }

/* toolbar controls */
.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); }
.seg button { border: 0; background: transparent; min-height: 36px; padding: 0 12px; border-radius: 9px; font-size: 14px; font-weight: 600; color: var(--ink-2); white-space: nowrap; }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.tb-select, .tb-date { appearance: none; -webkit-appearance: none; min-height: 42px; padding: 0 34px 0 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238a8f9c' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center; font-size: 14px; font-weight: 600; color: var(--ink); max-width: 220px; }
.tb-date { padding-right: 10px; background-image: none; width: 160px; }
.tb-range-select { display: none; }
@media (max-width: 1600px) { .toolbar .seg { display: none; } .tb-range-select { display: inline-block; } }
@media (max-width: 1180px) {
  .toolbar .tb-full { display: none; }
  .toolbar .tb-summary { display: inline-flex; align-items: center; gap: 6px; min-height: 42px; max-width: 62vw; padding: 0 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); font-size: 14px; font-weight: 700; }
  .tb-summary span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
.tb-summary { display: none; }
.tb-custom { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--ink-2); }

/* ---------- page heads ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.page-head-text { min-width: 0; }
.eyebrow { margin: 0 0 6px; color: var(--gold); font-size: 14px; font-weight: 700; }
h1 { margin: 0; font: 700 34px/1.15 var(--serif); text-wrap: balance; }
h1 .accent { color: var(--ember); }
.sub { margin: 8px 0 0; max-width: 72ch; color: var(--ink-2); font-size: 16px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; flex: none; }

/* ---------- headline numbers: one band, not a row of boxes ---------- */
.kpis { display: grid; grid-template-columns: minmax(0, 1.5fr) repeat(5, minmax(0, 1fr)); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; margin-bottom: 18px; }
.kpi { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 18px 18px 16px; border-left: 1px solid var(--line-2); text-decoration: none; color: inherit; min-width: 0; }
.kpi:hover { background: var(--surface-2); }
.kpi:first-child { border-left: 0; background: linear-gradient(180deg, var(--money-bg), transparent 80%); }
.kpi-label { font-size: 14px; font-weight: 600; color: var(--ink-2); }
.kpi-value { font: 700 24px/1.15 var(--sans); font-variant-numeric: tabular-nums; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi.hero .kpi-value { font-size: 36px; }
.kpi-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; flex-wrap: wrap; }
.kpi-note { font-size: 13px; color: var(--ink-3); }
.delta { font-size: 14px; font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.delta.flat { color: var(--ink-3); font-weight: 600; }
.spark { width: 100%; max-width: 120px; height: 32px; }
.spark path { fill: none; stroke: var(--ink); stroke-opacity: .55; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.spark circle { fill: var(--ember-2); }
.kpi.hero .spark path { stroke: var(--ember-2); stroke-opacity: 1; stroke-width: 2.5; }

/* ---------- cards and grids ---------- */
.stack { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.grid { display: grid; gap: 18px; }
.g-main { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 20px 22px; min-width: 0; }
.card.flush { padding: 0; overflow: hidden; }
.card.flush .card-head { padding: 18px 22px 0; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card h2 { margin: 0; font: 700 21px/1.25 var(--serif); }
.card h3.sub-head { margin: 20px 0 8px; font-size: 16px; font-weight: 700; }
.hint { margin: 4px 0 0; font-size: 14px; color: var(--ink-3); }
.card.alert { border-color: color-mix(in srgb, var(--bad) 35%, var(--line)); }
.card.money { border-color: color-mix(in srgb, var(--gold-2) 55%, var(--line)); background: linear-gradient(180deg, var(--money-bg), var(--surface) 160px); }
.empty { padding: 22px; text-align: center; color: var(--ink-3); font-size: 15px; border: 1px dashed var(--line); border-radius: var(--r-sm); }
.note-line { font-size: 14px; color: var(--ink-3); margin: 12px 0 0; }
.loading { color: var(--ink-3); padding: 40px 0; }
.loading::before { content: ""; display: inline-block; width: 14px; height: 14px; margin-right: 10px; border: 2px solid var(--line); border-top-color: var(--ember); border-radius: 50%; animation: spin .8s linear infinite; vertical-align: -2px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- charts ---------- */
.chart-box { margin: 0; outline-offset: 6px; }
.chart { display: block; width: 100%; height: auto; overflow: visible; touch-action: pan-y; cursor: crosshair; }
.c-grid { stroke: var(--line-2); stroke-width: 1; }
.tick { fill: var(--ink-3); font: 13px var(--sans); font-variant-numeric: tabular-nums; }
.c-line { fill: none; stroke: var(--ember-2); stroke-width: 3.5; stroke-linejoin: round; stroke-linecap: round; }
.c-cmp { fill: none; stroke: var(--gold-2); stroke-width: 2.5; stroke-dasharray: 6 6; stroke-linecap: round; }
.c-stop-a { stop-color: var(--ember-2); stop-opacity: .2; }
.c-stop-b { stop-color: var(--ember-2); stop-opacity: 0; }
.c-cursor { stroke: var(--ink-3); stroke-width: 1; stroke-dasharray: 3 4; }
.c-dot { fill: var(--ember-2); stroke: var(--surface); stroke-width: 3; }
.readout { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; min-height: 30px; margin-bottom: 4px; font-size: 15px; }
.ro-v { font: 700 21px var(--sans); font-variant-numeric: tabular-nums; }
.ro-c { color: var(--ink-2); font-variant-numeric: tabular-nums; }
.ro-c em { font-style: normal; font-weight: 700; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 8px; font-size: 14px; color: var(--ink-2); }
.legend i { display: inline-block; width: 20px; vertical-align: middle; margin-right: 8px; }
.lg-now { height: 4px; border-radius: 2px; background: var(--ember-2); }
.lg-cmp { border-top: 3px dashed var(--gold-2); }

.hbars { display: flex; flex-direction: column; gap: 14px; }
.hbar { display: block; text-decoration: none; color: inherit; border-radius: 8px; }
a.hbar:hover .hbar-label { text-decoration: underline; }
.hbar-top { display: flex; justify-content: space-between; gap: 12px; font-size: 15px; }
.hbar-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar-val { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.hbar-track { height: 8px; margin-top: 6px; border-radius: 99px; background: var(--line-2); overflow: hidden; }
.hbar-track i { display: block; height: 100%; border-radius: 99px; background: var(--ink); opacity: .72; }
.hbar-track i.hot { background: var(--ember-2); opacity: 1; }
.hbar small { display: block; margin-top: 3px; font-size: 13px; color: var(--ink-3); }

.split-bar { display: flex; height: 14px; border-radius: 99px; overflow: hidden; gap: 2px; background: var(--line-2); }
.split-key { list-style: none; margin: 16px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.split-key li { display: grid; grid-template-columns: 14px 1fr auto 44px; align-items: center; gap: 10px; font-size: 15px; }
.split-key b { font-variant-numeric: tabular-nums; }
.split-key small { text-align: right; color: var(--ink-3); font-size: 14px; }
.split i { display: block; height: 100%; }
.split-key i { width: 12px; height: 12px; border-radius: 3px; }
.s0 { background: var(--ink); } .s1 { background: var(--gold-2); } .s2 { background: color-mix(in srgb, var(--ink) 45%, var(--surface)); } .s3 { background: color-mix(in srgb, var(--gold-2) 45%, var(--surface)); } .s4 { background: var(--ink-3); }

.heatmap { --hours: 14; }
.hm-readout { margin: 0 0 12px; font-size: 15px; color: var(--ink-2); min-height: 24px; }
.hm-readout b { color: var(--ink); }
.hm-row { display: grid; grid-template-columns: 60px repeat(var(--hours), minmax(0, 1fr)); gap: 3px; margin-bottom: 3px; align-items: center; }
.hm-head span { font-size: 13px; color: var(--ink-3); text-align: center; }
.hm-label { font-size: 13px; font-weight: 600; color: var(--ink-2); white-space: nowrap; }
.hm-cell { position: relative; aspect-ratio: 1.5; min-height: 18px; border: 0; padding: 0; border-radius: 4px; background: var(--line-2); }
.hm-cell::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: var(--ember-2); opacity: var(--a); }
.hm-cell[aria-pressed="true"] { outline: 2px solid var(--ink); outline-offset: 1px; }

.dbs { display: flex; flex-direction: column; gap: 16px; }
.db-row { display: block; text-decoration: none; color: inherit; }
.db-top { display: flex; align-items: baseline; gap: 10px; font-size: 15px; }
.db-top span { flex: 1; min-width: 0; font-weight: 600; }
.db-top b { font-variant-numeric: tabular-nums; }
.db-top em { font-style: normal; font-weight: 700; font-size: 14px; min-width: 48px; text-align: right; }
.db { position: relative; height: 22px; margin: 6px 0 2px; }
.db i { position: absolute; top: 50%; transform: translateY(-50%); }
.db .rail { left: 0; right: 0; height: 2px; background: var(--line); }
.db .seg { height: 6px; border-radius: 3px; opacity: .45; }
.db .seg.good { background: var(--good); } .db .seg.bad { background: var(--bad); }
.db .then, .db .now { width: 16px; height: 16px; margin-left: -8px; border-radius: 50%; }
.db .then { border: 3px solid var(--ink-3); background: var(--surface); }
.db .now { background: var(--ink); box-shadow: 0 0 0 3px var(--surface); }
.db .now.bad { background: var(--bad); }
.db-row small { font-size: 13px; color: var(--ink-3); }

/* the season stage: the one dark surface, a night sky */
.night { position: relative; overflow: hidden; border-radius: var(--r); padding: 26px 26px 22px; margin-bottom: 18px; color: #f7efdc; background: radial-gradient(900px 300px at 90% -20%, rgba(224, 82, 43, .28), transparent 60%), linear-gradient(170deg, #0a1430 0%, #14213d 100%); }
.night .eyebrow { color: #e8bb68; }
.night .big { font: 700 56px/1 var(--serif); margin: 8px 0 6px; font-variant-numeric: tabular-nums; }
.night p { margin: 6px 0 0; color: #d9dcea; font-size: 16px; }
.night b { color: #fff; }
.night .up { color: #7fe0a9; } .night .down { color: #ff9a8a; }
.night .tick { fill: #b8bfd3; } .night .c-grid { stroke: rgba(255, 255, 255, .1); } .night .c-dot { stroke: #14213d; }
.night .readout, .night .legend { color: #e5e7f0; } .night .ro-c { color: #c9cde0; }
.days { display: flex; gap: 3px; margin: 18px 0 4px; }
.days i { flex: 1; height: 10px; border-radius: 3px; background: rgba(255, 255, 255, .14); }
.days i.sold { background: #e8bb68; } .days i.today { background: #ff7b52; }
.days-key { display: flex; justify-content: space-between; font-size: 13px; color: #b8bfd3; }
.night .chart-box { margin-top: 18px; }

/* ---------- insights ---------- */
.insights { list-style: none; margin: 0; padding: 0; }
.insight { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 12px; padding: 14px 0; border-top: 1px solid var(--line-2); }
.insight:first-child { border-top: 0; padding-top: 2px; }
.ins-icon { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 15px; }
.insight.alert .ins-icon { background: var(--bad-bg); color: var(--bad); }
.insight.money .ins-icon { background: var(--money-bg); color: var(--gold); }
.insight.good .ins-icon { background: var(--good-bg); color: var(--good); }
.insight.info .ins-icon { background: var(--line-2); color: var(--ink-2); }
.insight h3 { margin: 4px 0 4px; font-size: 16px; line-height: 1.35; }
.insight p { margin: 0; font-size: 15px; color: var(--ink-2); }
.ins-link { display: inline-block; margin-top: 8px; font-size: 15px; font-weight: 700; text-decoration: none; border-bottom: 2px solid var(--gold-2); }

/* ---------- tables ---------- */
.table-tools { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.table-tools .search { flex: 1; min-width: 200px; }
.table-wrap { overflow-x: auto; margin: 0 -6px; }
table.data { width: 100%; border-collapse: collapse; font-size: 15px; font-variant-numeric: tabular-nums; }
table.data th { padding: 0; text-align: left; font-size: 14px; font-weight: 600; color: var(--ink-2); border-bottom: 1px solid var(--line); white-space: nowrap; }
table.data th button { display: flex; align-items: center; gap: 6px; width: 100%; padding: 10px 10px; border: 0; background: none; font-weight: 600; text-align: left; }
table.data th.num button { justify-content: flex-end; text-align: right; }
.sort-mark { font-size: 13px; color: var(--ink-3); opacity: .6; }
th[aria-sort="ascending"] .sort-mark, th[aria-sort="descending"] .sort-mark { opacity: 1; color: var(--ember); }
table.data td { padding: 11px 10px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
table.data td.num { text-align: right; white-space: nowrap; }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data tfoot td { border-top: 2px solid var(--line); font-weight: 700; border-bottom: 0; }
table.data tr.link-row { cursor: pointer; }
table.data tr.link-row:hover td { background: var(--surface-2); }
table.data td small { display: block; color: var(--ink-3); font-size: 13px; }
table.data tr.group-row th { padding: 16px 10px 8px; font: 700 16px var(--serif); color: var(--ink); border-bottom: 1px solid var(--line); }
.badge { display: inline-block; padding: 1px 8px; border-radius: 99px; font-size: 13px; font-weight: 700; background: var(--line-2); color: var(--ink-2); white-space: nowrap; }
.badge.bad { background: var(--bad-bg); color: var(--bad); } .badge.good { background: var(--good-bg); color: var(--good); } .badge.gold { background: var(--money-bg); color: var(--gold); }
details.fold { margin-top: 10px; }
details.fold summary { cursor: pointer; font-weight: 700; padding: 10px 0; list-style: none; display: flex; align-items: center; gap: 8px; }
details.fold summary::before { content: "›"; display: inline-block; transition: transform .15s; font-size: 20px; line-height: 1; color: var(--gold); }
details.fold[open] summary::before { transform: rotate(90deg); }
details.fold summary::-webkit-details-marker { display: none; }

/* ---------- rows for lists ---------- */
.rows { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; gap: 14px; padding: 13px 0; border-top: 1px solid var(--line-2); text-decoration: none; color: inherit; background: none; border-left: 0; border-right: 0; border-bottom: 0; width: 100%; text-align: left; }
.row:first-child { border-top: 0; }
button.row:hover, a.row:hover { background: var(--surface-2); }
.row .row-main { flex: 1; min-width: 0; }
.row .row-main b { display: block; font-size: 16px; }
.row .row-main > span { display: block; font-size: 14px; color: var(--ink-2); }
.row .row-end { text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; white-space: nowrap; }
.row .row-end small { display: block; font-weight: 500; font-size: 13px; color: var(--ink-3); }
.avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; flex: none; font-weight: 800; background: var(--line-2); color: var(--ink); }
.avatar.owner { background: var(--ink); color: var(--bg); } .avatar.manager { background: var(--gold-2); color: #14213d; }
.chev { color: var(--ink-3); flex: none; }

/* report library */
.lib-group { margin-top: 26px; }
.lib-group h2 { font: 700 21px var(--serif); margin: 0 0 6px; }
.lib-row { display: flex; align-items: center; gap: 12px; padding: 12px 4px; border-top: 1px solid var(--line-2); }
.lib-row:first-of-type { border-top: 0; }
.lib-row a { flex: 1; min-width: 0; text-decoration: none; }
.lib-row a b { display: block; font-size: 16px; }
.lib-row a span { display: block; font-size: 14px; color: var(--ink-2); }
.lib-row a:hover b { text-decoration: underline; }
.star { width: 44px; height: 44px; border: 0; background: none; border-radius: 50%; color: var(--ink-3); display: grid; place-items: center; flex: none; }
.star[aria-pressed="true"] { color: var(--gold-2); }
.star:hover { background: var(--line-2); }

/* ---------- buttons, chips, forms ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 12px; border: 1px solid transparent; font-weight: 700; font-size: 15px; text-decoration: none; white-space: nowrap; }
.btn:disabled { opacity: .55; cursor: default; }
.btn-primary { background: var(--ink); color: var(--bg); }
.btn-ember { background: var(--ember); color: #fff; }
.btn-outline { background: var(--surface); border-color: var(--line); color: var(--ink); }
.btn-quiet { min-height: 40px; padding: 0 12px; background: var(--surface); border-color: var(--line); color: var(--ink); font-size: 14px; }
.btn-danger { background: var(--bad-bg); color: var(--bad); }
.btn-text { border: 0; background: none; padding: 8px 0; font-weight: 700; color: var(--ink); text-decoration: underline; text-decoration-color: var(--gold-2); text-underline-offset: 4px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; align-items: center; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; }
.chip { min-height: 40px; padding: 0 14px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); font-size: 14px; font-weight: 600; color: var(--ink-2); }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.chip .n { opacity: .7; margin-left: 4px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-top: 14px; }
.field label, .field .label { font-size: 14px; font-weight: 700; color: var(--ink-2); }
.field small { font-size: 13px; color: var(--ink-3); }
input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="date"], input[type="search"], input.input, select.input {
  min-height: 46px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-size: 16px; width: 100%; }
input:focus { border-color: var(--gold-2); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold-2) 30%, transparent); }
.inline-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.inline-form .field { margin-top: 0; }
.error-box { margin-top: 12px; padding: 10px 14px; border-radius: 10px; background: var(--bad-bg); color: var(--bad); font-weight: 600; font-size: 15px; }
.done-box { margin-top: 12px; padding: 10px 14px; border-radius: 10px; background: var(--good-bg); color: var(--good); font-weight: 600; font-size: 15px; }
.switch { position: relative; width: 52px; height: 32px; flex: none; border-radius: 16px; border: 0; background: var(--line); padding: 0; transition: background .15s; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .15s; }
.switch[aria-checked="true"] { background: var(--good); }
.switch[aria-checked="true"]::after { transform: translateX(20px); }
.switch:disabled { opacity: .5; }
.perm { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line-2); }
.perm:first-child { border-top: 0; }
.perm span { flex: 1; font-size: 15px; }
.perm small { display: block; font-size: 13px; color: var(--ink-3); }
.perm-group { margin-top: 18px; }
.perm-group > b { display: block; font-size: 14px; color: var(--gold); margin-bottom: 4px; }
.summary-box { margin-top: 16px; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line-2); font-size: 15px; }

/* price approvals */
.ask { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 12px; padding: 16px 0; border-top: 1px solid var(--line-2); }
.ask:first-of-type { border-top: 0; }
.ask h3 { margin: 4px 0; font-size: 16px; }
.ask p { margin: 0; font-size: 15px; color: var(--ink-2); }
.ask .ins-icon { background: var(--money-bg); color: var(--gold); }
.top-search { display: none; width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); place-items: center; flex: none; }

/* ---------- sheets, search, toast ---------- */
.sheet-back { position: fixed; inset: 0; z-index: 60; display: flex; align-items: flex-start; justify-content: center; padding: 8vh 20px 20px; background: var(--scrim); }
.sheet { width: min(580px, 100%); max-height: 84vh; overflow-y: auto; padding: 22px 24px 26px; border-radius: 20px; background: var(--surface); color: var(--ink); box-shadow: 0 24px 64px rgba(0, 0, 0, .28); }
.sheet h2 { margin: 0; font: 700 24px var(--serif); }
.sheet-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.x { width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--line-2); display: grid; place-items: center; flex: none; }
.search-sheet { padding: 0; }
.search-box { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.search-box input { border: 0 !important; box-shadow: none !important; padding: 0; min-height: 40px; font-size: 18px; background: transparent; }
.results { list-style: none; margin: 0; padding: 8px; max-height: 60vh; overflow-y: auto; }
.results li a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; text-decoration: none; }
.results li a[aria-selected="true"], .results li a:hover { background: var(--surface-2); }
.results li a span { flex: 1; min-width: 0; }
.results li a b { display: block; font-size: 15px; }
.results li a small { display: block; font-size: 13px; color: var(--ink-3); }
.results .kind { font-size: 13px; color: var(--gold); font-weight: 700; }
.results-group { padding: 10px 12px 4px; font-size: 13px; font-weight: 700; color: var(--ink-3); }
.toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; z-index: 80; max-width: min(560px, calc(100vw - 32px)); padding: 12px 18px; border-radius: 14px; background: var(--ink); color: var(--bg); font-weight: 600; font-size: 15px; transition: opacity .2s, transform .2s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- sign in ---------- */
.signin { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.signin-art { background: #000; display: grid; place-items: center; padding: 40px; }
.signin-art img { width: min(420px, 90%); }
.signin-form { display: grid; place-items: center; padding: 40px 24px; }
.signin-form > div { width: min(420px, 100%); }
.signin-form h1 { font-size: 38px; }
.signin-form form { margin-top: 18px; }
.signin-form .btn { width: 100%; margin-top: 18px; }
.who-sees { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 14px; color: var(--ink-2); }
.who-sees p { margin: 4px 0; }

/* ---------- phone tab bar ---------- */
.tabbar { display: none; }

/* ---------- smaller screens ---------- */
@media (max-width: 1240px) {
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kpi:nth-child(4) { border-left: 0; }
  .kpi:nth-child(n + 4) { border-top: 1px solid var(--line-2); }
  .toolbar .seg { display: none; }
  .tb-range-select { display: inline-block; }
  .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g3 > :last-child:nth-child(odd) { grid-column: 1 / -1; }
}
@media (max-width: 1023px) {
  .app { grid-template-columns: minmax(0, 1fr); background: none; }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: 288px; transform: translateX(-100%); transition: transform .2s ease; box-shadow: 20px 0 60px rgba(0, 0, 0, .3); }
  body.menu-open .side { transform: none; }
  body.menu-open .scrim { display: block; position: fixed; inset: 0; z-index: 35; background: var(--scrim); }
  .menu-btn, .top-search { display: grid; }
  .top { padding: 10px 20px; }
  .page { padding: 22px 20px 72px; }
  .sample-band { margin: 14px 20px 0; }
  .g-main, .g2 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 720px) {
  .top { gap: 10px; padding: 8px 14px; min-height: 60px; }
  .toolbar .tb-full { display: none; }
  .tb-summary { display: inline-flex; align-items: center; gap: 6px; min-height: 42px; max-width: 62vw; padding: 0 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); font-size: 14px; font-weight: 700; }
  .tb-summary span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .page { padding: 18px 16px calc(96px + env(safe-area-inset-bottom)); }
  .sample-band { margin: 10px 16px 0; padding: 8px 12px; font-size: 14px; }
  .sb-long { display: none; } .sb-short { display: inline; }
  h1 { font-size: 27px; }
  .page-head { flex-direction: column; align-items: stretch; gap: 14px; margin-bottom: 18px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi { padding: 14px 14px 12px; }
  .kpi.hero { grid-column: 1 / -1; }
  .kpi:nth-child(4) { border-left: 1px solid var(--line-2); }
  .kpi:nth-child(2), .kpi:nth-child(4), .kpi:nth-child(6) { border-left: 0; }
  .kpi:nth-child(n + 2) { border-top: 1px solid var(--line-2); }
  .kpi-value { font-size: 22px; }
  .kpi.hero .kpi-value { font-size: 34px; }
  .g3 { grid-template-columns: minmax(0, 1fr); }
  .card { padding: 18px 16px; }
  .card.flush .card-head { padding: 16px 16px 0; }
  .card h2 { font-size: 20px; }
  .opt { display: none; }
  .only-phone { display: block !important; }
  .table-wrap { margin: 0; }
  table.data th button, table.data td { padding-left: 6px; padding-right: 6px; }
  .night { padding: 20px 16px 16px; }
  .night .big { font-size: 44px; }
  .hm-row { grid-template-columns: 50px repeat(var(--hours), minmax(0, 1fr)); gap: 2px; margin-bottom: 2px; }
  .hm-cell { min-height: 16px; border-radius: 3px; }
  .sheet-back { align-items: flex-end; padding: 0; }
  .sheet { width: 100%; max-height: 92vh; border-radius: 20px 20px 0 0; padding: 20px 18px calc(24px + env(safe-area-inset-bottom)); }
  .search-sheet { padding: 0; }
  .toast { bottom: calc(86px + env(safe-area-inset-bottom)); }
  .tabbar { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; padding-bottom: env(safe-area-inset-bottom); background: var(--surface); border-top: 1px solid var(--line); }
  .tabbar a, .tabbar button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 58px; border: 0; background: none; font-size: 13px; font-weight: 600; color: var(--ink-3); text-decoration: none; }
  .tabbar [aria-current="page"] { color: var(--ember); }
  .signin { grid-template-columns: minmax(0, 1fr); }
  .signin-art { padding: 28px 24px 20px; }
  .signin-art img { width: min(260px, 70%); }
  .signin-form { padding: 24px 18px 40px; place-items: start center; }
}

@media print {
  .side, .top, .tabbar, .sample-band, .page-actions, .btn, .chips, .table-tools { display: none !important; }
  .app { display: block; }
  body, .card { background: #fff; color: #000; }
  .card { border-color: #ccc; break-inside: avoid; }
  .page { padding: 0; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---------- setup ---------- */
.subnav { display: flex; flex-wrap: wrap; gap: 6px; margin: -6px 0 18px; }
.subnav a { padding: 8px 14px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); font-size: 14px; font-weight: 600; color: var(--ink-2); text-decoration: none; }
.subnav a[aria-current="page"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.meter { height: 8px; border-radius: 99px; background: var(--line-2); overflow: hidden; margin: -4px 0 6px; }
.meter i { display: block; height: 100%; background: var(--good); border-radius: 99px; }
.tick { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; flex: none; font-weight: 800; font-size: 14px; background: var(--bad-bg); color: var(--bad); }
.tick.ok { background: var(--good-bg); color: var(--good); }
.tick.opt { background: var(--line-2); color: var(--ink-3); }
.setup-form textarea.input { min-height: 0; padding: 10px 14px; line-height: 1.45; resize: vertical; }
.fee-box { margin-top: 20px; padding-top: 6px; border-top: 1px solid var(--line-2); }
.rules, .steps { margin: 12px 0 0; padding-left: 20px; font-size: 15px; color: var(--ink-2); }
.rules li, .steps li { margin: 6px 0; }
.calc { margin-top: 16px; padding: 14px 16px; border-radius: 12px; background: var(--money-bg); }
.calc-out { margin: 10px 0 0; font-size: 15px; }
.paper { max-width: 340px; margin: 0 auto; padding: 18px 16px; background: #fff; color: #111; border-radius: 8px; box-shadow: 0 2px 10px rgba(0, 0, 0, .12); font: 13px/1.45 ui-monospace, "SF Mono", Menlo, Consolas, monospace; }
.paper .pc { margin: 0; text-align: center; }
.paper hr { border: 0; border-top: 1px dashed #999; margin: 8px 0; }
.paper .pl { display: flex; justify-content: space-between; gap: 10px; white-space: pre; }
.paper .pl.g span:last-child { color: #0b7a50; }
.paper .pl.b { font-weight: 800; }
.paper .pf { margin-top: 10px; }
.bulk { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 14px; margin-bottom: 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line-2); }
.bulk .label { font-size: 14px; font-weight: 700; color: var(--ink-2); width: 100%; }
.bulk select.input { width: auto; flex: 1 1 220px; }
.bulk input.input { width: 110px; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 15px; }
.check input { width: 20px; height: 20px; accent-color: var(--ink); }
.pbt td { vertical-align: middle; }
.pbin { width: 120px !important; text-align: right; min-height: 42px !important; }
.pb-hint:empty { display: none; }
@media (max-width: 720px) {
  .pbin { width: 96px !important; }
  .paper { max-width: none; }
}

/* ---------- deals ---------- */
.kinds { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.kind { display: grid; gap: 3px; align-content: start; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); text-align: left; color: var(--ink); }
.kind b { font-size: 15px; }
.kind small { font-size: 13px; color: var(--ink-3); }
.kind[aria-pressed="true"] { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); background: var(--surface-2, var(--surface)); }
.kind[aria-pressed="true"] small { color: var(--ink-2); }
.grid.tight { gap: 0 14px; }
.label { font-size: 14px; font-weight: 700; color: var(--ink-2); }
.down { color: var(--bad); }
.card.warn { border-color: color-mix(in srgb, var(--bad) 35%, var(--line)); }
ul.plain { margin: 0; padding-left: 18px; display: grid; gap: 6px; color: var(--ink-2); }
.tag-preview { display: grid; grid-template-columns: 22px 1fr; border-radius: 18px 14px 14px 18px; overflow: hidden; border: 1px solid var(--line); background: var(--surface); }
.tag-preview .hole { background: linear-gradient(135deg, #e8442a, #f08a24); position: relative; }
.tag-preview .hole::after { content: ""; position: absolute; left: 5px; top: 18px; width: 12px; height: 12px; border-radius: 50%; background: var(--bg); }
.tag-preview > div { display: grid; gap: 4px; padding: 14px 16px; }
.tag-preview b { font: 700 24px/1.05 var(--serif); color: var(--ember); }
.tag-preview strong { font-size: 15px; }
.tag-preview small { font-size: 14px; color: var(--ink-2); }
@media (max-width: 900px) { .kinds { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1181px) { .deal-side { position: sticky; top: 16px; align-self: start; } }
.grid.tight.pair { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
