/* FluxNote Spend — one token set drives every surface, control and chart. */
:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;

  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #f9fafb;
  --surface-3: #f2f3f6;
  --line: #e6e8ec;
  --line-soft: #eff1f4;
  --ink: #12141c;
  --ink-2: #464b59;
  --ink-3: #5f6473;
  --ink-4: #8b909c;

  --brand: #6b47dc;
  --brand-strong: #5835c4;
  --brand-soft: #f1edfd;
  --brand-line: #ded5fa;
  --focus: #a990f5;

  --good: #0e7a43;
  --good-soft: #e8f6ee;
  --warn: #8a5300;
  --warn-soft: #fdf3e1;
  --bad: #b42d35;
  --bad-soft: #fdecec;
  --info: #2a5fb8;
  --info-soft: #eaf1fc;

  --nav: #11121a;
  --nav-2: #191a25;
  --nav-ink: #c9cbd6;
  --nav-ink-2: #8d90a0;

  --chart-grid: #eef0f3;
  --chart-axis: #c9ccd4;

  --r-lg: 14px;
  --r-md: 10px;
  --r-sm: 7px;
  --shadow-sm: 0 1px 2px rgba(18, 20, 28, .05);
  --shadow: 0 1px 2px rgba(18, 20, 28, .04), 0 4px 16px rgba(18, 20, 28, .04);
  --shadow-lg: 0 18px 50px rgba(18, 20, 28, .16), 0 2px 8px rgba(18, 20, 28, .06);

  color: var(--ink);
  background: var(--bg);
}

/* Categorical series: validated order, color follows the provider. */
.cost-s1 { --series: #2a78d6; }
.cost-s2 { --series: #eb6834; }
.cost-s3 { --series: #1baf7a; }
.cost-s4 { --series: #eda100; }
.cost-s5 { --series: #e87ba4; }
.cost-s6 { --series: #008300; }
.cost-s7 { --series: #6250d6; }
.cost-s8 { --series: #e34948; }
.cost-other { --series: #9aa0ab; }

/* ── Base ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; font-size: 14px; line-height: 1.5; }
button, input, select, textarea { font: inherit; color: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { opacity: .5; cursor: not-allowed; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
:is(button, a, input, select, textarea, summary):focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
button { transition: background-color .15s, border-color .15s, color .15s, box-shadow .15s; }
[hidden] { display: none !important; }
p { margin: 0; line-height: 1.55; }
h1, h2, h3 { color: var(--ink); }
h1 { font-size: 30px; line-height: 1.15; letter-spacing: -.025em; font-weight: 650; margin: 0 0 8px; }
h2 { font-size: 16px; line-height: 1.3; letter-spacing: -.01em; font-weight: 620; margin: 0 0 4px; }
h3 { font-size: 14px; line-height: 1.35; font-weight: 600; margin: 0 0 6px; }
.i { width: 16px; height: 16px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; }
.skip { position: fixed; top: -60px; left: 20px; z-index: 50; background: var(--surface); padding: 12px 16px; border-radius: var(--r-sm); box-shadow: var(--shadow); }
.skip:focus { top: 12px; }
.muted { color: var(--ink-3); }

/* ── Sidebar ──────────────────────────────────────────── */
.sidebar { position: fixed; inset: 0 auto 0 0; width: 248px; z-index: 10; display: flex; flex-direction: column; padding: 24px 16px 20px; color: var(--nav-ink); background: linear-gradient(180deg, var(--nav-2) 0%, var(--nav) 38%); border-right: 1px solid rgba(255, 255, 255, .04); }
.brand { display: flex; align-items: center; gap: 11px; margin: 2px 8px 26px; color: #fff; }
.brand:hover { text-decoration: none; }
.brand img { width: 34px; height: 34px; }
.brand > span { font-size: 21px; font-weight: 650; letter-spacing: -.03em; line-height: 1; }
.brand small { display: block; margin-top: 6px; font-size: 10px; font-weight: 600; letter-spacing: .14em; color: var(--nav-ink-2); }
.workspace { display: flex; align-items: center; gap: 11px; margin-bottom: 26px; padding: 11px 12px; border-radius: var(--r-md); background: rgba(255, 255, 255, .04); border: 1px solid rgba(255, 255, 255, .06); font-size: 13px; font-weight: 600; line-height: 1.3; color: #eef0f6; }
.workspace small { display: block; margin-top: 3px; font-size: 12px; font-weight: 400; color: var(--nav-ink-2); }
.workspace-icon { display: grid; place-items: center; width: 32px; height: 32px; flex-shrink: 0; border-radius: 9px; background: linear-gradient(140deg, #8b6cf0, #5b3bd0); color: #fff; font-size: 14px; font-weight: 700; }
.lock { margin-left: auto; color: var(--nav-ink-2); display: grid; }
.nav-label { margin: 0 12px 8px; font-size: 11px; font-weight: 600; letter-spacing: .1em; color: #6c6f80; }
nav { display: grid; gap: 2px; }
.nav-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 9px 12px; border: 0; border-radius: 9px; background: none; color: var(--nav-ink); font-size: 14px; font-weight: 500; text-align: left; }
.nav-item .i { width: 18px; height: 18px; color: var(--nav-ink-2); }
.nav-item:hover { background: rgba(255, 255, 255, .05); color: #fff; }
.nav-item:hover .i { color: var(--nav-ink); }
.nav-item.active { background: rgba(139, 108, 240, .18); color: #fff; box-shadow: inset 0 0 0 1px rgba(167, 139, 250, .18); }
.nav-item.active .i { color: #c4b2ff; }
.nav-count { margin-left: auto; min-width: 24px; padding: 1px 7px; border-radius: 999px; background: rgba(255, 255, 255, .08); color: var(--nav-ink); font-size: 12px; font-weight: 600; text-align: center; font-variant-numeric: tabular-nums; }
.sidebar-bottom { margin-top: auto; padding: 16px 12px 0; border-top: 1px solid rgba(255, 255, 255, .06); font-size: 13px; }
.sidebar-bottom > div:first-child { display: flex; align-items: center; gap: 9px; color: #e3e5ee; font-weight: 500; }
.sidebar-bottom p { margin: 8px 0 14px; font-size: 12px; line-height: 1.55; color: var(--nav-ink-2); }
.status-dot { display: inline-block; flex-shrink: 0; width: 7px; height: 7px; border-radius: 50%; background: #2fbf7f; box-shadow: 0 0 0 3px rgba(47, 191, 127, .18); }
.identity { overflow-wrap: anywhere; font-size: 12px; color: var(--nav-ink-2); }
.signout { margin-top: 4px; padding: 4px 0; border: 0; background: none; color: var(--nav-ink); font-size: 13px; font-weight: 500; }
.signout:hover { color: #fff; }

/* ── Shell & top bar ─────────────────────────────────── */
.app-shell { margin-left: 248px; min-height: 100vh; }
.topbar { position: sticky; top: 0; z-index: 5; height: 60px; display: flex; align-items: center; justify-content: space-between; padding: 0 40px; background: rgba(245, 246, 248, .85); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); font-size: 13px; color: var(--ink-3); }
.topbar > div:first-child { display: flex; align-items: center; gap: 10px; }
.topbar > div:first-child > span { color: var(--ink-4); }
.topbar strong { color: var(--ink); font-weight: 600; }
.topbar-right { display: flex; align-items: center; gap: 9px; font-size: 13px; color: var(--ink-2); }
.avatar { display: grid; place-items: center; width: 30px; height: 30px; margin-left: 10px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); font-size: 13px; font-weight: 700; }
main { max-width: 1360px; margin: 0 auto; padding: 36px 40px 28px; }

/* ── Page heading & filters ──────────────────────────── */
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 22px; }
.eyebrow { margin-bottom: 8px; font-size: 12px; font-weight: 600; letter-spacing: .08em; color: var(--brand); text-transform: uppercase; }
.page-heading p { max-width: 620px; font-size: 15px; color: var(--ink-3); }
.heading-actions { display: flex; gap: 10px; flex-shrink: 0; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 38px; padding: 8px 15px; border: 1px solid transparent; border-radius: var(--r-sm); font-size: 14px; font-weight: 550; line-height: 1.2; white-space: nowrap; text-decoration: none; }
.button:hover { text-decoration: none; }
.button.primary { background: var(--brand); color: #fff; box-shadow: 0 1px 2px rgba(91, 56, 196, .25), inset 0 1px 0 rgba(255, 255, 255, .12); }
.button.primary:hover:not(:disabled) { background: var(--brand-strong); }
.button.secondary { background: var(--surface); border-color: var(--line); color: var(--ink-2); box-shadow: var(--shadow-sm); }
.button.secondary:hover:not(:disabled) { border-color: #cfd3db; color: var(--ink); background: var(--surface-2); }
.button.ghost { background: var(--brand-soft); color: var(--brand-strong); }
.button.ghost:hover:not(:disabled) { background: #e7e0fc; }
.button.danger { background: var(--bad-soft); color: var(--bad); border-color: #f6d3d5; }
.button.small { min-height: 32px; padding: 5px 11px; font-size: 13px; }
.button .i { width: 16px; height: 16px; }
.filterbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; padding: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow-sm); }
.range-presets { display: flex; gap: 2px; padding: 3px; background: var(--surface-3); border-radius: 9px; }
.chip { padding: 6px 12px; border: 0; border-radius: 7px; background: transparent; color: var(--ink-3); font-size: 13px; font-weight: 550; white-space: nowrap; }
.chip:hover { color: var(--ink); }
.chip.selected { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(18, 20, 28, .1), 0 0 0 1px rgba(18, 20, 28, .04); }
.filter-inputs { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.filter-inputs label { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 500; color: var(--ink-3); }
.filter-inputs input, .filter-inputs select { min-height: 36px; max-width: 160px; padding: 6px 10px; font-size: 13px; }

/* ── Form controls ───────────────────────────────────── */
input, select, textarea { min-width: 0; max-width: 100%; padding: 9px 12px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); color: var(--ink); font-size: 14px; box-shadow: var(--shadow-sm); }
input:hover, select:hover, textarea:hover { border-color: #d3d6de; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(107, 71, 220, .14); }
input::placeholder, textarea::placeholder { color: var(--ink-4); }
select { cursor: pointer; }
label { display: grid; gap: 6px; font-size: 13px; font-weight: 550; color: var(--ink-2); }
label small, .field-hint { font-size: 12px; font-weight: 400; line-height: 1.5; color: var(--ink-3); }
.field-error { color: var(--bad); font-size: 13px; }
.field-error:empty { display: none; }
.note { color: var(--ink-3); }

/* ── Banners & notices ───────────────────────────────── */
.loading { padding: 96px 20px; text-align: center; color: var(--ink-3); }
.error-banner { margin-bottom: 18px; padding: 12px 16px; border: 1px solid #f4cfd2; border-radius: var(--r-md); background: var(--bad-soft); color: var(--bad); font-weight: 500; }
.coverage { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; padding: 16px 18px; border: 1px solid #cdebd9; border-radius: var(--r-md); background: linear-gradient(100deg, #f0faf4, #f7fcf9); }
.coverage.incomplete { border-color: var(--brand-line); background: linear-gradient(100deg, #f5f1ff, #fbfaff); }
.coverage-icon { display: grid; place-items: center; width: 40px; height: 40px; flex-shrink: 0; border-radius: 11px; background: var(--surface); color: var(--brand); box-shadow: var(--shadow-sm), 0 0 0 1px var(--brand-line); }
.coverage-icon .i { width: 20px; height: 20px; }
.coverage > div:nth-child(2) { flex: 1; min-width: 0; }
.coverage strong { display: block; font-size: 15px; font-weight: 600; color: var(--ink); }
.coverage p { margin-top: 2px; font-size: 13px; color: var(--ink-2); }
.coverage-meter { display: flex; align-items: center; gap: 10px; margin-top: 10px; max-width: 420px; font-size: 12px; font-weight: 600; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.coverage-meter progress { flex: 1; height: 6px; background: rgba(107, 71, 220, .12); }
.coverage-meter span { white-space: nowrap; }
.coverage-meter progress::-webkit-progress-bar { background: rgba(107, 71, 220, .12); }
.coverage-meter progress::-webkit-progress-value { background: var(--brand); }
.coverage-meter progress::-moz-progress-bar { background: var(--brand); }
.coverage .button { margin-left: auto; flex-shrink: 0; }
.notice { margin-bottom: 20px; padding: 14px 16px; border: 1px solid var(--line); border-left: 3px solid var(--brand); border-radius: var(--r-sm); background: var(--surface); color: var(--ink-2); font-size: 13px; line-height: 1.6; }
.notice strong { color: var(--ink); }

/* ── KPI tiles ───────────────────────────────────────── */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.kpi { position: relative; min-height: 136px; padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow); }
.kpi-label { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; font-size: 13px; font-weight: 550; color: var(--ink-2); }
.kpi-icon { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: var(--surface-3); color: var(--ink-3); }
.kpi:first-child .kpi-icon { background: var(--brand-soft); color: var(--brand); }
.kpi-value { margin-bottom: 8px; font-size: 30px; font-weight: 650; line-height: 1.05; letter-spacing: -.025em; color: var(--ink); }
.kpi-value.unknown { font-size: 16px; font-weight: 550; letter-spacing: 0; line-height: 1.9; color: var(--ink-4); }
.kpi-note { font-size: 12px; line-height: 1.5; color: var(--ink-3); }

/* ── Cards & generic layout ──────────────────────────── */
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(280px, 1fr); gap: 20px; margin-bottom: 20px; }
.card { overflow: hidden; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow); }
.card.pad { padding: 22px; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 20px 22px 14px; }
.card-head p, .card-subtitle { margin: 0; font-size: 13px; line-height: 1.55; color: var(--ink-3); }
.section-gap { margin-top: 20px; }
.chart { position: relative; min-height: 185px; padding: 0 20px 10px; }
.chart svg { display: block; width: 100%; height: 188px; }
.chart-grid { stroke: var(--chart-grid); }
.chart-axis { fill: var(--ink-3); font-size: 11px; }
.chart-bar { fill: var(--brand); }
.chart-empty { display: grid; place-items: center; min-height: 188px; text-align: center; color: var(--ink-3); font-size: 13px; }
.chart-caption { padding: 0 22px 18px; font-size: 12px; line-height: 1.6; color: var(--ink-3); }

/* Category / product split */
.split-list { padding: 2px 22px 18px; }
.split-row { padding: 10px 0; }
.split-line { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 8px; font-size: 14px; }
.split-line span { display: flex; align-items: center; gap: 9px; color: var(--ink-2); }
.split-line strong { font-weight: 600; font-variant-numeric: tabular-nums; }
.legend-dot { display: inline-block; width: 8px; height: 8px; border-radius: 2px; background: var(--brand); }
.split-row:nth-child(2) .legend-dot { background: #2a78d6; }
.split-row:nth-child(3) .legend-dot { background: #1baf7a; }
.split-row:nth-child(4) .legend-dot { background: #eda100; }
progress { display: block; width: 100%; height: 6px; border: 0; border-radius: 999px; background: var(--surface-3); appearance: none; overflow: hidden; }
progress::-webkit-progress-bar { background: var(--surface-3); border-radius: 999px; }
progress::-webkit-progress-value { background: var(--brand); border-radius: 999px; }
progress::-moz-progress-bar { background: var(--brand); border-radius: 999px; }
.split-row:nth-child(2) progress::-webkit-progress-value { background: #2a78d6; }
.split-row:nth-child(3) progress::-webkit-progress-value { background: #1baf7a; }
.split-row:nth-child(4) progress::-webkit-progress-value { background: #eda100; }
.split-row:nth-child(2) progress::-moz-progress-bar { background: #2a78d6; }
.split-row:nth-child(3) progress::-moz-progress-bar { background: #1baf7a; }
.split-row:nth-child(4) progress::-moz-progress-bar { background: #eda100; }

/* Pills (status always paired with a word) */
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; background: var(--surface-3); color: var(--ink-2); font-size: 12px; font-weight: 550; line-height: 1.6; white-space: nowrap; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .7; }
.pill.green { background: var(--good-soft); color: var(--good); }
.pill.purple { background: var(--brand-soft); color: var(--brand-strong); }
.pill.amber { background: var(--warn-soft); color: var(--warn); }
.pill.red { background: var(--bad-soft); color: var(--bad); }
.pill.blue { background: var(--info-soft); color: var(--info); }

/* ── Tables ──────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: 14px; }
th { padding: 10px 20px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--surface-2); color: var(--ink-3); font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; }
td { padding: 14px 20px; border-bottom: 1px solid var(--line-soft); color: var(--ink-2); vertical-align: top; }
tbody tr:hover td { background: #fcfcfd; }
table:not(.provider-table) td { white-space: nowrap; }
td .button + .button { margin-left: 6px; }
#ledger-table td:nth-child(2) { min-width: 220px; white-space: normal; }
tr:last-child td { border-bottom: 0; }
td strong { color: var(--ink); font-weight: 600; }
td small { display: block; margin-top: 4px; font-size: 12px; line-height: 1.5; color: var(--ink-3); }
td small.field-error { color: var(--bad); }
td .pill + small { margin-top: 6px; }
.numeric { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--ink); }
.provider-name { display: flex; align-items: center; gap: 12px; }
.provider-name small { margin-top: 2px; }
.provider-icon { display: grid; place-items: center; width: 34px; height: 34px; flex-shrink: 0; border-radius: 9px; background: var(--brand-soft); color: var(--brand-strong); font-size: 12px; font-weight: 700; letter-spacing: .02em; }
.provider-icon.infrastructure { background: #e9f1fc; color: #2a5fb8; }
.provider-icon.advertising { background: #fdf3e1; color: #8a5300; }
.provider-icon.payments { background: #e8f6ee; color: #0e7a43; }
.provider-icon.email { background: #fdedf3; color: #a8365f; }
.provider-icon.stock_search, .provider-icon.analytics { background: #eef0f4; color: #464b59; }
.text-button { padding: 0; border: 0; background: transparent; color: var(--ink); font-size: 14px; font-weight: 600; text-align: left; }
.text-button:hover { color: var(--brand); }
.provider-table td:nth-child(1) { min-width: 210px; }
.provider-table td:nth-child(2) { white-space: nowrap; }
.provider-table td:nth-child(4) { min-width: 280px; max-width: 460px; }
.table-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 20px; border-top: 1px solid var(--line); font-size: 13px; color: var(--ink-3); }
.pager { display: flex; align-items: center; gap: 8px; }
.pager > span { margin: 0 4px; font-weight: 600; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 0 22px 16px; }
.toolbar input { flex: 1; min-width: 200px; }
.toolbar input[type="search"], #provider-search { padding-left: 36px; background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238b909c' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") no-repeat 12px center / 16px; }

/* ── Empty states, alerts, renewals ──────────────────── */
.empty { padding: 40px 24px; text-align: center; font-size: 14px; line-height: 1.6; color: var(--ink-3); }
.empty strong { display: block; margin-bottom: 4px; font-size: 15px; color: var(--ink); }
.empty-icon { display: grid; place-items: center; width: 46px; height: 46px; margin: 0 auto 14px; border-radius: 13px; background: var(--brand-soft); color: var(--brand); }
.empty-icon .i { width: 22px; height: 22px; }
.empty p { max-width: 400px; margin: 0 auto 16px; }
.alerts-list { padding: 0 22px 8px; }
.alert { display: flex; align-items: flex-start; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--line-soft); }
.alert:last-child { border: 0; }
.alert-mark { display: grid; place-items: center; width: 28px; height: 28px; flex-shrink: 0; border-radius: 8px; background: var(--info-soft); color: var(--info); }
.alert.warning .alert-mark { background: var(--warn-soft); color: var(--warn); }
.alert.critical .alert-mark, .alert.error .alert-mark { background: var(--bad-soft); color: var(--bad); }
.alert strong { display: block; font-size: 14px; font-weight: 600; color: var(--ink); }
.alert p { margin-top: 2px; font-size: 13px; line-height: 1.5; color: var(--ink-3); }
.renewal-list { padding: 0 22px 8px; }
.renewal { display: flex; justify-content: space-between; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--line-soft); }
.renewal:last-child { border: 0; }
.renewal strong { font-size: 14px; color: var(--ink); }
.renewal small { display: block; margin-top: 2px; font-size: 12px; color: var(--ink-3); }
.renewal > div:last-child { text-align: right; }

/* ── Forms, imports, settings ────────────────────────── */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.form-grid .full { grid-column: 1 / -1; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.form-section { margin: 22px 0 14px; padding-top: 20px; border-top: 1px solid var(--line); }
.checkbox { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; font-weight: 400; line-height: 1.5; color: var(--ink-2); }
.checkbox input { margin-top: 3px; box-shadow: none; accent-color: var(--brand); }
.file-drop { display: grid; justify-items: center; gap: 8px; padding: 28px 20px; border: 1.5px dashed #cfc3f5; border-radius: var(--r-md); background: #fbfaff; text-align: center; color: var(--ink-3); cursor: pointer; }
.file-drop:hover { border-color: var(--brand); background: var(--brand-soft); }
.file-drop > span { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: var(--surface); color: var(--brand); box-shadow: var(--shadow-sm); }
.file-drop strong { font-size: 15px; color: var(--ink); }
.file-drop small { font-size: 13px; color: var(--ink-3); }
.file-drop input { width: 100%; max-width: 360px; border: 0; background: none; box-shadow: none; font-size: 13px; color: var(--ink-2); }
.mapping-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.preview-errors { max-height: 140px; overflow: auto; padding: 12px 16px; border-radius: var(--r-sm); background: var(--bad-soft); color: var(--bad); font-size: 13px; line-height: 1.7; list-style-position: inside; }
.preview-table { max-height: 320px; overflow: auto; margin: 18px 0; }
.import-step { padding: 24px; }
.import-step h2 { font-size: 20px; letter-spacing: -.02em; }
.step-label { margin-bottom: 10px; font-size: 12px; font-weight: 600; letter-spacing: .08em; color: var(--brand); text-transform: uppercase; }
.account-panel { margin-top: 14px; padding: 16px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface-2); }
.account-panel h3 { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.account-panel > p { font-size: 13px; color: var(--ink-3); }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 14px 0; }
.account-panel .facts { grid-template-columns: 1fr; }
.fact { padding-top: 10px; border-top: 1px solid var(--line); }
.fact dt { margin-bottom: 3px; font-size: 12px; font-weight: 550; color: var(--ink-3); }
.fact dd { margin: 0; font-size: 14px; line-height: 1.5; color: var(--ink); overflow-wrap: anywhere; }
.settings-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 20px; align-items: start; }
.settings-section { padding: 24px; }
.settings-section > p { margin: 0 0 20px; font-size: 14px; line-height: 1.6; color: var(--ink-3); }
.settings-section > p + p { margin-top: -10px; }
.settings-section textarea { min-height: 130px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; resize: vertical; }
.connection-summary { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.connection-summary > span { display: flex; align-items: center; gap: 4px; padding: 3px 4px 3px 3px; border: 1px solid var(--line); border-radius: 999px; }
.connection-summary strong { padding-right: 6px; font-size: 13px; color: var(--ink); font-variant-numeric: tabular-nums; }
.connection-controls { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 6px; }
.connection-controls input { flex: 1; min-width: 160px; }
.connection-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line-soft); }
.connection-row:last-of-type { border-bottom: 0; }
.connection-row > div { min-width: 0; }
.connection-row small { display: block; margin-top: 3px; font-size: 12px; line-height: 1.5; color: var(--ink-3); overflow-wrap: anywhere; }
.connection-row small.field-error { color: var(--bad); }
.connection-row > .pill { flex-shrink: 0; }
#connection-list .table-foot { padding: 12px 0 0; }

/* ── Dialog & toast ──────────────────────────────────── */
dialog { width: calc(100% - 32px); max-width: 680px; max-height: 90vh; padding: 0; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); color: var(--ink); box-shadow: var(--shadow-lg); }
dialog::backdrop { background: rgba(17, 18, 26, .42); backdrop-filter: blur(3px); }
.dialog-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; padding: 18px 24px; border-bottom: 1px solid var(--line); background: var(--surface); }
.dialog-head h2 { margin: 0; font-size: 18px; }
.icon-button { display: grid; place-items: center; width: 32px; height: 32px; border: 0; border-radius: 9px; background: var(--surface-3); color: var(--ink-3); font-size: 20px; line-height: 1; }
.icon-button:hover { background: #e7e9ee; color: var(--ink); }
#dialog-content { padding: 22px 24px; }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 80; max-width: calc(100vw - 40px); padding: 12px 18px; border-radius: var(--r-md); background: var(--ink); color: #fff; font-size: 14px; font-weight: 500; box-shadow: var(--shadow-lg); }
footer { display: flex; gap: 16px; margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 12px; color: var(--ink-4); }
footer span:last-child { margin-left: auto; }

/* ── Login ───────────────────────────────────────────── */
.login-page { display: grid; place-items: center; min-height: 100vh; background: radial-gradient(900px 500px at 20% -10%, #e6dcff, transparent 60%), radial-gradient(700px 400px at 100% 110%, #dfe9ff, transparent 60%), var(--bg); }
.login-card { width: calc(100% - 40px); max-width: 420px; padding: 36px; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); box-shadow: var(--shadow-lg); }
.login-card .eyebrow { margin-top: 24px; }
.login-card h1 { font-size: 28px; }
.login-card p { margin-bottom: 22px; font-size: 15px; color: var(--ink-3); }
.login-card form { display: grid; gap: 16px; }
.login-card form .button { min-height: 42px; }
.login-card small { display: block; margin-top: 18px; font-size: 13px; line-height: 1.6; color: var(--ink-3); }
.login-card .field-error { margin: 0; }

/* ── Stripe processing fees ──────────────────────────── */
.stripe-fees { margin-bottom: 20px; }
.stripe-fees-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px 24px 0; }
.stripe-fees-heading > div { display: flex; align-items: center; gap: 12px; }
.stripe-fees-mark { display: grid; place-items: center; width: 40px; height: 40px; flex-shrink: 0; border-radius: 11px; background: #635bff; color: #fff; font-size: 20px; font-weight: 750; }
.stripe-fees-heading h2 { margin: 0 0 2px; }
.stripe-fees-heading p { font-size: 13px; color: var(--ink-3); }
.stripe-fees-body { display: grid; grid-template-columns: 220px minmax(160px, 1fr) 200px; gap: 32px; align-items: center; padding: 22px 24px; }
.stripe-fees-total > span, .stripe-fees-trend-label > span { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.stripe-fees-total > strong { display: block; margin: 6px 0 4px; font-size: 32px; font-weight: 650; letter-spacing: -.025em; line-height: 1.1; }
.stripe-fees-total > small { font-size: 13px; color: var(--ink-3); }
.stripe-fees-total p { margin-top: 8px; font-size: 13px; }
.stripe-fees-trend { min-width: 0; }
.stripe-fees-trend-label, .stripe-fees-dates { display: flex; justify-content: space-between; gap: 12px; font-size: 12px; color: var(--ink-3); }
.stripe-fees-trend-label small { font-size: 12px; }
.stripe-fees-trend svg { display: block; width: 100%; height: 76px; margin: 10px 0 6px; }
.stripe-fees-bar { fill: #635bff; transition: fill .15s; }
.stripe-fees-bar:hover { fill: #4339e0; }
.stripe-fees-zero { stroke: var(--chart-axis); stroke-width: 1; }
.stripe-fees-stats { display: grid; gap: 18px; padding-left: 24px; border-left: 1px solid var(--line); font-size: 13px; color: var(--ink-3); }
.stripe-fees-stats strong { display: block; margin-top: 2px; font-size: 18px; font-weight: 620; letter-spacing: -.01em; color: var(--ink); }
.stripe-fees-stats small { display: block; margin-top: 1px; font-size: 12px; color: var(--ink-3); }
.stripe-fees-note { padding: 12px 24px; border-top: 1px solid var(--line-soft); background: var(--surface-2); font-size: 12px; line-height: 1.6; color: var(--ink-3); }
.stripe-fees-detail { border-top: 1px solid var(--line-soft); }
.stripe-fees-detail summary { padding: 13px 24px; font-size: 14px; font-weight: 550; color: var(--ink-2); cursor: pointer; }
.stripe-fees-detail summary:hover { color: var(--ink); }
.stripe-fees-detail summary span { margin-left: 8px; font-size: 13px; font-weight: 400; color: var(--ink-3); }
.stripe-fees-detail .table-wrap { max-height: 280px; overflow: auto; }
.stripe-fees-detail th { position: sticky; top: 0; }
.stripe-fees-empty { padding: 28px 0; font-size: 13px; color: var(--ink-3); }

/* ── Cost explorer ───────────────────────────────────── */
.cost-card { margin-bottom: 20px; }
.cost-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 22px 24px 20px; border-bottom: 1px solid var(--line); }
.cost-eyebrow { display: flex; align-items: center; gap: 7px; margin-bottom: 6px; font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--brand); }
.cost-spark { display: inline-grid; }
.cost-heading h2 { margin-bottom: 4px; font-size: 20px; letter-spacing: -.02em; }
.cost-heading p { font-size: 14px; color: var(--ink-3); }
.cost-modes { display: flex; flex-shrink: 0; gap: 2px; padding: 3px; border-radius: 9px; background: var(--surface-3); }
.cost-modes button { display: flex; align-items: center; gap: 7px; min-height: 32px; padding: 6px 12px; border: 0; border-radius: 7px; background: none; color: var(--ink-3); font-size: 13px; font-weight: 550; }
.cost-modes button:hover { color: var(--ink); }
.cost-modes button.active { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(18, 20, 28, .1), 0 0 0 1px rgba(18, 20, 28, .04); }
.cost-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; }
.cost-main { min-width: 0; padding: 22px 24px 0; }
.cost-summary { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.cost-total > span { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.cost-total > strong { display: block; margin: 4px 0 2px; font-size: 44px; font-weight: 650; letter-spacing: -.035em; line-height: 1.1; }
.cost-total > small { font-size: 13px; color: var(--ink-3); }
.cost-total i { margin: 0 6px; font-style: normal; color: var(--ink-4); }
.cost-summary-side { display: grid; gap: 10px; min-width: 150px; padding-left: 20px; border-left: 1px solid var(--line); }
.cost-summary-side > span { font-size: 20px; font-weight: 650; color: var(--ink); font-variant-numeric: tabular-nums; }
.cost-summary-side small { margin-left: 4px; font-size: 13px; font-weight: 400; color: var(--ink-3); }
.cost-reporting-split { display: flex; flex-wrap: wrap; gap: 8px; margin: -6px 0 20px; }
.cost-reporting-split > span { padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface-2); font-size: 12px; color: var(--ink-3); }
.cost-reporting-split strong { margin-left: 6px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.cost-plot-meta { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 6px; font-size: 13px; color: var(--ink-3); }
.cost-plot-meta > span:first-child { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.cost-plot-meta i { margin-left: 6px; font-style: normal; font-weight: 400; color: var(--ink-4); }
.cost-plot-meta strong { font-weight: 650; color: var(--ink); }
.cost-plot-scroll { overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: thin; scrollbar-color: #d5d8df transparent; }
.cost-plot { display: block; width: 100%; min-width: 570px; height: auto; overflow: visible; user-select: none; }
.cost-grid { stroke: var(--chart-grid); stroke-width: 1; }
.cost-grid.zero { stroke: var(--chart-axis); }
.cost-axis { fill: var(--ink-3); font-size: 12px; font-variant-numeric: tabular-nums; }
.cost-fill { fill: var(--series); }
.cost-line { fill: none; stroke: var(--series); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.cost-line-dot { stroke: var(--surface); stroke-width: 2; }
.cost-hit { pointer-events: all; fill: transparent; stroke: none; cursor: crosshair; outline: none; }
.cost-hit.is-active { fill: rgba(107, 71, 220, .055); }
.cost-hit:focus-visible { fill: rgba(107, 71, 220, .08); stroke: var(--focus); stroke-width: 1.5; }
.cost-plot-hint { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 6px 0 18px; font-size: 12px; line-height: 1.5; color: var(--ink-3); }
.cost-cursor { display: inline-grid; margin-right: 4px; vertical-align: -3px; color: var(--ink-4); }
.cost-day-detail { padding: 18px 0 22px; border-top: 1px solid var(--line); }
.cost-day-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.cost-day-heading > div > span { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.cost-day-heading h3 { margin: 4px 0 0; font-size: 18px; letter-spacing: -.01em; }
.cost-day-heading h3 small { display: inline-block; margin-left: 10px; font-size: 13px; font-weight: 400; color: var(--ink-3); }
.cost-day-heading > strong { font-size: 24px; font-weight: 650; letter-spacing: -.02em; text-align: right; color: var(--ink); }
.cost-day-heading > strong small { display: block; margin-top: 2px; font-size: 12px; font-weight: 400; letter-spacing: 0; color: var(--ink-3); }
.cost-day-rows { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 32px; }
.cost-day-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-width: 0; padding: 4px 0; font-size: 14px; }
.cost-day-row > span { display: flex; align-items: center; gap: 9px; min-width: 0; color: var(--ink-2); }
.cost-day-row strong { font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; color: var(--ink); }
.cost-day-row strong.missing { font-size: 13px; font-weight: 400; color: var(--ink-4); }
.cost-dot { display: inline-block; flex-shrink: 0; width: 10px; height: 10px; min-width: 10px; border-radius: 3px; background: var(--series); }
.cost-dot.neutral { background: #c4c8d0; }
.cost-breakdown { display: flex; flex-direction: column; padding: 22px 20px 0; border-left: 1px solid var(--line); background: var(--surface-2); }
.cost-breakdown-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.cost-breakdown-head h3 { margin-bottom: 2px; font-size: 16px; }
.cost-breakdown-head p { font-size: 13px; color: var(--ink-3); }
.cost-breakdown-head > span { min-width: 28px; padding: 2px 8px; border-radius: 999px; background: var(--surface-3); color: var(--ink-2); font-size: 13px; font-weight: 600; text-align: center; }
.cost-selection { display: flex; align-items: center; gap: 4px; margin-bottom: 10px; }
.cost-selection button { padding: 5px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink-2); font-size: 12px; font-weight: 550; white-space: nowrap; }
.cost-selection button:hover { border-color: #cfd3db; color: var(--ink); }
.cost-selection button.active, .cost-selection button[aria-pressed="true"] { border-color: var(--brand-line); background: var(--brand-soft); color: var(--brand-strong); }
.cost-selection small { margin-left: auto; font-size: 12px; color: var(--ink-4); }
.cost-provider-list { max-height: 520px; margin: 0 -8px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #d5d8df transparent; }
.cost-provider { display: block; width: 100%; padding: 11px 8px 12px; border: 0; border-radius: var(--r-sm); background: none; text-align: left; transition: opacity .18s, background-color .18s; }
.cost-provider:hover { background: var(--surface-3); }
.cost-provider.muted-series { opacity: .4; }
.cost-provider-line { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.cost-provider-name { display: flex; align-items: center; gap: 9px; min-width: 0; font-size: 14px; font-weight: 550; line-height: 1.4; color: var(--ink); }
.cost-provider-line > strong { font-size: 14px; font-weight: 650; line-height: 1.4; white-space: nowrap; font-variant-numeric: tabular-nums; color: var(--ink); }
.cost-provider-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 2px 0 8px 19px; font-size: 12px; line-height: 1.4; color: var(--ink-3); }
.cost-provider-meta > span:last-child { white-space: nowrap; font-variant-numeric: tabular-nums; }
.cost-provider progress { width: calc(100% - 19px); height: 4px; margin-left: 19px; background: #e8eaee; }
.cost-provider progress::-webkit-progress-bar { background: #e8eaee; }
.cost-provider progress::-webkit-progress-value { background: var(--series); }
.cost-provider progress::-moz-progress-bar { background: var(--series); }
.cost-breakdown-footer { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: auto; padding: 16px 0 18px; border-top: 1px solid var(--line); font-size: 12px; line-height: 1.5; color: var(--ink-3); }
.cost-breakdown-footer .text-button { display: block; width: 100%; margin-top: 2px; font-size: 13px; color: var(--brand); }
.cost-footnote { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 13px 24px; border-top: 1px solid var(--line); background: var(--surface-2); font-size: 12px; line-height: 1.6; color: var(--ink-3); }
.cost-footnote strong { font-weight: 600; color: var(--ink); }
.cost-footnote .pill { flex-shrink: 0; }
.cost-plot-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 260px; padding: 24px; border: 1px dashed var(--line); border-radius: var(--r-md); text-align: center; }
.cost-plot-empty > span { display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: 12px; border-radius: 12px; background: var(--brand-soft); color: var(--brand); }
.cost-plot-empty > strong { font-size: 15px; font-weight: 600; }
.cost-plot-empty p { max-width: 340px; margin: 6px 0 14px; font-size: 13px; color: var(--ink-3); }
.cost-no-providers, .cost-day-empty { padding: 14px 4px; font-size: 13px; line-height: 1.6; color: var(--ink-3); }
.cost-tooltip { position: fixed; top: 12px; left: 12px; z-index: 60; width: 300px; max-width: calc(100vw - 24px); max-height: calc(100vh - 24px); overflow: hidden; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); box-shadow: var(--shadow-lg); pointer-events: none; }
.cost-tooltip-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--line-soft); }
.cost-tooltip-head > span { font-size: 14px; font-weight: 600; white-space: nowrap; }
.cost-tooltip-head small { display: block; margin-top: 1px; font-size: 12px; font-weight: 400; color: var(--ink-3); }
.cost-tooltip-head > strong { font-size: 22px; font-weight: 650; letter-spacing: -.02em; white-space: nowrap; }
.cost-tooltip-rows { display: grid; gap: 9px; padding: 12px 0; }
.cost-tooltip-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 13px; }
.cost-tooltip-row > span { display: flex; align-items: center; gap: 8px; min-width: 0; color: var(--ink-2); }
.cost-tooltip-row strong { font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.cost-tooltip-row strong.missing { font-size: 12px; font-weight: 400; color: var(--ink-4); }
.cost-tooltip-foot { padding-top: 10px; border-top: 1px solid var(--line-soft); font-size: 12px; line-height: 1.5; color: var(--ink-3); }
.cost-tooltip-foot > span { display: block; margin-top: 2px; }

/* ── Responsive ──────────────────────────────────────── */
@media (min-width: 1600px) {
  main { padding-top: 44px; }
  .cost-layout { grid-template-columns: minmax(0, 1fr) 340px; }
}
@media (max-width: 1250px) {
  .sidebar { width: 220px; padding: 22px 12px 18px; }
  .app-shell { margin-left: 220px; }
  main { padding: 30px 28px 24px; }
  .topbar { padding: 0 28px; }
  h1 { font-size: 27px; }
  .kpis { gap: 12px; }
  .kpi { padding: 16px; }
  .kpi-value { font-size: 26px; }
  .grid-2 { grid-template-columns: minmax(0, 1.4fr) minmax(250px, 1fr); }
}
@media (max-width: 1150px) {
  .stripe-fees-body { grid-template-columns: 180px minmax(140px, 1fr) 170px; gap: 22px; }
  .stripe-fees-stats { padding-left: 18px; }
  .cost-layout { grid-template-columns: minmax(0, 1fr) 280px; }
  .cost-main { padding: 20px 20px 0; }
  .cost-breakdown { padding: 20px 16px 0; }
  .cost-total > strong { font-size: 36px; }
  .cost-selection small { display: none; }
}
@media (max-width: 960px) {
  .sidebar { width: 196px; }
  .app-shell { margin-left: 196px; }
  .workspace { display: none; }
  main { padding: 26px 22px 22px; }
  .topbar { padding: 0 22px; }
  .page-heading { flex-direction: column; align-items: flex-start; gap: 16px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2, .settings-grid { grid-template-columns: 1fr; }
  .stripe-fees-body { grid-template-columns: 1fr 1fr; gap: 20px; }
  .stripe-fees-trend { grid-column: 1 / -1; grid-row: 2; }
  .stripe-fees-stats { grid-column: 2; grid-row: 1; }
  .cost-layout { grid-template-columns: 1fr; }
  .cost-breakdown { border-left: 0; border-top: 1px solid var(--line); }
  .cost-provider-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 20px; max-height: 320px; }
  .cost-selection small { display: block; }
  .cost-breakdown-footer { margin-top: 14px; }
  .cost-plot { min-width: 530px; }
}
@media (max-width: 650px) {
  body { font-size: 15px; }
  .sidebar { position: sticky; top: 0; width: 100%; padding: 12px 14px 0; border-right: 0; border-bottom: 1px solid rgba(255, 255, 255, .06); }
  .brand { margin: 0 2px 10px; }
  .brand img { width: 28px; height: 28px; }
  .brand > span { font-size: 18px; }
  .brand small { display: inline; margin-left: 8px; font-size: 9px; vertical-align: middle; }
  .workspace, .nav-label, .sidebar-bottom { display: none; }
  nav { display: flex; gap: 4px; padding-bottom: 10px; overflow-x: auto; scrollbar-width: none; }
  .nav-item { width: auto; min-height: 36px; padding: 7px 11px; font-size: 14px; white-space: nowrap; }
  .nav-item .i { width: 16px; height: 16px; }
  .nav-count { min-width: 20px; padding: 0 6px; font-size: 11px; }
  .app-shell { margin: 0; }
  .topbar { position: static; height: 46px; padding: 0 16px; }
  .topbar-right > :not(.avatar) { display: none; }
  main { padding: 22px 16px 18px; }
  .page-heading { gap: 14px; margin-bottom: 18px; }
  .page-heading p { font-size: 14px; }
  h1 { font-size: 25px; }
  .heading-actions { width: 100%; }
  .heading-actions .button { flex: 1; }
  .filterbar { flex-direction: column; align-items: stretch; gap: 10px; padding: 10px; }
  .range-presets .chip { flex: 1; }
  .filter-inputs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .filter-inputs label { display: grid; gap: 4px; }
  .filter-inputs input, .filter-inputs select { width: 100%; max-width: none; }
  .product-label { grid-column: 1 / -1; }
  .coverage { flex-wrap: wrap; align-items: flex-start; padding: 14px; }
  .coverage > div:nth-child(2) { flex-basis: calc(100% - 56px); }
  .coverage .button { margin-left: 56px; }
  .kpis { gap: 10px; margin-bottom: 16px; }
  .kpi { min-height: 0; padding: 14px; }
  .kpi-label { margin-bottom: 8px; font-size: 12px; }
  .kpi-icon { display: none; }
  .kpi-value { font-size: 23px; }
  .kpi-value.unknown { font-size: 14px; line-height: 1.6; }
  .card-head { padding: 16px 16px 12px; }
  .split-list, .alerts-list, .renewal-list { padding-left: 16px; padding-right: 16px; }
  .grid-2 { gap: 16px; margin-bottom: 16px; }
  .toolbar { padding: 0 16px 14px; }
  .toolbar input { min-width: 100%; }
  .toolbar select { flex: 1; }
  .table-foot { flex-wrap: wrap; padding: 12px 16px; }
  td, th { padding-left: 16px; padding-right: 16px; }
  .provider-table thead { display: none; }
  .provider-table tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px 12px; padding: 14px 16px; border-bottom: 1px solid var(--line-soft); }
  .provider-table tr:last-child { border-bottom: 0; }
  .provider-table td { min-width: 0 !important; max-width: none !important; padding: 0; border: 0; }
  .provider-table td:nth-child(1) { grid-column: 1; grid-row: 1; }
  .provider-table td:nth-child(5) { grid-column: 2; grid-row: 1; }
  .provider-table td:nth-child(2) { display: none; }
  .provider-table td:nth-child(3) { grid-column: 1 / -1; grid-row: 2; }
  .provider-table td:nth-child(4) { grid-column: 1 / -1; grid-row: 3; }
  .provider-table td:nth-child(6) { grid-column: 1 / -1; grid-row: 4; }
  .provider-table td:nth-child(6) .button { width: 100%; }
  footer { flex-wrap: wrap; gap: 8px; }
  footer span:last-child { margin-left: 0; }
  .form-grid { grid-template-columns: 1fr; }
  .mapping-grid { grid-template-columns: 1fr 1fr; }
  .settings-section, .import-step { padding: 18px 16px; }
  #dialog-content { padding: 18px; }
  .dialog-head { padding: 16px 18px; }
  .facts { grid-template-columns: 1fr; }
  .toast { right: 16px; bottom: 16px; }
  .form-actions .button { flex: 1; }
  .stripe-fees-heading { flex-wrap: wrap; padding: 16px 16px 0; }
  .stripe-fees-body { grid-template-columns: 1fr; gap: 18px; padding: 18px 16px; }
  .stripe-fees-stats { grid-column: 1; grid-row: 2; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding: 16px 0 0; border-left: 0; border-top: 1px solid var(--line); }
  .stripe-fees-trend { grid-row: 3; }
  .stripe-fees-note, .stripe-fees-detail summary { padding-left: 16px; padding-right: 16px; }
  .cost-heading { flex-direction: column; align-items: stretch; gap: 14px; padding: 18px 16px; }
  .cost-modes button { flex: 1; justify-content: center; }
  .cost-main { padding: 18px 16px 0; }
  .cost-summary { align-items: flex-start; gap: 12px; }
  .cost-total > strong { font-size: 32px; }
  .cost-summary-side { min-width: 0; padding-left: 12px; }
  .cost-summary-side > span { font-size: 17px; }
  .cost-summary-side small { display: block; margin: 0; font-size: 12px; }
  .cost-plot-meta { flex-direction: column; align-items: flex-start; gap: 2px; }
  .cost-plot { min-width: 600px; }
  .cost-axis { font-size: 17px; }
  .cost-plot-hint { flex-direction: column; align-items: flex-start; gap: 4px; }
  .cost-day-rows { grid-template-columns: 1fr; }
  .cost-day-heading h3 small { display: block; margin: 2px 0 0; }
  .cost-breakdown { padding: 18px 16px 0; }
  .cost-provider-list { grid-template-columns: 1fr; max-height: 380px; }
  .cost-footnote { flex-direction: column; align-items: flex-start; gap: 8px; padding: 13px 16px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}
@media (forced-colors: active) {
  .cost-fill { fill: CanvasText; }
  .cost-line { stroke: CanvasText; }
  .pill::before { background: CanvasText; }
}
