/* ------------------------------------------------------------------ tokens */
:root {
  color-scheme: light;
  --bg: #f0f2f6;
  --surface: #ffffff;
  --surface-2: #f6f7fa;
  --surface-3: #eceff4;
  --ink: #151a26;
  --ink-2: #485064;
  --ink-3: #747d91;
  --line: #e0e4ec;
  --line-strong: #cdd3de;
  --accent: #2f4bdb;
  --accent-ink: #ffffff;
  --accent-soft: #e7ebfd;
  --danger: #c2371f;
  --danger-soft: #fbe9e5;

  --request: #a86a0c;
  --request-soft: #fbf0d9;
  --option: #6b45dc;
  --option-soft: #ece7fb;
  --confirmed: #14804f;
  --confirmed-soft: #dcf2e6;
  --cancelled: #727b8f;
  --cancelled-soft: #e9ecf1;

  --radius-panel: 14px;
  --radius-control: 8px;
  --shadow-pop: 0 18px 50px rgba(15, 22, 40, 0.22);
  --font: "Avenir Next", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0e121a;
    --surface: #161b26;
    --surface-2: #1b2130;
    --surface-3: #232a3b;
    --ink: #e8ebf3;
    --ink-2: #b0b8ca;
    --ink-3: #7d869b;
    --line: #272f42;
    --line-strong: #353f56;
    --accent: #7f96ff;
    --accent-ink: #0e1220;
    --accent-soft: #1f2850;
    --danger: #ff8a73;
    --danger-soft: #3a1f1a;
    --request: #e5b055;
    --request-soft: #35290f;
    --option: #a894f5;
    --option-soft: #2a2250;
    --confirmed: #4cc38a;
    --confirmed-soft: #12301f;
    --cancelled: #98a1b5;
    --cancelled-soft: #252b3a;
    --shadow-pop: 0 18px 50px rgba(0, 0, 0, 0.6);
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 var(--font);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { margin: 0; letter-spacing: -0.012em; line-height: 1.2; }
h1 { font-size: 26px; font-weight: 680; }
h2 { font-size: 16px; font-weight: 650; }
h3 { font-size: 14px; font-weight: 650; }
p { margin: 0 0 8px; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.muted { color: var(--ink-2); }
.faint { color: var(--ink-3); }
.small { font-size: 13px; }
.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.hidden { display: none !important; }
.stack { display: grid; gap: 16px; }
.stack-sm { display: grid; gap: 8px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.spacer { flex: 1; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ------------------------------------------------------------------ shell */
.shell { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; padding: 20px 14px;
  display: flex; flex-direction: column; gap: 6px;
  background: var(--surface); border-right: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 16px; font-weight: 700; font-size: 17px; letter-spacing: -0.01em; }
.brand-mark { width: 28px; height: 28px; flex: none; }
.brand-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand-logo { height: 32px; width: auto; max-width: 96px; flex: 0 1 auto; min-width: 0; object-fit: contain; }
.brand-logo:only-child { height: auto; max-height: 44px; max-width: 100%; }
.nav { display: grid; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: var(--radius-control);
  color: var(--ink-2); font-weight: 560; text-decoration: none;
}
.nav a:hover { background: var(--surface-2); color: var(--ink); }
.nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); }
.nav .badge-count { margin-left: auto; }
.sidebar-foot { margin-top: auto; display: grid; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.me { display: flex; align-items: center; gap: 10px; padding: 4px 8px; font-weight: 560; }
.avatar {
  width: 28px; height: 28px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: var(--c, var(--accent)); color: #fff; font-size: 13px; font-weight: 700;
}
.avatar-sm { width: 20px; height: 20px; font-size: 11px; }
.main { padding: 28px 36px 96px; max-width: 1320px; width: 100%; }
.bottom-nav { display: none; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head .sub { color: var(--ink-2); margin-top: 4px; }

@media (max-width: 860px) {
  .shell { display: block; }
  .sidebar { display: none; }
  .main { padding: 18px 16px 100px; }
  h1 { font-size: 22px; }
  .bottom-nav {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    background: var(--surface); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  .bottom-nav a, .bottom-nav button {
    display: grid; justify-items: center; gap: 2px; padding: 6px 2px; font-size: 11.5px; color: var(--ink-3);
    background: none; border: 0; text-decoration: none; font-weight: 560; cursor: pointer;
  }
  .bottom-nav [aria-current="page"] { color: var(--accent); }
  .more-sheet {
    position: fixed; right: 10px; bottom: 74px; z-index: 31; background: var(--surface); border: 1px solid var(--line);
    border-radius: 14px; box-shadow: var(--shadow-pop); padding: 6px; display: grid; min-width: 200px;
  }
  .more-sheet a { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 8px; color: var(--ink); text-decoration: none; }
  .more-sheet a:hover { background: var(--surface-2); }
}

/* ------------------------------------------------------------- primitives */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-panel); padding: 18px 20px; }
.card > h2:first-child, .card-head h2 { margin-bottom: 0; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.card-flat { background: var(--surface-2); border-radius: 10px; padding: 12px 14px; }
.divider { height: 1px; background: var(--line); margin: 14px 0; border: 0; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 14px;
  border-radius: var(--radius-control); border: 1px solid var(--line-strong); background: var(--surface);
  font-weight: 580; cursor: pointer; text-decoration: none; color: var(--ink); white-space: nowrap;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent); filter: brightness(1.08); }
.btn-danger { color: var(--danger); }
.btn-danger:hover { background: var(--danger-soft); }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-sm { height: 30px; padding: 0 10px; font-size: 13.5px; }
.icon-btn {
  width: 32px; height: 32px; display: inline-grid; place-items: center; border-radius: 8px; border: 0;
  background: transparent; cursor: pointer; color: var(--ink-2);
}
.icon-btn:hover { background: var(--surface-3); color: var(--ink); }
.icon { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.field { display: grid; gap: 5px; align-content: start; min-width: 0; }
.field-label { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.field-hint { font-size: 12.5px; color: var(--ink-3); }
.input, .select, .textarea {
  width: 100%; min-width: 0; height: 36px; padding: 0 10px; border: 1px solid var(--line-strong);
  border-radius: var(--radius-control); background: var(--surface); color: var(--ink); font: inherit;
}
.textarea { height: auto; min-height: 78px; padding: 8px 10px; resize: vertical; line-height: 1.45; }
.input:focus, .select:focus, .textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
.input[readonly] { background: var(--surface-2); }
.input-xl { height: 44px; font-size: 20px; font-weight: 650; letter-spacing: -0.01em; }
.input-money { text-align: right; }
.input-group { display: flex; align-items: center; }
.input-group .affix { padding: 0 9px; color: var(--ink-3); }
.check { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.check input { width: 17px; height: 17px; accent-color: var(--accent); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.form-grid .span-2 { grid-column: span 2; }
.form-grid .span-all { grid-column: 1 / -1; }
@media (max-width: 520px) { .form-grid .span-2 { grid-column: 1 / -1; } }

.pill {
  display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 99px;
  font-size: 12.5px; font-weight: 620; background: var(--surface-3); color: var(--ink-2); white-space: nowrap;
}
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill-plain::before { display: none; }
.pill[data-status="request"], .pill[data-tone="request"] { background: var(--request-soft); color: var(--request); }
.pill[data-status="option"], .pill[data-tone="option"] { background: var(--option-soft); color: var(--option); }
.pill[data-status="confirmed"], .pill[data-tone="confirmed"] { background: var(--confirmed-soft); color: var(--confirmed); }
.pill[data-status="cancelled"], .pill[data-tone="cancelled"] { background: var(--cancelled-soft); color: var(--cancelled); }
.pill[data-tone="danger"] { background: var(--danger-soft); color: var(--danger); }
.pill[data-tone="accent"] { background: var(--accent-soft); color: var(--accent); }
select.pill-select {
  appearance: none; border: 0; cursor: pointer; height: 28px; padding: 0 26px 0 12px; border-radius: 99px; font-weight: 620;
  font-size: 13px; background-repeat: no-repeat; background-position: right 9px center; background-size: 10px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23888' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E");
}
select.pill-select[data-status="request"] { background-color: var(--request-soft); color: var(--request); }
select.pill-select[data-status="option"] { background-color: var(--option-soft); color: var(--option); }
select.pill-select[data-status="confirmed"] { background-color: var(--confirmed-soft); color: var(--confirmed); }
select.pill-select[data-status="cancelled"] { background-color: var(--cancelled-soft); color: var(--cancelled); }
.badge-count {
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: var(--accent); color: var(--accent-ink);
  font-size: 12px; font-weight: 700; display: inline-grid; place-items: center;
}
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip-btn {
  height: 30px; padding: 0 12px; border-radius: 99px; border: 1px solid var(--line-strong); background: var(--surface);
  cursor: pointer; font-size: 13.5px; font-weight: 580; color: var(--ink-2);
}
.chip-btn:hover { background: var(--surface-2); }
.chip-btn[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12.5px; font-weight: 600; color: var(--ink-3); padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table th.num, .table td.num { text-align: right; }
.table td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:hover { background: var(--surface-2); }
.table tfoot td { font-weight: 650; border-bottom: 0; }
.table .row-link { color: var(--ink); font-weight: 600; text-decoration: none; }
.table .row-link:hover { color: var(--accent); }
.table .input, .table .select { height: 30px; font-size: 13.5px; }

.empty { text-align: center; color: var(--ink-2); padding: 28px 16px; display: grid; gap: 8px; justify-items: center; }
.empty strong { color: var(--ink); font-size: 15px; }
.callout { border-radius: 10px; padding: 11px 14px; background: var(--accent-soft); color: var(--ink); display: flex; gap: 10px; align-items: flex-start; }
.callout-warn { background: var(--request-soft); }
.callout-danger { background: var(--danger-soft); }
.callout .icon { margin-top: 2px; color: var(--accent); }
.callout-warn .icon { color: var(--request); }
.callout-danger .icon { color: var(--danger); }
.error-text { color: var(--danger); font-size: 13.5px; }

/* dialogs & toast */
.backdrop { position: fixed; inset: 0; z-index: 50; background: rgba(10, 14, 24, 0.5); display: grid; place-items: center; padding: 16px; }
.modal {
  width: min(560px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: var(--surface);
  border-radius: 16px; box-shadow: var(--shadow-pop); display: flex; flex-direction: column;
}
.modal-wide { width: min(760px, 100%); }
.modal-head { padding: 18px 22px 0; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.modal-body { padding: 16px 22px; display: grid; gap: 14px; }
.modal-foot { padding: 12px 22px 18px; display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 60; display: grid; gap: 8px; }
@media (max-width: 860px) { .toasts { bottom: 84px; } }
.toast { background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-weight: 560; box-shadow: var(--shadow-pop); }
.toast-error { background: var(--danger); color: #fff; }

/* -------------------------------------------------------------- dashboard */
.dash { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; align-items: start; }
.dash-side { position: sticky; top: 20px; display: grid; gap: 16px; }
@media (max-width: 1100px) { .dash { grid-template-columns: minmax(0, 1fr); } .dash-side { position: static; order: -1; } }
.list { display: grid; }
.list-item {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 6px;
  border-top: 1px solid var(--line); color: inherit; text-decoration: none; border-radius: 8px;
}
.list-item:first-child { border-top: 0; }
.list-item:hover { background: var(--surface-2); text-decoration: none; }
.list-title { font-weight: 620; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-sub { color: var(--ink-2); font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.datebox {
  width: 46px; text-align: center; border-radius: 10px; background: var(--surface-2); padding: 5px 0 4px; line-height: 1.1;
}
.datebox b { display: block; font-size: 19px; font-weight: 700; }
.datebox span { font-size: 11.5px; color: var(--ink-2); font-weight: 600; }
.datebox.open { background: transparent; border: 1px dashed var(--line-strong); }
.datebox.open b { font-size: 15px; color: var(--ink-3); }

.two-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
@media (max-width: 900px) { .two-col { grid-template-columns: minmax(0, 1fr); } }

/* the balance beam */
.balance { display: grid; gap: 12px; }
.beam-wrap { position: relative; padding-top: 22px; }
.beam { display: flex; gap: 2px; height: 38px; }
.beam-seg { background: var(--c); min-width: 3px; flex: none; }
.beam-seg:first-child { border-radius: 10px 3px 3px 10px; }
.beam-seg:last-child { border-radius: 3px 10px 10px 3px; }
.beam-seg:only-child { border-radius: 10px; }
.beam-fair { position: absolute; top: 14px; bottom: -6px; width: 0; border-left: 2px dashed var(--ink); opacity: 0.85; }
.beam-fair::before {
  content: attr(data-label); position: absolute; top: -17px; left: 0; transform: translateX(-50%);
  font-size: 11.5px; font-weight: 600; white-space: nowrap; color: var(--ink-2);
}
.beam-legend { display: grid; gap: 6px; }
.beam-legend .row-between { font-size: 14px; }
.swatch { width: 10px; height: 10px; border-radius: 3px; background: var(--c); display: inline-block; margin-right: 8px; }
.balance-big { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; }
.meter { height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.meter > span { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.meter.due > span { background: var(--confirmed); }

/* ------------------------------------------------------------------ board */
.board { display: grid; grid-template-columns: repeat(var(--cols, 3), minmax(240px, 1fr)); gap: 14px; align-items: start; }
@media (max-width: 860px) { .board { grid-template-columns: minmax(0, 1fr); } }
.col { align-content: start; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-panel); padding: 10px; display: grid; gap: 8px; min-height: 140px; }
.col.drop { outline: 2px dashed var(--accent); outline-offset: -4px; background: var(--accent-soft); }
.col-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 6px 2px; }
.col-head .count { color: var(--ink-3); font-weight: 600; margin-left: 6px; }
.gcard {
  background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--st, var(--line-strong));
  border-radius: 10px; padding: 10px 12px; display: grid; gap: 4px; cursor: grab; color: inherit; text-decoration: none;
}
.gcard:hover { border-color: var(--line-strong); border-left-color: var(--st); text-decoration: none; }
.gcard.dragging { opacity: 0.4; }
.gcard[data-status="request"] { --st: var(--request); }
.gcard[data-status="option"] { --st: var(--option); }
.gcard[data-status="confirmed"] { --st: var(--confirmed); }
.gcard[data-status="cancelled"] { --st: var(--cancelled); }
.gcard-title { font-weight: 640; }
.gcard-meta { display: flex; gap: 8px; flex-wrap: wrap; color: var(--ink-2); font-size: 13px; align-items: center; }
.tag { padding: 1px 8px; border-radius: 6px; background: var(--surface-3); font-size: 12px; color: var(--ink-2); font-weight: 580; }
.tag-warn { background: var(--request-soft); color: var(--request); }
.tag-danger { background: var(--danger-soft); color: var(--danger); }

/* --------------------------------------------------------------- calendar */
.cal-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.cal-title { font-size: 20px; font-weight: 680; min-width: 170px; text-transform: capitalize; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); background: var(--surface); border-radius: 12px; overflow: hidden; }
.cal-dow { padding: 8px; font-size: 12.5px; font-weight: 600; color: var(--ink-3); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--surface-2); }
.cal-day { min-height: 116px; padding: 6px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 3px; position: relative; }
.cal-day.other { background: var(--surface-2); }
.cal-day.other .cal-num { color: var(--ink-3); }
.cal-num { font-size: 13px; font-weight: 620; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; }
.cal-day.today .cal-num { background: var(--accent); color: var(--accent-ink); }
.cal-add { position: absolute; top: 4px; right: 4px; opacity: 0; width: 22px; height: 22px; }
.cal-day:hover .cal-add, .cal-add:focus-visible { opacity: 1; }
.cal-chip {
  display: block; padding: 2px 6px; border-radius: 5px; font-size: 12.5px; line-height: 1.35; font-weight: 580;
  background: var(--st-soft); color: var(--st); border-left: 3px solid var(--st); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-decoration: none;
}
.cal-chip:hover { text-decoration: none; filter: brightness(0.96); }
.cal-chip[data-status="request"] { --st: var(--request); --st-soft: var(--request-soft); border-left-style: dotted; }
.cal-chip[data-status="option"] { --st: var(--option); --st-soft: var(--option-soft); border-left-style: dashed; }
.cal-chip[data-status="confirmed"] { --st: var(--confirmed); --st-soft: var(--confirmed-soft); }
.cal-chip[data-status="cancelled"] { --st: var(--cancelled); --st-soft: var(--cancelled-soft); text-decoration: line-through; }
.cal-conflict { position: absolute; top: 8px; right: 8px; }
@media (max-width: 700px) {
  .cal-day { min-height: 64px; padding: 3px; }
  .cal-chip { font-size: 0; padding: 0; height: 6px; border-left-width: 0; border-radius: 3px; background: var(--st); }
  .cal-dow { padding: 6px 2px; text-align: center; font-size: 11px; }
}
.month-group { margin-top: 18px; }
.month-group > h3 { text-transform: capitalize; margin-bottom: 6px; color: var(--ink-2); }

/* ------------------------------------------------------------- gig detail */
.gig-layout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 20px; align-items: start; }
.gig-side { position: sticky; top: 20px; display: grid; gap: 16px; }
@media (max-width: 1100px) { .gig-layout { grid-template-columns: minmax(0, 1fr); } .gig-side { position: static; } }
.gig-head { display: grid; gap: 10px; margin-bottom: 20px; }
.back-link { display: inline-flex; gap: 6px; align-items: center; color: var(--ink-2); font-weight: 560; }
.money-summary { display: grid; gap: 4px; }
.money-summary .row-between { padding: 2px 0; }
.money-total { font-size: 22px; font-weight: 700; letter-spacing: -0.015em; }
.preset-row { display: flex; flex-wrap: wrap; gap: 6px; }
.sticky-save {
  position: sticky; bottom: 12px; z-index: 20; display: flex; justify-content: flex-end; gap: 8px; padding: 10px 14px;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: 12px; box-shadow: var(--shadow-pop);
}
.member-check { display: inline-flex; gap: 8px; align-items: center; padding: 6px 12px 6px 8px; border: 1px solid var(--line-strong); border-radius: 99px; cursor: pointer; }
.member-check input { accent-color: var(--accent); }

/* ------------------------------------------------------------------ stats */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 20px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-panel); padding: 14px 16px; }
.kpi .kpi-value { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; }
.kpi .kpi-label { color: var(--ink-2); font-size: 13.5px; }
.charts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.charts .wide { grid-column: 1 / -1; }
@media (max-width: 960px) { .charts { grid-template-columns: minmax(0, 1fr); } }
.chart-svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart-svg text { fill: var(--ink-2); font-size: 11.5px; font-family: var(--font); }
.chart-svg .grid { stroke: var(--line); stroke-width: 1; }
.chart-svg .axis { stroke: var(--line-strong); stroke-width: 1; }
.chart-svg .bar { fill: var(--accent); }
.chart-svg .bar-prev { fill: var(--surface-3); stroke: var(--line-strong); stroke-width: 1; }
.chart-svg .line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart-svg .area { fill: var(--accent-soft); }
.chart-svg .hit { fill: transparent; }
.chart-svg .hit:hover + .bar, .chart-svg .bar:hover { filter: brightness(1.12); }
.chart-svg .dot { fill: var(--surface); stroke: var(--accent); stroke-width: 2; }
.hbars { display: grid; gap: 8px; }
.hbar { display: grid; grid-template-columns: minmax(80px, 150px) minmax(0, 1fr) auto; gap: 10px; align-items: center; font-size: 14px; }
.hbar-track { height: 12px; background: var(--surface-2); border-radius: 4px; overflow: hidden; }
.hbar-fill { height: 100%; background: var(--accent); border-radius: 0 4px 4px 0; min-width: 2px; }
.hbar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.legend { display: flex; gap: 14px; font-size: 13px; color: var(--ink-2); flex-wrap: wrap; }
.tooltip {
  position: fixed; z-index: 70; pointer-events: none; background: var(--ink); color: var(--bg); padding: 6px 10px;
  border-radius: 8px; font-size: 13px; line-height: 1.35; box-shadow: var(--shadow-pop);
}
.funnel { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.funnel > div { background: var(--surface-2); border-radius: 10px; padding: 10px 12px; }
.funnel b { display: block; font-size: 22px; letter-spacing: -0.02em; }

/* ------------------------------------------------------------------ misc */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.auth-card { width: min(420px, 100%); }
.auth-card .brand { padding-left: 0; }
.explain { font-size: 14px; color: var(--ink-2); }
.explain ol, .explain ul { margin: 6px 0 0 18px; padding: 0; }
.copy-box { display: flex; gap: 6px; }
.copy-box .input { font-family: ui-monospace, "SF Mono", Consolas, monospace; font-size: 12.5px; }
details > summary { cursor: pointer; font-weight: 600; color: var(--ink-2); }
.color-input { width: 40px; height: 36px; padding: 2px; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--surface); }
.swatches { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.swatch { width: 28px; height: 28px; padding: 0; border-radius: 50%; border: 2px solid var(--surface); background: var(--c); box-shadow: 0 0 0 1px var(--line-strong); cursor: pointer; }
.swatch[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--ink); }
.logo-preview {
  display: grid; place-items: center; width: 180px; height: 96px; padding: 12px; flex: none;
  background: var(--surface-2); border: 1px dashed var(--line-strong); border-radius: 10px; color: var(--ink-3); font-size: 13px;
}
.logo-preview img { max-width: 100%; max-height: 72px; object-fit: contain; }
.loading { padding: 40px; text-align: center; color: var(--ink-3); }

/* print: the info sheet */
.sheet { background: #fff; color: #111; max-width: 780px; margin: 0 auto; padding: 36px 44px; border-radius: 4px; border: 1px solid var(--line); line-height: 1.45; }
.sheet-logo { float: right; max-height: 64px; max-width: 200px; margin: 0 0 12px 16px; object-fit: contain; }
.sheet h1 { font-size: 26px; margin-bottom: 2px; }
.sheet h2 { font-size: 12.5px; letter-spacing: 0.04em; margin: 20px 0 6px; color: #444; border-bottom: 1px solid #ccc; padding-bottom: 3px; }
.sheet dl { display: grid; grid-template-columns: 150px 1fr; gap: 4px 14px; margin: 0; }
.sheet dt { color: #555; }
.sheet dd { margin: 0; white-space: pre-wrap; }
@media print {
  body { background: #fff; }
  .sidebar, .bottom-nav, .no-print, .toasts { display: none !important; }
  .shell { display: block; }
  .main { padding: 0; max-width: none; }
  .sheet { border: 0; padding: 0; }
}
@media (prefers-reduced-motion: no-preference) {
  .btn, .chip-btn, .icon-btn { transition: background-color 0.12s, filter 0.12s; }
  .beam-seg { transition: flex-basis 0.5s ease, width 0.5s ease; }
  .meter > span { transition: width 0.5s ease; }
}
