:root {
  color-scheme: light;
  --graphite: #0f1417;
  --fog: #f3f5f2;
  --ink: #182126;
  --teal: #2f9e8d;
  --teal-strong: #247f72;
  --teal-soft: #dceee9;
  --copper: #d4873b;
  --copper-strong: #a96023;
  --copper-soft: #f5e6d5;
  --coral: #d65f57;
  --on-teal: #ffffff;
  --canvas: var(--fog);
  --surface: #fbfcf9;
  --surface-raised: #ffffff;
  --surface-muted: #edf0ec;
  --text: var(--ink);
  --text-soft: #5b686c;
  --text-faint: #667276;
  --line: rgba(24, 33, 38, .12);
  --line-strong: rgba(24, 33, 38, .22);
  --header: rgba(243, 245, 242, .84);
  --scrim: rgba(15, 20, 23, .38);
  --shadow-float: 0 22px 64px rgba(30, 42, 45, .16);
  --shadow-small: 0 8px 24px rgba(30, 42, 45, .08);
  --display: "Segoe UI Variable Display", "SF Pro Display", system-ui, -apple-system, "Segoe UI", sans-serif;
  --body: "Segoe UI Variable Text", "SF Pro Text", system-ui, -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --mono: "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
  --type-micro: .6875rem;
  --type-caption: .75rem;
  --type-small: .8125rem;
  --type-ui: .875rem;
  --type-body: .9375rem;
  --type-brand: 1.0625rem;
  --type-section: 1.25rem;
  --type-dialog: 1.4375rem;
  --density-topbar-height: 76px;
  --density-shell-top: 32px;
  --density-hero-min: 230px;
  --density-hero-pad-min: 25px;
  --density-hero-pad-max: 50px;
  --density-panel-block: 24px;
  --density-panel-inline: 26px;
  --density-row-block: 11px;
  --density-calendar-day: 94px;
  --density-session-height: 66px;
  --density-mobile-panel: 19px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  font-family: var(--body);
}

/* Service modes share the existing palette; labels remain meaningful without color. */
.mode-cost-breakdown { margin-top: 10px; font-size: .8rem; color: var(--text-soft); font-variant-numeric: tabular-nums; }
.mode-legend { display: flex; gap: 18px; padding: 8px 0 4px; color: var(--text-soft); font-size: .75rem; }
.mode-legend > span::before { content: ""; display: inline-block; width: 16px; height: 3px; margin: 0 6px 3px 0; background: var(--teal); }
.mode-legend > .fast::before { background: var(--copper); }
.mode-fast, .day-fast-amount { color: var(--copper-strong); }
.update-banner { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 18px; padding: 14px 20px; border: 1px solid var(--line); border-radius: 13px; background: var(--teal-soft); }
.update-banner > div, .footer-updates { display: flex; align-items: center; gap: 20px; }
.update-versions { display: grid; grid-template-columns: 1fr auto; gap: 12px; padding: 18px 0; border-block: 1px solid var(--line); }
.update-versions strong { font-family: var(--mono); }
.update-preference { display: flex; align-items: center; gap: 10px; margin-block: 24px; }
.update-preference input { accent-color: var(--teal-strong); width: 18px; height: 18px; flex-shrink: 0; }
.update-error { color: var(--copper-strong); overflow-wrap: anywhere; }
.update-dialog .dialog-actions { flex-wrap: wrap; }
.update-dialog .dialog-actions .action-button { white-space: nowrap; }
.update-directory { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.update-directory > label { display: block; margin-bottom: 8px; font-weight: 600; }
.update-directory input { width: 100%; min-width: 0; padding: 10px 12px; color: var(--text); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 8px; font: inherit; }
.update-directory-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.update-last-download { overflow-wrap: anywhere; color: var(--text-soft); font-size: var(--type-caption); user-select: text; }
.mode-detail { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: .8rem; color: var(--text-soft); margin: 6px 0 12px; }
.mode-row-detail { display: grid; gap: 3px; font-size: .7rem; margin-top: 4px; }
.hour-line-fast { fill: none; stroke: var(--copper); stroke-width: 2; stroke-dasharray: 5 4; vector-effect: non-scaling-stroke; }
.pulse-bar-space { gap: 3px; }
.pulse-fast-bar { display: block; height: var(--pulse-height); width: 5px; border-radius: 3px; background: var(--copper); align-self: flex-end; }
.day-fast-amount { display: block; font-size: .65rem; line-height: 1.2; font-variant-numeric: tabular-nums; }
.mini-model-row strong small { display: block; font-size: .7rem; font-weight: 500; }
@media (max-width: 640px) {
  .mode-cost-breakdown { line-height: 1.7; }
  .day-fast-amount { font-size: .57rem; }
}

:root[data-font-size="compact"] { font-size: 15px; }
:root[data-font-size="comfortable"], :root:not([data-font-size]) { font-size: 16px; }
:root[data-font-size="large"] { font-size: 18px; }

:root[data-density="compact"] {
  --density-topbar-height: 68px;
  --density-shell-top: 24px;
  --density-hero-min: 204px;
  --density-hero-pad-min: 20px;
  --density-hero-pad-max: 40px;
  --density-panel-block: 20px;
  --density-panel-inline: 22px;
  --density-row-block: 8px;
  --density-calendar-day: 80px;
  --density-session-height: 60px;
  --density-mobile-panel: 15px;
}

:root[data-density="relaxed"] {
  --density-topbar-height: 82px;
  --density-shell-top: 38px;
  --density-hero-min: 252px;
  --density-hero-pad-min: 30px;
  --density-hero-pad-max: 56px;
  --density-panel-block: 28px;
  --density-panel-inline: 30px;
  --density-row-block: 14px;
  --density-calendar-day: 104px;
  --density-session-height: 74px;
  --density-mobile-panel: 23px;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --canvas: var(--graphite);
  --surface: #151c1f;
  --surface-raised: #1a2225;
  --surface-muted: #202a2d;
  --text: #f1f4f0;
  --text-soft: #a7b1b0;
  --text-faint: #7f8b8c;
  --line: rgba(243, 245, 242, .11);
  --line-strong: rgba(243, 245, 242, .22);
  --header: rgba(15, 20, 23, .82);
  --teal: #52b6a6;
  --teal-strong: #74cabb;
  --teal-soft: #1b3733;
  --copper: #e09a55;
  --copper-strong: #f0b270;
  --copper-soft: #3c2c1f;
  --coral: #ed7870;
  --on-teal: #0f1417;
  --scrim: rgba(0, 0, 0, .62);
  --shadow-float: 0 28px 76px rgba(0, 0, 0, .38);
  --shadow-small: 0 10px 28px rgba(0, 0, 0, .2);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --canvas: var(--graphite);
    --surface: #151c1f;
    --surface-raised: #1a2225;
    --surface-muted: #202a2d;
    --text: #f1f4f0;
    --text-soft: #a7b1b0;
    --text-faint: #7f8b8c;
    --line: rgba(243, 245, 242, .11);
    --line-strong: rgba(243, 245, 242, .22);
    --header: rgba(15, 20, 23, .82);
    --teal: #52b6a6;
    --teal-strong: #74cabb;
    --teal-soft: #1b3733;
    --copper: #e09a55;
    --copper-strong: #f0b270;
    --copper-soft: #3c2c1f;
    --coral: #ed7870;
    --on-teal: #0f1417;
    --scrim: rgba(0, 0, 0, .62);
    --shadow-float: 0 28px 76px rgba(0, 0, 0, .38);
    --shadow-small: 0 10px 28px rgba(0, 0, 0, .2);
  }
}

* { box-sizing: border-box; }
html { min-width: 320px; min-height: 100%; background: var(--canvas); scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; overflow-x: hidden; color: var(--text); background: var(--canvas); font-size: var(--type-body); line-height: 1.55; }
button, select, input, a { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: inherit; }
code, .mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
[hidden], .hidden { display: none !important; }
.visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }

.skip-link { position: fixed; z-index: 200; left: 12px; top: -60px; padding: 10px 14px; color: var(--surface-raised); background: var(--text); border-radius: 8px; text-decoration: none; transition: top 180ms var(--ease); }
.skip-link:focus { top: 12px; }

:focus-visible { outline: 3px solid color-mix(in srgb, var(--teal) 68%, transparent); outline-offset: 3px; }
.pressable { transition: transform 180ms var(--ease), background-color 180ms var(--ease), border-color 180ms var(--ease), color 180ms var(--ease), opacity 180ms var(--ease); }
.pressable:active, .pressable.is-pressed { transform: scale(.975); transition-duration: 70ms; }
button:disabled { cursor: not-allowed; opacity: .52; }

.topbar { position: sticky; top: 0; z-index: 50; border-bottom: 1px solid var(--line); background: var(--header); -webkit-backdrop-filter: blur(22px) saturate(1.15); backdrop-filter: blur(22px) saturate(1.15); }
.topbar-inner { width: min(1320px, calc(100% - 40px)); min-height: var(--density-topbar-height); margin: 0 auto; display: grid; grid-template-columns: minmax(190px, 1fr) auto minmax(450px, 1fr); align-items: center; gap: 24px; }
.brand { justify-self: start; display: inline-flex; align-items: center; gap: 11px; padding: 0; border: 0; background: transparent; cursor: pointer; text-align: left; }
.brand-mark { width: 34px; height: 34px; display: flex; align-items: end; justify-content: center; gap: 3px; padding: 8px 7px; border: 1px solid var(--line-strong); background: var(--surface); border-radius: 10px; }
.brand-mark i { width: 3px; border-radius: 2px; background: var(--teal); }
.brand-mark i:nth-child(1) { height: 7px; opacity: .44; }
.brand-mark i:nth-child(2) { height: 15px; opacity: .72; }
.brand-mark i:nth-child(3) { height: 11px; }
.brand-mark i:nth-child(4) { height: 18px; background: var(--copper); }
.brand-copy { display: grid; line-height: 1; }
.brand-copy strong { font-family: var(--display); font-size: var(--type-brand); letter-spacing: -.02em; }
.brand-copy small { margin-top: 6px; color: var(--text-faint); font-family: var(--mono); font-size: var(--type-micro); letter-spacing: .14em; }

.primary-nav { display: flex; align-items: center; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 11px; background: color-mix(in srgb, var(--surface) 72%, transparent); }
.nav-tab { min-width: 70px; padding: 8px 14px; border: 0; border-radius: 7px; color: var(--text-soft); background: transparent; cursor: pointer; font-size: var(--type-ui); }
.nav-tab.active { color: var(--text); background: var(--surface-raised); box-shadow: 0 1px 5px rgba(20, 30, 32, .08); font-weight: 650; }

.top-actions { justify-self: end; display: flex; align-items: center; gap: 7px; }
.machine-pill { min-width: 164px; display: flex; align-items: center; gap: 9px; margin-right: 3px; }
.machine-pill > span:last-child { min-width: 0; display: grid; line-height: 1.12; }
.machine-pill small { color: var(--text-faint); font-size: var(--type-caption); }
.machine-pill strong { max-width: 150px; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--type-ui); font-weight: 600; }
.status-dot { width: 8px; height: 8px; flex: 0 0 auto; border-radius: 50%; background: var(--text-faint); box-shadow: 0 0 0 4px color-mix(in srgb, var(--text-faint) 12%, transparent); }
.status-dot.live { background: var(--teal); box-shadow: 0 0 0 4px color-mix(in srgb, var(--teal) 15%, transparent); }
.status-dot.warn { background: var(--copper); box-shadow: 0 0 0 4px color-mix(in srgb, var(--copper) 14%, transparent); }
.icon-button, .action-button { min-height: 38px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-raised); cursor: pointer; }
.icon-button { width: 38px; padding: 0; color: var(--text-soft); }
.locale-button { font-family: var(--mono); font-size: var(--type-caption); font-weight: 700; letter-spacing: .04em; }
.action-button { padding: 8px 13px; text-decoration: none; font-size: var(--type-ui); font-weight: 620; }
.action-button.quiet { color: var(--text-soft); background: transparent; }
.action-button.primary { color: var(--on-teal); border-color: var(--teal-strong); background: var(--teal-strong); }
.count-badge { min-width: 19px; height: 19px; display: inline-grid; place-items: center; padding: 0 4px; border-radius: 6px; color: #fff; background: var(--copper-strong); font-family: var(--mono); font-size: var(--type-micro); }

.settings-glyph { width: 17px; height: 15px; display: grid; align-content: space-between; }
.settings-glyph i { position: relative; height: 1px; display: block; background: currentColor; }
.settings-glyph i::after { content: ""; position: absolute; top: 50%; width: 4px; height: 4px; border: 1.5px solid currentColor; border-radius: 50%; background: var(--surface-raised); transform: translate(-50%, -50%); }
.settings-glyph i:nth-child(1)::after, .settings-glyph i:nth-child(3)::after { left: 35%; }
.settings-glyph i:nth-child(2)::after { left: 70%; }

.shell { width: min(1320px, calc(100% - 40px)); margin: 0 auto; padding: var(--density-shell-top) 0 48px; }
.demo-banner { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 14px; margin-bottom: 18px; padding: 13px 16px; border: 1px solid color-mix(in srgb, var(--teal) 42%, var(--line)); border-radius: 13px; background: color-mix(in srgb, var(--teal) 7%, var(--surface)); }
.demo-banner .eyebrow { margin-bottom: 3px; color: var(--teal-strong); }
.demo-banner strong { font-size: var(--type-body); }
.demo-banner p:last-child { margin: 3px 0 0; color: var(--text-soft); font-size: var(--type-small); line-height: 1.55; }
.demo-beacon { position: relative; width: 30px; height: 30px; border: 1px solid color-mix(in srgb, var(--teal) 55%, var(--line)); border-radius: 10px; background: color-mix(in srgb, var(--teal) 8%, var(--surface-raised)); box-shadow: inset -5px -5px 0 color-mix(in srgb, var(--copper) 13%, transparent); }
.demo-beacon::before { content: ""; position: absolute; left: 7px; bottom: 7px; width: 3px; height: 10px; border-radius: 2px; background: var(--teal); box-shadow: 6px -5px 0 var(--teal), 12px 2px 0 var(--copper); }
.coverage-banner { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 13px; margin-bottom: 18px; padding: 12px 15px; border: 1px solid color-mix(in srgb, var(--coral) 35%, var(--line)); border-radius: 12px; background: color-mix(in srgb, var(--coral) 7%, var(--surface)); }
.coverage-banner strong { font-size: var(--type-body); }
.coverage-banner p { margin: 2px 0 0; color: var(--text-soft); font-size: var(--type-ui); }
.coverage-icon { width: 24px; height: 24px; display: grid; place-items: center; border: 1px solid color-mix(in srgb, var(--coral) 50%, transparent); border-radius: 50%; color: var(--coral); font-family: var(--mono); font-weight: 700; }
.text-button { padding: 2px; border: 0; color: var(--teal-strong); background: transparent; cursor: pointer; font-size: var(--type-ui); font-weight: 650; }
.text-button.copper, .copper { color: var(--copper-strong); }

.filter-context { display: flex; align-items: center; gap: 10px; margin: -4px 0 20px; min-height: 30px; }
.filter-context-label { color: var(--text-faint); font-size: var(--type-small); white-space: nowrap; }
.chip-list { min-width: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.filter-chip { max-width: 280px; display: inline-flex; align-items: center; gap: 6px; padding: 6px 9px 6px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--text-soft); font-size: var(--type-small); }
.filter-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.filter-chip button { width: 16px; height: 16px; padding: 0; border: 0; border-radius: 4px; color: var(--text-faint); background: transparent; cursor: pointer; line-height: 1; }

.view-panel { min-height: 620px; }
.view-panel.entering { animation: view-in 120ms var(--ease) both; }
@keyframes view-in { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
.view-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 22px; }
.eyebrow { margin: 0 0 6px; color: var(--text-faint); font-family: var(--mono); font-size: var(--type-micro); font-weight: 650; letter-spacing: .12em; }
h1, h2, h3 { font-family: var(--display); text-wrap: balance; }
.view-heading h1 { margin: 0; font-size: clamp(1.875rem, 3vw, 2.625rem); line-height: 1.08; letter-spacing: -.045em; font-weight: 690; }
.view-subtitle { margin: 8px 0 0; color: var(--text-soft); font-size: var(--type-body); }
.segmented { display: inline-flex; flex-wrap: nowrap; padding: 3px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-muted); }
.segmented button { min-width: 56px; padding: 7px 12px; border: 0; border-radius: 7px; color: var(--text-soft); background: transparent; cursor: pointer; font-size: var(--type-ui); }
.segmented button.selected { color: var(--text); background: var(--surface-raised); box-shadow: 0 1px 5px rgba(20, 30, 32, .08); font-weight: 650; }
.details-range-tools { display: flex; align-items: center; justify-content: flex-end; gap: 9px; }
.details-date-picker { min-width: 154px; height: 42px; grid-template-columns: minmax(0, 1fr) 26px; gap: 8px; padding: 5px 10px 5px 12px; border-radius: 10px; background: var(--surface-muted); box-shadow: none; }
.details-date-picker .date-picker-copy strong { margin-top: 0; font-size: var(--type-ui); font-weight: 650; }
.details-date-picker .date-picker-glyph { transform: scale(.88); }
.details-date-picker.selected { border-color: color-mix(in srgb, var(--teal) 58%, var(--line)); background: var(--teal-soft); }

.surface { border: 1px solid var(--line); border-radius: 17px; background: var(--surface); }
.hero-metrics { min-height: var(--density-hero-min); display: grid; grid-template-columns: minmax(0, 1.14fr) 1px minmax(0, .86fr); align-items: stretch; overflow: hidden; }
.hero-metric { min-width: 0; display: flex; flex-direction: column; justify-content: center; padding: clamp(var(--density-hero-pad-min), 4vw, var(--density-hero-pad-max)); }
.hero-divider { align-self: stretch; background: var(--line); }
.metric-label, .metric-label-row { color: var(--text-soft); font-size: var(--type-body); }
.metric-label-row { display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.hero-value { margin: 11px 0 14px; font-family: var(--display); font-size: clamp(3rem, 6vw, 4.875rem); line-height: 1; letter-spacing: -.065em; font-variant-numeric: tabular-nums; font-weight: 690; }
.hero-value.cost { color: var(--copper-strong); font-size: clamp(2.625rem, 5vw, 4.25rem); }
.loading { animation: loading-pulse 1.2s ease-in-out infinite alternate; color: var(--text-faint); }
@keyframes loading-pulse { to { opacity: .42; } }
.metric-breakdown { display: flex; flex-wrap: wrap; gap: 8px 18px; color: var(--text-soft); font-size: var(--type-small); }
.metric-breakdown span { white-space: nowrap; }
.metric-breakdown b { margin-left: 4px; color: var(--text); font-family: var(--mono); font-weight: 550; }
.coverage-line { display: flex; align-items: center; gap: 10px; color: var(--text-soft); font-size: var(--type-small); }
.coverage-track { width: min(150px, 38%); height: 5px; overflow: hidden; border-radius: 3px; background: var(--surface-muted); }
.coverage-track i { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--copper); transition: width 220ms var(--ease); }
.metric-note { margin: 9px 0 0; color: var(--text-faint); font-size: var(--type-small); }

.trend-panel { margin-top: 16px; padding: 20px var(--density-panel-inline); overflow: hidden; }
.trend-switcher { width: min(230px, 100%); display: flex; margin: 0 0 18px auto; }
.trend-switcher button { flex: 1; }
.trend-pane { min-width: 0; }
.trend-pane[hidden] { display: none; }
.hourly-head { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin-bottom: 17px; }
.hourly-head h2 { margin: 0; font-size: var(--type-section); letter-spacing: -.025em; }
.hourly-head p { margin: 3px 0 0; color: var(--text-faint); font-family: var(--mono); font-size: var(--type-micro); }
.hourly-navigator, .month-nav { display: flex; align-items: center; gap: 6px; padding: 4px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface-muted); }
.date-picker-shell { position: relative; min-width: 174px; height: 50px; display: grid; grid-template-columns: minmax(0, 1fr) 30px; align-items: center; gap: 12px; padding: 7px 12px 7px 14px; overflow: hidden; border: 1px solid color-mix(in srgb, var(--line-strong) 82%, transparent); border-radius: 11px; background: var(--surface-raised); box-shadow: 0 1px 3px rgba(20, 30, 32, .06); cursor: pointer; transition: border-color 160ms var(--ease), background-color 160ms var(--ease), box-shadow 160ms var(--ease); }
.date-picker-shell:hover { border-color: color-mix(in srgb, var(--teal-strong) 52%, var(--line)); background: color-mix(in srgb, var(--teal) 2.5%, var(--surface-raised)); box-shadow: 0 4px 13px rgba(30, 86, 78, .11); }
.date-picker-shell:has(.date-picker-native:focus-visible) { border-color: var(--teal-strong); outline: 3px solid color-mix(in srgb, var(--teal) 22%, transparent); outline-offset: 1px; }
.date-picker-copy { min-width: 0; display: grid; align-content: center; line-height: 1; pointer-events: none; }
.date-picker-copy small { color: var(--text-faint); font-family: var(--mono); font-size: .6875rem; font-weight: 650; letter-spacing: .065em; }
.date-picker-copy strong { margin-top: 4px; overflow: hidden; font-family: var(--mono); font-size: 1.03rem; font-weight: 720; letter-spacing: -.025em; text-overflow: ellipsis; white-space: nowrap; }
.date-picker-glyph { position: relative; justify-self: center; width: 19px; height: 18px; border: 1.5px solid var(--teal-strong); border-radius: 4px; color: var(--teal-strong); box-shadow: 0 0 0 5px var(--teal-soft); pointer-events: none; }
.date-picker-glyph::before { position: absolute; left: -1.5px; right: -1.5px; top: 4px; border-top: 1.5px solid currentColor; content: ""; }
.date-picker-glyph::after { position: absolute; left: 3.5px; top: 8px; width: 3px; height: 3px; border-radius: 1px; background: currentColor; box-shadow: 6px 0 currentColor, 0 4.5px currentColor, 6px 4.5px currentColor; content: ""; }
.date-picker-native { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; color-scheme: light dark; }
.hourly-nav-button, .hourly-today-button { height: 50px; flex: 0 0 auto; border: 0; border-radius: 10px; color: var(--text-soft); background: transparent; cursor: pointer; white-space: nowrap; }
.hourly-nav-button { width: 42px; padding: 0; font-family: var(--mono); font-size: 1.15rem; }
.hourly-today-button { min-width: 54px; padding: 0 11px; font-size: var(--type-body); font-weight: 650; }
.hourly-nav-button:hover, .hourly-today-button:hover { color: var(--text); background: var(--surface-raised); }
.hourly-summary { display: grid; grid-template-columns: minmax(210px, .72fr) minmax(0, 1.28fr); gap: 24px; align-items: center; padding-bottom: 17px; border-bottom: 1px solid var(--line); opacity: 1; transition: opacity 160ms var(--ease); }
.hourly-summary.is-updating { opacity: .58; }
.hourly-total-block { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 18px; align-items: end; }
.hourly-total-block > span { grid-column: 1; color: var(--text-faint); font-size: var(--type-small); }
.hourly-total-block > strong { grid-column: 1; overflow: hidden; color: var(--text-soft); font-family: var(--mono); font-size: clamp(.94rem, 1.45vw, 1.1rem); font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.hourly-total-block > b { grid-column: 2; grid-row: 1 / 3; color: var(--teal-strong); font-family: var(--display); font-size: clamp(2.35rem, 4.5vw, 3.5rem); font-variant-numeric: tabular-nums; font-weight: 690; letter-spacing: -.05em; line-height: 1; }
.hourly-ledger { min-width: 0; display: grid; grid-template-columns: repeat(5, minmax(62px, 1fr)); gap: 8px; }
.hourly-ledger > span { min-width: 0; display: grid; gap: 5px; padding-left: 12px; border-left: 1px solid var(--line); }
.hourly-ledger small { overflow: hidden; color: var(--text-faint); font-size: var(--type-small); text-overflow: ellipsis; white-space: nowrap; }
.hourly-ledger strong { overflow: hidden; font-family: var(--mono); font-size: clamp(1rem, 1.55vw, 1.16rem); font-weight: 620; text-overflow: ellipsis; white-space: nowrap; }
.hourly-ledger .hourly-placeholder { grid-column: 1 / -1; border-left: 0; color: var(--text-faint); }
.hourly-chart-scroll { width: 100%; overflow-x: auto; overflow-y: hidden; overscroll-behavior-inline: contain; scroll-behavior: smooth; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
.hourly-chart { position: relative; min-width: 680px; height: 196px; margin-top: 8px; isolation: isolate; opacity: 1; transform: translateX(0); transition: opacity 160ms var(--ease), transform 240ms var(--ease); will-change: opacity, transform; }
.hourly-chart.is-updating { opacity: .58; }
.hourly-chart.enter-previous { opacity: 0; transform: translateX(-9px); }
.hourly-chart.enter-next { opacity: 0; transform: translateX(9px); }
.hourly-chart::before { position: absolute; z-index: 0; inset: 12px 28px 44px; border-bottom: 1px solid var(--line-strong); background: repeating-linear-gradient(to bottom, transparent 0 34px, var(--line) 34px 35px); content: ""; pointer-events: none; }
.hourly-line { position: absolute; z-index: 1; inset: 0; width: 100%; height: 180px; overflow: visible; pointer-events: none; }
.hour-line-area { fill: color-mix(in srgb, var(--teal) 12%, transparent); }
.hour-line-path { fill: none; stroke: var(--teal-strong); stroke-linecap: round; stroke-linejoin: round; stroke-width: 2.5; vector-effect: non-scaling-stroke; }
.hour-selection-guide { stroke: color-mix(in srgb, var(--copper) 64%, transparent); stroke-dasharray: 3 5; stroke-width: 1; vector-effect: non-scaling-stroke; }
.hourly-points { position: absolute; z-index: 2; inset: 0; }
.hourly-points > .empty-state { position: absolute; inset: 52px 0 auto; }
.hour-point { position: absolute; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 50%; background: transparent; transform: translate(-50%, -50%); cursor: pointer; }
.hour-point::before { display: block; width: 8px; height: 8px; margin: 10px; border: 2px solid var(--surface); border-radius: 50%; background: var(--teal-strong); box-shadow: 0 0 0 1px color-mix(in srgb, var(--teal-strong) 76%, transparent); content: ""; transition: width 120ms var(--ease), height 120ms var(--ease), margin 120ms var(--ease), background-color 120ms var(--ease), box-shadow 120ms var(--ease); }
.hour-point:hover::before, .hour-point:focus-visible::before { width: 12px; height: 12px; margin: 8px; box-shadow: 0 0 0 4px color-mix(in srgb, var(--teal) 18%, transparent); }
.hour-point.selected::before { width: 12px; height: 12px; margin: 8px; background: var(--copper); box-shadow: 0 0 0 4px color-mix(in srgb, var(--copper) 18%, transparent); }
.hour-point.zero:not(.selected)::before { background: var(--line-strong); }
.hour-point:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.hourly-axis { position: absolute; z-index: 1; inset: 0; color: var(--text-faint); pointer-events: none; }
.hourly-axis time { position: absolute; bottom: 8px; left: var(--label-x); font-family: var(--mono); font-size: .625rem; line-height: 1; white-space: nowrap; transform: translateX(-50%); }
.hourly-axis time.edge-start { transform: none; }
.hourly-axis time.edge-end { transform: translateX(-100%); }
.hourly-context { display: grid; grid-template-columns: minmax(250px, .72fr) minmax(0, 1.28fr); gap: 24px; align-items: center; padding-top: 18px; border-top: 1px solid var(--line); opacity: 1; transition: opacity 160ms var(--ease); }
.hourly-context.is-updating { opacity: .52; }
.hourly-cost-block { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 5px 18px; align-items: end; }
.hourly-cost-block > span { grid-column: 1; color: var(--text-soft); font-size: var(--type-small); font-weight: 620; }
.hourly-cost-block > strong { grid-column: 2; grid-row: 1 / 3; color: var(--copper-strong); font-family: var(--display); font-size: clamp(2.35rem, 4.5vw, 3.5rem); font-variant-numeric: tabular-nums; font-weight: 690; letter-spacing: -.05em; line-height: 1; white-space: nowrap; }
.hourly-cost-block > small { grid-column: 1; overflow: hidden; color: var(--text-faint); font-size: var(--type-caption); line-height: 1.4; text-overflow: ellipsis; white-space: nowrap; }
.hourly-context-details { min-width: 0; display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(150px, .55fr); gap: 18px; align-items: stretch; }
.hourly-context-group { min-width: 0; display: grid; align-content: center; gap: 7px; }
.hourly-context-group > span { color: var(--text-faint); font-size: var(--type-small); }
.hourly-models { min-width: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.hourly-model-chip { min-width: 0; display: inline-flex; align-items: baseline; gap: 7px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-muted); }
.hourly-model-chip strong { overflow: hidden; max-width: 145px; font-size: var(--type-ui); font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.hourly-model-chip small { color: var(--text-faint); font-family: var(--mono); font-size: var(--type-micro); white-space: nowrap; }
.hourly-models .hourly-placeholder, .hourly-model-more { align-self: center; color: var(--text-faint); font-size: var(--type-small); }
.hourly-coverage-group { padding-left: 16px; border-left: 1px solid var(--line); }
.hourly-coverage-group strong { font-family: var(--mono); font-size: clamp(1.05rem, 1.6vw, 1.25rem); font-weight: 650; }
.hourly-coverage-group small { color: var(--text-faint); font-size: var(--type-caption); line-height: 1.4; }

.trend-daily-head { margin-top: 2px; }
.section-head { display: flex; align-items: start; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.section-head.compact { align-items: center; margin-bottom: 18px; }
.section-head h2 { margin: 0; font-size: var(--type-section); letter-spacing: -.025em; }
.section-head > p, .section-meta { margin: 3px 0 0; color: var(--text-faint); font-size: var(--type-small); }
.pulse-scroll { width: 100%; overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
.pulse-belt { height: 170px; min-width: 100%; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(32px, 1fr); align-items: end; gap: clamp(3px, .6vw, 9px); padding: 9px 2px 2px; border-bottom: 1px solid var(--line); }
.pulse-day { height: 158px; min-width: 28px; display: grid; grid-template-rows: 1fr 25px; gap: 5px; padding: 0; border: 0; border-radius: 6px 6px 0 0; color: var(--text-faint); background: transparent; cursor: pointer; }
.pulse-bar-space { display: flex; align-items: end; justify-content: center; min-height: 0; }
.pulse-bar { width: min(18px, 72%); min-height: 2px; height: var(--pulse-height); border-radius: 4px 4px 2px 2px; background: color-mix(in srgb, var(--teal) 78%, var(--surface-muted)); transform-origin: bottom; transition: height 220ms var(--ease), background-color 180ms var(--ease), width 180ms var(--ease); }
.pulse-day.zero .pulse-bar { height: 2px; background: var(--line-strong); }
.pulse-day:hover .pulse-bar, .pulse-day:focus-visible .pulse-bar { width: min(22px, 84%); background: var(--teal-strong); }
.pulse-day.selected { color: var(--text); }
.pulse-day.selected .pulse-bar { width: min(23px, 70%); background: var(--teal-strong); }
.pulse-day time { font-family: var(--mono); font-size: var(--type-micro); white-space: nowrap; }
.pulse-inspector { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; padding-top: 17px; }
.pulse-inspector > div { min-width: 0; display: grid; gap: 4px; }
.pulse-inspector span { color: var(--text-faint); font-size: var(--type-caption); }
.pulse-inspector strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--mono); font-size: var(--type-ui); font-weight: 550; }

.overview-lower { display: grid; grid-template-columns: 1.14fr .86fr; gap: 16px; margin-top: 16px; }
.quiet-section { min-height: 280px; padding: var(--density-panel-block) var(--density-panel-inline); }
.rank-list { display: grid; }
.rank-row { display: grid; grid-template-columns: minmax(125px, 1.2fr) 2fr minmax(82px, auto); align-items: center; gap: 14px; padding: var(--density-row-block) 0; border-top: 1px solid var(--line); }
.rank-row:first-child { border-top: 0; }
.rank-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--type-ui); font-weight: 600; }
.rank-signal { height: 5px; overflow: hidden; border-radius: 3px; background: var(--surface-muted); }
.rank-signal i { display: block; height: 100%; border-radius: inherit; background: var(--teal); }
.rank-value { display: grid; justify-items: end; font-family: var(--mono); font-size: var(--type-small); }
.rank-value small { margin-top: 2px; color: var(--copper-strong); font-size: var(--type-micro); }
.provenance-list { margin: 0; display: grid; }
.provenance-list > div { min-width: 0; display: grid; grid-template-columns: 126px minmax(0, 1fr); align-items: center; gap: 12px; padding: var(--density-row-block) 0; border-top: 1px solid var(--line); }
.provenance-list > div:first-child { border-top: 0; }
.provenance-list dt { color: var(--text-faint); font-size: var(--type-small); }
.provenance-list dd { min-width: 0; margin: 0; display: grid; justify-items: end; text-align: right; font-size: var(--type-ui); }
.provenance-list code { max-width: 100%; overflow: hidden; text-overflow: ellipsis; color: var(--teal-strong); font-size: var(--type-small); }
.provenance-list small { margin-top: 2px; color: var(--text-faint); font-size: var(--type-micro); }

.month-nav .icon-button { width: 42px; height: 50px; border: 0; border-radius: 10px; background: transparent; font-size: 1.15rem; }
.month-nav .icon-button:hover, .month-today-button:hover { color: var(--text); background: var(--surface-raised); }
.month-today-button { min-width: 54px; height: 50px; padding: 0 11px; border: 0; border-radius: 10px; color: var(--text-soft); background: transparent; font-size: var(--type-body); font-weight: 650; cursor: pointer; white-space: nowrap; }
.daily-layout { display: grid; grid-template-columns: minmax(0, 1.28fr) minmax(330px, .72fr); align-items: start; gap: 16px; }
.calendar-panel { min-width: 0; padding: var(--density-panel-block); }
.weekday-row, .calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.weekday-row { padding: 0 4px 8px; color: var(--text-faint); font-family: var(--mono); font-size: var(--type-caption); text-align: center; }
.calendar-grid { overflow: hidden; border-top: 1px solid var(--line); border-left: 1px solid var(--line); border-radius: 10px; }
.calendar-blank, .calendar-day { min-width: 0; min-height: var(--density-calendar-day); border: 0; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--surface); }
.calendar-blank { background: var(--surface-muted); opacity: .42; }
.calendar-day { position: relative; display: grid; grid-template-rows: auto 1fr auto; align-items: start; padding: 10px; text-align: left; cursor: pointer; }
.calendar-day:hover { background: color-mix(in srgb, var(--teal) 5%, var(--surface)); }
.calendar-day.selected { z-index: 1; color: var(--text); background: var(--teal-soft); box-shadow: inset 0 0 0 2px var(--teal); }
.calendar-day.today .day-number::after { content: ""; width: 4px; height: 4px; display: inline-block; margin-left: 5px; border-radius: 50%; background: var(--copper); vertical-align: middle; }
.day-number { font-family: var(--mono); font-size: var(--type-small); }
.day-usage { align-self: end; width: 100%; height: 4px; overflow: hidden; border-radius: 2px; background: var(--surface-muted); }
.day-usage i { display: block; height: 100%; width: var(--day-strength); border-radius: inherit; background: var(--teal); }
.calendar-day.zero .day-usage i { width: 0; }
.day-amount { align-self: end; margin-top: 7px; color: var(--text-soft); font-family: var(--mono); font-size: var(--type-micro); }
.calendar-day .cost-marker { position: absolute; right: 8px; top: 9px; width: 4px; height: 4px; border-radius: 50%; background: var(--copper); }
.calendar-legend { display: flex; flex-wrap: wrap; gap: 10px 18px; margin-top: 14px; color: var(--text-faint); font-size: var(--type-caption); }
.calendar-legend span { display: inline-flex; align-items: center; gap: 5px; }
.calendar-legend b { font-weight: inherit; }
.calendar-legend i { width: 18px; height: 4px; border-radius: 2px; background: var(--teal); }
.calendar-legend i.cost-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--copper); }

.day-detail { position: sticky; top: 92px; min-width: 0; padding: var(--density-panel-block); }
.day-detail-head { display: flex; justify-content: space-between; gap: 16px; }
.day-detail h2 { margin: 0; font-size: var(--type-section); }
.day-status { align-self: start; padding: 4px 7px; border-radius: 6px; color: var(--text-soft); background: var(--surface-muted); font-size: var(--type-caption); }
.day-total { display: grid; gap: 5px; margin-top: 25px; }
.day-total span, .day-cost span { color: var(--text-faint); font-size: var(--type-caption); }
.day-total strong { font-family: var(--display); font-size: 2.375rem; letter-spacing: -.05em; font-variant-numeric: tabular-nums; }
.composition-bar { height: 8px; display: flex; overflow: hidden; gap: 1px; margin: 16px 0 12px; border-radius: 4px; background: var(--surface-muted); }
.composition-bar i { height: 100%; min-width: 1px; }
.composition-bar .regular { background: var(--teal-strong); }
.composition-bar .cached { background: color-mix(in srgb, var(--teal) 42%, var(--surface)); }
.composition-bar .write { background: var(--copper); }
.composition-bar .output { background: var(--text-soft); }
.token-ledger { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 18px; margin: 0; }
.token-ledger div { display: flex; justify-content: space-between; gap: 8px; color: var(--text-soft); font-size: var(--type-caption); }
.token-ledger dt, .token-ledger dd { margin: 0; }
.token-ledger dd { color: var(--text); font-family: var(--mono); }
.day-cost { display: grid; gap: 3px; margin-top: 22px; padding: 15px 16px; border-left: 3px solid var(--copper); background: var(--copper-soft); }
.day-cost strong { color: var(--copper-strong); font-family: var(--display); font-size: 1.625rem; letter-spacing: -.03em; }
.day-cost small { color: var(--text-soft); font-size: var(--type-caption); }
.day-models-head { display: flex; align-items: center; justify-content: space-between; margin: 24px 0 8px; }
.day-models-head h3 { margin: 0; font-size: var(--type-body); }
.day-models-head span { color: var(--text-faint); font-size: var(--type-caption); }
.mini-model-list { display: grid; }
.mini-model-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); font-size: var(--type-small); }
.mini-model-row span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-model-row strong { font-family: var(--mono); font-weight: 550; }

.dimension-tabs { width: max-content; max-width: 100%; display: flex; gap: 5px; margin-bottom: 12px; overflow-x: auto; padding: 3px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-muted); scrollbar-width: none; }
.dimension-tabs button { min-width: 76px; padding: 9px 14px; border: 0; border-radius: 7px; color: var(--text-soft); background: transparent; cursor: pointer; font-size: var(--type-ui); }
.dimension-tabs button.selected { color: var(--text); background: var(--surface-raised); box-shadow: 0 1px 5px rgba(20, 30, 32, .08); font-weight: 650; }
.detail-breakdown, .sessions-panel { padding: var(--density-panel-block) var(--density-panel-inline); }
.detail-breakdown { min-height: 280px; }
.breakdown-list { display: grid; }
.breakdown-row { display: grid; grid-template-columns: minmax(160px, 1.1fr) minmax(180px, 2fr) minmax(90px, auto) 28px; align-items: center; gap: 16px; min-height: 52px; border-top: 1px solid var(--line); }
.breakdown-row:first-child { border-top: 0; }
.breakdown-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--type-ui); font-weight: 600; }
.breakdown-track { height: 6px; overflow: hidden; border-radius: 3px; background: var(--surface-muted); }
.breakdown-track i { display: block; height: 100%; border-radius: inherit; background: var(--teal); }
.breakdown-value { text-align: right; font-family: var(--mono); font-size: var(--type-small); }
.breakdown-filter { width: 24px; height: 24px; padding: 0; border: 0; border-radius: 6px; color: var(--text-faint); background: transparent; cursor: pointer; }
.breakdown-filter.active { color: var(--teal-strong); background: var(--teal-soft); }
.sessions-panel { margin-top: 16px; }
.sessions-toolbar { align-items: center; margin-bottom: 12px; }
.session-search { position: relative; width: min(390px, 42vw); }
.session-search svg { position: absolute; z-index: 1; left: 11px; top: 50%; width: 17px; height: 17px; fill: none; stroke: var(--text-faint); stroke-linecap: round; stroke-width: 1.6; transform: translateY(-50%); pointer-events: none; }
.session-search input { min-height: 38px; padding: 7px 34px 7px 36px; border-radius: 9px; background: var(--surface-raised); font-size: var(--type-ui); }
.session-search input::-webkit-search-cancel-button { appearance: none; }
.session-search-clear { position: absolute; right: 6px; top: 50%; width: 27px; height: 27px; padding: 0; border: 0; border-radius: 6px; color: var(--text-faint); background: transparent; cursor: pointer; font-size: 1.15rem; line-height: 1; transform: translateY(-50%); }
.session-search-clear:hover { color: var(--text); background: var(--surface-muted); }
.session-head, .session-row { display: grid; grid-template-columns: minmax(180px, 1.35fr) minmax(135px, 1fr) minmax(120px, .9fr) 68px 74px 96px minmax(105px, .82fr) 88px; gap: 12px; align-items: center; }
.session-head { padding: 9px 10px; color: var(--text-faint); font-family: var(--mono); font-size: var(--type-micro); letter-spacing: .07em; text-transform: uppercase; }
.session-row { min-height: var(--density-session-height); padding: var(--density-row-block) 10px; border-top: 1px solid var(--line); font-size: var(--type-small); }
.session-cell { min-width: 0; }
.session-cell strong, .session-cell span, .session-cell small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.session-cell strong { font-size: var(--type-ui); font-weight: 600; }
.session-cell small, .session-cell span { margin-top: 3px; color: var(--text-faint); font-family: var(--mono); font-size: var(--type-micro); }
.session-metric { min-width: 0; display: grid; justify-items: end; gap: 2px; font-family: var(--mono); text-align: right; }
.session-metric strong { overflow: hidden; max-width: 100%; font-size: var(--type-small); font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.session-metric > small { color: var(--text-faint); font-size: var(--type-micro); }
.session-cost strong { color: var(--copper-strong); }
.session-cost.pending strong { color: var(--text-faint); font-weight: 520; }
.session-cost.unavailable strong { color: var(--coral); font-weight: 520; }
.session-mobile-label { display: none; }
.session-filter { min-height: 30px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 7px; color: var(--text-soft); background: transparent; cursor: pointer; font-size: var(--type-micro); font-weight: 620; white-space: nowrap; }
.session-filter:hover { color: var(--teal-strong); border-color: color-mix(in srgb, var(--teal) 42%, var(--line)); }
.session-filter.active { color: var(--teal-strong); border-color: color-mix(in srgb, var(--teal) 48%, var(--line)); background: var(--teal-soft); }
.agent-badge, .confidence-badge { display: inline-flex; width: fit-content; margin-top: 3px; padding: 3px 6px; border: 1px solid var(--line); border-radius: 5px; color: var(--text-soft); background: var(--surface-muted); font-size: var(--type-micro); }
.confidence-badge.exact { color: var(--teal-strong); }
.confidence-badge.gap_fallback, .confidence-badge.aggregate_only { color: var(--copper-strong); }
.empty-state { min-height: 92px; display: grid; place-items: center; padding: 18px; color: var(--text-faint); text-align: center; font-size: var(--type-ui); }

footer { display: flex; justify-content: space-between; gap: 20px; margin-top: 28px; padding: 16px 2px 0; border-top: 1px solid var(--line); color: var(--text-faint); font-size: var(--type-caption); line-height: 1.5; }
#versionLabel { font-family: var(--mono); white-space: nowrap; }

dialog { color: var(--text); opacity: 0; border: 1px solid var(--line-strong); background: color-mix(in srgb, var(--surface-raised) 94%, transparent); box-shadow: var(--shadow-float); -webkit-backdrop-filter: blur(24px) saturate(1.08); backdrop-filter: blur(24px) saturate(1.08); transition: opacity 190ms var(--ease), transform 210ms var(--ease), display 210ms allow-discrete, overlay 210ms allow-discrete; }
dialog::backdrop { opacity: 0; background: var(--scrim); -webkit-backdrop-filter: blur(5px); backdrop-filter: blur(5px); transition: opacity 190ms var(--ease), display 210ms allow-discrete, overlay 210ms allow-discrete; }
dialog[open].is-open { opacity: 1; transform: none; }
dialog[open].is-open::backdrop { opacity: 1; }
dialog.is-closing { opacity: 0; }
.modal-dialog { width: min(620px, calc(100% - 28px)); max-height: min(86vh, 850px); padding: 0; border-radius: 18px; transform: translateY(8px) scale(.985); }
.dialog-frame { max-height: inherit; overflow-y: auto; padding: 24px; }
.dialog-head { display: flex; align-items: start; justify-content: space-between; gap: 18px; }
.dialog-head h2 { margin: 0; font-size: var(--type-dialog); letter-spacing: -.03em; }
.dialog-close { width: 36px; height: 36px; flex: 0 0 auto; padding: 0; border: 0; border-radius: 9px; color: var(--text-soft); background: var(--surface-muted); cursor: pointer; font-size: 1.5rem; line-height: 1; }
.dialog-intro { margin: 12px 0 20px; color: var(--text-soft); font-size: var(--type-ui); line-height: 1.65; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 22px; }
.dialog-actions.split { justify-content: space-between; }
.sheet-dialog { width: min(430px, 100%); max-width: 100%; height: 100%; max-height: 100%; margin: 0 0 0 auto; padding: 0; border-width: 0 0 0 1px; border-radius: 0; transform: translateX(24px); }
.sheet-dialog .dialog-frame { height: 100%; display: flex; flex-direction: column; padding: 27px; }
.sheet-dialog .dialog-actions { margin-top: auto; padding-top: 24px; }
.filter-form { display: grid; gap: 15px; }
.sheet-dialog .filter-form { margin-top: 22px; }
.filter-form label { display: grid; gap: 7px; color: var(--text-soft); font-size: var(--type-small); }
select, input { width: 100%; min-height: 42px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; color: var(--text); background: var(--surface); outline: 0; }
select:focus, input:focus { border-color: var(--teal); box-shadow: 0 0 0 3px color-mix(in srgb, var(--teal) 13%, transparent); }
.settings-dialog { width: min(510px, 100%); }
.settings-dialog .dialog-frame { display: block; padding: 28px; }
.settings-preview { display: grid; grid-template-columns: minmax(118px, auto) 1fr; align-items: center; gap: 18px; margin: 2px 0 24px; padding: 16px 18px; overflow: hidden; border: 1px solid color-mix(in srgb, var(--teal) 42%, var(--line)); border-radius: 13px; background: linear-gradient(120deg, color-mix(in srgb, var(--teal) 9%, var(--surface-raised)), var(--surface-raised) 58%); }
.settings-preview > div { display: grid; gap: 2px; }
.settings-preview span { color: var(--teal-strong); font-family: var(--mono); font-size: var(--type-micro); letter-spacing: .08em; text-transform: uppercase; }
.settings-preview strong { color: var(--text); font-family: var(--display); font-size: 2rem; line-height: 1; letter-spacing: -.05em; font-variant-numeric: tabular-nums; }
.settings-preview p { margin: 0; color: var(--text-soft); font-size: var(--type-small); line-height: 1.55; }
.settings-form { display: grid; gap: 23px; margin-top: 24px; }
.settings-group { min-width: 0; margin: 0; padding: 0; border: 0; }
.settings-group legend { margin: 0; padding: 0; color: var(--text); font-family: var(--display); font-size: var(--type-body); font-weight: 670; }
.settings-group > p { margin: 4px 0 10px; color: var(--text-faint); font-size: var(--type-caption); line-height: 1.5; }
.setting-options { display: grid; gap: 8px; }
.setting-options.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.setting-options.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.setting-option { position: relative; min-width: 0; cursor: pointer; }
.setting-option input { position: absolute; width: 1px; height: 1px; min-height: 0; margin: 0; padding: 0; overflow: hidden; opacity: 0; pointer-events: none; }
.setting-option > span { position: relative; min-height: 62px; display: grid; align-content: center; gap: 3px; padding: 10px 27px 10px 11px; border: 1px solid var(--line); border-radius: 10px; color: var(--text-soft); background: var(--surface); transition: border-color 160ms var(--ease), background-color 160ms var(--ease), color 160ms var(--ease); }
.setting-option > span::after { content: ""; position: absolute; right: 10px; top: 11px; width: 7px; height: 7px; border: 1px solid var(--line-strong); border-radius: 50%; background: var(--surface-raised); }
.setting-option strong { overflow: hidden; text-overflow: ellipsis; font-size: var(--type-small); font-weight: 650; white-space: nowrap; }
.setting-option small { overflow: hidden; color: var(--text-faint); font-size: var(--type-micro); line-height: 1.35; text-overflow: ellipsis; }
.setting-option input:checked + span { border-color: color-mix(in srgb, var(--teal) 68%, var(--line)); color: var(--text); background: var(--teal-soft); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--teal) 32%, transparent); }
.setting-option input:checked + span::after { border-color: var(--teal-strong); background: var(--teal-strong); box-shadow: inset 0 0 0 2px var(--surface-raised); }
.setting-option input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--teal) 68%, transparent); outline-offset: 3px; }
.settings-actions { margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--line); }
.pricing-dialog { width: min(760px, calc(100% - 28px)); }
.pricing-meta { margin-bottom: 18px; padding: 11px 13px; border-left: 3px solid var(--copper); background: var(--copper-soft); color: var(--text-soft); font-size: var(--type-small); }
.override-toolbar { display: grid; gap: 7px; margin-bottom: 14px; }
.override-toolbar > label { color: var(--text-soft); font-size: var(--type-small); }
.override-toolbar > div { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.override-list { display: grid; gap: 10px; }
.override-card { padding: 14px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); }
.override-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 11px; }
.override-card-head strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; font-family: var(--mono); font-size: var(--type-ui); }
.override-card-head small { display: block; margin-top: 3px; color: var(--text-faint); font-family: var(--body); font-size: var(--type-micro); }
.remove-override { padding: 4px 6px; border: 0; color: var(--coral); background: transparent; cursor: pointer; font-size: var(--type-caption); }
.override-mode { display: grid; grid-template-columns: 120px 1fr; gap: 10px; align-items: end; }
.override-mode label, .custom-rate-grid label { display: grid; gap: 5px; color: var(--text-soft); font-size: var(--type-caption); }
.custom-rate-grid { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.override-hint { grid-column: 1 / -1; margin: 0; color: var(--text-faint); font-size: var(--type-micro); }
.catalog-disclosure { margin-top: 16px; border-top: 1px solid var(--line); }
.catalog-disclosure summary { padding: 14px 0 5px; color: var(--text-soft); cursor: pointer; font-size: var(--type-small); }
.catalog-table { overflow-x: auto; }
.catalog-row { min-width: 620px; display: grid; grid-template-columns: 1.2fr repeat(4, .7fr); gap: 10px; padding: 9px 4px; border-top: 1px solid var(--line); font-family: var(--mono); font-size: var(--type-micro); }
.catalog-row.header { color: var(--text-faint); }
.catalog-row a { color: var(--teal-strong); text-decoration: none; }
.warning-list { display: grid; gap: 8px; margin-top: 18px; }
.warning-row { display: grid; grid-template-columns: 125px minmax(0, 1fr); gap: 4px 14px; padding: 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); }
.warning-row time { color: var(--text-faint); font-family: var(--mono); font-size: var(--type-micro); }
.warning-row time small { display: block; margin-top: 3px; color: var(--text-faint); font: inherit; line-height: 1.35; }
.warning-row code { color: var(--coral); font-size: var(--type-caption); }
.warning-row.informational code { color: var(--teal-strong); }
.warning-row p { grid-column: 2; margin: 0; color: var(--text-soft); font-size: var(--type-small); }
.warning-row details { grid-column: 2; color: var(--text-soft); font-size: var(--type-caption); }
.warning-row details summary { cursor: pointer; color: var(--text-faint); }
.warning-row details p { grid-column: auto; margin-top: 6px; overflow-wrap: anywhere; font-family: var(--mono); line-height: 1.5; }
.toast { position: fixed; z-index: 100; right: 22px; bottom: 22px; max-width: min(420px, calc(100% - 28px)); padding: 12px 15px; border: 1px solid var(--line-strong); border-radius: 10px; color: var(--text); background: var(--surface-raised); box-shadow: var(--shadow-small); font-size: var(--type-ui); }
.toast.error { border-color: color-mix(in srgb, var(--coral) 52%, var(--line)); }
.spin { display: inline-block; animation: spin 800ms linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 1120px) {
  .topbar-inner { grid-template-columns: 1fr auto; gap: 10px 18px; padding: 10px 0; }
  .primary-nav { grid-row: 2; grid-column: 1 / -1; justify-self: center; }
  .top-actions { grid-column: 2; }
  .machine-pill { min-width: 140px; }
  .machine-pill strong { max-width: 125px; }
  .day-detail { position: static; }
  .session-head, .session-row { grid-template-columns: minmax(165px, 1.3fr) minmax(120px, 1fr) minmax(110px, .9fr) 64px 70px 88px 82px; }
  .session-head > :nth-child(7), .session-row > :nth-child(7) { display: none; }
}

@media (max-width: 840px) {
  .topbar-inner, .shell { width: min(100% - 24px, 1320px); }
  .machine-pill { min-width: auto; }
  .machine-pill > span:last-child { display: none; }
  .hero-metrics { grid-template-columns: 1fr; }
  .hero-divider { width: auto; height: 1px; }
  .hero-metric { padding: 28px; }
  .hourly-summary { grid-template-columns: 1fr; gap: 17px; }
  .hourly-context { grid-template-columns: 1fr; gap: 17px; }
  .overview-lower, .daily-layout { grid-template-columns: 1fr; }
  .day-detail { position: static; }
  .calendar-day, .calendar-blank { min-height: 80px; }
  .breakdown-row { grid-template-columns: minmax(120px, 1fr) minmax(120px, 1.5fr) auto 24px; gap: 10px; }
  .session-head { display: none; }
  .session-list { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .session-row { min-width: 0; display: grid; grid-template-columns: 1fr auto; gap: 10px 14px; align-items: start; padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-raised); }
  .session-row > :nth-child(1), .session-row > :nth-child(2), .session-row > :nth-child(3) { grid-column: 1 / -1; }
  .session-row > :nth-child(4) { grid-column: 1; grid-row: 4; }
  .session-row > :nth-child(5) { grid-column: 2; grid-row: 4; }
  .session-row > :nth-child(6) { grid-column: 2; grid-row: 5; }
  .session-row > :nth-child(7) { display: block; grid-column: 1; grid-row: 5; }
  .session-row > :nth-child(8) { grid-column: 1 / -1; grid-row: 6; justify-self: start; }
  .session-mobile-label { display: block; }
}

@media (max-width: 620px) {
  .topbar-inner { grid-template-columns: 1fr auto; }
  .brand-copy small { display: none; }
  .top-actions { gap: 5px; }
  .top-actions .icon-button { display: none; }
  .top-actions .locale-button, .top-actions .settings-button { display: inline-flex; }
  .top-actions .action-button { min-width: 36px; padding: 8px 9px; }
  #scanButton span:last-child { display: none; }
  .primary-nav { width: 100%; }
  .nav-tab { flex: 1; }
  .shell { padding-top: var(--density-shell-top); }
  .view-heading { align-items: start; flex-direction: column; gap: 16px; }
  .details-range-tools { width: 100%; align-items: stretch; flex-direction: column; }
  .range-control { align-self: stretch; }
  .range-control button { flex: 1; }
  .details-date-picker { width: 100%; }
  .month-nav { width: 100%; }
  .month-nav .date-picker-shell { min-width: 0; flex: 1; }
  .hero-value { font-size: clamp(2.625rem, 15vw, 4rem); }
  .hero-value.cost { font-size: clamp(2.25rem, 12vw, 3.375rem); }
  .trend-panel, .quiet-section, .calendar-panel, .day-detail, .detail-breakdown, .sessions-panel { padding: var(--density-mobile-panel); }
  .trend-switcher { width: 100%; }
  .hourly-head { align-items: stretch; flex-direction: column; }
  .hourly-navigator { width: 100%; }
  .hourly-navigator .date-picker-shell { min-width: 0; flex: 1; }
  .hourly-ledger { grid-template-columns: repeat(3, minmax(70px, 1fr)); }
  .hourly-chart { min-width: 660px; }
  .hourly-context-details { grid-template-columns: 1fr; }
  .hourly-coverage-group { padding: 13px 0 0; border-top: 1px solid var(--line); border-left: 0; }
  .section-head > p { display: none; }
  .pulse-belt { grid-auto-columns: 32px; }
  .pulse-inspector { grid-template-columns: 1fr 1fr; }
  .provenance-list > div { grid-template-columns: 100px minmax(0, 1fr); }
  .calendar-day, .calendar-blank { min-height: 67px; }
  .calendar-day { padding: 7px; }
  .day-amount { font-size: var(--type-micro); }
  .calendar-legend { gap: 8px 12px; }
  .breakdown-row { grid-template-columns: minmax(105px, 1fr) auto 24px; min-height: 52px; }
  .breakdown-track { grid-row: 2; grid-column: 1 / 3; }
  .breakdown-value { grid-column: 2; grid-row: 1; }
  .breakdown-filter { grid-column: 3; grid-row: 1 / 3; }
  .sessions-toolbar { align-items: stretch; flex-direction: column; gap: 12px; }
  .session-search { width: 100%; }
  .session-list { grid-template-columns: 1fr; }
  footer { flex-direction: column; gap: 5px; }
  .filter-context { align-items: start; }
  .filter-context-label { display: none; }
  .filter-context > .text-button { margin-left: auto; white-space: nowrap; }
  .sheet-dialog { width: 100%; height: min(82vh, 690px); margin: auto 0 0; border-width: 1px 0 0; border-radius: 18px 18px 0 0; transform: translateY(22px); }
  .sheet-dialog .dialog-frame { padding: 22px; }
  .settings-preview { grid-template-columns: 1fr; gap: 7px; }
  .setting-options.three { grid-template-columns: 1fr; }
  .setting-option > span { min-height: 52px; }
  .custom-rate-grid { grid-template-columns: 1fr 1fr; }
  .override-mode { grid-template-columns: 1fr; }
  .dialog-actions .action-button { flex: 1; }
  .toast { right: 14px; bottom: 14px; }
}

@media (max-width: 390px) {
  .topbar-inner, .shell { width: calc(100% - 18px); }
  .brand-mark { width: 31px; height: 31px; }
  .brand-copy strong { font-size: var(--type-body); }
  .calendar-panel { padding: 14px 10px 16px; }
  .calendar-day, .calendar-blank { min-height: 65px; }
  .calendar-day { padding: 6px; }
  .day-amount { overflow: hidden; text-overflow: ellipsis; }
  .rank-row { grid-template-columns: minmax(100px, 1fr) auto; }
  .rank-signal { grid-row: 2; grid-column: 1 / -1; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .view-panel.entering { animation: none; }
}

:root[data-motion="reduce"] { scroll-behavior: auto; }
:root[data-motion="reduce"] *, :root[data-motion="reduce"] *::before, :root[data-motion="reduce"] *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
:root[data-motion="reduce"] .view-panel.entering { animation: none; }

@media (prefers-reduced-transparency: reduce) {
  .topbar, dialog { -webkit-backdrop-filter: none; backdrop-filter: none; background: var(--surface-raised); }
  dialog::backdrop { -webkit-backdrop-filter: none; backdrop-filter: none; }
}

@media (prefers-contrast: more) {
  :root { --line: currentColor; --line-strong: currentColor; }
  .surface, .action-button, .icon-button, .segmented, .primary-nav, .date-picker-shell { border-width: 2px; }
  .text-button { text-decoration: underline; text-underline-offset: 2px; }
  .status-dot { outline: 1px solid currentColor; }
}

.breakdown-value .mode-fast { display: block; font-size: .7rem; }

.mode-token-breakdown { margin: 10px 0 6px; color: var(--text-soft); font-size: .8rem; line-height: 1.7; font-variant-numeric: tabular-nums; }
.mode-token-breakdown b, .mode-detail b { font-weight: inherit; }

/* Task hierarchy uses the existing ledger typography and surfaces. */
.session-view-switch {display:flex;gap:4px;border:1px solid var(--line);border-radius:8px;padding:3px;}
.session-view-switch button,.tree-pagination button {border:0;border-radius:5px;background:transparent;color:var(--text-soft);padding:7px 10px;font:inherit;cursor:pointer;white-space:nowrap;}
.session-view-switch .selected {background:var(--teal-soft);color:var(--text);}
.tree-pagination {display:flex;align-items:center;flex-wrap:wrap;gap:12px;padding:12px 0;font-size:.8rem;color:var(--text-soft);}
.tree-pagination[hidden] {display:none;}
.tree-pagination button:disabled {opacity:.4;cursor:default;}
.task-tree-row .task-name {position:relative;padding-left:calc(28px + var(--task-depth)*14px);border-left:1px solid var(--line);}
.tree-toggle {position:absolute;left:calc(var(--task-depth)*14px);top:0;width:25px;height:30px;border:1px solid var(--line);border-radius:5px;background:var(--surface);color:var(--text);cursor:pointer;}
.tree-note,.tree-subtotal {color:var(--text-soft);font-size:.72rem;white-space:normal!important;}
.session-view-switch button:focus-visible,.tree-toggle:focus-visible,.tree-pagination button:focus-visible {outline:2px solid var(--teal);outline-offset:2px;}
.footer-updates {flex-wrap:wrap;}
@media(max-width:700px) {.sessions-toolbar{flex-wrap:wrap}.session-search{flex-basis:100%}.task-tree-row .task-name{padding-left:calc(28px + min(var(--task-depth),3)*12px)}.tree-toggle{left:calc(min(var(--task-depth),3)*12px)}}
