/* Sheetly data — band surface, tokens mirrored from design-system/tokens.css */
@font-face { font-family: "Nunito";  src: url("fonts/nunito-latin.woff2") format("woff2"); font-weight: 700 1000; font-display: swap; }
@font-face { font-family: "DM Sans"; src: url("fonts/dmsans-400.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "DM Sans"; src: url("fonts/dmsans-500.ttf") format("truetype"); font-weight: 500; font-display: swap; }
@font-face { font-family: "DM Sans"; src: url("fonts/dmsans-700.ttf") format("truetype"); font-weight: 700; font-display: swap; }

:root {
  --paper-top: #F8F1E1; --card: #FCF6E6; --ink: #3A2415; --ink-deep: #2A1A0C; --body: #7A6450; --muted: #8A745C;
  --line-strong: rgba(74,46,28,0.22); --ledge: #DCCDAE;
  --gold: #C4952A; --gold-light: #D4A94A; --gold-dark: #A67B1E; --gold-text: #A8761A;
  --gold-12: rgba(196,149,42,0.12); --gold-16: rgba(196,149,42,0.16); --gold-18: rgba(196,149,42,0.18); --gold-34: rgba(196,149,42,0.34); --gold-45: rgba(196,149,42,0.45); --gold-60: rgba(196,149,42,0.60);
  --espresso: #5C3B22; --espresso-deep: #3C2414; --cta-text: #F6ECD6;
  --band: #2C1A0E; --band-deep: #150C06; --band-surface: #3D2817; --band-card: #4A3220; --band-card-light: #563C21;
  --band-text: #F5ECD7; --band-text-2: #BEAF96; --band-body: rgba(246,236,214,0.74); --band-deepest: #23160E; --parchment: #F5EDD6;
  --band-tile: rgba(74,50,32,0.42); --band-field: rgba(74,50,32,0.40); --band-control: rgba(74,50,32,0.72); --band-pill: rgba(61,40,23,0.72);
  --band-border: rgba(126,88,29,0.28); --band-border-strong: rgba(126,88,29,0.32); --band-border-soft: rgba(126,88,29,0.22); --band-hairline: rgba(126,88,29,0.15);
  --band-ink: #1A1208;
  --success-dark: #7BC47F; --error-dark: #CF6679;
  --font-display: "Nunito", ui-rounded, system-ui, sans-serif; --font-ui: "DM Sans", system-ui, sans-serif;
  --r-sm: 12px; --r-md: 16px; --r-lg: 20px; --r-xl: 26px; --r-chip: 10px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1); --t-press: .12s; --t-color: .15s;
  /* chart palette — validated on #382416 (band tile over gradient) */
  --s1: #A67B1E; --s2: #3987E5; --s3: #CF6679; --s4: #9085E9; --s5: #199E70;
  --bar: #D9C9A6; --grid: rgba(126,88,29,0.15); --axis: rgba(190,175,150,0.35);
  --sidebar-w: 232px;
}

* { box-sizing: border-box; }
html { color-scheme: dark; }
body {
  margin: 0; min-height: 100vh;
  background: linear-gradient(180deg, var(--band) 0%, var(--band-deep) 100%) fixed;
  color: var(--band-text); font-family: var(--font-ui); font-size: 15px; line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
:focus-visible { outline: 3px solid var(--gold-60); outline-offset: 3px; border-radius: 6px; }
button, input { font-family: inherit; }
a { color: inherit; }
[hidden] { display: none !important; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: 0s !important; transition-duration: 0s !important; } }

/* ── Type ── */
.h1 { font-family: var(--font-display); font-weight: 900; letter-spacing: -0.02em; line-height: 1.12; font-size: clamp(26px, 2.6vw, 34px); margin: 0; color: var(--band-text); }
.h1 em, .accent { font-style: normal; color: var(--gold-light); }
.h3 { font-family: var(--font-display); font-weight: 900; letter-spacing: -0.02em; font-size: 18px; margin: 0; color: var(--band-text); }
.eyebrow { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--gold-light); }
.note { color: var(--band-text-2); font-size: 13.5px; }
.lede { color: var(--band-body); font-size: 15px; max-width: 46ch; margin: 0; }
.num { font-variant-numeric: tabular-nums; }
.mono { font-variant-numeric: tabular-nums; letter-spacing: 0.01em; }

/* ── Buttons — pressed edge ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em;
  padding: 11px 18px; border: 0; border-radius: var(--r-md); cursor: pointer; white-space: nowrap;
  box-shadow: 0 4px 0 var(--edge, transparent);
  transition: transform var(--t-press) var(--ease), box-shadow var(--t-press) var(--ease), filter var(--t-color) ease;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 6px 0 var(--edge, transparent); filter: brightness(1.07); }
.btn:active { transform: translateY(4px); box-shadow: 0 0 0 transparent !important; }
.btn-gold { background: var(--gold); color: var(--ink-deep); --edge: var(--gold-dark); }
.btn-primary { background: var(--espresso); color: var(--cta-text); --edge: var(--espresso-deep); }
.btn-secondary { background: var(--band-card); color: var(--band-text); --edge: var(--band-deepest); border: 1px solid var(--band-border); }
.btn-block { display: flex; width: 100%; padding: 15px 24px; font-size: 14.5px; border-radius: var(--r-lg); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none !important; }
.btn.is-loading { color: transparent !important; pointer-events: none; position: relative; }
.btn.is-loading::after { content: ""; position: absolute; width: 16px; height: 16px; border: 2.4px solid var(--ink-deep); border-top-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.btn-ghost { background: none; border: 0; box-shadow: none; padding: 0; height: 40px; color: var(--band-text-2); font-weight: 700; font-size: 13.5px; text-transform: none; letter-spacing: 0; cursor: pointer; transition: color var(--t-color) ease, opacity var(--t-color) ease; }
.btn-ghost:hover { color: var(--gold-light); }
.btn-ghost:active { opacity: .55; }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; background: var(--band-control); border: 1px solid var(--band-border); color: var(--band-text); display: grid; place-items: center; cursor: pointer; box-shadow: 0 4px 0 var(--band-deepest); transition: transform var(--t-press) var(--ease), box-shadow var(--t-press) var(--ease); }
.icon-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 0 var(--band-deepest); }
.icon-btn:active { transform: translateY(4px); box-shadow: 0 0 0 transparent; }
.icon-btn svg { width: 18px; height: 18px; stroke-width: 2.2; }

/* ── Pills (range presets, toggles) ── */
.pills { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.pill {
  font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--band-text-2); background: transparent; border: 2px solid var(--band-border-strong); border-radius: var(--r-sm);
  padding: 7px 12px; cursor: pointer; display: inline-flex; align-items: center; gap: 7px;
  transition: transform var(--t-press) var(--ease), background var(--t-color) ease, color var(--t-color) ease, border-color var(--t-color) ease;
}
.pill:hover { color: var(--gold-light); border-color: var(--gold); }
.pill:active { transform: translateY(2px); }
.pill.is-active { color: var(--band-text); background: var(--gold-16); border-color: var(--gold); }

/* ── Chips ── */
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px; border-radius: var(--r-chip); background: var(--gold-12); border: 1.5px solid var(--gold-34); color: var(--gold-light); font-weight: 700; font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; white-space: nowrap; }
.chip-quiet { background: var(--band-pill); border-color: var(--band-border); color: var(--band-text-2); }
.chip-good { color: var(--success-dark); border-color: rgba(123,196,127,.4); background: rgba(123,196,127,.1); }
.chip-bad { color: var(--error-dark); border-color: rgba(207,102,121,.4); background: rgba(207,102,121,.1); }

/* ── Fields ── */
.field { background: var(--band-field); border: 1px solid var(--band-border); border-radius: var(--r-md); color: var(--band-text); font-size: 16px; padding: 10px 14px; min-height: 44px; }
.field::placeholder { color: var(--band-text-2); opacity: .8; }
input[type="date"].field { color-scheme: dark; }
.label { font-size: 12px; font-weight: 700; color: var(--band-text-2); text-transform: uppercase; letter-spacing: .05em; }

/* ── Layout ── */
.shell { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; padding: 24px 16px; display: flex; flex-direction: column; gap: 24px;
  background: var(--band-surface); border-right: 1px solid var(--band-hairline);
  box-shadow: 8px 0 24px rgba(26,18,8,.22);
}
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px; text-decoration: none; }
.brand img { width: 40px; height: 40px; filter: drop-shadow(0 6px 8px rgba(0,0,0,.35)); }
.brand .wordmark { width: 96px; height: auto; color: var(--cta-text); display: block; }
.brand .sub { display: block; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--gold-light); margin-top: 2px; }
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav a {
  display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: var(--r-sm); text-decoration: none;
  color: var(--band-text-2); font-weight: 500; font-size: 14.5px; border: 1px solid transparent;
  transition: background var(--t-color) ease, color var(--t-color) ease, border-color var(--t-color) ease;
}
.nav a svg { width: 18px; height: 18px; stroke-width: 2.1; flex: none; }
.nav a:hover { color: var(--band-text); background: var(--band-tile); }
.nav a.is-active { color: var(--band-text); background: var(--gold-18); border-color: var(--gold-34); }
.nav a.is-active svg { color: var(--gold-light); }
.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; padding: 0 8px; }
.sidebar-foot .note { font-size: 12.5px; }

.main { min-width: 0; padding: 28px 32px 64px; }
.topbar { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px 24px; margin-bottom: 24px; }
.topbar-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.controls .dates { display: inline-flex; align-items: center; gap: 6px; }
.controls .dates .field { padding: 6px 10px; min-height: 40px; font-size: 16px; width: 150px; }

.section { display: none; }
.section.is-active { display: block; animation: reveal .75s var(--ease) both; }
@keyframes reveal { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }
.section-head { margin: 8px 0 20px; }
.section-head .lede { margin-top: 6px; }

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.spread { justify-content: space-between; }

/* ── Cards ── */
.card {
  background: var(--band-tile); border: 1px solid var(--band-border); border-radius: var(--r-lg); padding: 18px 20px;
  box-shadow: 0 8px 16px rgba(26,18,8,.22); min-width: 0;
}
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card-head .h3 { font-size: 16px; }
.card-head .note { font-size: 12.5px; }

/* ── Stat tiles ── */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.tile { background: var(--band-tile); border: 1px solid var(--band-border-soft); border-radius: var(--r-md); padding: 14px 16px 12px; min-width: 0; }
.tile .k { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--band-text-2); line-height: 1.3; min-height: 15px; }
.tile .v { font-family: var(--font-display); font-weight: 900; font-size: 30px; letter-spacing: -0.02em; line-height: 1.1; margin-top: 6px; color: var(--band-text); }
.tile .s { font-size: 12.5px; color: var(--band-text-2); margin-top: 4px; min-height: 18px; }
.tile.is-accent .v { color: var(--gold-light); }
.tile.is-empty .v { color: var(--band-text-2); }

/* ── Conversion strip ── */
.strip { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0; align-items: stretch; }
.strip .stage { position: relative; padding: 14px 16px 12px 18px; border-left: 1px solid var(--band-hairline); min-width: 0; }
.strip .stage:first-child { border-left: 0; padding-left: 4px; }
.strip .stage .k { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--band-text-2); }
.strip .stage .v { font-family: var(--font-display); font-weight: 900; font-size: 26px; letter-spacing: -.02em; margin-top: 4px; line-height: 1.1; }
.strip .stage .p { font-size: 12.5px; color: var(--band-text-2); margin-top: 3px; }
.strip .stage .p b { color: var(--gold-light); font-weight: 700; }
.strip-bar { height: 6px; border-radius: 3px; background: var(--band-hairline); margin-top: 10px; overflow: hidden; }
.strip-bar > i { display: block; height: 100%; border-radius: 3px; background: var(--gold); transform-origin: left; animation: fill .52s var(--ease) both; }
@keyframes fill { from { transform: scaleX(.06); } }

/* ── Horizontal bars ── */
.bars { display: flex; flex-direction: column; gap: 8px; }
.bar-row { display: grid; grid-template-columns: minmax(80px, 38%) 1fr auto; align-items: center; gap: 12px; font-size: 13.5px; }
.bar-row .bl { color: var(--band-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-row .bt { height: 14px; position: relative; display: flex; align-items: center; }
.bar-row .bt i { display: block; height: 10px; border-radius: 0 4px 4px 0; background: var(--bar); min-width: 2px; transition: filter var(--t-color) ease, background var(--t-color) ease; transform-origin: left; animation: fill .52s var(--ease) both; }
.bar-row .bt i.c1 { background: var(--s1); } .bar-row .bt i.c2 { background: var(--s2); } .bar-row .bt i.c3 { background: var(--s3); } .bar-row .bt i.c4 { background: var(--s4); } .bar-row .bt i.c5 { background: var(--s5); }
.bar-row:hover .bt i { background: var(--gold-light); }
.bar-row .bv { color: var(--band-text); font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.bar-row .bv small { color: var(--band-text-2); font-weight: 400; margin-left: 6px; }
.bar-row.is-bad .bt i { background: var(--error-dark); }

/* stacked segments (results by plan) */
.stack-bar { display: flex; gap: 2px; height: 12px; border-radius: 4px; overflow: hidden; background: var(--band-hairline); }
.stack-bar i { display: block; height: 100%; }

/* ── Funnel ── */
.funnel { display: flex; flex-direction: column; gap: 6px; }
.f-row { display: grid; grid-template-columns: 24px minmax(90px, 150px) 1fr 60px 64px 70px; align-items: center; gap: 12px; font-size: 13.5px; padding: 3px 0; border-radius: 8px; }
.f-row:hover { background: rgba(74,50,32,.35); }
.f-row.is-base { border-bottom: 1px solid var(--band-hairline); padding-bottom: 8px; margin-bottom: 4px; }
.f-row .fi { color: var(--band-text-2); font-size: 11.5px; font-variant-numeric: tabular-nums; text-align: right; }
.f-row .fl { color: var(--band-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.f-row .fl small { color: var(--band-text-2); margin-left: 6px; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; font-weight: 700; }
.f-row .ft { height: 16px; display: flex; align-items: center; }
.f-row .ft i { display: block; height: 12px; border-radius: 0 4px 4px 0; min-width: 2px; transform-origin: left; animation: fill .52s var(--ease) both; }
.f-row .fv { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.f-row .fp { text-align: right; color: var(--band-text-2); font-variant-numeric: tabular-nums; }
.f-row .fd { text-align: right; font-variant-numeric: tabular-nums; color: var(--band-text-2); font-size: 12.5px; }
.f-row .fd.is-drop { color: var(--error-dark); }
.f-head { display: grid; grid-template-columns: 24px minmax(90px,150px) 1fr 60px 64px 70px; gap: 12px; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; font-weight: 700; color: var(--band-text-2); padding-bottom: 6px; border-bottom: 1px solid var(--band-hairline); margin-bottom: 4px; }
.f-head span:nth-child(n+4) { text-align: right; }

/* ── SVG charts ── */
.chart { position: relative; width: 100%; }
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart .grid-line { stroke: var(--grid); stroke-width: 1; }
.chart .axis { stroke: var(--axis); stroke-width: 1; }
.chart text { fill: var(--band-text-2); font-family: var(--font-ui); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart .line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .dot { stroke-width: 2; stroke: #382416; }
.chart .xhair { stroke: var(--band-text-2); stroke-width: 1; stroke-dasharray: 3 3; opacity: 0; }
.chart .hit { fill: transparent; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12.5px; color: var(--band-text-2); margin-top: 10px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.legend b { color: var(--band-text); font-weight: 700; font-variant-numeric: tabular-nums; margin-left: 4px; }

/* tooltip */
.tip { position: fixed; z-index: 50; pointer-events: none; background: var(--band-deepest); border: 1px solid var(--band-border-strong); border-radius: var(--r-sm); padding: 8px 11px; font-size: 12.5px; color: var(--band-text); box-shadow: 0 12px 24px rgba(26,18,8,.36); opacity: 0; transform: translateY(4px); transition: opacity .12s ease, transform .12s var(--ease); max-width: 280px; }
.tip.is-on { opacity: 1; transform: none; }
.tip .t { font-weight: 700; color: var(--band-text-2); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 4px; }
.tip .r { display: flex; justify-content: space-between; gap: 16px; font-variant-numeric: tabular-nums; }
.tip .r i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 6px; }

/* ── Tables ── */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--band-hairline); vertical-align: top; }
th { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; font-weight: 700; color: var(--band-text-2); white-space: nowrap; user-select: none; }
th.sortable { cursor: pointer; }
th.sortable:hover { color: var(--gold-light); }
th.is-sorted { color: var(--gold-light); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: rgba(74,50,32,.28); }
td .id { font-variant-numeric: tabular-nums; letter-spacing: .02em; color: var(--band-text-2); }
td .msg { max-width: 60ch; }
tr.is-excluded td { opacity: .5; }
tr.is-excluded td:last-child { opacity: 1; }
.sw { position: relative; width: 38px; height: 22px; border-radius: 11px; background: var(--band-field); border: 1px solid var(--band-border); cursor: pointer; padding: 0; transition: background var(--t-color) ease, border-color var(--t-color) ease; }
.sw::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--band-text-2); transition: transform var(--t-press) var(--ease), background var(--t-color) ease; }
.sw[aria-checked="true"] { background: var(--gold-18); border-color: var(--gold); }
.sw[aria-checked="true"]::after { transform: translateX(16px); background: var(--gold); }

/* ── Donuts ── */
.donut { display: flex; align-items: center; gap: 18px; min-width: 0; }
.donut.is-bare { justify-content: center; }
.dn-ring { position: relative; flex: none; }
.dn-ring svg { width: 100%; height: 100%; display: block; overflow: visible; }
.dseg { transition: stroke-width var(--t-color) ease, opacity var(--t-color) ease; cursor: default; }
.dn-ring:hover .dseg { opacity: .55; }
.dn-ring .dseg:hover { opacity: 1; stroke-width: 15; }
.dn-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; text-align: center; padding: 0 22px; }
.dn-center b { font-family: var(--font-display); font-weight: 900; font-size: 24px; letter-spacing: -.02em; line-height: 1; color: var(--band-text); }
.dn-center span { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--band-text-2); margin-top: 4px; }
.dn-legend { display: flex; flex-direction: column; gap: 6px; min-width: 0; flex: 1; }
.dn-row { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto auto; align-items: center; gap: 8px; font-size: 13.5px; }
.dn-row i { width: 10px; height: 10px; border-radius: 3px; display: block; }
.dn-row .dk { color: var(--band-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dn-row b { font-weight: 700; color: var(--band-text); }
.dn-row small { color: var(--band-text-2); min-width: 34px; text-align: right; }
.donut-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.donut-pair .label { margin-bottom: 8px; }
.donut-pair .donut { flex-direction: column; align-items: center; gap: 12px; }
.donut-pair .dn-legend { width: 100%; }
.seg-body { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: center; }
.seg-donut { flex: none; }

/* platform + device cells */
.pf-cell { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; color: var(--band-text); }
.pf { width: 14px; height: 14px; flex: none; color: var(--band-text-2); }
.dev-cell { display: flex; flex-direction: column; gap: 2px; align-items: flex-start; }
.dev-cell b { font-weight: 700; color: var(--band-text); white-space: nowrap; }
.dev-cell .note { font-size: 12.5px; }
.dev-cell .chip { margin-top: 2px; }

/* inline bar inside table cells (cohorts) */
.inbar { display: inline-block; vertical-align: middle; width: 64px; height: 8px; border-radius: 4px; background: var(--band-hairline); margin-right: 8px; overflow: hidden; }
.inbar i { display: block; height: 100%; border-radius: 4px; background: var(--bar); }

/* feed */
.feed { display: flex; flex-direction: column; }
.feed-row { display: grid; grid-template-columns: 88px 76px minmax(110px, 180px) minmax(0, 1.4fr); gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--band-hairline); font-size: 13px; align-items: baseline; }
.feed-row:last-child { border-bottom: 0; }
.feed-row .tm { color: var(--band-text-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.feed-row .dv { color: var(--band-text-2); font-variant-numeric: tabular-nums; }
.feed-row .nm { font-weight: 700; color: var(--band-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.feed-row .pr { color: var(--band-text-2); overflow-wrap: anywhere; }
.feed-row .pr b { color: var(--band-text); font-weight: 500; }

/* feedback cards */
.fb { display: grid; grid-template-columns: 1fr; gap: 12px; }
.fb-item { background: var(--band-tile); border: 1px solid var(--band-border-soft); border-radius: var(--r-md); padding: 14px 16px; }
.fb-item .msg { font-size: 15px; color: var(--band-text); margin: 8px 0 10px; max-width: 70ch; }
.fb-item .meta { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12.5px; color: var(--band-text-2); }
.fb-item .meta .id { font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.fb-item.is-test { border-style: dashed; }
.fb-item.is-test .msg { opacity: .78; }

/* empty state */
.empty { border: 1.5px dashed var(--band-border-strong); border-radius: var(--r-md); padding: 22px 20px; text-align: center; color: var(--band-text-2); font-size: 13.5px; }
.empty b { display: block; color: var(--band-text); font-family: var(--font-display); font-weight: 900; font-size: 16px; margin-bottom: 4px; }

/* ── Login ── */
.login { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 24px; background: linear-gradient(180deg, var(--band) 0%, var(--band-deep) 100%); }
.login-card { width: min(400px, 100%); background: var(--band-surface); border: 1px solid var(--band-border); border-radius: var(--r-xl); padding: 28px 28px 24px; box-shadow: 0 8px 0 var(--band-deepest), 0 24px 48px rgba(26,18,8,.36); position: relative; }
.login-card .h1 { font-size: 30px; margin: 6px 0 4px; }
.login-card .lede { margin: 0 0 20px; font-size: 14.5px; }
.login-card form { display: flex; flex-direction: column; gap: 12px; }
.login-card .err { color: var(--error-dark); font-size: 13.5px; min-height: 20px; margin: 0; }

/* loading skeleton */
.busy .main { opacity: .55; pointer-events: none; transition: opacity .2s ease; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%) translateY(12px); background: var(--band-deepest); border: 1px solid var(--band-border-strong); color: var(--band-text); border-radius: var(--r-md); padding: 10px 16px; font-size: 13.5px; opacity: 0; transition: opacity .2s ease, transform .3s var(--ease); z-index: 60; pointer-events: none; }
.toast.is-on { opacity: 1; transform: translateX(-50%); }

/* ── Responsive ── */
@media (max-width: 1100px) { .grid-4 { grid-template-columns: repeat(2, minmax(0,1fr)); } .grid-3 { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: sticky; top: 0; height: auto; flex-direction: row; align-items: center; gap: 12px; padding: 10px 12px; overflow-x: auto; z-index: 30; }
  .brand { flex: none; gap: 0; padding: 0; } .brand > span { display: none; } .brand img { width: 34px; height: 34px; }
  .nav { flex-direction: row; gap: 0; flex: 1; justify-content: space-between; }
  .nav a { padding: 8px 7px; font-size: 13px; white-space: nowrap; }
  .nav a span { display: none; }
  .sidebar-foot { margin-top: 0; flex-direction: row; align-items: center; padding: 0; flex: none; gap: 6px; }
  .sidebar-foot .note { display: none; }
  .sidebar-foot .btn-ghost { font-size: 12.5px; }
  #excl-pill { font-size: 10px; padding: 3px 6px; }
  .main { padding: 20px 16px 48px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .strip { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px 0; }
  .strip .stage { padding: 10px 12px; }
  .strip .stage:nth-child(odd) { border-left: 0; padding-left: 4px; }
  .f-row, .f-head { grid-template-columns: 20px minmax(70px, 110px) 1fr 44px 52px; }
  .f-row .fd, .f-head span:last-child { display: none; }
  .feed-row { grid-template-columns: 70px 1fr; }
  .feed-row .dv { display: none; }
  .feed-row .pr { grid-column: 1 / -1; padding-left: 0; }
  .tile .v { font-size: 26px; }
  .controls .dates .field { width: 138px; }
  .seg-body { grid-template-columns: 1fr; justify-items: center; }
  .donut-pair { grid-template-columns: 1fr; }
  .donut { flex-wrap: wrap; justify-content: center; }
}

/* ── Money ── */
.mn-meta { margin: -8px 0 16px; min-height: 20px; }
.mn-check { margin: -6px 0 0 2px; font-size: 12.5px; }
.setup { max-width: 720px; }
.setup .steps { margin: 18px 0 16px; padding-left: 22px; display: flex; flex-direction: column; gap: 12px; color: var(--band-body); font-size: 14.5px; }
.setup .steps li::marker { color: var(--gold-light); font-weight: 700; }
.setup .steps b { color: var(--band-text); font-weight: 700; }
.setup .steps i { font-style: normal; color: var(--band-text); }
.setup code, .mn-meta code, .setup .note code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; background: var(--band-pill); border: 1px solid var(--band-border); border-radius: 6px; padding: 1px 6px; color: var(--band-text); }
.setup .scopes { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tile .k .p { color: var(--gold-light); margin-left: 6px; letter-spacing: .04em; }
.tile.is-money .v { font-size: 26px; }
.cash { font-variant-numeric: tabular-nums; white-space: nowrap; }
.chip-sand { text-transform: none; letter-spacing: 0; font-weight: 500; }
.launch-note { flex-basis: 100%; font-size: 12.5px; }

.nowrap { white-space: nowrap; }

/* Money v2 — KPI-first */
.tiles-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.tile.is-hero { padding: 20px 22px 18px; }
.tile.is-hero .k { font-size: 12px; }
.tile.is-hero .v { font-size: 42px; margin-top: 8px; }
.tile.is-hero .s { margin-top: 6px; }
.sandnote { color: var(--gold-light); }
.kv-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px 28px; }
.kv-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.kv { min-width: 0; }
.kv .k { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--band-text-2); line-height: 1.3; }
.kv .v { font-family: var(--font-display); font-weight: 900; font-size: 26px; letter-spacing: -.02em; line-height: 1.1; margin-top: 5px; color: var(--band-text); font-variant-numeric: tabular-nums; }
.kv .s { font-size: 12.5px; color: var(--band-text-2); margin-top: 3px; }
.kv.is-accent .v { color: var(--gold-light); }
.plan-table th:first-child, .plan-table td:first-child { width: 34%; }
.plan-table th.plan-h { text-transform: none; letter-spacing: -.01em; vertical-align: bottom; padding-bottom: 12px; }
.plan-table th.plan-h b { display: block; font-family: var(--font-display); font-weight: 900; font-size: 16px; color: var(--band-text); }
.plan-table th.plan-h span { display: block; font-size: 11.5px; font-weight: 500; letter-spacing: 0; color: var(--band-text-2); margin-top: 2px; }
.plan-table tbody th { font-size: 13.5px; text-transform: none; letter-spacing: 0; font-weight: 500; color: var(--band-body); white-space: normal; }
.plan-table td { font-size: 15px; color: var(--band-body); font-variant-numeric: tabular-nums; }
.plan-table td small { display: block; font-size: 11.5px; color: var(--band-text-2); font-weight: 400; margin-top: 1px; }
.plan-table td.is-best { color: var(--band-text); font-weight: 800; }
.plan-table td.is-na { color: var(--band-text-2); }
.plan-table tbody tr:hover td, .plan-table tbody tr:hover th { background: rgba(74,50,32,.28); }
.mn-month { margin-top: 18px; }
.mn-details-bar { margin-top: 4px; }
.mn-details-bar .btn { min-height: 40px; padding: 0 18px; font-size: 12.5px; }
.tick { color: var(--success-dark); font-weight: 800; }
@media (max-width: 1100px) { .tiles-4 { grid-template-columns: repeat(2, minmax(0,1fr)); } .kv-4 { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (max-width: 900px) { .tile.is-money .v { font-size: 22px; } .tile.is-hero .v { font-size: 32px; } .setup .steps { padding-left: 18px; } .plan-table td { font-size: 14px; } }
@media (max-width: 560px) { .tiles-4 { grid-template-columns: 1fr; } .kv-4 { grid-template-columns: 1fr; } .kv-row { grid-template-columns: repeat(2, minmax(0,1fr)); } }
.plan-table tbody tr:last-child th { border-bottom: 0; }
