/* Green Cloud CRM - design system (light). */

:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-2: #f3f5f9;
  --ink: #0e1a2b;
  --ink-2: #4a5568;
  --ink-3: #8b95a7;
  --line: #e7eaf1;
  --line-2: #d9dee8;
  --brand: #0b7a2f;
  --brand-2: #075f24;
  --brand-soft: #e9f7ee;
  --brand-ring: rgba(11, 122, 47, .18);
  --good: #0f8a5f;
  --good-soft: #e8f7f0;
  --warn: #b25e09;
  --warn-soft: #fff4e5;
  --bad: #c8372d;
  --bad-soft: #fdeeec;
  --heat-0: #f1f3f8;
  --heat-1: #d4f0dd;
  --heat-2: #a6e0b8;
  --heat-3: #6cc78c;
  --heat-4: #2fa85a;
  --heat-5: #0b7a2f;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow-1: 0 1px 2px rgba(15, 26, 43, .04), 0 1px 3px rgba(15, 26, 43, .06);
  --shadow-2: 0 10px 24px -8px rgba(15, 26, 43, .14), 0 2px 6px rgba(15, 26, 43, .06);
  --shadow-3: 0 24px 64px -16px rgba(15, 26, 43, .28);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --sidebar: 248px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 14px/1.5 "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-feature-settings: "cv11", "ss01"; -webkit-font-smoothing: antialiased;
}
.num, td.num, th.num, .value, .tabular { font-variant-numeric: tabular-nums; }
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-2); }
h1 { font-size: 24px; letter-spacing: -.02em; margin: 0; font-weight: 700; }
h2 { font-size: 15px; letter-spacing: -.01em; margin: 0; font-weight: 650; }
.muted { color: var(--ink-3); }
.mono, code { font-family: "JetBrains Mono", ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 12.5px; letter-spacing: -.01em; }
.ico { flex: none; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 6px; }

/* ---------------------------------------------------------------- layout */
.app { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; transition: grid-template-columns .25s var(--ease); }
.app.collapsed { --sidebar: 76px; }
.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 4px;
  background: var(--surface); border-right: 1px solid var(--line); padding: 18px 14px; overflow: hidden;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; color: var(--ink); white-space: nowrap; }
.brand:hover { color: var(--ink); }
.brand .word { font-weight: 750; font-size: 15.5px; letter-spacing: -.02em; }
.brand .word span { color: var(--ink-3); font-weight: 550; }
.nav-label { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); padding: 14px 10px 6px; white-space: nowrap; }
.nav a {
  position: relative; display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: var(--radius-sm);
  color: var(--ink-2); font-weight: 550; white-space: nowrap; transition: background .15s, color .15s;
}
.nav a:hover { background: var(--surface-2); color: var(--ink); }
.nav a.on { background: var(--brand-soft); color: var(--brand-2); }
.nav a.on::before { content: ""; position: absolute; left: -14px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--brand); }
.nav .count { margin-left: auto; font-size: 11px; font-weight: 700; color: #fff; background: var(--bad); border-radius: 999px; padding: 1px 7px; }
.nav .count.soft { background: #e3a008; }
[data-needs-you-count][hidden] { display: none !important; }
.sev { width: 10px; height: 10px; border-radius: 3px; flex: none; margin-top: 5px; }
.sev.critical { background: var(--bad); box-shadow: 0 0 0 3px var(--bad-soft); }
.sev.warning { background: #e3a008; box-shadow: 0 0 0 3px var(--warn-soft); }
.sev.info { background: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.alert-list { list-style: none; margin: 0; padding: 0; }
.alert-list li { display: flex; gap: 14px; align-items: flex-start; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.alert-list li:last-child { border-bottom: 0; }
.alert-list .body { flex: 1; min-width: 0; }
.alert-list .body strong { display: block; font-size: 14px; }
.alert-list .body .detail { color: var(--ink-2); font-size: 13px; margin-top: 2px; }
.alert-list .body .meta { color: var(--ink-3); font-size: 12px; margin-top: 4px; display: flex; gap: 10px; flex-wrap: wrap; }
.alert-list .acts { display: flex; gap: 6px; align-items: center; flex: none; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chips a { padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--ink-2); font-weight: 600; font-size: 12.5px; background: var(--surface); }
.chips a.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.chips a b { font-weight: 700; margin-left: 4px; opacity: .7; }
.all-in { padding: 10px 12px; margin: 4px 0 12px; border-radius: 10px; background: var(--surface-2); font-size: 13px; line-height: 1.6; }
.all-in strong { font-size: 15px; }
.rate-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); gap: 14px; align-items: start; }
.rate-card h2 { margin: 0 0 2px; }
.rate-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 12px; }
.rate-total { display: grid; justify-items: end; flex: none; font-size: 12px; }
.rate-total strong { font-size: 24px; line-height: 1.15; }
.rate-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 0; border-top: 1px solid var(--line); }
.rate-origin { flex-basis: 100%; display: flex; }
.rate-origin select { flex: 1; min-width: 0; height: 32px; font-size: 12.5px; color: var(--ink-2); }
.rate-name { flex: 1; min-width: 0; font-weight: 600; }
.rate-line input[type="text"] { width: 84px; text-align: right; }
.rate-add { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.rate-add select { flex: 1 1 150px; min-width: 0; }
.rate-add input[type="text"] { width: 96px; }
.rate-add select.rate-merchant { flex: 2 1 220px; }
.rate-share { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.rate-name .sub { display: block; font-size: 12px; font-weight: 500; color: var(--ink-3); }
.proc-title { margin: 18px 0 2px; font-size: 11.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-3); }
.proc-title span { text-transform: none; letter-spacing: 0; font-weight: 500; margin-left: 4px; }
.proc-title:first-of-type { margin-top: 4px; }
details.proc { border-top: 1px solid var(--line); }
details.proc > summary, .proc-row { display: flex; align-items: center; gap: 12px; padding: 11px 0; list-style: none; cursor: pointer; }
.proc-row { border-top: 1px solid var(--line); cursor: default; }
details.proc > summary::-webkit-details-marker { display: none; }
.proc-name { flex: 1; min-width: 0; font-weight: 600; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.proc-tag { font-size: 11px; font-weight: 600; color: var(--good); background: var(--good-soft); border-radius: 999px; padding: 1px 8px; }
.proc-hint { font-size: 12px; font-weight: 500; color: var(--ink-3); }
.proc-tag.soon { color: var(--warn); background: var(--warn-soft); }
.proc-count { font-size: 12.5px; color: var(--ink-3); white-space: nowrap; }
.proc-amount { font-size: 17px; font-variant-numeric: tabular-nums; min-width: 64px; text-align: right; }
.proc-edit { font-size: 12.5px; font-weight: 600; color: var(--brand); }
details.proc[open] .proc-edit { visibility: hidden; }
details.proc-add > summary .proc-name { font-weight: 600; color: var(--brand); }
.proc-body { padding: 0 0 12px; }
.proc-body .rate-line:first-of-type { border-top: 0; }
.rate-share h3 { margin: 0 0 8px; font-size: 13px; }
.per-txn { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; }
.per-txn > div { display: grid; gap: 4px; }
.per-txn span { font-size: 12.5px; }
.per-txn strong { font-size: 20px; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.facts.deal dd { font-variant-numeric: tabular-nums; }
.small { font-size: 12px; }

.iso-filter select { height: 32px; max-width: 190px; font-size: 13px; }
@media (max-width: 900px) {
  .topbar { flex-wrap: wrap; }
  .iso-filter { order: 5; width: 100%; }
  .iso-filter select { width: 100%; max-width: none; }
}
/* The ISO column only fits wide screens; below that it sits under the merchant's name. */
table.fit .iso-sub { display: none; }
@media (max-width: 1500px) { table.fit .xxl { display: none; } table.fit .iso-sub { display: block; } }
@media (max-width: 760px) { table.fit td .pill { white-space: normal; } }

/* Deals: one editable row per merchant. Below 1180px each row becomes a card, so it never scrolls sideways. */
.deal-tools { display: grid; gap: 12px; }
.deal-tools[hidden] { display: none; }
.deal-bulk { padding-top: 12px; border-top: 1px solid var(--line); }
.deals-card { overflow: visible; }
table.deals { table-layout: fixed; }
table.deals th, table.deals td { padding: 8px 6px; vertical-align: middle; }
table.deals th { white-space: normal; line-height: 1.2; vertical-align: bottom; }
table.deals .pick { width: 34px; padding-left: 12px; padding-right: 0; }
table.deals .agent { width: 13%; }
table.deals .plan { width: 16%; }
table.deals .plan-link { display: block; margin-top: 3px; font-size: 11.5px; font-weight: 500; }
table.deals .amt { width: 8%; }
table.deals .share { width: 6.5%; }
table.deals .result { width: 92px; padding-right: 14px; }
table.deals td.who { white-space: normal; font-weight: 600; overflow-wrap: anywhere; }
table.deals .sub { font-size: 12px; font-weight: 500; color: var(--ink-3); margin-top: 2px; }
table.deals input[type=text], table.deals select { width: 100%; height: 32px; padding: 0 7px; font-size: 13px; border-radius: 8px; }
table.deals input[type=text] { font-variant-numeric: tabular-nums; }
table.deals input[type=text]:disabled { background: var(--surface-2); }
table.deals .changed { border-color: var(--brand); background: var(--brand-soft); }
table.deals .bad-value { border-color: var(--bad); background: var(--bad-soft); }
table.deals tr.dirty td.who a { color: var(--brand); }
.deal-save { position: sticky; bottom: 12px; z-index: 5; display: flex; align-items: center; gap: 10px; margin-top: 12px; padding: 10px 14px;
  background: var(--surface); border: 1px solid var(--line-2); border-radius: 14px; box-shadow: var(--shadow-1); font-size: 13px; font-weight: 600; }
.deal-save .grow { flex: 1; }
.deal-save button[hidden] { display: none; }
.deal-save.pending { border-color: var(--brand); }
button.link.danger { color: var(--bad); }
@media (max-width: 1180px) {
  table.deals, table.deals tbody { display: block; }
  table.deals thead { display: none; }
  table.deals tr[data-deal] { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
  table.deals td { display: block; width: auto !important; padding: 0 !important; border: 0; }
  table.deals td[data-label]::before { content: attr(data-label); display: block; font-size: 11px; font-weight: 600; color: var(--ink-3); margin-bottom: 3px; }
  table.deals tr[data-deal][hidden] { display: none; }
  table.deals tr[data-deal] { position: relative; }
  table.deals td.pick { position: absolute; top: 12px; left: 14px; }
  table.deals td.who { grid-column: 1 / -1; padding-left: 26px !important; }
  table.deals td.agent, table.deals td.plan { grid-column: span 2; }
  table.deals td.result { text-align: left; }
}
/* Admin's Logins table: each login becomes a card on smaller screens, so it never scrolls sideways */
@media (max-width: 1180px) {
  table.logins, table.logins tbody { display: block; }
  table.logins thead { display: none; }
  table.logins tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 16px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
  table.logins td { display: block; padding: 0; border: 0; white-space: normal; overflow-wrap: anywhere; min-width: 0 !important; max-width: none !important; }
  table.logins td:nth-child(1) { font-weight: 650; }
  table.logins td:nth-child(4), table.logins td:nth-child(6) { grid-column: 1 / -1; }
  table.logins input[type=email] { width: 100% !important; max-width: 280px; }
}
@media (max-width: 900px) { .deal-save { bottom: calc(68px + env(safe-area-inset-bottom)); } }
@media (max-width: 560px) { table.deals tr[data-deal] { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Onboarding board: one lane per stage, scrolls sideways on small screens */
.board { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; padding-bottom: 6px; } /* lanes wrap rather than scroll sideways */
@media (max-width: 560px) { .lane { min-height: 0; } }
.lane { background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px; padding: 10px; display: grid; gap: 8px; align-content: start; min-height: 160px; }
.lane header { display: flex; justify-content: space-between; align-items: center; padding: 2px 4px 4px; font-size: 13px; }
.lane-empty { margin: 4px; }
.deal-card { padding: 10px 12px; display: grid; gap: 3px; transition: transform .15s ease, box-shadow .15s ease; }
.deal-card:hover { transform: translateY(-1px); box-shadow: var(--shadow-2, var(--shadow-1)); }
.deal-card .name { font-weight: 650; color: var(--ink); }
.deal-card .foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 4px; }
.deal-card .icon-btn { width: 28px; height: 28px; }

/* Stage stepper on a prospect */
.stepper { display: flex; flex-wrap: wrap; gap: 6px; }
.stepper form { margin: 0; }
.step { background: var(--surface); color: var(--ink-2); border: 1px solid var(--line-2); box-shadow: none; height: 32px; font-size: 12.5px; }
.step.done { background: var(--good-soft); color: var(--good); border-color: transparent; }
.step.on { background: var(--ink); color: #fff; border-color: var(--ink); }

/* Support ticket thread */
.thread { display: grid; gap: 10px; }
.msg { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; max-width: 88%; }
.msg.staff { justify-self: end; background: var(--brand-soft); border-color: transparent; }
.msg.internal { background: var(--warn-soft); }
.msg .meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 12.5px; margin-bottom: 4px; }
.msg .body { white-space: pre-wrap; overflow-wrap: anywhere; }
/* Profit: share of each surcharge dollar (one bar, 6 parts, legend + % labels below) */
.waterfall { display: flex; gap: 2px; height: 26px; border-radius: 8px; overflow: hidden; background: var(--surface-2); }
.waterfall span { min-width: 3px; transform-origin: left; animation: grow-x .8s var(--ease) both; }
.legend-row { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 12px; font-size: 12.5px; color: var(--ink-2); }
.legend-row i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.w-rebate { background: #d97706; } .w-cost { background: #7c3aed; } .w-cost2 { background: #0891b2; }
.w-cost3 { background: #64748b; } .w-res { background: #2f5bea; } .w-profit { background: #0f8a5f; }
.qr { width: 220px; padding: 10px; background: #fff; border: 1px solid var(--line); border-radius: 12px; }
.qr svg { width: 100%; height: auto; display: block; }
.codes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.codes span { padding: 10px 14px; background: var(--surface-2); border-radius: 9px; font-size: 16px; text-align: center; letter-spacing: .08em; }
.idle-warning { position: fixed; z-index: 65; left: 50%; bottom: 24px; transform: translateX(-50%); display: flex; gap: 14px; align-items: center;
  padding: 12px 14px 12px 18px; border-radius: 14px; background: #0e1a2b; color: #fff; box-shadow: var(--shadow-3); animation: toast-in .35s var(--ease) both; }
@media print { .sidebar, .topbar, .bottom-nav, .no-print { display: none !important; } .app { display: block; } .card { box-shadow: none; } }
.sidebar .grow { flex: 1 0 0; }
/* The links scroll on a short window; the logo, collapse button and account row stay put.
   The side margins keep the current page's blue edge from being clipped by the scroll area. */
.sidebar > * { flex: none; }
.sidebar > .nav { flex: 0 1 auto; min-height: 0; position: relative; overflow-y: auto; overscroll-behavior: contain;
  margin: 0 -14px; padding: 0 14px; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.sidebar > .nav::-webkit-scrollbar { width: 6px; }
.sidebar > .nav::-webkit-scrollbar-thumb { background: var(--line); border-radius: 3px; }
.me { display: flex; align-items: center; gap: 10px; padding: 10px; border-top: 1px solid var(--line); margin: 0 -14px -18px; padding: 14px 18px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: linear-gradient(135deg, #3fbf6a, #0b7a2f); color: #fff; font-weight: 700; font-size: 13px; }
.me .who { min-width: 0; line-height: 1.25; }
.me .who strong { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me .who span { font-size: 12px; color: var(--ink-3); }
.me .icon-btn { margin-left: auto; }
.app.collapsed .brand .word, .app.collapsed .nav a span, .app.collapsed .nav-label, .app.collapsed .me .who,
.app.collapsed .nav .count { display: none; }
.app.collapsed .nav a { justify-content: center; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; padding: 12px 28px;
  background: rgba(246, 247, 251, .82); backdrop-filter: saturate(180%) blur(12px); border-bottom: 1px solid transparent;
  transition: border-color .2s, box-shadow .2s;
}
.topbar.scrolled { border-bottom-color: var(--line); box-shadow: 0 1px 0 rgba(15, 26, 43, .02); }
.content { padding: 8px 28px 64px; max-width: 1480px; width: 100%; }
.page-head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin: 10px 0 18px; }
.page-head .sub { color: var(--ink-3); margin-top: 4px; }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.crumbs { color: var(--ink-3); font-size: 13px; display: flex; gap: 6px; align-items: center; }
.crumbs a { color: var(--ink-3); }
.crumbs a:hover { color: var(--brand); }
.section { margin-top: 28px; }
.section-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.section-head .right { margin-left: auto; display: flex; gap: 8px; align-items: center; }

/* ---------------------------------------------------------------- search */
.search { position: relative; flex: 1; max-width: 520px; }
.search input[type=search] {
  width: 100%; height: 40px; padding: 0 70px 0 40px; border-radius: 11px; border: 1px solid var(--line-2);
  background: var(--surface); font: inherit; color: var(--ink); box-shadow: var(--shadow-1); transition: border-color .15s, box-shadow .15s;
}
.search input[type=search]:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-ring); }
.search > .ico { position: absolute; left: 13px; top: 11px; color: var(--ink-3); pointer-events: none; z-index: 1; }
.search kbd { position: absolute; right: 10px; top: 9px; font: 600 11px/20px Inter, sans-serif; color: var(--ink-3);
  border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 6px; padding: 0 6px; background: var(--surface-2); }
.search-results {
  position: absolute; top: 46px; left: 0; right: 0; background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; box-shadow: var(--shadow-3); padding: 6px; max-height: 420px; overflow: auto;
  transform-origin: top; animation: pop .16s var(--ease);
}
.search-results a { display: flex; gap: 12px; align-items: center; padding: 9px 10px; border-radius: 8px; color: var(--ink); }
.search-results a.active, .search-results a:hover { background: var(--brand-soft); }
.search-results .kind { font-size: 11px; font-weight: 650; color: var(--ink-3); width: 64px; flex: none; text-transform: uppercase; letter-spacing: .04em; }
.search-results .detail { color: var(--ink-3); font-size: 12.5px; }
.search-results .none { padding: 14px; color: var(--ink-3); }

/* ---------------------------------------------------------------- live status */
.live { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line); color: var(--ink-2); font-size: 12.5px; font-weight: 550; white-space: nowrap; }
.dot { position: relative; width: 8px; height: 8px; border-radius: 50%; background: var(--good); flex: none; }
.dot::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: inherit; }
.dot.s-live::after, .dot.pulse::after { animation: ring 2.4s var(--ease) infinite; }
.dot.s-stale, .dot.s-syncing, .dot.stale { background: #e3a008; }
.dot.s-syncing::after { animation: ring 1.2s var(--ease) infinite; }
.dot.s-error, .dot.bad { background: var(--bad); }
.dot.idle { background: var(--ink-3); }
@keyframes ring { 0% { transform: scale(1); opacity: .5; } 80%, 100% { transform: scale(2.6); opacity: 0; } }
.topbar .spacer { flex: 1; }

/* ---------------------------------------------------------------- buttons & inputs */
.btn, button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 36px; padding: 0 14px;
  border-radius: 10px; border: 1px solid transparent; background: var(--brand); color: #fff; font: 600 13.5px/1 Inter, sans-serif;
  cursor: pointer; white-space: nowrap; transition: background .15s, box-shadow .15s, transform .1s, border-color .15s;
  box-shadow: 0 1px 2px rgba(11, 122, 47, .25), inset 0 1px 0 rgba(255, 255, 255, .15);
}
.btn:hover, button:hover { background: var(--brand-2); color: #fff; }
.btn:active, button:active { transform: translateY(1px); }
.btn.secondary, button.secondary { background: var(--surface); color: var(--ink); border-color: var(--line-2); box-shadow: var(--shadow-1); }
.btn.secondary:hover, button.secondary:hover { background: var(--surface-2); color: var(--ink); }
.btn.ghost, button.ghost, button.link { background: none; color: var(--brand); box-shadow: none; padding: 0 6px; height: auto; }
button.link:hover { background: none; color: var(--brand-2); text-decoration: underline; }
.btn.sm, button.sm { height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 8px; }
.icon-btn { width: 34px; height: 34px; padding: 0; background: none; color: var(--ink-3); box-shadow: none; border-radius: 9px; }
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.btn .spin, button .spin { width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
input[type=text], input[type=search], input[type=email], input[type=password], input[type=number], input[type=date], select, textarea {
  height: 36px; padding: 0 11px; border-radius: 9px; border: 1px solid var(--line-2); background: var(--surface);
  font: inherit; color: var(--ink); transition: border-color .15s, box-shadow .15s;
}
textarea { height: auto; min-height: 76px; padding: 9px 11px; width: 100%; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-ring); }
label.field { display: grid; gap: 6px; font-size: 12px; font-weight: 600; color: var(--ink-2); }
label.field input, label.field select { width: 100%; }
.inline { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ---------------------------------------------------------------- cards */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-1); }
.card.pad { padding: 18px 20px; }
.card.lift { transition: transform .2s var(--ease), box-shadow .2s var(--ease), border-color .2s; }
.card.lift:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); border-color: var(--line-2); }
.card h2 { margin-bottom: 12px; }
.grid { display: grid; gap: 16px; }
.grid > * { min-width: 0; } /* wide content scrolls inside its card instead of stretching the page */
.grid.two { grid-template-columns: 1fr 1fr; }
.grid.three { grid-template-columns: repeat(3, 1fr); }
.grid.side { grid-template-columns: 2fr 1fr; }
@media (max-width: 1100px) { .grid.two, .grid.three, .grid.side { grid-template-columns: 1fr; } }
dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: 9px 18px; margin: 0; }
dl.facts dt { color: var(--ink-3); font-size: 13px; }
dl.facts dd { margin: 0; font-weight: 500; }

/* ---------------------------------------------------------------- KPI tiles */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; }
.kpi { position: relative; padding: 16px 18px 14px; overflow: hidden; }
.kpi .label { color: var(--ink-3); font-size: 12.5px; font-weight: 550; }
.kpi .value { font-size: 26px; font-weight: 720; letter-spacing: -.025em; margin-top: 6px; line-height: 1.15; }
.kpi .foot { display: flex; align-items: center; gap: 8px; margin-top: 8px; min-height: 22px; flex-wrap: wrap; padding-right: 76px; }
.kpi .hint { color: var(--ink-3); font-size: 12px; }
.kpi .spark { position: absolute; right: 14px; bottom: 14px; width: 68px; height: 22px; opacity: .85; }
.spark path { fill: none; stroke: var(--brand); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 1.1s .25s var(--ease) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.delta { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; font-weight: 650; padding: 2px 7px 2px 5px;
  border-radius: 999px; opacity: 0; animation: fade-up .4s .55s var(--ease) forwards; }
.delta.up { color: var(--good); background: var(--good-soft); }
.delta.down { color: var(--bad); background: var(--bad-soft); }
.delta.flat { color: var(--ink-3); background: var(--surface-2); }
.delta.invert.up { color: var(--bad); background: var(--bad-soft); }
.delta.invert.down { color: var(--good); background: var(--good-soft); }
@keyframes fade-up { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ---------------------------------------------------------------- date range */
.rangebar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding: 8px; }
.segmented { position: relative; display: inline-flex; gap: 2px; padding: 3px; background: var(--surface-2); border-radius: 11px;
  max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.segmented::-webkit-scrollbar { display: none; }
.segmented a { position: relative; z-index: 1; padding: 6px 12px; border-radius: 8px; color: var(--ink-2); font-weight: 600; font-size: 13px; white-space: nowrap; transition: color .2s; }
.segmented a.on { color: var(--ink); }
/* On a phone every range shows at once, on as many lines as it takes. */
@media (max-width: 560px) {
  .segmented { display: flex; flex-wrap: wrap; overflow: visible; }
  .segmented .thumb { display: none; }
  .segmented a { padding: 9px 12px; }
  .segmented a.on { background: var(--surface); box-shadow: 0 1px 2px rgba(16, 24, 40, .12); }
}
.segmented .thumb { position: absolute; z-index: 0; top: 3px; bottom: 3px; border-radius: 8px; background: var(--surface);
  box-shadow: var(--shadow-1); transition: left .3s var(--ease), width .3s var(--ease); }
.rangebar .custom { display: flex; gap: 8px; align-items: center; margin-left: auto; color: var(--ink-3); font-size: 13px; flex-wrap: wrap; }
.rangebar .custom input { height: 32px; }
.rangelabel { color: var(--ink-3); font-size: 13px; margin: 10px 2px 16px; }
.rangelabel strong { color: var(--ink); }

/* ---------------------------------------------------------------- pills & status */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.pill.ok { background: var(--good-soft); color: var(--good); }
.pill.info { background: var(--brand-soft); color: var(--brand-2); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.neutral { background: var(--surface-2); color: var(--ink-2); }
.status { display: inline-flex; align-items: center; gap: 8px; font-weight: 550; font-size: 13px; white-space: nowrap; }
.status.quiet { color: var(--bad); }
.status.warn { color: var(--warn); }

/* ---------------------------------------------------------------- tables */
.table-wrap { overflow: auto; border-radius: var(--radius); }
table { width: 100%; border-collapse: separate; border-spacing: 0; }
th, td { padding: 11px 14px; text-align: left; white-space: nowrap; border-bottom: 1px solid var(--line); }
thead th { position: sticky; top: 0; z-index: 2; background: var(--surface); color: var(--ink-3); font-weight: 600; font-size: 12px;
  border-bottom: 1px solid var(--line); }
th[data-sort] { cursor: pointer; user-select: none; }
th[data-sort]:hover { color: var(--ink); }
th[data-dir="asc"]::after { content: " ↑"; } th[data-dir="desc"]::after { content: " ↓"; }
tbody tr { transition: background .12s; }
tbody tr:hover { background: #fafbfe; }
tbody tr:last-child td { border-bottom: 0; }
tr.clickable { cursor: pointer; }
tr.dim td { color: var(--ink-3); }
tfoot th { background: var(--surface-2); color: var(--ink); font-size: 13px; border-top: 1px solid var(--line-2); border-bottom: 0; }
td.num, th.num { text-align: right; }
/* Tables that must fit the screen without sideways scrolling */
table.fit td.name { white-space: normal; min-width: 170px; }
table.fit td.name .dot { display: inline-block; margin-left: 6px; vertical-align: 1px; }
/* The small second line wraps, so it never widens its column */
table.fit .sub { font-size: 12px; color: var(--ink-3); font-weight: 500; margin-top: 2px; white-space: normal; line-height: 1.35; }
table.fit td.num .sub { max-width: 150px; margin-left: auto; }
table.fit .sub a { color: inherit; }
table.fit td.result { white-space: normal; min-width: 110px; }
table.fit td.result .muted { display: block; font-size: 12px; margin-top: 2px; }
@media (max-width: 1280px) { table.fit th, table.fit td { padding-left: 10px; padding-right: 10px; } }
@media (max-width: 1200px) { table.fit .xl { display: none; } table.fit td.name { min-width: 130px; } }
table.fit .phone-only { display: none; }
table.fit td.wrap, table.fit td.name { white-space: normal; overflow-wrap: anywhere; }
td[colspan] { white-space: normal; } /* a "nothing here" message wraps instead of stretching the table */
@media (max-width: 560px) {
  .section-head .right { width: 100%; min-width: 0; flex-wrap: wrap; }
  .section-head .right input[type=search] { width: auto !important; flex: 1 1 120px; min-width: 0; }
}
table.fit select { width: 100%; min-width: 0; max-width: 260px; }
/* Comfortable to tap on a phone: at least 36px high. */
@media (max-width: 900px) {
  button, .btn, select, input[type=text], input[type=email], input[type=password], input[type=search], input[type=number], input[type=date] { min-height: 36px; }
  button.link { padding-top: 8px; padding-bottom: 8px; }
  summary { min-height: 32px; display: list-item; padding: 6px 0; }
}
table.fit .sub .status { white-space: normal; }
@media (max-width: 760px) {
  table.fit .wide, table.fit .contact { display: none; }
  table.fit .phone-only { display: block; }
  table.fit td.result { min-width: 0; }
  table.fit th, table.fit td { padding: 10px 6px; }
  table.fit td.name { min-width: 0; }
}
.table-tools { display: flex; gap: 6px; align-items: center; }
table.compact th, table.compact td { padding-top: 7px; padding-bottom: 7px; }
.colmenu { position: absolute; right: 0; top: 40px; z-index: 30; width: 230px; padding: 8px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-3); animation: pop .16s var(--ease); }
.colmenu label { display: flex; gap: 8px; align-items: center; padding: 6px 8px; border-radius: 7px; font-size: 13px; cursor: pointer; }
.colmenu label:hover { background: var(--surface-2); }
@keyframes pop { from { opacity: 0; transform: scale(.97) translateY(-4px); } to { opacity: 1; transform: none; } }

/* ---------------------------------------------------------------- filters */
.filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; align-items: end; padding: 16px; }
.summaryline { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 4px 2px 14px; color: var(--ink-3); }
.summaryline strong { color: var(--ink); font-weight: 650; }
.pager { display: flex; gap: 12px; align-items: center; justify-content: flex-end; margin: 14px 0; color: var(--ink-3); }

/* ---------------------------------------------------------------- charts */
.chart { position: relative; padding: 18px 20px 12px; margin: 0; }
.chart figcaption { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.chart figcaption .muted { font-size: 12.5px; }
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart .grid { stroke: var(--line); stroke-width: 1; stroke-dasharray: 3 4; }
.chart .base { stroke: var(--line-2); stroke-width: 1; }
.chart .axis { fill: var(--ink-3); font-size: 11px; font-family: Inter, sans-serif; }
.chart .mark { fill: var(--brand); transform-box: fill-box; transform-origin: bottom; animation: grow .7s var(--ease) both; }
.chart .bar:hover .mark { fill: var(--brand-2); }
.chart .hit { fill: transparent; }
@keyframes grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
.tooltip { position: absolute; z-index: 5; pointer-events: none; background: #0e1a2b; color: #fff; padding: 9px 12px; border-radius: 10px;
  font-size: 12px; line-height: 1.55; white-space: nowrap; transform: translate(-50%, calc(-100% - 10px)); box-shadow: var(--shadow-3);
  transition: left .12s var(--ease), top .12s var(--ease), opacity .12s; }
.tooltip strong { display: block; font-size: 12.5px; margin-bottom: 2px; }

.heat { padding: 18px 20px; }
/* The busy-hours chart shrinks to fit: 24 hours always show, on any screen. */
.heat table { border-spacing: 3px; width: 100%; table-layout: fixed; }
.heat tr:first-child th { width: 34px; }
.heat td, .heat th { padding: 0; border: 0; }
.heat th { font-size: 11px; color: var(--ink-3); font-weight: 550; padding-right: 8px; text-align: right; }
.heat .cell { width: 100%; aspect-ratio: 1; border-radius: 5px; background: var(--heat-0); animation: fade-in .5s var(--ease) both; }
.heat .cell:hover { outline: 2px solid var(--ink); outline-offset: 1px; }
.heat .l1 { background: var(--heat-1); } .heat .l2 { background: var(--heat-2); } .heat .l3 { background: var(--heat-3); }
.heat .l4 { background: var(--heat-4); } .heat .l5 { background: var(--heat-5); }
.heat .hours th { text-align: left; padding: 4px 0 0; font-size: 10.5px; overflow: visible; white-space: nowrap; }
@media (max-width: 560px) {
  .heat { padding: 14px 12px; }
  .heat table { border-spacing: 1px; }
  .heat tr:first-child th { width: 28px; }
  .heat th { padding-right: 4px; font-size: 10px; }
  .heat .cell { border-radius: 2px; }
  .heat .hours th { font-size: 9px; }
}
.heat .legend { display: flex; align-items: center; gap: 4px; font-size: 11.5px; color: var(--ink-3); margin-top: 12px; }
.heat .legend i { width: 14px; height: 14px; border-radius: 4px; display: inline-block; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

.movers { list-style: none; margin: 0; padding: 0; }
.movers li { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.movers li:last-child { border-bottom: 0; }
.movers .bar-track { flex: 1; height: 6px; border-radius: 6px; background: var(--surface-2); overflow: hidden; max-width: 120px; }
.movers .bar-fill { height: 100%; border-radius: 6px; transform-origin: left; animation: grow-x .8s .2s var(--ease) both; }
.movers .up .bar-fill { background: var(--good); } .movers .down .bar-fill { background: var(--bad); }
@keyframes grow-x { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* ---------------------------------------------------------------- live feed */
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 11px 18px; border-bottom: 1px solid var(--line); }
.feed li:last-child { border-bottom: 0; }
.feed .what { min-width: 0; }
.feed .what strong { display: block; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.feed .what span { color: var(--ink-3); font-size: 12px; }
.feed .amt { text-align: right; font-weight: 650; }
.feed .amt span { display: block; font-weight: 500; font-size: 12px; color: var(--ink-3); }
.feed .icon-dot { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--good-soft); color: var(--good); }
.feed .icon-dot.bad { background: var(--bad-soft); color: var(--bad); }
.feed li.enter { animation: slide-in .5s var(--ease) both, flash 2.2s .2s ease-out; }
@keyframes slide-in { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }
@keyframes flash { 0% { background: var(--brand-soft); } 100% { background: transparent; } }

/* ---------------------------------------------------------------- drawer */
.scrim { position: fixed; inset: 0; z-index: 40; background: rgba(14, 26, 43, .28); opacity: 0; pointer-events: none; transition: opacity .25s; }
.scrim.open { opacity: 1; pointer-events: auto; }
.drawer { position: fixed; z-index: 41; top: 0; right: 0; bottom: 0; width: min(460px, 100vw); background: var(--surface);
  box-shadow: var(--shadow-3); transform: translateX(104%); transition: transform .32s var(--ease); display: flex; flex-direction: column; }
.drawer.open { transform: none; }
.drawer header { display: flex; align-items: center; gap: 10px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.drawer header h2 { font-size: 16px; }
.drawer header .icon-btn { margin-left: auto; }
.drawer .body { padding: 20px; overflow: auto; }
.drawer .big { font-size: 30px; font-weight: 750; letter-spacing: -.03em; }
.drawer dl.facts { margin-top: 18px; }

.skeleton { border-radius: 8px; background: linear-gradient(90deg, var(--surface-2) 0%, #e9ecf3 40%, var(--surface-2) 80%);
  background-size: 200% 100%; animation: shimmer 1.2s linear infinite; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ---------------------------------------------------------------- toasts & progress */
.toasts { position: fixed; z-index: 60; top: 18px; right: 18px; display: grid; gap: 10px; }
.toast { display: flex; gap: 10px; align-items: center; min-width: 280px; max-width: 420px; padding: 12px 16px; border-radius: 12px;
  background: #0e1a2b; color: #fff; box-shadow: var(--shadow-3); animation: toast-in .35s var(--ease) both; font-weight: 500; }
.toast.out { animation: toast-out .3s var(--ease) both; }
.toast .badge { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--good); }
.toast.bad .badge { background: var(--bad); }
.toast .badge path { stroke-dasharray: 24; stroke-dashoffset: 24; animation: tick .4s .2s var(--ease) forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-10px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateX(16px); } }
@keyframes tick { to { stroke-dashoffset: 0; } }
.progress { position: fixed; z-index: 70; top: 0; left: 0; height: 3px; width: 0; background: linear-gradient(90deg, #3fbf6a, var(--brand));
  box-shadow: 0 0 10px var(--brand-ring); opacity: 0; transition: width .4s var(--ease), opacity .3s; }
.progress.run { opacity: 1; width: 80%; transition: width 8s cubic-bezier(.1, .7, .2, 1), opacity .2s; }
.progress.done { opacity: 0; width: 100%; transition: width .2s, opacity .4s .2s; }

/* ---------------------------------------------------------------- banners & empty states */
.banner { position: relative; overflow: hidden; display: flex; gap: 14px; align-items: center; padding: 14px 18px; margin-bottom: 18px;
  border-radius: var(--radius); background: linear-gradient(120deg, #e9f7ee, #f0faf3); border: 1px solid #cdeed7; }
.banner .ico { color: var(--brand); }
.banner .close { margin-left: auto; }
.burst { position: absolute; left: 34px; top: 50%; width: 0; height: 0; pointer-events: none; }
.burst i { position: absolute; width: 8px; height: 8px; background: linear-gradient(135deg, #3fbf6a, #0b7a2f); transform: rotate(45deg);
  border-radius: 1px; opacity: 0; animation: burst 1.1s var(--ease) forwards; }
@keyframes burst { 0% { opacity: 1; transform: translate(0, 0) rotate(45deg) scale(.4); }
  100% { opacity: 0; transform: translate(var(--x), var(--y)) rotate(225deg) scale(1); } }
.empty { text-align: center; padding: 44px 20px; color: var(--ink-3); }
.empty .ico { color: var(--line-2); margin-bottom: 8px; }
.empty strong { display: block; color: var(--ink); font-size: 15px; margin-bottom: 4px; }

/* ---------------------------------------------------------------- sign in */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.15fr 1fr; }
.auth .hero { position: relative; overflow: hidden; isolation: isolate; padding: 40px 48px 48px; color: #fff;
  display: flex; flex-direction: column; background: #04160b; }
.auth .hero .brand { position: relative; z-index: 2; }
.auth .hero .brand .word { color: #fff; }
.auth .hero .brand .word span { color: rgba(255, 255, 255, .6); }

/* Slow-drifting aurora light behind everything */
.aurora { position: absolute; inset: -25%; z-index: -2; filter: blur(70px); opacity: .85; }
.aurora i { position: absolute; border-radius: 50%; mix-blend-mode: screen; }
.aurora .b1 { width: 60%; height: 60%; left: 5%; top: 0; background: radial-gradient(circle, #15803d 0%, transparent 65%); animation: drift-a 22s ease-in-out infinite alternate; }
.aurora .b2 { width: 55%; height: 55%; right: 0; top: 20%; background: radial-gradient(circle, #22c55e 0%, transparent 62%); opacity: .7; animation: drift-b 26s ease-in-out infinite alternate; }
.aurora .b3 { width: 50%; height: 50%; left: 25%; bottom: 0; background: radial-gradient(circle, #0d9488 0%, transparent 62%); opacity: .55; animation: drift-c 30s ease-in-out infinite alternate; }
@keyframes drift-a { to { transform: translate(14%, 10%) scale(1.15); } }
@keyframes drift-b { to { transform: translate(-16%, 8%) scale(.9); } }
@keyframes drift-c { to { transform: translate(10%, -14%) scale(1.1); } }
.dots { position: absolute; inset: 0; z-index: -1; opacity: .55;
  background-image: radial-gradient(rgba(255, 255, 255, .16) 1px, transparent 1.2px); background-size: 24px 24px;
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 55% 45%, #000 20%, transparent 75%);
          mask-image: radial-gradient(ellipse 70% 60% at 55% 45%, #000 20%, transparent 75%); }

/* The cloud on its stage */
.stage { position: relative; flex: 1; display: grid; place-items: center; min-height: 380px; }
.halo { position: absolute; width: 520px; height: 520px; max-width: 95%; aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle, rgba(74, 222, 128, .38) 0%, rgba(22, 163, 74, .22) 35%, transparent 68%);
  animation: breathe 7s ease-in-out infinite; }
@keyframes breathe { 50% { transform: scale(1.08); opacity: .8; } }
.gem-wrap { position: relative; width: min(330px, 62%); animation: float 7s ease-in-out infinite; }
.gem { display: block; width: 100%; height: auto; filter: drop-shadow(0 26px 40px rgba(34, 197, 94, .45)) drop-shadow(0 0 1px rgba(255, 255, 255, .6)); }
.shine { position: absolute; inset: 0; pointer-events: none;
  -webkit-mask: var(--logo) center / contain no-repeat; mask: var(--logo) center / contain no-repeat;
  background: linear-gradient(115deg, transparent 35%, rgba(255, 255, 255, .75) 48%, rgba(255, 255, 255, .15) 54%, transparent 62%);
  background-size: 260% 100%; background-position: 130% 0; animation: sweep 6s 1.2s ease-in-out infinite; mix-blend-mode: soft-light; }
@keyframes sweep { 0% { background-position: 130% 0; } 35%, 100% { background-position: -40% 0; } }
@keyframes float { 50% { transform: translateY(-14px); } }
.floor { position: absolute; top: calc(50% + min(150px, 24%)); width: 220px; height: 26px; border-radius: 50%;
  background: radial-gradient(ellipse, rgba(34, 197, 94, .45), transparent 70%); filter: blur(6px); animation: shadow 7s ease-in-out infinite; }
@keyframes shadow { 50% { transform: scaleX(.82); opacity: .6; } }

/* Twinkling sparkles (4-point stars) */
.sparkle { position: absolute; width: 14px; height: 14px; opacity: 0; animation: twinkle 3.6s ease-in-out infinite; }
.sparkle::before, .sparkle::after { content: ""; position: absolute; left: 50%; top: 50%; background: #fff; border-radius: 2px;
  box-shadow: 0 0 8px rgba(187, 247, 208, .9); transform: translate(-50%, -50%); }
.sparkle::before { width: 2px; height: 100%; } .sparkle::after { width: 100%; height: 2px; }
.s1 { left: 22%; top: 24%; animation-delay: .2s; } .s2 { right: 20%; top: 18%; animation-delay: 1.4s; transform: scale(.7); }
.s3 { right: 16%; top: 58%; animation-delay: 2.3s; } .s4 { left: 18%; top: 66%; animation-delay: .9s; transform: scale(.6); }
.s5 { left: 46%; top: 10%; animation-delay: 3s; transform: scale(.5); } .s6 { right: 32%; bottom: 14%; animation-delay: 1.9s; transform: scale(.55); }
@keyframes twinkle { 0%, 100% { opacity: 0; scale: .4; rotate: 0deg; } 40% { opacity: 1; scale: 1; rotate: 45deg; } 60% { opacity: .9; } }

/* Frosted glass hint cards */
.glass { position: absolute; display: flex; gap: 10px; align-items: center; padding: 10px 14px 10px 12px; border-radius: 14px;
  background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .16); backdrop-filter: blur(14px) saturate(140%);
  box-shadow: 0 14px 34px rgba(2, 6, 23, .35); font-size: 12px; line-height: 1.3; animation: float 8s ease-in-out infinite; }
.glass strong { display: block; font-size: 13px; }
.glass span:not(.dot):not(.tick) { color: rgba(255, 255, 255, .65); }
.glass .tick { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: rgba(16, 185, 129, .9); color: #fff; }
.glass .dot { background: #34d399; }
.g1 { left: 6%; top: 30%; animation-delay: -2s; }
.g2 { right: 5%; bottom: 22%; animation-delay: -5s; }

.auth .copy { position: relative; z-index: 2; }
.auth .hero h2 { font-size: 34px; line-height: 1.12; letter-spacing: -.035em; max-width: 480px; margin: 0 0 10px; font-weight: 750; }
.auth .hero p { color: rgba(255, 255, 255, .68); max-width: 420px; font-size: 15px; margin: 0; }
.auth .panel { display: grid; place-items: center; padding: 32px; background: var(--surface); }
.mobile-brand { display: none; }
@media (max-width: 900px) { .mobile-brand { display: block; } }
.auth form { width: min(380px, 100%); display: grid; gap: 14px; animation: fade-up .5s var(--ease) both; }
.auth form h1 { font-size: 26px; }
.auth form .btn, .auth form button { height: 42px; }
/* The sign-in button in the cloud's glossy 3D green: a darker rim, a bright top, a soft shine on the upper half and a
   glow underneath, like the logo. */
.auth form button[type="submit"] { position: relative; overflow: hidden; isolation: isolate; height: 46px; border-radius: 14px;
  border: 1.5px solid #067a25; color: #fff; font-size: 14.5px; text-shadow: 0 1px 1px rgba(0, 60, 15, .45);
  background: radial-gradient(120% 140% at 50% 115%, #2fd15f 0%, rgba(47, 209, 95, 0) 55%),
              linear-gradient(180deg, #34c95d 0%, #17a83f 42%, #0a8a2e 100%);
  box-shadow: 0 10px 22px -10px rgba(10, 138, 46, .75), 0 2px 4px rgba(6, 90, 30, .25),
              inset 0 -3px 6px rgba(0, 70, 20, .35), inset 0 2px 0 rgba(255, 255, 255, .35); }
.auth form button[type="submit"]::before { content: ""; position: absolute; z-index: -1; left: 6px; right: 6px; top: 3px; height: 46%;
  border-radius: 11px 11px 40% 40% / 11px 11px 14px 14px; pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, .55), rgba(255, 255, 255, .06)); }
.auth form button[type="submit"]:hover { background: radial-gradient(120% 140% at 50% 115%, #3ee06d 0%, rgba(62, 224, 109, 0) 55%),
  linear-gradient(180deg, #3dd666 0%, #1db446 42%, #0c9532 100%); box-shadow: 0 14px 26px -10px rgba(10, 138, 46, .85),
  0 2px 4px rgba(6, 90, 30, .25), inset 0 -3px 6px rgba(0, 70, 20, .35), inset 0 2px 0 rgba(255, 255, 255, .4); }
.auth form button[type="submit"]:active { transform: translateY(1px); box-shadow: 0 4px 10px -6px rgba(10, 138, 46, .8),
  inset 0 -1px 4px rgba(0, 70, 20, .35), inset 0 2px 3px rgba(0, 60, 15, .25); }
.alert { padding: 11px 14px; border-radius: 10px; background: var(--bad-soft); color: var(--bad); font-weight: 550; }
@media (max-width: 900px) { .auth { grid-template-columns: 1fr; } .auth .hero { display: none; } }

/* ---------------------------------------------------------------- misc */
.list { list-style: none; margin: 0; padding: 0; }
.list li { padding: 12px 0; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }
.done { text-decoration: line-through; color: var(--ink-3); }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px 14px; margin: 8px 0 12px; }
.checks label { display: flex; gap: 8px; align-items: center; font-size: 13px; }
.tz { color: var(--ink-3); font-size: 11px; margin-left: 4px; font-weight: 500; }
.note { color: var(--ink-3); font-size: 12px; margin-top: 10px; }
details.disclosure > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 8px; padding: 14px 18px; font-weight: 600; }
details.disclosure > summary::-webkit-details-marker { display: none; }
details.disclosure > summary::before { content: "›"; display: inline-block; transition: transform .2s var(--ease); font-size: 16px; color: var(--ink-3); }
details.disclosure[open] > summary::before { transform: rotate(90deg); }
.reveal { animation: fade-up .45s var(--ease) both; }

/* ---------------------------------------------------------------- phones */
.bottom-nav { display: none; }
.more-scrim { display: none; }
@keyframes sheet-up { from { transform: translateY(16px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (max-width: 900px) {
  .app, .app.collapsed { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .topbar { padding: 10px 16px; }
  .content { padding: 4px 16px 96px; }
  .live .label { display: none; }
  .search kbd { display: none; }
  .bottom-nav { display: flex; position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; justify-content: space-around;
    background: rgba(255, 255, 255, .94); backdrop-filter: blur(10px); 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; font-size: 11px; font-weight: 600; color: var(--ink-3); padding: 4px 6px; min-width: 0; }
  .bottom-nav button { background: none; border: 0; box-shadow: none; border-radius: 0; height: auto; font-family: inherit; line-height: inherit; cursor: pointer; }
  .bottom-nav button:hover { background: none; transform: none; box-shadow: none; }
  .bottom-nav a.on, .bottom-nav button.on, body.more-open .bottom-nav button { color: var(--brand); }
  /* The More tab shows the sidebar's full list as a sheet above the tabs. */
  body.more-open .sidebar { display: flex; position: fixed; z-index: 29; left: 0; right: 0; top: auto; bottom: calc(60px + env(safe-area-inset-bottom)); height: auto; max-height: calc(100dvh - 90px - env(safe-area-inset-bottom));
    overflow-y: auto; border-right: 0; border-radius: 16px 16px 0 0; box-shadow: 0 -10px 30px rgba(15, 26, 43, .16); animation: sheet-up .2s var(--ease); }
  body.more-open .sidebar .brand, body.more-open .sidebar [data-collapse], body.more-open .sidebar .grow { display: none; }
  body.more-open .sidebar > .nav { flex: none; overflow: visible; } /* the whole sheet scrolls on a phone */
  body.more-open .sidebar .nav a { justify-content: flex-start; padding: 11px 10px; }
  body.more-open .sidebar .nav a.on::before { display: none; }
  body.more-open .sidebar .me { flex: none; margin-top: 8px; }
  body.more-open .more-scrim { display: block; position: fixed; inset: 0; z-index: 28; background: rgba(14, 26, 43, .28); }
  .rangebar .custom { margin-left: 0; }
}

/* ---------------------------------------------------------------- Residuals */
:root { --gold: #f5b301; --gold-2: #ffd24a; }

#res-root { transition: opacity .18s var(--ease); }
#res-root.res-leaving { opacity: .45; pointer-events: none; }
#res-root.res-enter .res-hero { animation: res-in .55s var(--ease) both; }
#res-root.res-enter .res-charts, #res-root.res-enter [data-res-board-wrap] { animation: res-in .6s .08s var(--ease) both; }
@keyframes res-in { from { opacity: 0; transform: translateX(var(--enter-x, 0)) translateY(6px); } to { opacity: 1; transform: none; } }

/* the big number */
.res-hero { position: relative; isolation: isolate; overflow: hidden; display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 26px 30px 24px; border-radius: 22px; color: #fff; min-height: 236px;
  background: linear-gradient(118deg, #052b13 0%, #0b7a2f 55%, #1fa653 100%);
  box-shadow: 0 22px 50px -22px rgba(11, 122, 47, .75), inset 0 1px 0 rgba(255, 255, 255, .14); touch-action: pan-y; }
.res-hero::after { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: .9;
  background: radial-gradient(340px circle at var(--mx, 24%) var(--my, 30%), rgba(255, 255, 255, .17), transparent 70%); }
.res-hero::before { content: ""; position: absolute; top: 0; bottom: 0; width: 34%; left: -50%; z-index: -1; pointer-events: none; transform: skewX(-18deg);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .11), transparent); animation: res-sheen 7.5s 1.2s ease-in-out infinite; }
@keyframes res-sheen { 0% { left: -50%; } 34%, 100% { left: 130%; } }
.res-aurora { position: absolute; inset: 0; z-index: -2; overflow: hidden; }
.res-aurora i { position: absolute; display: block; border-radius: 50%; filter: blur(46px); opacity: .55; }
.res-aurora i:nth-child(1) { width: 340px; height: 340px; right: 6%; top: -48%; background: #6f7dff; animation: res-drift 13s ease-in-out infinite alternate; }
.res-aurora i:nth-child(2) { width: 300px; height: 300px; left: 34%; bottom: -66%; background: #18b6d8; opacity: .4; animation: res-drift 17s -6s ease-in-out infinite alternate-reverse; }
.res-aurora i:nth-child(3) { width: 240px; height: 240px; left: -6%; top: -46%; background: #a04dff; opacity: .36; animation: res-drift 15s -3s ease-in-out infinite alternate; }
@keyframes res-drift { from { transform: translate(-30px, -14px) scale(1); } to { transform: translate(44px, 26px) scale(1.18); } }
.res-sparks { position: absolute; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.res-sparks i { position: absolute; bottom: -14px; width: 8px; height: 8px; border-radius: 1px; background: rgba(255, 255, 255, .55);
  transform: rotate(45deg) scale(var(--s, 1)); animation: res-float 11s linear infinite; }
@keyframes res-float { 0% { transform: translateY(0) rotate(45deg) scale(var(--s, 1)); opacity: 0; } 12% { opacity: .75; } 80% { opacity: .35; }
  100% { transform: translateY(-300px) rotate(225deg) scale(var(--s, 1)); opacity: 0; } }
.res-hero-main { position: relative; min-width: 0; flex: 1; }
.res-hero-top { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; font-size: 12.5px; color: rgba(255, 255, 255, .78); font-weight: 550; }
.res-live-pill { display: inline-flex; align-items: center; gap: 7px; padding: 3px 11px 3px 9px; border-radius: 999px; font-weight: 700; color: #fff; letter-spacing: .01em;
  background: rgba(255, 255, 255, .16); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .2); }
.res-pulse { position: relative; width: 8px; height: 8px; border-radius: 50%; background: #4bf0a6; }
.res-pulse::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: #4bf0a6; animation: ring 1.8s var(--ease) infinite; }
.res-next { font-variant-numeric: tabular-nums; color: rgba(255, 255, 255, .62); }
.res-next::before { content: "·"; margin-right: 8px; }
.res-label { margin-top: 16px; font-size: 14.5px; font-weight: 550; color: rgba(255, 255, 255, .84); }
.res-amount { display: inline-flex; align-items: baseline; flex-wrap: nowrap; margin-top: 2px; font-size: clamp(38px, 10.2vw, 78px); line-height: 1.12; font-weight: 750; letter-spacing: -.035em;
  cursor: pointer; user-select: none; text-shadow: 0 6px 30px rgba(10, 20, 70, .4); transition: transform .35s var(--ease), filter .35s; }
.res-amount:hover { transform: scale(1.012); }
.res-amount.res-flash { filter: drop-shadow(0 0 22px rgba(255, 210, 74, .95)); transform: scale(1.03); }
.res-odo-cell { display: inline-block; height: 1.12em; overflow: hidden; vertical-align: top; }
.res-odo-strip { display: flex; flex-direction: column; transition: transform 1.15s cubic-bezier(.16, 1, .3, 1); will-change: transform; }
.res-odo-strip span { display: block; height: 1.12em; line-height: 1.12em; font-variant-numeric: tabular-nums; }
.res-gain-slot { min-height: 28px; margin-top: 2px; }
.res-gain { display: inline-block; padding: 2px 12px; border-radius: 999px; font-weight: 750; font-size: 15px; color: #33210a; background: linear-gradient(120deg, var(--gold-2), var(--gold));
  box-shadow: 0 8px 22px -6px rgba(245, 179, 1, .85); animation: res-gain .6s var(--ease) both; }
.res-gain.big { font-size: 16.5px; padding: 3px 14px; }
.res-gain.out { opacity: 0; transform: translateY(-10px); transition: opacity .5s, transform .5s; }
@keyframes res-gain { 0% { opacity: 0; transform: translateY(14px) scale(.8); } 60% { transform: translateY(-3px) scale(1.06); } 100% { opacity: 1; transform: none; } }
.res-chips { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 4px; }
.res-chip { display: inline-flex; align-items: center; gap: 5px; padding: 4px 11px; border-radius: 999px; font-size: 12.5px; color: rgba(255, 255, 255, .9); font-weight: 500;
  background: rgba(255, 255, 255, .11); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .13); transition: background .2s, transform .2s var(--ease); }
.res-chip:hover { background: rgba(255, 255, 255, .2); transform: translateY(-1px); }
.res-chip b { color: #fff; font-weight: 700; }
.res-chip.strong { background: rgba(255, 210, 74, .22); box-shadow: inset 0 0 0 1px rgba(255, 210, 74, .45); }
.res-chip.strong b { color: var(--gold-2); }

/* the ring */
.res-ring-wrap { position: relative; flex: none; width: 164px; text-align: center; }
.res-ring { width: 148px; height: 148px; display: block; margin: 0 auto; transform: rotate(-90deg); overflow: visible; }
.res-ring circle { fill: none; stroke-width: 9; }
.res-ring .track { stroke: rgba(255, 255, 255, .16); }
.res-ring .fill { stroke: var(--gold-2); stroke-linecap: round; stroke-dasharray: var(--pct, 0) 100; filter: drop-shadow(0 0 7px rgba(255, 210, 74, .75));
  transition: stroke-dasharray 1.1s var(--ease); }
#res-root.res-enter .res-ring .fill { animation: res-ring-in 1.5s .15s var(--ease) both; }
@keyframes res-ring-in { from { stroke-dasharray: 0 100; } }
.res-ring.done .fill { animation: res-ring-glow 2.4s ease-in-out infinite; }
@keyframes res-ring-glow { 50% { filter: drop-shadow(0 0 16px rgba(255, 210, 74, 1)); } }
.res-ring-text { position: absolute; left: 0; right: 0; top: 0; height: 148px; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.2; padding: 0 30px; }
.res-ring-text strong { font-size: 26px; font-weight: 750; letter-spacing: -.02em; }
.res-ring-text span { font-size: 12px; color: rgba(255, 255, 255, .78); }
.res-gem { animation: res-bob 2.2s ease-in-out infinite; }
.res-gem + strong { font-size: 13.5px; margin-top: 3px; letter-spacing: 0; }
@keyframes res-bob { 50% { transform: translateY(-3px) rotate(4deg); } }
.res-ring-note { margin-top: 5px; font-size: 12.5px; font-weight: 600; color: rgba(255, 255, 255, .88); }

/* flying confetti */
.res-gemlet, .res-confetti { position: fixed; z-index: 9000; pointer-events: none; display: block; }
.res-gemlet { width: 9px; height: 9px; margin: -4px 0 0 -4px; border-radius: 1.5px; animation: res-gemlet 1.15s cubic-bezier(.15, .7, .3, 1) both; }
@keyframes res-gemlet { 0% { opacity: 1; transform: translate(0, 0) rotate(45deg) scale(.2); } 70% { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--x), calc(var(--y) + 46px)) rotate(var(--r)) scale(var(--s)); } }
.res-confetti { top: -18px; width: 11px; height: 11px; border-radius: 2px; animation: res-fall 3s cubic-bezier(.3, .4, .5, 1) both; }
@keyframes res-fall { 0% { opacity: 1; transform: translate(0, 0) rotate(45deg) scale(var(--s)); } 85% { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--drift), 105vh) rotate(var(--r)) scale(var(--s)); } }

.res-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1180px) { .res-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* charts */
.res-charts { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.55fr); gap: 14px; }
.res-chart { position: relative; margin: 0; padding: 16px 18px 12px; min-width: 0; }
.res-chart figcaption { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; margin-bottom: 14px; }
.res-chart figcaption .muted { font-size: 12.5px; }
.res-plot { position: relative; padding-left: 38px; }
.res-axis { position: absolute; left: 0; right: 0; top: 0; height: 176px; pointer-events: none; }
.res-axis span { position: absolute; left: 38px; right: 0; border-top: 1px solid var(--line); }
.res-axis em { position: absolute; right: 100%; margin-right: 6px; top: -8px; font-style: normal; font-size: 11px; color: var(--ink-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.res-bars { position: relative; display: flex; align-items: stretch; touch-action: pan-y; }
.res-col { position: relative; flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; color: inherit; cursor: pointer; border-radius: 6px; outline-offset: -1px; }
.res-track { position: relative; display: flex; align-items: flex-end; justify-content: center; width: 100%; height: 176px; padding: 0 1px; }
.res-bar { display: block; width: 100%; max-width: 24px; height: var(--h, 0%); min-height: 0; border-radius: 4px 4px 0 0; background: var(--heat-2); transform-origin: bottom;
  transition: height .9s var(--ease), background .18s, opacity .18s, box-shadow .18s; }
#res-root.res-enter .res-bar { animation: res-grow .85s calc(var(--i, 0) * 18ms) var(--ease) both; }
@keyframes res-grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
.res-bars.days .res-bar { max-width: 16px; background: var(--brand); }
.res-bars.months .res-col.on .res-bar { background: linear-gradient(180deg, #3fbf6a, var(--brand)); box-shadow: 0 8px 18px -8px rgba(11, 122, 47, .9); }
.res-bars .res-col.now .res-bar { position: relative; overflow: hidden; }
.res-bars .res-col.now .res-bar::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, transparent 30%, rgba(255, 255, 255, .55) 50%, transparent 70%); background-size: 100% 300%; animation: res-rise 2.4s linear infinite; }
@keyframes res-rise { from { background-position: 0 -100%; } to { background-position: 0 200%; } }
.res-bars.days .res-col.now .res-bar { background: linear-gradient(180deg, var(--gold-2), var(--gold)); box-shadow: 0 0 16px rgba(245, 179, 1, .7); }
.res-col.best .res-track::before { content: ""; width: 0; }
.res-col.best .res-bar { position: relative; overflow: visible; }
.res-col.best .res-bar::before { content: ""; position: absolute; left: 50%; top: -13px; width: 8px; height: 8px; margin-left: -4px; border-radius: 1.5px; background: var(--gold);
  transform: rotate(45deg); box-shadow: 0 0 0 2px var(--surface); animation: res-bob 2.2s ease-in-out infinite; }
.res-bars:hover .res-col:not(:hover) .res-bar { opacity: .5; }
.res-col:hover .res-bar, .res-col.tipped .res-bar { opacity: 1; background: var(--brand-2); }
.res-bars.days .res-col.now:hover .res-bar, .res-bars.days .res-col.now.tipped .res-bar { background: var(--gold); }
.res-tick { display: block; height: 20px; margin-top: 4px; font-size: 11px; line-height: 20px; color: var(--ink-3); white-space: nowrap; font-variant-numeric: tabular-nums; }
.res-col.on .res-tick { color: var(--ink); font-weight: 700; }
.res-col.now .res-tick { font-weight: 700; }
.res-col.ahead { cursor: default; }
.res-chart .tooltip { pointer-events: none; }

/* ranked merchants */
.res-board-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.res-sort { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); }
.res-sort button { height: 28px; padding: 0 12px; border: 0; border-radius: 8px; background: transparent; color: var(--ink-2); box-shadow: none; font-size: 12.5px; font-weight: 600; }
.res-sort button:hover { background: transparent; color: var(--ink); }
.res-sort button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); }
.res-board { list-style: none; margin: 0; padding: 0; counter-reset: rank; }
.res-board li[data-key] { counter-increment: rank; display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--surface); position: relative; transition: background .18s; }
.res-board li[data-key]:first-child { border-radius: var(--radius) var(--radius) 0 0; }
.res-board li[data-key]:last-child { border-bottom: 0; border-radius: 0 0 var(--radius) var(--radius); }
.res-board li[data-key]:hover { background: var(--surface-2); }
#res-root.res-enter .res-board li[data-key] { animation: res-row .5s calc(var(--i, 0) * 38ms + 120ms) var(--ease) both; }
@keyframes res-row { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.res-rank { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 12.5px; font-weight: 700; color: var(--ink-2); background: var(--surface-2); font-variant-numeric: tabular-nums; }
.res-rank::before { content: counter(rank); }
.res-board li:nth-child(1) .res-rank { color: #4a3000; background: linear-gradient(135deg, var(--gold-2), var(--gold)); box-shadow: 0 4px 12px -3px rgba(245, 179, 1, .8); }
.res-board li:nth-child(2) .res-rank { color: #2c3a52; background: linear-gradient(135deg, #e6ebf3, #bcc6d6); }
.res-board li:nth-child(3) .res-rank { color: #4a2a0c; background: linear-gradient(135deg, #f0c9a0, #d59a63); }
.res-who { flex: 1; min-width: 0; }
.res-who a { font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.res-who a:hover { color: var(--brand); }
.res-meter { height: 6px; margin-top: 6px; border-radius: 6px; background: var(--surface-2); overflow: hidden; }
.res-meter-fill { display: block; height: 100%; width: var(--w, 0%); border-radius: 6px; background: linear-gradient(90deg, var(--brand), #6f8dff); transform-origin: left; transition: width .9s var(--ease); }
#res-root.res-enter .res-meter-fill { animation: grow-x .95s calc(var(--i, 0) * 38ms + 200ms) var(--ease) both; }
.res-board li:nth-child(1) .res-meter-fill { background: linear-gradient(90deg, var(--gold), var(--gold-2)); }
.res-money { flex: none; text-align: right; font-variant-numeric: tabular-nums; }
.res-money strong { display: block; font-size: 15px; font-weight: 700; }
.res-money span { font-size: 12px; color: var(--ink-3); }
.res-none { padding: 6px; }

/* the numbers behind it */
.res-details { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.res-details summary { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; padding: 9px 14px; border-radius: 10px; font-weight: 600; font-size: 13px; color: var(--ink-2);
  background: var(--surface); border: 1px solid var(--line); list-style: none; transition: color .15s, border-color .15s, transform .15s var(--ease); }
.res-details summary::-webkit-details-marker { display: none; }
.res-details summary:hover { color: var(--ink); border-color: var(--line-2); transform: translateY(-1px); }
.res-details details[open] summary { color: var(--brand); margin-bottom: 8px; }
.res-details details[open] > .card { animation: fade-up .3s var(--ease) both; }
.res-row-on td { background: var(--brand-soft); }

@media (max-width: 1100px) { .res-charts { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 760px) {
  .res-next::before { display: none; }
  .res-hero { flex-direction: column; align-items: stretch; padding: 20px 18px; gap: 14px; border-radius: 18px; }
  .res-ring-wrap { display: flex; align-items: center; width: auto; gap: 14px; text-align: left; }
  .res-ring { width: 84px; height: 84px; margin: 0; flex: none; }
  .res-ring circle { stroke-width: 11; }
  .res-ring-text { width: 84px; height: 84px; right: auto; padding: 0 12px; text-align: center; }
  .res-ring-text strong { font-size: 17px; }
  .res-ring-text span { font-size: 10px; }
  .res-gem svg { width: 16px; height: 16px; }
  .res-gem + strong { display: none; }
  .res-ring-note { margin: 0; font-size: 14px; }
  .res-chart { padding: 14px 12px 10px; }
  .res-plot { padding-left: 34px; }
  .res-axis span { left: 34px; }
  .res-track { height: 150px; }
  .res-axis { height: 150px; }
  .res-bars.days .res-track { padding: 0 .5px; }
  .res-board li[data-key] { padding: 11px 12px; gap: 10px; }
  .res-rank { width: 24px; height: 24px; font-size: 11.5px; }
}

@media (prefers-reduced-motion: reduce) {
  .res-sparks, .res-hero::before { display: none; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .spark path { stroke-dashoffset: 0; } .delta { opacity: 1; }
}
