:root {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei UI", sans-serif;
  font-synthesis: none; font-weight: 400; font-size: 14px; line-height: 1.57; color: #1f1f1f;
  --accent: #bfff3f; --ink: #1f1f1f; --canvas: #f5f6f8; --surface: #fff; --surface-muted: #fafafa;
  --line: #d9d9d9; --muted: #595959; --faint: #8c8c8c; --danger: #d4380d; --warning: #d48806; --success: #389e0d;
  background: var(--canvas); color-scheme: light;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
body:has(dialog[open]) { overflow: hidden; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
button:disabled { cursor: default; opacity: .48; }
button, a, input, select { transition: background-color 180ms ease-out, border-color 180ms ease-out; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
input:focus-visible, select:focus-visible { outline-offset: 1px; }
h1, h2, h3, h4, strong, th { font-weight: 600; }
h1 { margin: 0; font-size: 40px; line-height: 1.1; letter-spacing: 0; }
h2 { margin: 0; font-size: 24px; line-height: 1.2; }
h3 { margin: 0; font-size: 18px; line-height: 1.3; }
p { margin: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; top: -60px; left: 16px; z-index: 100; padding: 12px 20px; border-radius: 8px; background: var(--accent); }
.skip-link:focus { top: 12px; }
.brand-bar { height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 24px; background: white; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 40; }
.brand-group { display: flex; align-items: center; gap: 16px; min-width: 0; }
.brand { display: flex; align-items: center; gap: 12px; font-size: 18px; line-height: 1.3; font-weight: 500; }
.brand img { border-radius: 10px; }
.brand small { display: block; color: var(--muted); font-size: 11px; font-weight: 400; margin-top: 3px; }
.header-tools { display: flex; align-items: center; gap: 16px; }
.connection { font-size: 13px; color: var(--muted); }
.connection::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 7px; border-radius: 50%; background: currentColor; vertical-align: 2px; }
.connection.error { color: var(--danger); }
#app-shell { display: grid; grid-template-columns: 216px minmax(0,1fr); align-items: start; }
.sidebar { position: sticky; top: 64px; min-height: calc(100dvh - 64px); height: calc(100dvh - 64px); padding: 24px 12px 16px; background: var(--surface); border-right: 1px solid var(--line); display: flex; flex-direction: column; overflow-y: auto; }
.sidebar-heading { padding: 0 16px 12px; color: var(--muted); font-size: 11px; letter-spacing: .08em; }
.sidebar nav { display: grid; gap: 4px; }
.sidebar nav a { min-height: 40px; display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 1px solid transparent; border-radius: 6px; font-size: 14px; font-weight: 400; color: var(--muted); }
.sidebar nav a svg { width: 18px; height: 18px; flex-shrink: 0; }
.sidebar nav a:hover { background: var(--surface-muted); color: var(--ink); }
.sidebar nav a[aria-current="page"] { color: var(--ink); background: #f0ffc9; font-weight: 600; }
.sidebar-footer { margin-top: auto; padding: 24px 16px 0; }
.sidebar-footer .mode-label { border-top: 1px solid var(--line); padding-top: 16px; flex-direction: column; align-items: start; gap: 4px; line-height: 1.6; }
.sidebar-toggle { display: grid; flex: 0 0 44px; }
.navigation-scrim { display: none; }
.mode-label { font-size: 11px; color: var(--muted); display: flex; align-items: center; gap: 12px; }
.mode-label a { min-height: 44px; display: inline-flex; align-items: center; text-decoration: underline; text-underline-offset: 4px; }
.workspace { max-width: 1320px; width: 100%; min-width: 0; padding: 32px 32px 56px; margin: auto; outline: none; }
.page-head { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.eyebrow { font-size: 11px; color: var(--muted); letter-spacing: .08em; font-weight: 500; display: block; margin-bottom: 12px; }
.page-head p { margin-top: 14px; color: var(--muted); max-width: 620px; }
.button { min-height: 36px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 7px 15px; border: 1px solid var(--line); border-radius: 6px; color: var(--ink); background: transparent; font-size: 14px; font-weight: 400; line-height: 1.2; white-space: nowrap; }
.button:hover { background: var(--surface-muted); border-color: var(--ink); }
.button:active { background: var(--line); }
.button-primary { min-height: 40px; background: var(--accent); border-color: var(--accent); padding: 9px 16px; font-weight: 600; }
.button-primary:hover { background: #aee842; border-color: #aee842; }
.button-primary:active { background: #a3dc3a; }
.button-ink { background: var(--ink); border-color: var(--ink); color: var(--accent); font-weight: 600; }
.button-ink:hover { color: var(--ink); background: var(--surface); }
.button-text { border-color: transparent; background: transparent; padding-left: 8px; padding-right: 8px; }
.button-text:hover { border-color: transparent; background: var(--surface-muted); }
.button-danger { color: var(--danger); }
.full-width { width: 100%; }
.button svg, .state-icon { width: 16px; height: 16px; flex: 0 0 auto; }
.metric-strip { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); padding: 20px 0; margin-bottom: 20px; box-shadow: 0 1px 2px rgba(0,0,0,.03); }
.upstream-metrics { grid-template-columns: repeat(5,minmax(0,1fr)); }
.metric { padding: 0 24px; border-right: 1px solid var(--line); min-width: 0; }
.metric:last-child { border-right: 0; }
.metric-label { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.metric-value { display: block; margin: 8px 0 4px; font-size: 28px; line-height: 1.2; font-weight: 600; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.metric-value.unknown { font-size: 24px; }
.metric-note { display: block; font-size: 11px; color: var(--muted); line-height: 1.5; }
.metric-total { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; }
.metric-total-button { min-height: 36px; margin: 5px 0 2px -8px; color: var(--ink); font-size: 16px; font-weight: 600; }
.metric-total-button svg { width: 17px; height: 17px; }
.metric-total-button:hover { color: #486c18; }
.upstream-balance-alert { min-height: 0; margin: 0 0 20px; padding: 10px 12px; border: 1px solid rgba(118, 157, 161, .2); }
.upstream-balance-alert .z8-balance-alert-list { padding-bottom: 2px; }
.balance-total-list { margin-top: 14px; border-top: 1px solid var(--line); }
.balance-total-row { display: grid; grid-template-columns: minmax(60px, .6fr) minmax(120px, 1fr) auto; align-items: center; gap: 16px; padding: 14px 4px; border-bottom: 1px solid var(--line); }
.balance-total-row > strong { font-size: 13px; }
.balance-total-row > span { text-align: right; font-size: 18px; font-weight: 650; font-variant-numeric: tabular-nums; }
.balance-total-row > small,.balance-total-source { color: var(--muted); font-size: 11px; }
.balance-total-source { margin-top: 14px; }
.action-surface { background: #f0ffc9; border: 1px solid #d7f59b; border-radius: 8px; padding: 20px 24px; margin-bottom: 20px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.action-surface .eyebrow { color: var(--ink); margin-bottom: 8px; }
.action-surface h2 { font-size: 20px; }
.action-surface p { margin-top: 8px; font-size: 13px; }
.surface { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; min-width: 0; overflow: hidden; box-shadow: 0 1px 2px rgba(0,0,0,.03); }
.surface-head { padding: 24px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.surface-head p { color: var(--muted); font-size: 13px; margin-top: 5px; }
.surface-body { padding: 0 24px 24px; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 24px 20px; }
.search-wrap { width: 320px; max-width: 100%; position: relative; }
.search-wrap svg { width: 18px; height: 18px; position: absolute; top: 14px; left: 14px; color: var(--muted); pointer-events: none; }
.search-wrap input { padding-left: 42px; width: 100%; }
input, select, textarea { min-height: 36px; width: 100%; border: 1px solid var(--line); border-radius: 6px; background: white; color: var(--ink); padding: 6px 11px; font-size: 14px; }
input::placeholder { color: var(--faint); }
input[readonly] { background: var(--canvas); color: var(--muted); }
.filters, .period-picker { display: flex; gap: 4px; flex-wrap: wrap; }
.filters button, .period-picker button { min-height: 36px; border: 1px solid transparent; border-radius: 6px; padding: 7px 12px; font-size: 13px; font-weight: 400; background: transparent; color: var(--muted); }
.filters button:hover, .period-picker button:hover { background: var(--surface-muted); }
.filters button[aria-pressed="true"], .period-picker button[aria-pressed="true"] { background: #f0ffc9; color: var(--ink); font-weight: 600; }
.period-picker { padding: 3px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); flex-wrap: nowrap; }
.period-picker button[aria-pressed="true"] { background: var(--accent); }
.z8-range-toolbar { align-items: center; padding-bottom: 12px; }
.date-range-panel { max-width: 520px; margin: 0 0 24px; padding: 18px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: 0 1px 2px rgba(0,0,0,.03); }
.calendar-head { display: grid; grid-template-columns: 36px 1fr 36px; align-items: center; gap: 8px; text-align: center; margin-bottom: 14px; }
.calendar-head strong { font-size: 14px; }
.calendar-nav { width: 32px; height: 32px; border-radius: 6px; font-size: 20px; line-height: 1; }
.calendar-weekdays, .calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.calendar-weekdays { margin-bottom: 4px; color: var(--muted); font-size: 11px; text-align: center; }
.calendar-day { min-height: 34px; border: 1px solid transparent; border-radius: 6px; background: transparent; color: var(--ink); font-size: 13px; cursor: pointer; }
.calendar-day:hover { background: var(--surface-muted); }
.calendar-day.in-range { background: #f0ffc9; }
.calendar-day.selected { border-color: var(--ink); font-weight: 600; }
.calendar-day.today { box-shadow: inset 0 -2px 0 var(--accent); }
.calendar-day.disabled { color: var(--faint); cursor: not-allowed; opacity: .55; }
.calendar-day.disabled:hover { background: transparent; }
.calendar-day.empty { pointer-events: none; }
.date-range-fields { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: end; margin-top: 16px; }
.date-range-fields label { color: var(--muted); font-size: 11px; }
.date-range-fields input { margin-top: 5px; min-height: 34px; font-size: 12px; }
.date-range-fields > span { padding-bottom: 9px; color: var(--muted); font-size: 12px; }
.list-head, .account-row { display: grid; grid-template-columns: minmax(200px,1.7fr) minmax(150px,1fr) minmax(140px,1fr) auto; align-items: center; gap: 20px; }
.list-head { padding: 12px 24px; background: var(--canvas); border-block: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.account-row { padding: 18px 24px; border-bottom: 1px solid var(--line); }
.account-row:last-child { border-bottom: 0; }
.account-identity { display: flex; align-items: center; gap: 14px; min-width: 0; }
.site-mark { width: 36px; height: 36px; border: 1px solid var(--line); background: #f0ffc9; border-radius: 6px; display: grid; place-items: center; font-size: 14px; font-weight: 600; flex-shrink: 0; }
.account-name { border: 0; background: transparent; padding: 0; text-align: left; min-height: 44px; color: var(--ink); font-weight: 500; font-size: 15px; }
.account-name small { display: block; font-weight: 400; color: var(--muted); font-size: 13px; margin-top: 3px; overflow-wrap: anywhere; }
.balance-value { font-size: 22px; font-weight: 500; font-variant-numeric: tabular-nums; }
.balance-value small { font-size: 11px; color: var(--muted); font-weight: 400; margin-left: 5px; }
.account-meta { font-size: 11px; color: var(--muted); margin-top: 5px; }
.status-tag { display: inline-flex; align-items: center; gap: 6px; padding: 3px 7px; border: 1px solid var(--line); border-radius: 4px; font-size: 12px; color: var(--muted); line-height: 1.4; }
.status-tag.ok { color: var(--ink); }
.status-tag.warning { color: var(--ink); border-color: var(--ink); }
.status-tag.warn { color: #8b5a00; border-color: #e3c781; background: #fff9e8; }
.status-tag.error { color: var(--danger); border-color: #e7b8b2; }
.status-tag svg { width: 12px; height: 12px; }
.z8-overview-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; align-items: stretch; }
.z8-today-overview, .z8-month-calendar { min-width: 0; }
.z8-today-overview { display: flex; height: 100%; flex-direction: column; }
.z8-today-overview .surface-head { padding-bottom: 12px; }
.z8-today-main { display: grid; flex: 1; grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(168px, 1fr) auto; gap: 12px; padding: 0 24px 16px; }
.z8-today-primary { display: flex; min-width: 0; min-height: 168px; flex-direction: column; align-items: flex-start; justify-content: center; gap: 10px; padding: 20px 18px; border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 8px; background: #fbfff1; }
.z8-today-primary > div { min-width: 0; }
.z8-today-primary .metric-value { display: block; margin: 3px 0 0; font-size: 40px; line-height: 1.1; }
.z8-today-primary .status-tag { flex-shrink: 0; }
.z8-today-support-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-content: start; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.z8-today-support-item { display: grid; align-content: start; gap: 5px; min-width: 0; padding: 12px; border-right: 1px solid var(--line); }
.z8-today-support-item:last-child { border-right: 0; }
.z8-support-label { color: var(--muted); font-size: 12px; line-height: 1.35; }
.z8-today-support-item > strong { color: var(--ink); font-size: 18px; line-height: 1.2; font-variant-numeric: tabular-nums; }
.z8-today-support-foot { display: flex; min-width: 0; align-items: center; justify-content: space-between; gap: 6px; }
.z8-today-support-foot small { color: var(--muted); font-size: 11px; line-height: 1.35; overflow-wrap: anywhere; }
.z8-today-support-foot .status-tag { flex-shrink: 0; padding: 1px 5px; font-size: 10px; }
.z8-today-support-foot .status-tag svg { width: 10px; height: 10px; }
.z8-dashboard-status { margin-top: 12px; }
.z8-dashboard-status p { margin: 4px 0 0; font-size: 12px; }
.z8-coverage-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 14px 20px; margin-bottom: 20px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.z8-coverage-row strong { display: block; font-size: 22px; margin: -4px 0 2px; font-variant-numeric: tabular-nums; }
.z8-coverage-row small { display: block; color: var(--muted); font-size: 12px; }
.period-kpis { display: flex; gap: 18px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.period-kpis strong { display: block; margin-top: 4px; color: var(--ink); font-size: 16px; font-variant-numeric: tabular-nums; }
.row-actions { display: flex; gap: 4px; }
.row-actions .button { padding-inline: 10px; }
.account-status small { display: block; margin-top: 7px; color: var(--muted); font-size: 11px; }
.empty-state { padding: 48px 24px; text-align: center; }
.empty-state svg { width: 28px; height: 28px; color: var(--muted); margin-bottom: 12px; }
.empty-state h3 { margin-bottom: 8px; }
.empty-state p { color: var(--muted); font-size: 13px; max-width: 450px; margin: 0 auto 20px; }
.inline-message { color: var(--muted); font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
.inline-message:empty { display: none; }
.inline-message.error { color: var(--danger); }
.page-message { padding: 12px 16px; margin-bottom: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.page-message.error { border-color: #e7b8b2; color: var(--danger); }
.skeleton { background: var(--surface-muted); border-radius: 5px; height: 18px; width: 70%; margin: 12px 0; }
.loading-row { padding: 26px 24px; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 24px; }
.loading-row .skeleton { width: 85%; }
.split { display: grid; grid-template-columns: minmax(0,1.55fr) minmax(0,1fr); gap: 24px; margin-bottom: 24px; }
.chart { height: 220px; display: flex; align-items: end; gap: 8px; padding: 16px 0 0; border-bottom: 1px solid var(--line); }
.chart-column { border: 0; background: transparent; padding: 0; flex: 1; min-width: 0; height: 100%; display: flex; flex-direction: column; justify-content: end; align-items: center; gap: 10px; }
.chart-bar { background: var(--ink); width: 100%; max-width: 32px; min-height: 3px; border-radius: 4px 4px 0 0; display: block; }
.chart-column[aria-pressed="true"] .chart-bar { background: var(--accent); border: 1px solid var(--ink); }
.chart-column:hover .chart-bar { background: var(--faint); }
.chart-column small { font-size: 11px; color: var(--muted); padding-bottom: 8px; }
.chart-info { min-height: 24px; font-size: 13px; margin-top: 16px; color: var(--muted); }
.chart-info strong { color: var(--ink); font-variant-numeric: tabular-nums; }
.source-list { padding-inline: 24px; }
.source-row { padding: 14px 0; border-top: 1px solid var(--line); display: flex; align-items: start; gap: 16px; justify-content: space-between; font-size: 13px; }
.source-row small { color: var(--muted); font-size: 11px; display: block; margin-top: 4px; }
.source-row .source-quality { text-align: right; flex-shrink: 0; }
.source-foot { padding: 12px 24px 24px; color: var(--muted); font-size: 11px; }
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 14px 24px; border-top: 1px solid var(--line); white-space: nowrap; }
th { color: var(--muted); font-size: 11px; background: var(--canvas); }
.numeric { text-align: right; }
.recharge-breakdown { display: block; color: var(--muted); font-size: 11px; font-weight: 400; margin-top: 4px; white-space: nowrap; }
.footnote { color: var(--muted); font-size: 11px; margin-top: 16px; }
.disclosure { margin-top: 24px; border-top: 1px solid var(--line); padding-top: 16px; }
summary { min-height: 44px; cursor: pointer; font-size: 13px; font-weight: 500; }
.disclosure p { color: var(--muted); font-size: 13px; margin: 8px 0; }
.auth-workspace { max-width: 1120px; padding: 96px 32px 64px; margin: auto; display: grid; grid-template-columns: 1fr 420px; gap: 64px; align-items: center; }
.auth-copy h1 { line-height: 1.3; margin: 16px 0 24px; }
.auth-copy p { color: var(--muted); }
.auth-summary { margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--line); display: grid; gap: 16px; color: var(--muted); font-size: 13px; }
.auth-summary strong { margin-left: 16px; color: var(--ink); }
.auth-form-surface { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 32px; }
.supporting { color: var(--muted); font-size: 13px; margin-top: 8px; }
.field { display: block; margin-top: 20px; font-size: 13px; }
.field > span { display: block; font-weight: 500; margin-bottom: 8px; }
.field > small { color: var(--muted); font-size: 11px; line-height: 1.5; display: block; margin-top: 6px; }
.auth-form-surface .button-primary { margin-top: 24px; }
.auth-form-surface .inline-message { margin-top: 16px; }
.demo-link { display: flex; margin-top: 16px; }
dialog { padding: 0; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 20px; width: min(560px,calc(100% - 40px)); max-height: calc(100dvh - 40px); }
dialog::backdrop { background: #14140f55; }
dialog.drawer { width: min(580px,100%); height: 100dvh; max-height: 100dvh; margin: 0 0 0 auto; border-radius: 20px 0 0 20px; border-block: 0; }
.dialog-head { padding: 24px 28px; display: flex; justify-content: space-between; align-items: start; gap: 16px; border-bottom: 1px solid var(--line); }
.dialog-head .eyebrow { margin-bottom: 8px; }
.dialog-head p { color: var(--muted); font-size: 13px; margin-top: 6px; }
.icon-button { width: 44px; height: 44px; border: 1px solid var(--line); background: transparent; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; }
.icon-button:hover { background: var(--surface-muted); }
.icon-button svg { width: 18px; height: 18px; }
.dialog-body { padding: 24px 28px; }
.dialog-body > p { color: var(--muted); font-size: 13px; }
.dialog-footer { position: sticky; bottom: 0; background: var(--surface); border-top: 1px solid var(--line); padding: 20px 28px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.save-state { font-size: 11px; color: var(--muted); }
.form-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.field-wide { grid-column: 1 / -1; }
.detail-balance { font-size: 40px; line-height: 1.2; font-weight: 500; margin: 8px 0; font-variant-numeric: tabular-nums; }
.detail-summary { padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.detail-summary .button { margin-top: 16px; }
.detail-facts { margin: 24px 0; }
.detail-facts div { display: flex; align-items: start; justify-content: space-between; gap: 24px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.detail-facts dt { color: var(--muted); }
.detail-facts dd { margin: 0; text-align: right; overflow-wrap: anywhere; max-width: 65%; }
.detail-tabs { display: flex; gap: 12px; margin-top: 24px; border-bottom: 1px solid var(--line); }
.detail-tabs button { border: 0; border-bottom: 2px solid transparent; padding: 12px 4px; min-height: 44px; color: var(--muted); background: transparent; font-size: 13px; }
.detail-tabs button[aria-selected="true"] { border-color: var(--ink); color: var(--ink); }
.sync-row { border-bottom: 1px solid var(--line); padding: 16px 0; font-size: 13px; }
.sync-row small { display: block; color: var(--muted); font-size: 11px; margin-top: 5px; }
.inline-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 20px; }
.capability-section { margin-top: 24px; }
.capability-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.spinner { display: inline-block; width: 14px; height: 14px; border: 1.5px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin 800ms linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.browser-entry { margin-top: 24px; border-top: 1px solid var(--line); padding-top: 20px; }
.browser-entry h3 { font-size: 16px; }
.browser-entry p { color: var(--muted); font-size: 13px; line-height: 1.8; }
dialog.browser-dialog { width: min(1180px,calc(100% - 32px)); }
.browser-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; font-size: 12px; color: var(--muted); margin-bottom: 12px; }
.browser-toolbar span { overflow-wrap: anywhere; }
.browser-screen-wrap { background: #f1f1ed; border: 1px solid var(--line); min-height: 180px; overflow: hidden; }
.browser-screen { display: block; width: 100%; height: auto; min-height: 180px; cursor: pointer; }
.browser-screen:focus { outline: 2px solid var(--accent); outline-offset: -2px; }
.browser-loading { padding: 60px 20px; text-align: center; color: var(--muted); font-size: 13px; }
.browser-text-entry { display: flex; align-items: center; gap: 16px; padding-top: 16px; }
.browser-text-entry .field { flex: 1; margin: 0; }
.account-drawer { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; overflow: hidden; }
.account-drawer:not([open]) { display: none; }
.account-drawer .dialog-head { padding: 20px 24px 16px; }
.account-drawer .dialog-head h2 { font-size: 22px; }
.account-drawer .dialog-head p { margin-top: 5px; font-size: 12px; overflow-wrap: anywhere; }
.account-drawer .dialog-body { overflow-y: auto; padding: 0 24px 24px; scrollbar-gutter: stable; }
.account-drawer .detail-summary { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 18px 0; }
.account-drawer .detail-summary .supporting { margin: 0; font-size: 12px; }
.account-drawer .detail-balance { margin: 4px 0 0; font-size: 30px; letter-spacing: -.02em; }
.detail-summary-status { display: grid; justify-items: end; gap: 7px; }
.account-drawer .detail-tabs { position: sticky; top: 0; z-index: 2; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 0; margin: 0; padding-top: 6px; background: var(--surface); }
.account-drawer .detail-tabs button { padding: 10px 4px; font-size: 13px; white-space: nowrap; }
.account-drawer .detail-tabs button[aria-selected="true"] { border-color: #8fbb24; }
.account-drawer .detail-facts { margin: 16px 0; }
.account-drawer .detail-facts div { gap: 16px; padding: 10px 0; font-size: 12px; }
.account-drawer .sync-row { padding: 12px 0; }
.account-drawer .usage-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 18px; padding: 0; }
.account-drawer .usage-metrics .metric { padding: 14px; border-bottom: 1px solid var(--line); }
.account-drawer .usage-metrics .metric:nth-child(even) { border-right: 0; }
.account-drawer .usage-metrics .metric:nth-last-child(-n+2) { border-bottom: 0; }
.account-drawer .usage-metrics .metric-value { font-size: 22px; overflow-wrap: anywhere; }
.account-drawer .account-data-meta { margin: 14px 0 0; color: var(--muted); font-size: 11px; }
.account-drawer #account-tab-panel > .filters { margin: 16px 0 12px; }
.account-drawer #detail-message { margin: 12px 0 0; padding: 10px 12px; border-radius: 6px; background: var(--surface-muted); font-size: 12px; }
.account-drawer #detail-message.error { background: #fff1ef; }
.account-drawer .inline-message:empty { display: none; }
.account-setting-section { padding: 20px 0; border-bottom: 1px solid var(--line); }
.account-setting-section h3 { font-size: 14px; font-weight: 600; }
.account-section-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.account-setting-state { font-size: 11px; color: var(--muted); }
.account-field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.account-drawer .field { min-width: 0; margin-top: 12px; font-size: 12px; }
.account-drawer .field > span { margin-bottom: 6px; }
.account-drawer .field input { min-width: 0; min-height: 42px; padding: 9px 11px; font-size: 13px; }
.account-setting-section.browser-entry { margin: 0; border-top: 0; }
.account-setting-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.account-drawer .button { min-height: 40px; padding: 8px 13px; font-size: 12px; }
.account-setting-fold { padding: 4px 0; border-bottom: 1px solid var(--line); }
.account-setting-fold summary { display: flex; align-items: center; gap: 8px; min-height: 44px; font-size: 13px; list-style: none; }
.account-setting-fold summary::-webkit-details-marker { display: none; }
.account-setting-fold summary::before { content: '›'; width: 12px; color: var(--muted); font-size: 18px; transition: transform .15s; }
.account-setting-fold[open] > summary::before { transform: rotate(90deg); }
.account-setting-fold[open] { padding-bottom: 18px; }
.account-danger-fold summary { color: var(--muted); }
.account-drawer .dialog-footer { position: static; flex-direction: row; align-items: center; justify-content: flex-end; padding: 14px 24px; }
.account-drawer .dialog-footer .button { min-height: 44px; }
@media (max-width: 480px) {
  .account-drawer .dialog-head { padding: 16px 18px; }
  .account-drawer .dialog-body { padding: 0 18px 20px; }
  .account-drawer .detail-summary { padding: 14px 0; }
  .account-drawer .detail-balance { font-size: 26px; }
  .account-field-grid { grid-template-columns: 1fr; gap: 0; }
  .account-drawer .dialog-footer { flex-direction: row; padding: 12px 18px; }
  .account-drawer .dialog-footer .button-primary { flex: 1; }
  .account-drawer .button { min-height: 44px; }
}
@media (max-width:760px) { dialog.browser-dialog { width: calc(100% - 16px); } .browser-text-entry { align-items: stretch; flex-direction: column; gap: 8px; } .browser-screen-wrap { min-height: 160px; } }
@media (max-width: 1100px) { .row-actions { flex-direction: column; } .list-head,.account-row { grid-template-columns: minmax(190px,1.4fr) minmax(135px,1fr) minmax(125px,.8fr) auto; gap: 12px; } .metric { padding-inline: 20px; } }
@media (max-width: 900px) { .workspace { padding-top: 32px; } .metric-strip { grid-template-columns: 1fr 1fr; padding: 0; } .metric { padding: 20px; border-bottom: 1px solid var(--line); } .metric:nth-child(even) { border-right: 0; } .metric:nth-child(4),.metric:nth-child(5) { border-bottom: 0; } .metric:nth-child(5) { border-right: 0; } .split { grid-template-columns: 1fr; } .list-head { display: none; } .account-row { grid-template-columns: 1.5fr 1fr auto; } .account-status { grid-column: 1; grid-row: 2; margin-left: 54px; } .row-actions { grid-column: 3; grid-row: 1 / 3; } .account-row .account-status small { display: inline; margin-left: 6px; } .auth-workspace { gap: 32px; grid-template-columns: 1fr 380px; } .auth-copy h1 { font-size: 40px; } .toolbar { align-items: stretch; flex-direction: column; } .search-wrap { width: 100%; } }
@media (max-width: 760px) { .brand-bar { height: 72px; padding-inline: 20px; } .brand-group { gap: 8px; } .connection { font-size: 11px; } .header-tools { gap: 8px; } .brand small { display: none; } .brand { font-size: 15px; gap: 8px; } .brand img { width: 32px; height: 32px; } .navigation { padding: 20px 20px 0; align-items: start; flex-direction: column; gap: 8px; } .navigation nav { width: 100%; gap: 4px; } .navigation nav a { padding-inline: 16px; flex: 1; justify-content: center; } .mode-label { min-height: 28px; } .workspace { padding: 24px 20px 48px; } .page-head { align-items: start; flex-direction: column; gap: 20px; margin-bottom: 24px; } .page-head > .button-primary { width: 100%; } .page-head p { font-size: 13px; } .action-surface { align-items: start; flex-direction: column; padding: 20px; gap: 16px; } .action-surface .button { width: 100%; } .metric { padding: 16px; } .metric-value { font-size: 32px; } .surface-head { padding: 20px; align-items: start; } .surface-body { padding: 0 20px 20px; } .toolbar { padding-inline: 20px; } .filters { gap: 0; } .filters button { padding-inline: 12px; } .account-row { grid-template-columns: 1fr 1fr; padding: 20px; gap: 16px; } .account-identity { grid-column: 1 / -1; } .account-status { grid-column: 2; grid-row: 2; margin-left: 0; text-align: right; } .account-row .account-status small { display: block; margin-left: 0; } .row-actions { grid-column: 1 / -1; grid-row: 3; flex-direction: row; padding-top: 4px; } .row-actions .button { flex: 1; border-color: var(--line); } .chart { gap: 5px; } .source-list { padding-inline: 20px; } .source-row { gap: 8px; } .source-foot { padding-inline: 20px; } th,td { padding: 12px; } .auth-workspace { display: block; padding: 40px 20px; max-width: 480px; } .auth-copy { margin-bottom: 32px; } .auth-copy h1 { line-height: 1.2; } .auth-summary { display: none; } .auth-form-surface { padding: 24px; } dialog { width: calc(100% - 24px); max-height: calc(100dvh - 24px); } dialog.drawer { border-radius: 0; } .dialog-head,.dialog-body { padding: 20px; } .dialog-footer { padding: 16px 20px; align-items: stretch; flex-direction: column; gap: 12px; } .form-columns { grid-template-columns: 1fr; gap: 0; } .header-tools .button { padding-inline: 8px; } .page-message { align-items: start; } }
@media (max-width: 380px) { .connection { max-width: 95px; } .brand-bar { gap: 8px; } .metric { padding-inline: 12px; } .metric-value { overflow-wrap: anywhere; } .navigation nav a { padding-inline: 8px; } .z8-today-support-item { padding-inline: 6px; } .z8-today-support-foot .status-tag { max-width: 100%; } }
@media (min-width: 761px) {
  #app-shell.sidebar-collapsed { grid-template-columns: 68px minmax(0,1fr); }
  #app-shell.sidebar-collapsed .sidebar { padding-inline: 8px; }
  #app-shell.sidebar-collapsed .sidebar-heading,
  #app-shell.sidebar-collapsed .sidebar nav a span,
  #app-shell.sidebar-collapsed .sidebar-footer .mode-label > span { display: none; }
  #app-shell.sidebar-collapsed .sidebar nav a { justify-content: center; gap: 0; padding-inline: 0; min-height: 44px; }
  #app-shell.sidebar-collapsed .sidebar nav a svg { width: 20px; height: 20px; }
  #app-shell.sidebar-collapsed .sidebar-footer { padding-inline: 0; }
  #app-shell.sidebar-collapsed .sidebar-footer .mode-label { align-items: center; padding-top: 12px; }
  #app-shell.sidebar-collapsed .sidebar-footer .mode-label > a { width: 44px; justify-content: center; overflow: hidden; font-size: 0; text-decoration: none; }
  #app-shell.sidebar-collapsed .sidebar-footer .mode-label > a::after { content: '↗'; font-size: 14px; }
}
@media (min-width: 761px) and (max-width: 1100px) { #app-shell { grid-template-columns: 208px minmax(0,1fr); } .sidebar { padding-inline: 12px; } .workspace { padding-inline: 24px; } .page-head { align-items: start; } .page-head h1 { overflow-wrap: anywhere; } .page-head > .button { flex-shrink: 0; } }
@media (max-width: 760px) { #app-shell { display: block; } .sidebar-toggle:not([hidden]) { display: grid !important; } .sidebar { position: fixed; top: 72px; left: 0; bottom: 0; z-index: 35; width: min(280px,calc(100% - 48px)); height: calc(100dvh - 72px); min-height: 0; padding: 24px 16px; } .navigation-scrim:not([hidden]) { position: fixed; inset: 72px 0 0; display: block; z-index: 30; border: 0; background: #14140f55; } .header-tools { gap: 4px; } .connection { max-width: 90px; } .workspace { padding-top: 32px; } body:has(.navigation-scrim:not([hidden])) { overflow: hidden; } }
@media (max-width: 760px) { .brand-bar:has(.sidebar-toggle:not([hidden])) .connection { display: none; } }
@media (prefers-reduced-motion: reduce) { *,*::before,*::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }

/* Z8 visual direction: airy mint canvas, editorial numbers, and a clear
   split between the selected range and the monthly calendar. The lime accent
   remains the brand action color; the softer backdrop gives it room to lead. */
body:has(.z8-page-head) { background: #eaf3f1; }
body:has(.z8-page-head) #app-shell { background: linear-gradient(135deg, #f8fbf8 0%, #eaf3f1 52%, #e3f0ef 100%); }
body:has(.z8-page-head) .workspace { max-width: 1480px; padding: 36px 40px 72px; }
.z8-page-head { margin-bottom: 22px; padding-inline: 4px; }
.z8-page-head .eyebrow { margin-bottom: 9px; color: #64747a; letter-spacing: .12em; text-transform: uppercase; }
.z8-page-head h1 { font-size: clamp(32px, 3vw, 46px); letter-spacing: -.045em; }
.z8-page-head p { margin-top: 10px; color: #64747a; font-size: 14px; }
.z8-page-head .inline-actions { align-items: center; }
.z8-page-head .button { border-radius: 12px; min-height: 42px; padding-inline: 16px; }
.z8-page-head .button-primary { box-shadow: 0 8px 18px rgba(158, 205, 29, .22); }
.z8-filter-toolbar { grid-template-columns: minmax(0, 1fr) minmax(230px, .34fr); gap: 18px; margin-bottom: 20px; padding: 15px 18px 17px; border-color: rgba(118, 157, 161, .22); border-radius: 18px; background: rgba(255, 255, 255, .82); box-shadow: 0 12px 28px rgba(45, 79, 83, .08); }
.z8-filter-group { flex-direction: column; align-items: flex-start; gap: 7px; }
.z8-filter-group:last-child { justify-content: flex-start; }
.toolbar-label { color: #66767b; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.period-picker, .metric-picker { width: 100%; padding: 4px; border-color: rgba(118, 157, 161, .2); border-radius: 12px; background: #f5f8f6; }
.period-picker { justify-content: space-between; }
.period-picker button, .metric-picker button { min-height: 40px; border-radius: 9px; color: #6f7d81; font-size: 13px; font-weight: 500; }
.period-picker button { flex: 1 1 auto; }
.metric-picker button { flex: 1 1 0; }
.period-picker button:hover, .metric-picker button:hover { background: rgba(255, 255, 255, .92); color: var(--ink); }
.period-picker button[aria-pressed="true"] { background: var(--accent); color: var(--ink); box-shadow: 0 4px 10px rgba(158, 205, 29, .2); }
.metric-picker button[aria-pressed="true"] { background: var(--ink); color: #f7ffdc; box-shadow: 0 4px 10px rgba(31, 31, 31, .12); }
.z8-overview-grid { grid-template-columns: minmax(370px, .93fr) minmax(0, 1.07fr); gap: 20px; margin-bottom: 20px; }
.z8-overview-grid > .surface, .z8-overview-grid > .z8-calendar-column > .surface { border-color: rgba(118, 157, 161, .2); border-radius: 20px; box-shadow: 0 14px 30px rgba(45, 79, 83, .08); }
.z8-today-overview { background: rgba(255, 255, 255, .92); }
.z8-today-overview .surface-head { padding: 24px 28px 15px; }
.z8-today-overview .surface-head h2 { font-size: clamp(22px, 2.1vw, 30px); letter-spacing: -.035em; }
.z8-today-overview .surface-head .supporting { max-width: 165px; color: #78868a; font-size: 11px; line-height: 1.45; text-align: right; }
.z8-today-main { gap: 14px; padding: 0 28px 22px; }
.z8-today-primary { position: relative; min-height: 218px; overflow: hidden; justify-content: center; gap: 14px; padding: 26px 24px; border: 0; border-radius: 16px; background: var(--accent); box-shadow: inset 0 -24px 46px rgba(120, 166, 18, .08); }
.z8-today-primary::after { position: absolute; right: -38px; top: -48px; width: 190px; height: 190px; border: 1px solid rgba(31, 31, 31, .1); border-radius: 50%; box-shadow: 0 0 0 18px rgba(255, 255, 255, .12), 0 0 0 38px rgba(255, 255, 255, .08); content: ''; pointer-events: none; }
.z8-today-primary > div { position: relative; z-index: 1; }
.z8-today-primary .metric-label { color: rgba(31, 31, 31, .7); font-size: 13px; font-weight: 600; letter-spacing: .02em; }
.z8-today-primary .metric-value { margin-top: 8px; color: var(--ink); font-size: clamp(42px, 4.2vw, 64px); font-weight: 650; letter-spacing: -.065em; line-height: .98; }
.z8-today-primary .status-tag { position: relative; z-index: 1; border-color: rgba(31, 31, 31, .1); background: rgba(255, 255, 255, .42); color: var(--ink); }
.z8-today-support-list { border-color: rgba(118, 157, 161, .2); border-radius: 14px; background: #fbfdfc; }
.z8-today-support-item { gap: 7px; padding: 15px 14px; }
.z8-support-label { color: #718084; font-size: 11px; font-weight: 600; letter-spacing: .01em; }
.z8-today-support-item > strong { font-size: 21px; letter-spacing: -.035em; }
.z8-today-support-foot small { color: #89969a; }
.z8-today-detail { margin: 0 28px; padding: 17px 0 24px; border-top-color: rgba(118, 157, 161, .18); }
.z8-today-detail > div { padding-inline: 18px; border-right-color: rgba(118, 157, 161, .18); }
.z8-today-detail span { color: #78868a; }
.z8-today-detail strong { font-size: 20px; letter-spacing: -.035em; }
.z8-today-detail small { color: #8b979b; }
.z8-month-calendar { background: rgba(255, 255, 255, .92); }
.z8-month-calendar .surface-head { min-height: 96px; padding: 24px 28px 13px; }
.z8-month-calendar .surface-head h3 { font-size: clamp(22px, 2.1vw, 30px); letter-spacing: -.035em; }
.z8-month-calendar .surface-head p { margin-top: 7px; color: #78868a; }
.z8-month-calendar .surface-body { padding: 0 28px 26px; }
.calendar-head-actions { gap: 8px; }
.calendar-nav { width: 42px; height: 42px; border-color: rgba(118, 157, 161, .2); border-radius: 12px; background: #fbfdfc; color: #526166; font-size: 23px; }
.calendar-nav:hover:not(:disabled) { border-color: var(--accent); background: #f5ffda; }
.calendar-month-control { min-height: 44px; padding: 4px 0 12px; border-bottom-color: rgba(118, 157, 161, .16); }
.calendar-month-control > span { color: #7c898d; font-size: 11px; }
.calendar-month-control > strong { color: #536167; font-size: 13px; }
.calendar-weekdays { margin-top: 13px; margin-bottom: 7px; color: #879397; font-size: 11px; font-weight: 600; }
.calendar-analysis-grid { gap: 8px; }
.calendar-analysis-day { min-height: 58px; align-items: flex-start; justify-content: space-between; padding: 9px 10px; border: 1px solid rgba(118, 157, 161, .12); border-radius: 12px; background: #f8fbfa; color: #58666b; }
.calendar-analysis-day span { font-size: 12px; font-weight: 600; }
.calendar-analysis-day small { align-self: flex-start; color: #4a9b52; font-size: 10px; font-weight: 600; }
.calendar-analysis-day.has-data { background: #eff8f2; }
.calendar-analysis-day.has-data::after { right: 9px; bottom: 8px; width: 5px; height: 5px; background: var(--accent); }
.calendar-analysis-day:not(.disabled):hover { border-color: var(--accent); background: #f4ffdb; }
.calendar-analysis-day.selected { border-color: var(--ink); background: #f4ffdb; box-shadow: 0 4px 12px rgba(45, 79, 83, .08); }
.calendar-analysis-day.today { box-shadow: inset 0 -3px 0 var(--accent); }
.calendar-analysis-day.disabled { border-color: transparent; background: transparent; color: #bdc5c6; }
.calendar-legend { margin-top: 17px; color: #889598; }
.calendar-period-summary { margin-top: 22px; padding-top: 18px; border-top-color: rgba(118, 157, 161, .16); }
.calendar-period-summary-head { margin-bottom: 12px; }
.calendar-period-summary-head .eyebrow { color: #7e8c90; letter-spacing: .1em; }
.calendar-period-summary-head strong { color: #526166; font-size: 12px; }
.calendar-month-kpis { gap: 10px; }
.calendar-month-kpis span { min-height: 68px; padding: 12px 13px; border-color: rgba(118, 157, 161, .14); border-radius: 12px; background: #f8fbfa; }
.calendar-month-kpis span:first-child { border-color: rgba(191, 255, 63, .68); background: #f5ffd9; }
.calendar-month-kpis small { color: #7f8d91; font-size: 10px; font-weight: 600; }
.calendar-month-kpis strong { margin-top: 7px; color: #334146; font-size: 17px; letter-spacing: -.035em; }
.z8-trend-surface, .z8-billing-surface { border-color: rgba(118, 157, 161, .2); border-radius: 18px; box-shadow: 0 12px 26px rgba(45, 79, 83, .06); }
.z8-trend-surface .surface-head, .z8-billing-surface .surface-head { padding: 19px 24px 12px; }
.z8-trend-surface .surface-head h3, .z8-billing-surface .surface-head h3 { letter-spacing: -.02em; }
.z8-trend-surface .surface-body { padding: 0 24px 20px; }
.z8-trend-surface .chart-bar { background: linear-gradient(180deg, #bfff3f 0%, #8bcf4b 100%); box-shadow: 0 4px 9px rgba(139, 207, 75, .18); }
.z8-trend-surface .chart-column[aria-pressed="true"] .chart-bar { background: var(--ink); box-shadow: none; }
.z8-trend-surface .chart-info { color: #748287; }
@media (max-width: 1100px) {
  body:has(.z8-page-head) .workspace { padding-inline: 24px; }
  .z8-overview-grid { grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr); }
  .z8-filter-toolbar { grid-template-columns: 1fr; }
  .z8-metric-group { max-width: 460px; }
}
@media (max-width: 760px) {
  body:has(.z8-page-head) .workspace { padding: 28px 16px 48px; }
  .z8-page-head { padding-inline: 0; }
  .z8-page-head .inline-actions { width: 100%; }
  .z8-filter-toolbar { padding: 14px; border-radius: 16px; }
  .z8-filter-group { flex-direction: column; }
  .period-picker { overflow-x: auto; justify-content: flex-start; }
  .period-picker button { flex: 0 0 auto; }
  .z8-overview-grid { grid-template-columns: 1fr; }
  .z8-today-overview .surface-head, .z8-month-calendar .surface-head { padding-inline: 20px; }
  .z8-today-main { padding-inline: 20px; }
  .z8-today-primary { min-height: 190px; }
  .z8-today-detail { margin-inline: 20px; }
  .z8-month-calendar .surface-body { padding-inline: 20px; }
  .calendar-analysis-grid { gap: 5px; }
  .calendar-analysis-day { min-height: 48px; padding: 7px 7px; border-radius: 9px; }
  .calendar-analysis-day small { font-size: 9px; }
  .z8-trend-surface .surface-head, .z8-billing-surface .surface-head { padding-inline: 20px; }
}

/* Ant Design inspired operations-console finish: compact controls, explicit hierarchy, brand accent reserved for action. */
dialog { border-radius: 8px; box-shadow: 0 6px 16px rgba(0,0,0,.08), 0 3px 6px rgba(0,0,0,.12); }
dialog.drawer { border-radius: 8px 0 0 8px; }
.dialog-head { padding: 20px 24px; }
.dialog-body { padding: 20px 24px; }
.dialog-footer { padding: 16px 24px; }
.surface-head { padding: 20px 24px; }
.surface-body { padding: 0 24px 20px; }
.table-wrap table tbody tr:hover { background: #fafafa; }
.account-row:hover { background: #fafafa; }
.account-row .button-text { color: var(--muted); }
.account-row .button-text:hover { color: var(--ink); }
.inline-message.error, .page-message.error { color: var(--danger); }
@media (max-width: 760px) {
  .brand-bar { height: 64px; padding-inline: 16px; }
  .sidebar { top: 64px; height: calc(100dvh - 64px); min-height: calc(100dvh - 64px); }
  .navigation-scrim { inset: 64px 0 0; }
  .workspace { padding: 24px 16px 40px; }
  .page-head { margin-bottom: 20px; }
  .page-head h1 { font-size: 30px; }
  .action-surface { padding: 16px; }
  .metric-strip { border-radius: 8px; }
  .surface-head, .surface-body { padding-inline: 16px; }
  .toolbar { padding-inline: 16px; }
}

/* Z8 operations dashboard: keep range selection and summary with the calendar. */
.z8-page-head { align-items: flex-end; }
.z8-filter-toolbar { display: grid; grid-template-columns: max-content minmax(0, 1fr); align-items: center; gap: 10px 18px; margin-bottom: 16px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: 0 1px 2px rgba(0,0,0,.03); }
.z8-filter-group { display: flex; align-items: center; gap: 8px; min-width: 0; flex-wrap: wrap; }
.z8-filter-group:last-child { justify-content: flex-start; }
.z8-period-group { flex: 0 1 auto; }
.z8-metric-group { flex: 1 1 auto; }
.toolbar-label { color: var(--muted); font-size: 12px; white-space: nowrap; }
.metric-picker { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 6px; background: var(--canvas); }
.metric-picker button { min-height: 30px; padding: 5px 10px; border: 0; border-radius: 4px; background: transparent; color: var(--muted); font-size: 12px; }
.metric-picker button:hover { color: var(--ink); background: var(--surface); }
.metric-picker button[aria-pressed="true"] { color: var(--ink); background: var(--surface); box-shadow: 0 1px 2px rgba(0,0,0,.12); font-weight: 600; }
.z8-calendar-column { display: grid; grid-template-columns: minmax(0, 1fr); align-content: start; min-width: 0; }
.z8-today-detail { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: stretch; gap: 0; margin: 0 24px; padding: 14px 0 20px; border-top: 1px solid var(--line); background: var(--surface); }
.z8-today-detail > div { min-width: 0; padding: 0 16px; border-right: 1px solid var(--line); }
.z8-today-detail > div:first-child { padding-left: 0; }
.z8-today-detail > div:last-child { border-right: 0; }
.z8-today-detail span { display: block; color: var(--muted); font-size: 11px; }
.z8-today-detail strong { display: block; margin-top: 3px; font-size: 19px; line-height: 1.2; font-variant-numeric: tabular-nums; }
.z8-today-detail small { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.calendar-period-summary { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.calendar-period-summary-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.calendar-period-summary-head .eyebrow { margin-bottom: 2px; }
.calendar-period-summary-head strong { display: block; font-size: 13px; }
.calendar-period-summary-head .supporting { max-width: 145px; text-align: right; font-size: 10px; }
.period-kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; align-items: start; padding: 0 24px 20px; }
.period-kpis span { min-width: 0; padding-left: 12px; border-left: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.period-kpis span:first-child { padding-left: 0; border-left: 0; }
.period-kpis small { display: block; color: var(--muted); font-size: 11px; }
.period-kpis strong { display: block; margin-top: 5px; color: var(--ink); font-size: clamp(13px, 1.35vw, 16px); line-height: 1.25; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.calendar-period-summary .period-kpis { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0; padding: 0; }
.calendar-period-summary .period-kpis span, .calendar-period-summary .period-kpis span:first-child { min-height: 0; padding: 2px 7px; border: 0; border-left: 1px solid var(--line); border-radius: 0; background: transparent; }
.calendar-period-summary .period-kpis span:first-child { padding-left: 0; border-left: 0; }
.calendar-period-summary .period-kpis small { min-height: 0; font-size: 10px; white-space: nowrap; }
.calendar-period-summary .period-kpis strong { margin-top: 3px; font-size: clamp(11px, 1vw, 13px); }
.calendar-month-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.calendar-month-kpis span { min-width: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-muted); }
.calendar-month-kpis small { display: block; color: var(--muted); font-size: 11px; white-space: nowrap; }
.calendar-month-kpis strong { display: block; margin-top: 5px; color: var(--ink); font-size: 15px; line-height: 1.2; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.z8-analysis-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(310px, .9fr); gap: 16px; margin-bottom: 20px; align-items: stretch; }
.z8-trend-surface { min-width: 0; margin-bottom: 16px; }
.z8-trend-surface .surface-head { padding: 16px 24px 8px; }
.z8-trend-surface .surface-head p { font-size: 12px; }
.z8-trend-surface .surface-body { padding-bottom: 16px; }
.z8-trend-surface .chart { height: 140px; padding-top: 0; gap: 6px; }
.z8-trend-surface .chart-info { margin-top: 10px; min-height: 20px; font-size: 12px; }
.z8-trend-surface .chart-label-hidden { visibility: hidden; }
.z8-trend-surface .chart-dense .chart-column small { width: 34px; font-size: 10px; }
.z8-trend-surface .empty-state { padding: 20px 8px; }
.z8-trend-surface .empty-state p { margin-bottom: 0; }
.chart-bar.is-unknown { background: repeating-linear-gradient(135deg, transparent, transparent 3px, var(--muted) 3px, var(--muted) 4px); border: 1px dashed var(--muted); opacity: .65; }
.z8-month-calendar { min-width: 0; }
.z8-month-calendar .surface-head { min-height: 82px; }
.calendar-head-actions { display: flex; gap: 4px; }
.calendar-analysis-grid { gap: 5px; }
.calendar-analysis-day { position: relative; min-height: 44px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border-color: transparent; }
.calendar-analysis-day span { line-height: 1.1; }
.calendar-analysis-day small { max-width: 100%; overflow: hidden; color: var(--muted); font-size: 9px; line-height: 1.1; text-overflow: ellipsis; white-space: nowrap; }
.calendar-analysis-day.has-data::after { position: absolute; bottom: 3px; width: 4px; height: 4px; border-radius: 50%; background: var(--accent); content: ''; }
.calendar-analysis-day:not(.disabled):hover { background: #f0ffc9; }
.calendar-analysis-day.selected { border-color: var(--ink); background: #f0ffc9; }
.calendar-analysis-day.today { box-shadow: inset 0 -2px 0 var(--accent); }
.calendar-nav { width: 44px; height: 44px; }
.calendar-nav:disabled { cursor: not-allowed; opacity: .4; }
.calendar-source-status { margin-left: auto; text-align: right; }
.z8-calendar-status { margin: 12px 0 0; padding: 8px 10px; border-left: 3px solid var(--danger); background: #fff6f4; color: var(--danger); font-size: 11px; line-height: 1.5; }
.z8-calendar-status .button { min-height: 36px; padding-inline: 6px; color: inherit; }
.calendar-legend { display: flex; flex-wrap: wrap; gap: 10px 16px; margin-top: 14px; color: var(--muted); font-size: 10px; }
.calendar-legend span { display: inline-flex; align-items: center; gap: 5px; }
.calendar-legend .calendar-source-status { flex: 1 1 160px; justify-content: flex-end; }
.calendar-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--line); }
.calendar-dot.has-data { background: var(--accent); border: 1px solid var(--ink); }
.calendar-dot.selected-dot { background: var(--ink); }
.z8-billing-surface { margin-bottom: 24px; }
.z8-billing-surface tbody tr.is-selected { background: #fbfff1; }
.table-date { min-height: 32px; padding: 0; border: 0; background: transparent; color: var(--ink); text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 4px; }
.table-date:hover { text-decoration-color: var(--ink); }
.z8-billing-surface th, .z8-billing-surface td { padding-inline: 16px; }
.z8-billing-surface th:first-child, .z8-billing-surface td:first-child { padding-left: 24px; }
.z8-billing-surface th:last-child, .z8-billing-surface td:last-child { padding-right: 24px; }
.z8-billing-surface .recharge-breakdown { max-width: 280px; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 1100px) {
  .z8-filter-toolbar { grid-template-columns: minmax(0, 1fr); align-items: start; }
  .z8-filter-group, .z8-filter-group:last-child { width: 100%; justify-content: flex-start; }
  .z8-overview-grid { grid-template-columns: 1fr; align-items: start; }
  .z8-today-overview { height: auto; }
  .z8-analysis-grid { grid-template-columns: 1fr; }
  .period-kpis { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .z8-page-head { align-items: flex-start; }
  .z8-page-head .inline-actions { width: 100%; }
  .z8-page-head .inline-actions .button { flex: 1; }
  .z8-filter-toolbar { grid-template-columns: minmax(0, 1fr); align-items: stretch; gap: 12px; padding: 12px; }
  .z8-filter-group, .z8-filter-group:last-child { width: 100%; align-items: flex-start; justify-content: flex-start; gap: 7px; }
  .z8-filter-group { flex-direction: column; }
  .period-picker, .metric-picker { max-width: 100%; flex-wrap: wrap; }
  .period-picker button, .metric-picker button { min-height: 44px; flex: 0 0 auto; padding-inline: 9px; }
  .z8-overview-grid { gap: 12px; }
  .z8-trend-surface .surface-head { padding-inline: 16px; }
  .z8-today-main { grid-template-columns: 1fr; gap: 10px; padding: 0 16px 14px; }
  .z8-today-main { grid-template-rows: auto auto; }
  .z8-today-primary { padding: 12px 14px; }
  .z8-today-primary .metric-value { font-size: 28px; }
  .z8-today-support-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .z8-today-support-item { gap: 5px; padding: 10px 8px; }
  .z8-support-label { font-size: 11px; }
  .z8-today-support-item > strong { font-size: 15px; }
  .z8-today-support-foot { align-items: flex-start; flex-direction: column; gap: 4px; }
  .z8-today-support-foot small { font-size: 10px; }
  .z8-today-detail { grid-template-columns: minmax(0, 1.5fr) minmax(0, .7fr) minmax(0, 1fr); gap: 0; margin-inline: 16px; }
  .z8-today-detail > div, .z8-today-detail > div:first-child { padding: 0 6px; border-right: 0; }
  .z8-today-detail > div:first-child { padding-left: 0; }
  .z8-today-detail > div:not(:last-child) { border-right: 1px solid var(--line); }
  .z8-today-detail strong { font-size: 17px; }
  .z8-today-detail small { white-space: normal; }
  .period-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 0; }
  .calendar-period-summary .period-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 0; }
  .calendar-period-summary .period-kpis span:nth-child(odd) { padding-left: 0; border-left: 0; }
  .calendar-period-summary .period-kpis span:nth-child(even) { padding-left: 10px; border-left: 1px solid var(--line); }
  .calendar-month-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .calendar-month-kpis span { padding: 9px 10px; }
  .z8-analysis-grid { gap: 16px; }
  .calendar-analysis-day { min-height: 44px; }
  .calendar-legend .calendar-source-status { flex-basis: 100%; justify-content: flex-start; margin-left: 0; text-align: left; }
  .z8-billing-surface .surface-head { align-items: flex-start; }
  .z8-billing-surface th, .z8-billing-surface td { padding-inline: 12px; }
  .z8-billing-surface th:first-child, .z8-billing-surface td:first-child { padding-left: 16px; }
  .z8-billing-surface th:last-child, .z8-billing-surface td:last-child { padding-right: 16px; }
}

/* Give each calendar day a clear date/amount hierarchy, and balance the
   primary consumption card against its supporting operating metrics. */
.z8-today-main { grid-template-rows: minmax(190px, .82fr) minmax(136px, .68fr); }
.z8-today-primary { min-height: 190px; }
.z8-today-support-list { min-height: 136px; align-content: stretch; }
.z8-today-support-item { align-content: center; padding-block: 18px; }
.z8-month-calendar .surface-head { min-height: 78px; padding-bottom: 14px; }
.z8-month-calendar .surface-body { padding-top: 2px; }
.calendar-weekdays { margin-top: 8px; }
.calendar-analysis-grid { gap: 8px; }
.calendar-analysis-day { min-height: 66px; align-items: stretch; justify-content: space-between; gap: 7px; padding: 8px 9px; border: 1px solid rgba(83, 111, 101, .14); border-radius: 10px; background: #f7faf8; }
.calendar-analysis-day > span { align-self: flex-start; min-width: 22px; height: 22px; padding: 3px 6px; border-radius: 7px; background: #e9f2ed; color: #40564d; font-size: 12px; font-weight: 700; line-height: 16px; text-align: center; }
.calendar-analysis-day > small { align-self: stretch; max-width: 100%; overflow: hidden; color: #263b35; font-size: clamp(10px, .95vw, 13px); font-weight: 700; letter-spacing: -.025em; line-height: 1.1; text-align: left; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; }
.calendar-analysis-day.has-data::after { top: 10px; right: 10px; bottom: auto; width: 6px; height: 6px; }
.calendar-analysis-day.selected > span { background: rgba(255, 255, 255, .65); }
.calendar-analysis-day.disabled > span { background: transparent; color: #bdc5c6; }
.calendar-nav { border: 1px solid rgba(78, 105, 111, .34); background: #f3f8f5; color: #30444a; font-size: 25px; font-weight: 650; box-shadow: 0 2px 7px rgba(45, 79, 83, .1); }
.calendar-nav:hover:not(:disabled) { border-color: #769a4a; background: #f1ffd0; color: #263b35; box-shadow: 0 4px 10px rgba(45, 79, 83, .14); }
.calendar-nav:focus-visible { outline: 3px solid rgba(143, 192, 44, .55); outline-offset: 2px; }
.calendar-summary-status { display: flex; justify-content: flex-end; margin-bottom: 6px; }
.calendar-summary-status .supporting { font-size: 10px; }
@media (max-width: 1100px) {
  .z8-today-main { flex: initial; grid-template-rows: auto auto; }
  .z8-today-primary { min-height: 196px; }
  .z8-today-support-list { min-height: 136px; }
}
@media (max-width: 760px) {
  .z8-today-support-list { min-height: 0; }
  .z8-today-support-item { padding-block: 10px; }
  .calendar-analysis-grid { gap: 4px; }
  .calendar-analysis-day { min-height: 58px; gap: 5px; padding: 6px 3px; border-radius: 8px; }
  .calendar-analysis-day > span { min-width: 19px; height: 19px; padding: 2px 5px; border-radius: 6px; font-size: 10px; line-height: 15px; }
  .calendar-analysis-day > small { font-size: clamp(8px, 2.35vw, 10px); letter-spacing: -.04em; text-align: center; }
  .calendar-analysis-day.has-data::after { top: 5px; right: 5px; width: 5px; height: 5px; }
  .calendar-nav { width: 40px; height: 40px; }
}

/* Custom dates open as a compact overlay below the period controls. */
.z8-filter-toolbar { position: relative; z-index: 12; }
.z8-period-group { position: relative; z-index: 2; }
.period-picker button[aria-expanded="true"] { background: #f0ffc9; color: var(--ink); box-shadow: 0 2px 7px rgba(158, 205, 29, .18); }
.z8-custom-date-popover { position: absolute; top: calc(100% + 10px); left: 0; z-index: 30; width: min(440px, calc(100vw - 36px)); padding: 16px; border: 1px solid rgba(84, 117, 110, .22); border-radius: 14px; background: #fff; box-shadow: 0 18px 44px rgba(35, 64, 60, .18), 0 3px 10px rgba(35, 64, 60, .08); }
.z8-custom-date-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.z8-custom-date-fields label { display: grid; gap: 6px; min-width: 0; color: #64747a; font-size: 11px; font-weight: 600; }
.z8-custom-date-fields input { min-width: 0; min-height: 42px; margin: 0; padding: 7px 10px; border-color: rgba(118, 157, 161, .3); border-radius: 9px; background: #fbfdfc; font-size: 13px; font-variant-numeric: tabular-nums; }
.z8-custom-date-fields input:focus-visible { border-color: #91b83c; outline: 3px solid rgba(158, 205, 29, .2); outline-offset: 1px; }
.z8-custom-date-error { margin: 10px 0 0; color: #b5473d; font-size: 12px; line-height: 1.4; }
.z8-custom-date-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; padding-top: 12px; border-top: 1px solid rgba(118, 157, 161, .14); }
.z8-custom-date-actions .button { min-height: 36px; border-radius: 9px; padding-inline: 13px; font-size: 12px; }
.z8-custom-date-actions .button-primary:disabled { cursor: not-allowed; opacity: .45; box-shadow: none; }
@media (max-width: 760px) {
  .z8-custom-date-popover { top: calc(100% + 8px); width: min(440px, calc(100vw - 56px)); padding: 14px; }
  .z8-custom-date-fields { gap: 8px; }
  .z8-custom-date-fields input { padding-inline: 6px; font-size: 12px; }
}

/* Align the lower dividers and give the operating metrics more legible type. */
@media (min-width: 1101px) {
  .z8-month-calendar { display: flex; flex-direction: column; }
  .z8-month-calendar .surface-body { display: flex; flex: 1 1 auto; flex-direction: column; }
  .calendar-period-summary { margin-top: auto; }
  .z8-today-detail, .calendar-period-summary { min-height: 117px; }
  .z8-today-detail { margin-bottom: 26px; }
}
.z8-support-label { color: #526166; font-size: 13px; font-weight: 600; line-height: 1.35; }
.z8-today-support-item > strong { font-size: 24px; line-height: 1.15; letter-spacing: -.035em; }
.z8-today-support-foot { gap: 8px; }
.z8-today-support-foot small { flex: 1 1 auto; min-width: 0; color: #718084; font-size: 12px; line-height: 1.4; }
.operating-status-dot { display: inline-block; width: 9px; height: 9px; flex: 0 0 9px; border-radius: 50%; vertical-align: middle; }
.operating-status-dot.is-confirmed { background: var(--success); box-shadow: 0 0 0 3px rgba(56, 158, 13, .14); }
.operating-status-dot.is-pending { background: var(--warning); box-shadow: 0 0 0 3px rgba(212, 136, 6, .16); }
.operating-status-dot.is-unknown { background: #cf1322; box-shadow: 0 0 0 3px rgba(207, 19, 34, .13); }
.z8-today-primary .operating-status-dot.is-confirmed { background: #1677ff; box-shadow: 0 0 0 3px rgba(22, 119, 255, .18); }
.z8-quality-indicator { display: flex !important; min-height: 12px; align-items: center; }
@media (max-width: 760px) {
  .z8-today-detail { min-height: 0; margin-bottom: 0; }
  .z8-support-label { font-size: 12px; }
  .z8-today-support-item > strong { font-size: 17px; }
  .z8-today-support-foot { flex-direction: row; align-items: flex-start; gap: 5px; }
  .z8-today-support-foot small { font-size: 11px; }
  .z8-today-support-foot .operating-status-dot { margin-top: 4px; }
}

/* Keep both selectors on the left; turn the reclaimed toolbar space into a working balance alert panel. */
.z8-filter-toolbar { grid-template-columns: minmax(0, .94fr) minmax(0, 1.06fr); align-items: stretch; gap: 14px; }
.z8-filter-controls { display: flex; min-width: 0; align-items: flex-end; justify-content: flex-start; flex-wrap: nowrap; gap: 8px; }
.z8-filter-controls .z8-filter-group { display: flex; width: auto; min-width: 0; flex-direction: column; align-items: flex-start; justify-content: flex-start; gap: 5px; }
.z8-filter-controls .z8-period-group { flex: 1 1 460px; max-width: 460px; }
.z8-filter-controls .z8-metric-group { flex: 0 0 auto; }
.z8-filter-controls .toolbar-label { color: #718084; font-size: 10px; font-weight: 650; letter-spacing: .04em; }
.z8-filter-controls .period-picker { width: 100%; min-width: 0; max-width: none; flex-wrap: nowrap; gap: 2px; overflow-x: auto; padding: 2px; border-radius: 5px; }
.z8-filter-controls .period-picker button { min-height: 32px; flex: 1 0 auto; padding: 4px 8px; border-radius: 4px; font-size: 11px; line-height: 1; white-space: nowrap; }
.z8-filter-controls .metric-picker { width: max-content; max-width: 100%; flex-wrap: nowrap; gap: 2px; padding: 2px; border-radius: 5px; }
.z8-filter-controls .metric-picker button { min-width: 44px; min-height: 32px; flex: 1 0 44px; padding: 4px 8px; border-radius: 4px; font-size: 11px; line-height: 1; white-space: nowrap; }
.z8-filter-controls .metric-picker button[aria-pressed="true"] { box-shadow: 0 1px 3px rgba(31, 31, 31, .12); }
.z8-balance-alert-panel { display: grid; min-width: 0; grid-template-rows: auto auto; align-content: start; gap: 6px; padding: 10px 12px; border-left: 1px solid rgba(118, 157, 161, .2); border-radius: 8px; background: linear-gradient(135deg, #fffaf7 0%, #fff 72%); }
.z8-balance-alert-head { display: flex; min-height: 20px; align-items: center; gap: 7px; }
.z8-balance-alert-head .toolbar-label { color: #8e513a; font-size: 11px; font-weight: 700; }
.z8-balance-alert-count { display: inline-flex; min-width: 19px; height: 19px; align-items: center; justify-content: center; padding: 0 5px; border: 1px solid rgba(207, 19, 34, .16); border-radius: 99px; background: #fff1ef; color: #b42318; font-size: 10px; font-weight: 700; font-variant-numeric: tabular-nums; }
.z8-balance-alert-panel:not(.has-warning) .z8-balance-alert-count { border-color: rgba(56, 120, 83, .16); background: #eff7f0; color: #4f785e; }
.z8-balance-alert-list { display: flex; min-width: 0; min-height: 34px; max-height: none; align-items: center; gap: 8px; overflow-x: auto; overflow-y: hidden; padding: 2px 2px 6px; scrollbar-color: rgba(142, 81, 58, .32) transparent; scrollbar-width: thin; scroll-snap-type: x proximity; }
.z8-balance-alert-list.is-empty { align-items: center; overflow: hidden; padding: 2px 0; }
.z8-balance-alert-list::-webkit-scrollbar { height: 5px; }
.z8-balance-alert-list::-webkit-scrollbar-thumb { border-radius: 99px; background: rgba(142, 81, 58, .32); }
.z8-balance-alert-item { display: flex; min-width: 0; min-height: 34px; flex: 0 0 clamp(145px, 24%, 190px); align-items: center; justify-content: space-between; gap: 8px; padding: 4px 8px; border: 1px solid rgba(207, 19, 34, .13); border-radius: 6px; background: rgba(255, 255, 255, .9); color: #425054; cursor: pointer; scroll-snap-align: start; text-align: left; transition: border-color .15s ease, background-color .15s ease, transform .15s ease; }
.z8-balance-alert-item:hover { transform: translateY(-1px); border-color: rgba(207, 19, 34, .32); background: #fff4f1; }
.z8-balance-alert-item:focus-visible { outline: 2px solid rgba(207, 19, 34, .38); outline-offset: 2px; }
.z8-balance-alert-identity { display: flex; min-width: 0; flex: 1 1 auto; align-items: center; }
.z8-balance-alert-identity strong { max-width: 5em; overflow: hidden; color: #36464a; font-size: 12px; font-weight: 650; line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; }
.z8-balance-alert-amount { flex: 0 0 auto; color: #b42318; font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.z8-balance-alert-empty { display: flex; min-height: 31px; align-items: center; gap: 8px; margin: 0; color: #7a888b; font-size: 11px; }
.z8-balance-alert-empty .button { min-height: 22px; padding: 2px 6px; border-color: transparent; color: #657579; font-size: 10px; }
@media (max-width: 1100px) {
  .z8-filter-toolbar { grid-template-columns: minmax(0, 1fr); }
  .z8-balance-alert-panel { min-height: 76px; border-top: 1px solid rgba(118, 157, 161, .18); border-left: 0; }
}
@media (max-width: 760px) {
  .z8-filter-controls { gap: 8px; }
  .z8-filter-controls .z8-period-group { flex: 1 1 0; max-width: none; }
  .z8-filter-controls .z8-metric-group { flex: 0 0 auto; }
  .z8-filter-controls .period-picker { max-width: 100%; overflow-x: auto; flex-wrap: nowrap; }
  .z8-filter-controls .period-picker button { min-height: 32px; flex: 0 0 auto; padding-inline: 8px; font-size: 11px; }
  .z8-filter-controls .metric-picker { flex-wrap: nowrap; overflow-x: auto; }
  .z8-filter-controls .metric-picker button { min-height: 32px; flex: 0 0 44px; padding-inline: 6px; }
  .z8-balance-alert-panel { padding: 9px 10px; }
  .z8-balance-alert-list { max-height: none; overflow-x: auto; overflow-y: hidden; }
  .z8-balance-alert-item { flex-basis: clamp(145px, 48%, 190px); }
}

/* Keep the sidebar pull handle on the rail edge, centered below the header. */
#app-shell { --sidebar-width: 216px; position: relative; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); }
#app-shell.sidebar-collapsed { --sidebar-width: 68px; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); }
.sidebar-toggle { position: fixed; top: calc(50vh + 32px); left: calc(var(--sidebar-width) - 13px); z-index: 39; display: grid; width: 26px; height: 48px; flex: none; place-items: center; padding: 0; transform: translateY(-50%); border: 1px solid rgba(100, 116, 122, .25); border-radius: 999px; background: rgba(255, 255, 255, .94); color: #64747a; box-shadow: 0 3px 10px rgba(39, 66, 69, .12); transition: left 180ms ease-out, background-color 180ms ease-out, color 180ms ease-out, box-shadow 180ms ease-out; }
.sidebar-toggle:hover { background: #f0ffc9; color: var(--ink); box-shadow: 0 4px 12px rgba(39, 66, 69, .18); }
.sidebar-toggle svg { width: 12px; height: 12px; transition: transform 180ms ease-out; }
.sidebar-toggle[aria-expanded="false"] svg { transform: rotate(180deg); }
@media (min-width: 761px) and (max-width: 1100px) {
  #app-shell { --sidebar-width: 208px; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); }
}
@media (max-width: 760px) {
  #app-shell { --sidebar-width: 0px; }
  .sidebar-toggle { top: calc(50vh + 32px); left: 8px; width: 40px; height: 48px; }
  #app-shell.nav-open .sidebar-toggle { left: calc(min(280px, calc(100vw - 48px)) - 20px); }
}

/* Match the filter labels and their controls across all three desktop groups. */
@media (min-width: 1101px) {
  .z8-filter-controls .toolbar-label { display: flex; min-height: 20px; align-items: center; line-height: 20px; }
  .z8-balance-alert-panel { grid-template-rows: 20px 36px; align-content: end; gap: 5px; padding: 0 12px; }
  .z8-balance-alert-head { min-height: 20px; }
  .z8-balance-alert-head .toolbar-label { display: flex; min-height: 20px; align-items: center; line-height: 20px; }
  .z8-balance-alert-list { min-height: 36px; padding: 0 2px; }
}

/* Mobile filters use compact labels; desktop keeps the full control names. */
.filter-label-mobile, .z8-balance-notice { display: none; }
/* One grid definition keeps account headers and values on the same columns. */
.upstream-account-list { --account-columns: minmax(0, 1.45fr) minmax(220px, 1fr) minmax(160px, .85fr) 168px; }
.upstream-account-list .list-head, .upstream-account-list .account-row { grid-template-columns: var(--account-columns); gap: 20px; padding-inline: 24px; }
.upstream-account-list .list-head > span { text-align: left; }
.upstream-account-list .list-head > span:first-child { margin-left: 50px; }
.upstream-account-list .account-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upstream-account-list .account-name small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upstream-account-list .account-status { margin-left: 0; text-align: left; }
.upstream-account-list .row-actions { display: flex; flex-direction: row; align-items: center; justify-content: flex-start; flex-wrap: nowrap; gap: 8px; }
.row-action { position: relative; display: grid; width: 36px; height: 36px; flex: none; place-items: center; padding: 0; border: 1px solid #e4e9e4; border-radius: 7px; background: white; color: #64756c; cursor: pointer; transition: background-color .15s, border-color .15s, color .15s; }
.row-action svg { width: 17px; height: 17px; }
.row-action:hover { border-color: #bdd79a; background: #f0ffc9; color: #304632; }
.row-action.is-danger { border-color: #f0dfdb; color: #ba463c; }
.row-action.is-danger:hover { border-color: #e8b0a7; background: #fff1ee; color: #ad2119; }
.row-action:focus-visible { outline: 2px solid #669724; outline-offset: 2px; }
.row-action.is-danger:focus-visible { outline-color: #ba463c; }
.row-action:disabled { opacity: .45; cursor: wait; }
.row-action-tip { position: absolute; bottom: calc(100% + 7px); left: 50%; z-index: 3; width: max-content; padding: 5px 8px; transform: translateX(-50%); border-radius: 5px; background: #263a30; color: white; font-size: 11px; font-weight: 500; line-height: 1.4; white-space: nowrap; pointer-events: none; opacity: 0; visibility: hidden; }
.row-action:hover .row-action-tip, .row-action:focus-visible .row-action-tip { opacity: 1; visibility: visible; }
dialog.account-delete-dialog { width: min(430px, calc(100% - 32px)); border-radius: 14px; }
.account-delete-dialog .dialog-head { padding: 18px 22px; }
.account-delete-dialog .dialog-head h2 { font-size: 20px; }
.account-delete-dialog .dialog-body { padding: 20px 22px; }
.delete-account-identity { display: flex; align-items: center; gap: 12px; }
.delete-account-symbol { display: grid; width: 42px; height: 42px; flex: none; place-items: center; border-radius: 10px; background: #fff0ec; color: #b42318; }
.delete-account-symbol svg { width: 21px; height: 21px; }
.delete-account-identity strong { display: block; color: var(--ink); font-size: 16px; }
.delete-account-identity > div > span { display: block; margin-top: 3px; color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.account-delete-dialog .dialog-body > p { margin: 16px 0 0; font-size: 13px; line-height: 1.65; }
.account-delete-dialog .dialog-footer { flex-direction: row; justify-content: flex-end; padding: 14px 22px; }
.account-delete-dialog .delete-confirm-button { border-color: #b42318; background: #b42318; color: white; }
.account-delete-dialog .delete-confirm-button:hover { background: #981b12; }
@media (max-width: 1100px) {
  .upstream-account-list .list-head { display: none; }
  .upstream-account-list .account-row { grid-template-columns: minmax(0, 1fr) minmax(200px, .65fr); gap: 14px 18px; }
  .upstream-account-list .account-identity { grid-column: 1; grid-row: 1; }
  .upstream-account-list .account-row > div:nth-child(2) { grid-column: 2; grid-row: 1; }
  .upstream-account-list .account-status { grid-column: 1; grid-row: 2; }
  .upstream-account-list .row-actions { grid-column: 2; grid-row: 2; }
}
@media (max-width: 760px) {
  .upstream-account-list .account-row { grid-template-columns: minmax(0, 1fr); gap: 14px; padding: 18px; }
  .upstream-account-list .account-identity { grid-column: 1; grid-row: 1; }
  .upstream-account-list .account-row > div:nth-child(2) { grid-column: 1; grid-row: 2; }
  .upstream-account-list .account-status { grid-column: 1; grid-row: 3; }
  .upstream-account-list .account-status small { display: inline; margin-left: 8px; }
  .upstream-account-list .row-actions { grid-column: 1; grid-row: 4; justify-content: flex-end; }
  .row-action { width: 44px; height: 44px; }
}
dialog.account-create { width: min(580px, calc(100% - 32px)); max-height: calc(100dvh - 32px); overflow: hidden; border-radius: 16px; }
dialog.account-create[open] { display: flex; flex-direction: column; }
.account-create .dialog-head { padding: 20px 24px; }
.account-create .dialog-head h2 { font-size: 22px; }
.account-create .dialog-head .icon-button { width: 36px; height: 36px; }
.account-create .dialog-body { min-height: 0; overflow-y: auto; padding: 20px 24px 12px; }
.account-create-progress { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 14px; }
.account-create-progress button { display: flex; min-height: 44px; align-items: center; justify-content: center; gap: 8px; padding: 6px; border: 1px solid var(--line); border-radius: 8px; background: #f7f9f7; color: #718077; font-size: 12px; font-weight: 650; cursor: pointer; }
.account-create-progress button > span { display: grid; width: 21px; height: 21px; place-items: center; border-radius: 50%; background: #e8eee8; font-size: 11px; }
.account-create-progress button[aria-current="step"] { border-color: #b4dd4a; background: #f1ffce; color: var(--ink); }
.account-create-progress button[aria-current="step"] > span { background: var(--accent); }
.account-create-progress button.is-complete { border-color: #d4dfce; color: #506b48; }
.account-create-progress button:focus-visible { outline: 2px solid #669724; outline-offset: 2px; }
.account-create [data-create-panel] { min-height: 204px; }
.account-create .form-columns { gap: 0 14px; }
.account-create .field { min-width: 0; margin: 14px 0 0; font-size: 12px; }
.account-create .field > span { margin-bottom: 7px; font-weight: 600; }
.account-create .field input, .account-create .field select { min-width: 0; min-height: 42px; padding: 8px 10px; border-radius: 8px; font-size: 14px; }
.account-create .inline-message:empty { display: none; }
.account-create .dialog-footer { flex: none; flex-direction: row; justify-content: flex-end; padding: 14px 24px; }
.account-create .dialog-footer [data-action="create-back"] { margin-right: auto; }
.account-create .dialog-footer .button { min-height: 42px; padding: 8px 18px; border-radius: 8px; font-size: 13px; }
@media (max-width: 760px) {
  .account-create .dialog-head { padding: 16px 18px; }
  .account-create .dialog-body { padding: 16px 18px 12px; }
  .account-create .dialog-footer { padding: 12px 18px; }
  .account-create-progress { gap: 5px; }
  .account-create-progress button { gap: 5px; font-size: 11px; white-space: nowrap; }
  .account-create .form-columns { grid-template-columns: 1fr; }
  .account-create .field input, .account-create .field select { min-height: 44px; font-size: 16px; }
  .account-create .dialog-footer .button { min-height: 44px; }
  .account-create [data-create-panel] { min-height: 260px; }
}
.calendar-analysis-day.has-data.live-data::after, .calendar-dot.live-dot { background: #1677ff; }
.calendar-dot.live-dot { border: 1px solid #1677ff; }
.calendar-legend > span { white-space: nowrap; }
@media (max-width: 760px) {
  .z8-filter-toolbar { grid-template-columns: minmax(0, 1fr) 36px; align-items: center; gap: 10px; padding: 10px; border-radius: 12px; }
  .z8-filter-toolbar:has(.balance-notice-popover, .z8-custom-date-popover) { z-index: 40; }
  .z8-filter-controls { align-items: center; gap: 8px; }
  .z8-filter-controls .toolbar-label, .filter-label-desktop, .z8-filter-toolbar > .z8-balance-alert-panel { display: none; }
  .filter-label-mobile { display: inline-flex; align-items: center; justify-content: center; }
  .filter-label-mobile svg { width: 16px; height: 16px; }
  .z8-filter-controls .z8-period-group { position: static; flex: 1 1 0; }
  .z8-filter-controls .z8-metric-group { flex: 0 0 auto; }
  .z8-filter-controls .period-picker { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 2px; overflow: visible; padding: 2px; border: 0; border-radius: 8px; background: #f2f6f4; }
  .z8-filter-controls .metric-picker { display: grid; grid-template-columns: repeat(4, 32px); gap: 2px; overflow: visible; padding: 2px; border: 0; border-radius: 8px; background: #f2f6f4; }
  .z8-filter-controls .period-picker button, .z8-filter-controls .metric-picker button { display: flex; min-width: 0; min-height: 36px; align-items: center; justify-content: center; padding: 0 2px; border-radius: 6px; font-size: 11px; font-weight: 650; line-height: 1; }
  .z8-filter-controls .period-picker button:active, .z8-filter-controls .metric-picker button:active { transform: scale(.94); }
  .z8-custom-date-popover { top: calc(100% + 8px); left: 8px; width: calc(100% - 16px); max-width: 440px; }
  .z8-balance-notice { display: block; align-self: center; }
  .balance-notice-trigger { position: relative; display: grid; width: 36px; height: 40px; place-items: center; padding: 0; border: 0; border-radius: 8px; background: #f2f6f4; color: #536662; cursor: pointer; }
  .balance-notice-trigger svg { width: 18px; height: 18px; }
  .has-warning .balance-notice-trigger { background: #fff4ef; color: #9d4630; }
  .balance-notice-trigger[aria-expanded="true"] { box-shadow: inset 0 0 0 1px #b8c6bb; }
  .balance-notice-trigger:active { background: #e9efeb; }
  .balance-notice-badge { position: absolute; top: -4px; right: -3px; display: grid; min-width: 17px; height: 17px; place-items: center; padding: 0 4px; border: 2px solid white; border-radius: 20px; background: #647a6b; color: white; font-size: 10px; font-weight: 750; line-height: 1; font-variant-numeric: tabular-nums; }
  .has-warning .balance-notice-badge { background: #b42318; }
  .balance-notice-popover { position: absolute; top: calc(100% + 8px); right: 8px; z-index: 30; width: min(360px, calc(100% - 16px)); max-height: min(520px, 65vh); max-height: min(520px, 65dvh); overflow-y: auto; overscroll-behavior: contain; border: 1px solid var(--line); border-radius: 14px; background: white; box-shadow: 0 16px 40px rgba(35, 64, 60, .18); }
  .balance-notice-heading { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; border-bottom: 1px solid #edf1ee; background: white; }
  .balance-notice-heading h2 { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 15px; font-weight: 700; }
  .balance-notice-heading h2 span { color: #b42318; font-size: 12px; font-variant-numeric: tabular-nums; }
  .balance-notice-heading button { display: grid; width: 36px; height: 36px; place-items: center; padding: 0; border: 0; border-radius: 8px; background: #f5f7f6; color: #64747a; cursor: pointer; }
  .balance-notice-heading button svg { width: 16px; height: 16px; }
  .balance-notice-list { display: grid; gap: 0; margin: 0; padding: 0 14px; list-style: none; }
  .balance-notice-item { min-width: 0; padding: 16px 0; }
  .balance-notice-item + .balance-notice-item { border-top: 1px solid #edf1ee; }
  .balance-notice-item-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; color: #304640; font-size: 15px; }
  .balance-notice-item-head > strong:first-child { min-width: 0; overflow-wrap: anywhere; }
  .balance-notice-amount { flex: none; color: #b42318; font-size: 18px; font-variant-numeric: tabular-nums; }
  .balance-notice-address { margin: 6px 0 10px; color: #596d66; font-size: 12px; overflow-wrap: anywhere; }
  .balance-notice-address a { color: inherit; text-decoration-color: #c4d0ca; text-underline-offset: 3px; }
  .balance-notice-address svg { width: 11px; height: 11px; margin-left: 5px; vertical-align: middle; }
  .balance-notice-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; color: #68776f; font-size: 11px; }
  .balance-notice-status { padding: 2px 6px; border-radius: 5px; background: #fff1ec; color: #9d4630; }
  .balance-notice-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
  .balance-notice-actions button, .balance-notice-retry { display: inline-flex; min-height: 36px; align-items: center; justify-content: center; gap: 6px; padding: 0 12px; border: 1px solid #dce5dd; border-radius: 7px; background: white; color: #40554a; font-size: 12px; font-weight: 650; cursor: pointer; }
  .balance-notice-actions button:last-child { border-color: #c4db9a; background: #f0ffc9; }
  .balance-notice-actions svg { width: 12px; height: 12px; }
  .balance-notice-empty { display: grid; justify-items: center; gap: 8px; padding: 30px 14px; color: #6d7c73; font-size: 13px; }
  .balance-notice-empty svg { width: 24px; height: 24px; }
  .balance-notice-empty p { margin: 0; }
  .balance-notice-feedback { margin: 12px 14px 0; color: #9d4630; font-size: 12px; }
  .balance-notice-retry { margin: 0 14px 14px; }
  .z8-balance-notice button:focus-visible, .balance-notice-address a:focus-visible { outline: 2px solid #669724; outline-offset: 2px; }
}
@media (max-width: 479px) {
  .z8-filter-toolbar { gap: 6px 10px; }
  .z8-filter-controls { display: contents; }
  .z8-filter-controls .z8-period-group { grid-column: 1 / -1; grid-row: 1; }
  .z8-filter-controls .z8-metric-group { grid-column: 1; grid-row: 2; }
  .z8-balance-notice { grid-column: 2; grid-row: 2; }
}

/* User ledgers share the operating dashboard's scope and typography. */
.billing-head{display:flex;align-items:center;justify-content:space-between;gap:24px;padding:26px 32px 0}
.billing-head .eyebrow{display:block;margin-bottom:12px}
.billing-tabs{display:flex;gap:24px}
.billing-tabs button{border:0;border-bottom:3px solid transparent;background:none;padding:0 0 16px;font:inherit;font-size:18px;font-weight:600;color:var(--muted,#6b7a7e);cursor:pointer;white-space:nowrap}
.billing-tabs button[aria-selected="true"]{border-color:var(--accent,#b8ff2c);color:var(--ink,#192520)}
.billing-toolbar{display:flex;align-items:center;gap:10px;flex-wrap:wrap;padding:20px 32px;border-top:1px solid var(--line,#e1e7e7)}
.billing-toolbar input,.billing-toolbar select{min-height:38px;font-size:14px;border:1px solid var(--line,#e1e7e7);border-radius:8px;padding:8px 10px;background:#fff;width:auto;max-width:240px}
.billing-search{display:flex;gap:6px}.billing-search input{width:210px}.billing-toolbar .button{min-height:38px;padding:8px 12px;font-size:14px}
.billing-view-toggle{display:flex;border:1px solid var(--line,#e1e7e7);border-radius:8px;padding:3px;background:#f6f8f8}
.billing-view-toggle button{font:inherit;font-size:14px;padding:6px 12px;border:0;border-radius:5px;color:#637270;background:transparent;cursor:pointer}
.billing-view-toggle button[aria-pressed="true"]{background:#eaffbb;color:#20340d;font-weight:600}
.billing-summary{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:16px;margin:0 32px;padding:18px 20px;background:#f6f9f7;border:1px solid #e4ece7;border-radius:12px}
.billing-summary>div{display:flex;flex-direction:column;gap:8px;min-width:0}.billing-summary span{font-size:13px;color:#72827c}.billing-summary strong{font-size:23px;font-weight:600;font-variant-numeric:tabular-nums;overflow-wrap:anywhere}.billing-summary small{font-size:13px;font-weight:400}
.billing-status{display:flex;justify-content:space-between;gap:12px;padding:14px 32px;font-size:12px;color:#7b8983}.billing-incomplete{color:#a77613}
.billing-table{table-layout:auto}.billing-table th{white-space:nowrap;vertical-align:top}.billing-table td{padding-top:18px;padding-bottom:18px;vertical-align:top}.billing-table td small{display:block;font-size:12px;color:#778680;margin-top:4px}.billing-recharge-cell{min-width:178px}.recharge-breakdown{line-height:1.45}
.billing-user-name{font-size:14px;font-weight:600}.billing-user-link{font:inherit;background:none;border:0;padding:0;text-align:left;color:inherit;cursor:pointer}.billing-user-link:hover .billing-user-name{text-decoration:underline}.billing-user-link small{display:block}
.billing-rank{width:55px;color:#84928b}.billing-amount{font-weight:600}.billing-channel{display:inline-block;padding:4px 8px;border-radius:5px;background:#eff5f2;font-size:12px}.billing-negative{color:#a0492f}
.billing-empty{padding:40px 32px;color:#7a8a82;text-align:center}.billing-pagination{display:flex;align-items:center;justify-content:flex-end;gap:12px;padding:18px 32px;font-size:13px;color:#738078}.billing-pagination>span:first-child{margin-right:auto}
@media(max-width:760px){.billing-head{padding:22px 18px 0;align-items:flex-start;gap:12px;flex-direction:column}.billing-head>.supporting{font-size:12px;padding-bottom:12px}.billing-tabs{gap:20px}.billing-tabs button{font-size:16px;padding-bottom:10px;min-height:40px}.billing-toolbar{padding:16px 18px;gap:8px}.billing-search{width:100%}.billing-search input{flex:1;min-width:0;max-width:none}.billing-toolbar select{flex:1;max-width:none;min-width:110px;min-height:42px}.billing-view-toggle button{min-height:36px}.billing-summary{margin:0 18px;grid-template-columns:repeat(2,minmax(0,1fr));padding:16px}.billing-summary strong{font-size:21px}.billing-status{padding:14px 18px;flex-wrap:wrap}.billing-pagination{padding:16px 18px;gap:8px}.billing-table{min-width:680px}}
.upstream-recharge-summary{grid-template-columns:repeat(7,minmax(0,1fr))}
.upstream-recharge-statuses{display:flex;flex-wrap:wrap;gap:8px;padding:16px 32px 0}
.upstream-recharge-state{display:flex;align-items:center;gap:7px;padding:7px 10px;border:1px solid #e6ece8;border-radius:8px;background:#fff;font:inherit;font-size:12px;cursor:pointer;color:#738179}
.upstream-recharge-state strong{color:#35483d;font-size:13px}.recharge-state-dot{width:7px;height:7px;flex-shrink:0;border-radius:50%;background:#e26e62}.recharge-state-dot.complete{background:#78ad2d}.recharge-state-dot.pending{background:#dca328}
.upstream-recharge-note{margin:16px 32px 20px;color:#77867f;font-size:12px}.upstream-recharge-note summary{cursor:pointer}.upstream-recharge-note p{line-height:1.7;margin-top:10px}
.billing-head>div{min-width:0;max-width:100%}
@media(max-width:1100px){.upstream-recharge-summary{grid-template-columns:repeat(4,minmax(0,1fr))}}
@media(max-width:980px){.upstream-recharge-summary{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:760px){.billing-tabs{gap:12px;overflow-x:auto;max-width:100%}.billing-tabs button{font-size:14px;min-height:44px;flex-shrink:0}.upstream-recharge-summary{grid-template-columns:repeat(2,minmax(0,1fr))}.upstream-recharge-statuses{padding:14px 18px 0}.upstream-recharge-note{margin:16px 18px}}
