:root {
  color: #182230;
  background: #f5f7fa;
  font-family: Inter, "Segoe UI", "Microsoft YaHei", sans-serif;
  font-synthesis: none;
  --blue: #245fda;
  --blue-dark: #1f50b6;
  --line: #dfe4eb;
  --line-soft: #edf0f4;
  --muted: #667085;
  --surface: #ffffff;
  --success: #087451;
  --danger: #b42318;
  --warning: #9a6700;
}

.traffic-analytics-dialog {
  width: min(980px, calc(100vw - 28px));
  max-height: calc(100dvh - 40px);
  border: 2px solid var(--line);
  border-radius: 0;
  background: #fbfafc;
  box-shadow: 8px 8px 0 rgba(23, 19, 31, .13);
  padding: 20px;
  overflow: auto;
}

.traffic-analytics-dialog::backdrop {
  background: rgba(16, 12, 23, .48);
  backdrop-filter: blur(3px);
}

.analytics-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.analytics-dialog-head strong { color: var(--ink); font-size: 18px; }
.analytics-periods { width: fit-content; margin-top: 16px; }
.analytics-status { min-height: 18px; margin: 8px 0 0; color: var(--muted); font-size: 11px; }
.analytics-status.error { color: var(--danger); }
.analytics-status.warning { color: var(--warning); }

.analytics-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 8px;
  border: 1px solid var(--line);
}

.analytics-trend { margin-top: 22px; }
.analytics-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.analytics-section-head h3 { margin: 0; color: var(--ink); font-size: 15px; }
.analytics-chart-reset { padding: 5px 10px; font-size: 10px; }
.analytics-chart-wrap { min-height: 260px; padding: 8px 6px 4px; background: #fff; }
.analytics-chart-wrap canvas { height: 250px; touch-action: pan-y; }
.analytics-chart-legend { min-height: 31px; margin-top: 4px; }
.analytics-observers {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  min-height: 24px;
  margin-top: 12px;
}
.analytics-observer {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  padding: 4px 7px;
  font-size: 10px;
}
.analytics-observer[data-state="success"] { border-color: #b7dfd1; color: var(--success); }
.analytics-observer[data-state="error"] { border-color: #f0b7b1; color: var(--danger); }
.analytics-observer[data-state="running"] { border-color: #f1d18a; color: var(--warning); }
.analytics-observer[data-state="stale"] {
  border-color: #ead9ad;
  background: #fffbf1;
  color: #9a6908;
}

.analytics-metrics article { min-width: 0; padding: 16px; }
.analytics-metrics article + article { border-left: 1px solid var(--line-soft); }
.analytics-metrics span { display: block; color: var(--muted); font-size: 11px; }
.analytics-metrics strong {
  display: block;
  margin-top: 7px;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 20px;
  font-variant-numeric: tabular-nums;
}

.analytics-ranking-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
  margin-top: 22px;
}

.analytics-ranking-grid section { min-width: 0; }
.analytics-ranking-grid h3 { margin: 0 0 8px; color: var(--ink); font-size: 15px; }
.analytics-ranking-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.analytics-ranking-table th,
.analytics-ranking-table td {
  border-top: 1px solid var(--line-soft);
  padding: 9px 4px;
  text-align: left;
  overflow-wrap: anywhere;
}
.analytics-ranking-table th { color: var(--muted); font-size: 10px; font-weight: 650; }
.analytics-ranking-table td { color: var(--ink); font-size: 11px; }
.analytics-ranking-table th:nth-child(2),
.analytics-ranking-table td:nth-child(2) { width: 60px; text-align: right; white-space: nowrap; }
.analytics-ranking-table th:nth-child(3),
.analytics-ranking-table td:nth-child(3) { width: 86px; text-align: right; white-space: nowrap; }
.analytics-ranking-table td:first-child span { font-weight: 650; }
.analytics-evidence { display: inline-block; margin-left: 6px; color: #735f96; font-size: 9px; }
.analytics-empty { color: var(--muted) !important; text-align: center !important; }
.analytics-unknown-row td { color: var(--muted); }
.analytics-coverage-note { display: block; margin-top: 2px; color: var(--muted); font-size: 9px; }

@media (max-width: 820px) {
  .analytics-ranking-grid { grid-template-columns: 1fr; gap: 18px; }
}

@media (max-width: 620px) {
  .traffic-analytics-dialog {
    width: calc(100vw - 18px);
    max-height: calc(100dvh - 18px);
    padding: 16px;
  }
  .analytics-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .analytics-metrics article:nth-child(3) { border-left: 0; border-top: 1px solid var(--line-soft); }
  .analytics-metrics article:nth-child(3) { grid-column: 1 / -1; }
  .analytics-metrics strong { font-size: 18px; }
  .analytics-periods { display: grid; grid-template-columns: repeat(3, 1fr); width: 100%; }
  .analytics-chart-wrap { min-height: 230px; }
  .analytics-chart-wrap canvas { height: 220px; }
}

@media (display-mode: standalone) {
  html.pwa-standalone .traffic-analytics-dialog {
    width: calc(100vw - 24px);
    max-height: calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 24px);
    border: 0;
    border-radius: 26px;
    box-shadow: 0 20px 60px rgba(35, 27, 55, .20);
  }
}

* { box-sizing: border-box; }

body { margin: 0; min-width: 320px; }

button, input, select { font: inherit; }

button {
  border: 1px solid var(--blue);
  border-radius: 7px;
  background: var(--blue);
  color: #fff;
  padding: 8px 14px;
  cursor: pointer;
}

button:hover { background: var(--blue-dark); }
button:disabled { cursor: not-allowed; opacity: .55; }

.button-secondary {
  border-color: #cbd3df;
  background: #fff;
  color: #344054;
}

.button-secondary:hover { background: #f7f8fa; }

.button-quiet-danger {
  border-color: #d8dde6;
  background: #fff;
  color: #596579;
}

.button-quiet-danger:hover {
  border-color: #c8a4a0;
  background: #fafafa;
  color: #9e342b;
}

input, select {
  width: 100%;
  border: 1px solid #cbd3df;
  border-radius: 7px;
  background: #fff;
  color: #182230;
  padding: 8px 10px;
}

input:focus, select:focus {
  border-color: var(--blue);
  outline: 3px solid rgba(36, 95, 218, .12);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 64px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  padding: 12px max(20px, calc((100vw - 1120px) / 2));
}

.brand { display: flex; align-items: baseline; gap: 10px; }
.brand h1 { margin: 0; font-size: 19px; letter-spacing: -.02em; }
.brand span { color: var(--muted); font-size: 13px; }

.page-shell { max-width: 1120px; margin: 0 auto; padding: 22px 20px 44px; }

.login-shell {
  min-height: calc(100vh - 64px);
  display: grid;
  place-items: center;
  padding: 32px 18px;
}

.login-shell[hidden], .page-shell[hidden] { display: none; }

.login-card {
  width: min(420px, 100%);
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
  box-shadow: 0 16px 40px rgba(24, 34, 48, .07);
  padding: 28px;
}

.login-card h2 { margin: 0 0 6px; font-size: 23px; }
.login-card > p, .login-card > small { color: var(--muted); line-height: 1.55; }
.login-card form { display: grid; gap: 14px; margin: 22px 0 12px; }
.login-card label { display: grid; gap: 6px; color: #475467; font-size: 13px; }
.login-card button { margin-top: 2px; padding: 10px 15px; }
.login-card .status { min-height: 20px; margin: 0 0 7px; }

.toolbar, .panel, .summary-grid {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 11px 14px;
}

.toolbar-actions { display: flex; align-items: center; gap: 9px; }
.toolbar-actions label { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.toolbar-actions select { width: 108px; }

.section-nav {
  display: flex;
  gap: 3px;
  margin-top: 14px;
  border-bottom: 1px solid var(--line);
}

.section-nav button {
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  padding: 10px 17px;
}

.section-nav button:hover { background: #eef3fb; color: #344054; }
.section-nav button.active { border-bottom-color: var(--blue); color: var(--blue); font-weight: 650; }
.view-pane[hidden] { display: none; }

.status { margin: 0; color: var(--muted); font-size: 13px; }
.status::before {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 7px;
  border-radius: 50%;
  background: #98a2b3;
  content: "";
}
.status.connected { color: var(--success); }
.status.connected::before { background: var(--success); }
.status.warning { color: var(--warning); }
.status.warning::before { background: #c58a12; }
.status.error { color: var(--danger); }
.status.error::before { background: var(--danger); }

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin-top: 14px;
  overflow: hidden;
}

.traffic-summary { grid-template-columns: repeat(3, 1fr); }

.summary-card { min-width: 0; padding: 16px 18px; }
.summary-card + .summary-card { border-left: 1px solid var(--line-soft); }
.summary-card > span { color: var(--muted); font-size: 12px; }
.summary-card strong { display: block; margin: 7px 0 3px; font-size: 23px; font-weight: 650; }
.summary-card small, .summary-card small span { color: #8a94a3; font-size: 11px; }
.summary-card-no-data strong { color: #667085; font-size: 18px; }

.panel { margin-top: 14px; padding: 18px; }

.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 14px;
}

.section-heading h2 { margin: 0; font-size: 17px; }
.section-heading p, .section-description, .provision-result p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.section-heading-actions { display: flex; align-items: center; gap: 13px; }
.traffic-heading-actions { align-items: flex-end; }
.traffic-meta { display: flex; align-items: center; justify-content: flex-end; gap: 6px; flex-wrap: wrap; }
.traffic-meta span {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f8fafc;
  color: #596579;
  padding: 4px 8px;
  font-size: 10px;
  white-space: nowrap;
}
.account-counts { color: var(--muted); font-size: 12px; white-space: nowrap; }
.account-counts strong { color: #344054; font-size: 14px; }

.account-hint {
  margin: -2px 0 15px;
  border-left: 3px solid #9fb6e8;
  background: #f7f9fd;
  color: #53627a;
  padding: 8px 10px;
  font-size: 12px;
}

.metric-definition {
  margin: -5px 0 14px;
  color: #697586;
  font-size: 11px;
  line-height: 1.55;
}

.account-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr)) auto;
  align-items: end;
  gap: 10px;
  border: 1px solid #dbe4f2;
  border-radius: 8px;
  background: #f8faff;
  margin: 0 0 15px;
  padding: 13px;
}

.account-form[hidden] { display: none; }
.account-form label { color: #475467; font-size: 12px; }
.account-form input, .account-form select { margin-top: 5px; }
.form-actions { display: flex; gap: 7px; }

.provision-result {
  display: grid;
  grid-template-columns: 1fr minmax(240px, 2fr) auto;
  align-items: center;
  gap: 12px;
  border: 1px solid #a7ddc9;
  border-radius: 8px;
  background: #f3fbf8;
  margin-bottom: 15px;
  padding: 13px;
}

.provision-result[hidden] { display: none; }
.provision-result code { overflow: hidden; color: #145c46; text-overflow: ellipsis; white-space: nowrap; }

.subscription-actions, .client-actions, .row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.client-actions { grid-column: 1 / -1; }
.client-actions button { flex: 1 1 140px; }
.row-actions { flex-wrap: wrap; }
.row-actions button { padding: 6px 9px; font-size: 12px; }

.button-danger {
  border-color: #d7aaa6;
  background: #fff;
  color: var(--danger);
}

.button-danger:hover { background: #fff7f6; }

.chart-wrap {
  position: relative;
  min-height: 295px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #fbfcfd;
  padding: 12px 12px 9px;
}

.chart-wrap canvas {
  display: block;
  width: 100%;
  height: 250px;
  border-radius: 4px;
  outline: 0;
}

.chart-wrap canvas:focus-visible {
  box-shadow: 0 0 0 3px rgba(36, 95, 218, .14);
}

.chart-wrap-secondary { min-height: 275px; background: #fff; }
.chart-wrap-secondary canvas { height: 230px; }

.chart-legend {
  display: flex;
  justify-content: flex-end;
  gap: 4px 8px;
  min-height: 24px;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.chart-legend-wrap { flex-wrap: wrap; }
.chart-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  padding: 3px 5px;
  font-size: 11px;
}

.chart-legend-item:hover { background: #eef2f7; color: #344054; }
.chart-legend-item[aria-pressed="false"] { opacity: .45; text-decoration: line-through; }
.chart-legend-item i { width: 17px; height: 3px; border-radius: 2px; }

.chart-tooltip {
  position: absolute;
  z-index: 3;
  display: grid;
  gap: 5px;
  min-width: 142px;
  max-width: min(260px, calc(100% - 16px));
  border: 1px solid #cfd7e3;
  border-radius: 7px;
  background: rgba(255, 255, 255, .97);
  box-shadow: 0 8px 22px rgba(24, 34, 48, .12);
  color: #344054;
  padding: 8px 9px;
  pointer-events: none;
  font-size: 11px;
}

.chart-tooltip[hidden] { display: none; }
.chart-tooltip > strong { color: #475467; font-size: 10px; font-weight: 600; }
.chart-tooltip > span { display: grid; grid-template-columns: 9px 1fr auto; align-items: center; gap: 6px; }
.chart-tooltip i { width: 7px; height: 7px; border-radius: 50%; }
.chart-tooltip b, .chart-tooltip em { font-style: normal; font-weight: 500; }
.chart-tooltip em { color: #182230; font-variant-numeric: tabular-nums; }

.table-block { margin-top: 16px; }
.table-block + .table-block { margin-top: 18px; }
.table-block h3 { margin: 0; color: #344054; font-size: 13px; }
.subsection-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.subsection-heading > span { color: #8a94a3; font-size: 10px; }
.table-scroll { overflow-x: auto; margin-top: 7px; }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { border-bottom: 1px solid var(--line-soft); padding: 10px 9px; text-align: left; white-space: nowrap; }
th { color: var(--muted); font-size: 11px; font-weight: 600; }
tbody tr:last-child td { border-bottom: 0; }
.empty { color: #98a2b3; text-align: center; padding: 22px; }

.badge { display: inline-block; border-radius: 999px; padding: 3px 8px; font-size: 11px; }
.badge-active { background: #eaf8f2; color: var(--success); }
.badge-disabled, .badge-expired, .badge-quota_exceeded { background: #fff0ee; color: #a93024; }
.badge-deletion-pending { background: #fff6dd; color: #8a5b10; }
.badge-deletion-error { background: #fff0ee; color: #a93024; }
.badge-node-sync-pending { background: #fff6dd; color: #8a5b10; }
.account-state-detail {
  display: block;
  max-width: 230px;
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
  white-space: normal;
}

.inline-disclosure {
  margin-top: 9px;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  background: #fbfcfd;
}

.inline-disclosure > summary {
  display: flex;
  align-items: center;
  gap: 12px;
  list-style: none;
  padding: 10px 12px;
  cursor: pointer;
}

.inline-disclosure > summary::-webkit-details-marker { display: none; }
.inline-disclosure > summary span { color: #344054; font-size: 12px; font-weight: 600; }
.inline-disclosure > summary small { margin-left: auto; color: #7a8699; font-size: 10px; }
.inline-disclosure > summary::after { color: #8792a3; font-size: 10px; content: "展开"; }
.inline-disclosure[open] > summary { border-bottom: 1px solid var(--line-soft); }
.inline-disclosure[open] > summary::after { content: "收起"; }
.inline-disclosure-body { padding: 11px 12px 12px; }
.inline-disclosure-body > .section-description { margin: 0 0 9px; }

.disclosure-panel { padding: 0; }
.disclosure-panel > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  list-style: none;
  padding: 15px 18px;
  cursor: pointer;
}

.disclosure-panel > summary::-webkit-details-marker { display: none; }
.disclosure-panel > summary span { font-size: 15px; font-weight: 650; }
.disclosure-panel > summary small { margin-left: auto; color: var(--muted); font-size: 11px; font-weight: 400; }
.disclosure-panel > summary::after { color: #8a94a3; font-size: 12px; content: "展开"; }
.disclosure-panel[open] > summary { border-bottom: 1px solid var(--line-soft); }
.disclosure-panel[open] > summary::after { content: "收起"; }
.details-body { padding: 16px 18px 18px; }
.details-body .section-description { margin: 0 0 12px; }

.collection-state {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start;
  gap: 10px 12px;
  margin-bottom: 12px;
  border: 1px solid #dfe4eb;
  border-radius: 8px;
  background: #f8fafc;
  padding: 11px 12px;
}

.collection-indicator { width: 8px; height: 8px; margin-top: 5px; border-radius: 50%; background: #98a2b3; }
.collection-copy strong { color: #344054; font-size: 12px; }
.collection-copy p { margin: 3px 0 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.collection-actions { display: flex; align-items: center; gap: 12px; }
.collection-times { display: flex; gap: 16px; margin: 0; }
.collection-times div { min-width: 78px; }
.collection-times dt { color: #8a94a3; font-size: 9px; }
.collection-times dd { margin: 2px 0 0; color: #475467; font-size: 10px; white-space: nowrap; }
.collection-actions > button { padding: 6px 9px; font-size: 10px; white-space: nowrap; }
.collection-state[data-state="success"] { border-color: #c9e8dc; background: #f5fbf8; }
.collection-state[data-state="success"] .collection-indicator { background: var(--success); }
.collection-state[data-state="warning"] { border-color: #ead9ad; background: #fffbf1; }
.collection-state[data-state="warning"] .collection-indicator { background: #b27a08; }
.collection-state[data-state="error"] { border-color: #f0c7c2; background: #fff7f6; }
.collection-state[data-state="error"] .collection-indicator { background: var(--danger); }
.collection-state[data-state="pending"] .collection-indicator { background: #4772c9; }

.tutorial-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 22px;
  padding: 16px 18px 18px;
}

.tutorial-grid article { border-top: 1px solid var(--line-soft); padding-top: 10px; }
.tutorial-grid h3 { margin: 0 0 5px; font-size: 13px; }
.tutorial-grid p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.help-panel .tutorial-grid { padding: 0; }
.help-panel .scope-note { margin-top: 18px; }

.qr-dialog {
  width: min(410px, calc(100vw - 28px));
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 17px;
}

.qr-dialog::backdrop, .confirm-dialog::backdrop { background: rgba(15, 23, 42, .45); }
.qr-dialog .dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.qr-dialog p { color: var(--muted); font-size: 12px; }
.qr-dialog img { display: block; width: min(310px, 100%); margin: 13px auto 0; }

.confirm-dialog {
  width: min(500px, calc(100vw - 28px));
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0;
}

.confirm-dialog form { padding: 18px; }
.confirm-dialog .dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}
.confirm-dialog p { color: #53627a; font-size: 13px; line-height: 1.65; }
.confirm-dialog label { display: block; margin-top: 14px; color: #344054; font-size: 12px; }
.confirm-dialog label input { margin-top: 6px; }
.confirm-dialog .confirmation-check {
  display: flex;
  align-items: center;
  gap: 9px;
}
.confirm-dialog .confirmation-check input { width: auto; margin: 0; }
.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 20px;
}

.scope-note { margin: 15px 3px 0; color: var(--muted); font-size: 11px; line-height: 1.55; }

.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;
}

@media (max-width: 820px) {
  .summary-grid { grid-template-columns: 1fr 1fr; }
  .summary-card:nth-child(3) { border-left: 0; border-top: 1px solid var(--line-soft); }
  .summary-card:nth-child(4) { border-top: 1px solid var(--line-soft); }
  .account-form { grid-template-columns: 1fr 1fr; }
  .provision-result { grid-template-columns: 1fr; }
  .client-actions { grid-column: 1; }
  .collection-state { grid-template-columns: auto minmax(0, 1fr); }
  .collection-actions { grid-column: 2; flex-wrap: wrap; }
}

@media (max-width: 560px) {
  .topbar { padding: 12px 15px; }
  .brand { align-items: flex-start; flex-direction: column; gap: 1px; }
  .login-card { padding: 23px 19px; }
  .page-shell { padding: 14px 11px 32px; }
  .toolbar, .section-heading { align-items: stretch; flex-direction: column; }
  .toolbar-actions { justify-content: space-between; }
  .toolbar-actions button { flex: 1; }
  .summary-grid { grid-template-columns: 1fr; }
  .summary-card + .summary-card { border-top: 1px solid var(--line-soft); border-left: 0; }
  .account-form { grid-template-columns: 1fr; }
  .section-heading-actions { align-items: stretch; flex-direction: column; }
  .traffic-meta { justify-content: flex-start; }
  .form-actions button, .section-heading button { flex: 1; }
  .tutorial-grid { grid-template-columns: 1fr; }
  .disclosure-panel > summary { align-items: flex-start; }
  .inline-disclosure > summary { align-items: flex-start; flex-wrap: wrap; }
  .inline-disclosure > summary small { order: 3; width: 100%; margin-left: 0; }
  .inline-disclosure > summary::after { margin-left: auto; }
  .collection-actions, .collection-times { flex-wrap: wrap; gap: 8px 14px; }
  .chart-wrap { padding-right: 7px; padding-left: 7px; }
}

/* 2026 operations-console redesign */
:root {
  --blue: #155eef;
  --blue-dark: #004eeb;
  --ink: #101828;
  --muted: #667085;
  --surface-soft: #f8fafc;
  --line: #e4e7ec;
  --line-soft: #f0f2f5;
}

body {
  background: #f6f8fb;
  color: var(--ink);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 62px;
  padding-inline: max(20px, calc((100vw - 1240px) / 2));
  box-shadow: 0 1px 0 rgba(16, 24, 40, .02);
}

.brand h1 { font-size: 18px; }
.brand span { padding-left: 10px; border-left: 1px solid var(--line); }
.page-shell { max-width: 1240px; padding: 18px 20px 56px; }

.toolbar {
  min-height: 44px;
  border-radius: 9px;
  padding: 8px 12px;
}

.toolbar-actions button { min-height: 32px; padding: 5px 11px; font-size: 12px; }

.section-nav {
  gap: 22px;
  margin-top: 10px;
}

.section-nav button {
  min-height: 43px;
  padding: 9px 2px;
}

.section-nav button:hover { background: transparent; color: var(--ink); }
.section-nav button:focus-visible,
.segmented-control button:focus-visible,
.action-menu summary:focus-visible {
  outline: 3px solid rgba(21, 94, 239, .18);
  outline-offset: 2px;
}

.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-top: 28px;
}

.page-heading h2 {
  margin: 3px 0 0;
  color: var(--ink);
  font-size: clamp(25px, 3vw, 32px);
  letter-spacing: -.035em;
}

.page-heading p,
.breakdown-heading p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.page-kicker {
  color: var(--blue);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .15em;
}

.metric-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
  overflow: hidden;
}

.metric-strip article {
  min-width: 0;
  padding: 16px 18px;
  border-left: 1px solid var(--line-soft);
}

.metric-strip article:first-child { border-left: 0; }
.metric-strip span, .metric-strip small { color: var(--muted); }
.metric-strip span { font-size: 11px; font-weight: 650; }
.metric-strip strong {
  display: block;
  margin: 6px 0 3px;
  color: var(--ink);
  font-size: 24px;
  line-height: 1.12;
  letter-spacing: -.025em;
  font-variant-numeric: tabular-nums;
}
.metric-strip small { font-size: 10px; }
.traffic-summary article:nth-child(2) strong { color: #087ea4; }
.traffic-summary article:nth-child(3) strong { color: #7f56d9; }

.panel { margin-top: 18px; border-radius: 11px; padding: 20px; }
.account-panel { padding-top: 16px; }

.account-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 150px;
  align-items: end;
  gap: 12px;
}

.account-toolbar label {
  display: grid;
  gap: 5px;
  color: #475467;
  font-size: 11px;
}

.account-toolbar input,
.account-toolbar select { min-height: 38px; }

.account-hint {
  margin: 12px 0 6px;
  border: 0;
  border-radius: 7px;
  background: #f8fafc;
  color: #667085;
  padding: 8px 10px;
}

.account-table { table-layout: fixed; }
.account-table th:nth-child(1) { width: 15%; }
.account-table th:nth-child(2) { width: 31%; }
.account-table th:nth-child(3) { width: 15%; }
.account-table th:nth-child(4) { width: 15%; }
.account-table th:nth-child(5) { width: 12%; }
.account-table th:nth-child(6) { width: 12%; }
.account-table td { height: 68px; vertical-align: middle; }
.account-table td, .account-table th { white-space: normal; }
.account-name-cell strong { display: block; color: var(--ink); font-size: 13px; }
.account-name-cell small { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; }
.last-used-cell { color: #475467; font-variant-numeric: tabular-nums; }

.usage-cell { min-width: 0; }
.usage-bar {
  height: 5px;
  margin-top: 7px;
  border-radius: 999px;
  background: #edf1f6;
  overflow: hidden;
}
.usage-bar i { display: block; width: var(--usage, 0%); height: 100%; border-radius: inherit; background: var(--blue); }
.usage-bar[data-state="warning"] i { background: #f79009; }
.usage-bar[data-state="danger"] i { background: #d92d20; }

.action-menu { position: relative; }
.action-menu summary {
  width: max-content;
  list-style: none;
  border: 1px solid #cfd5df;
  border-radius: 7px;
  background: #fff;
  color: #344054;
  padding: 6px 10px;
  cursor: pointer;
  font-size: 12px;
}
.action-menu summary::-webkit-details-marker { display: none; }
.action-menu[open] summary { border-color: #98a2b3; }
.action-menu-popover {
  position: static;
  z-index: 8;
  display: grid;
  min-width: 168px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  box-shadow: 0 14px 32px rgba(16, 24, 40, .13);
  padding: 5px;
  margin-top: 5px;
}
.action-menu-popover button {
  width: 100%;
  border: 0;
  background: transparent;
  color: #344054;
  padding: 8px 9px;
  text-align: left;
  font-size: 12px;
}
.action-menu-popover button:hover { background: #f2f4f7; }
.action-menu-popover .button-quiet-danger { color: var(--danger); }

.traffic-page-heading { align-items: center; }
.traffic-controls { display: flex; align-items: center; gap: 10px; }
.segmented-control {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  border: 1px solid #d0d5dd;
  border-radius: 8px;
  background: #fff;
  padding: 3px;
}
.segmented-control button {
  min-height: 31px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  padding: 5px 11px;
  font-size: 12px;
}
.segmented-control button:hover { background: #f2f4f7; color: var(--ink); }
.segmented-control button.active { background: #eaf0ff; color: #1849a9; font-weight: 650; }

.chart-panel .section-heading { align-items: center; }
.chart-panel .section-heading p { margin-top: 4px; }
.freshness-note { color: var(--muted); font-size: 11px; }
.monthly-server-panel .section-heading p { margin-top: 4px; }
.chart-panel .chart-wrap { min-height: 316px; border: 0; background: #fbfcfe; padding: 10px 8px 6px; }
.chart-panel .chart-wrap canvas { height: 270px; }

.breakdown-panel { padding-bottom: 16px; }
.breakdown-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 8px;
}
.breakdown-heading h2 { margin: 0; font-size: 17px; }
.breakdown-view[hidden] { display: none; }

.usage-ranking { display: grid; }
.usage-rank-row {
  display: grid;
  grid-template-columns: minmax(150px, 1.1fr) minmax(260px, 2fr) 110px;
  align-items: center;
  gap: 18px;
  min-height: 68px;
  border-bottom: 1px solid var(--line-soft);
  padding: 11px 2px;
}
.usage-rank-row:last-child { border-bottom: 0; }
.usage-rank-name strong { display: block; color: var(--ink); font-size: 13px; }
.usage-rank-name span { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; }
.usage-rank-bar { height: 8px; border-radius: 999px; background: #edf1f6; overflow: hidden; }
.usage-rank-bar i { display: block; width: var(--share, 0%); height: 100%; border-radius: inherit; background: #84adff; }
.usage-rank-row:nth-child(2) .usage-rank-bar i { background: #9e77ed; }
.usage-rank-row:nth-child(3) .usage-rank-bar i { background: #47b881; }
.usage-rank-value { text-align: right; }
.usage-rank-value strong { display: block; color: var(--ink); font-size: 13px; font-variant-numeric: tabular-nums; }
.usage-rank-value span { display: block; margin-top: 2px; color: var(--muted); font-size: 10px; }

.inline-disclosure { margin-top: 8px; border-right: 0; border-bottom: 0; border-left: 0; border-radius: 0; background: transparent; }
.inline-disclosure > summary { padding-inline: 2px; }
.disclosure-panel > summary > span { display: grid; gap: 3px; }
.disclosure-panel > summary > span small { margin: 0; }
.azure-summary-inline { margin-left: auto; text-align: right; }
.azure-summary-inline strong { font-size: 14px; }
.azure-summary-inline small { display: block; margin-top: 3px !important; }

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  border: 0 !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  white-space: nowrap !important;
}

.editor-dialog,
.subscription-dialog {
  width: min(560px, calc(100vw - 28px));
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(16, 24, 40, .2);
  padding: 0;
}
.subscription-dialog { width: min(720px, calc(100vw - 28px)); padding: 20px; }
.editor-dialog::backdrop,
.subscription-dialog::backdrop { background: rgba(15, 23, 42, .48); backdrop-filter: blur(2px); }
.editor-dialog .account-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: #fff;
  padding: 20px;
}
.editor-dialog .dialog-head,
.subscription-dialog .dialog-head { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.dialog-head > div { display: grid; gap: 3px; }
.dialog-head > div strong { font-size: 18px; }
.dialog-description { grid-column: 1 / -1; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.editor-dialog .account-form > label { display: grid; gap: 5px; color: #475467; font-size: 12px; }
.editor-dialog .account-form > label:nth-last-of-type(1),
.editor-dialog .form-actions { grid-column: 1 / -1; }
.editor-dialog .account-form > .monthly-reset-field {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 8px 11px;
}
.monthly-reset-field input { width: 16px; height: 16px; margin: 0; }
.node-access-fieldset {
  grid-column: 1 / -1;
  min-width: 0;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 11px 11px;
}
.node-access-fieldset legend { color: #475467; padding: 0 5px; font-size: 12px; }
.node-access-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.node-access-grid label {
  display: flex;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  background: #f8fafc;
  padding: 9px;
  cursor: pointer;
}
.node-access-grid input { width: 16px; height: 16px; margin: 0; }
.node-access-grid span { display: grid; gap: 2px; }
.node-access-grid strong { color: #344054; font-size: 12px; }
.node-access-grid small { color: var(--muted); font-size: 10px; }
.account-node-access { color: #667085; font-weight: 400; line-height: 1.45; }
.editor-dialog .form-actions { justify-content: flex-end; margin-top: 4px; }
.subscription-dialog code {
  display: block;
  margin: 16px 0 12px;
  border-radius: 8px;
  background: #f2f4f7;
  color: #344054;
  padding: 12px;
  overflow-wrap: anywhere;
  font-size: 11px;
}
.subscription-dialog .subscription-actions { justify-content: flex-end; }
.subscription-dialog .client-actions { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 14px; }
.subscription-dialog .client-actions button { min-width: 0; }

@media (max-width: 820px) {
  .metric-strip { grid-template-columns: 1fr 1fr; }
  .metric-strip article:nth-child(3) { border-left: 0; border-top: 1px solid var(--line-soft); }
  .metric-strip article:nth-child(4) { border-top: 1px solid var(--line-soft); }
  .account-table { table-layout: auto; min-width: 760px; }
  .usage-rank-row { grid-template-columns: minmax(120px, 1fr) minmax(180px, 1.7fr) 96px; }
}

@media (max-width: 620px) {
  .brand span { padding-left: 0; border-left: 0; }
  .page-shell { padding-inline: 12px; }
  .page-heading,
  .traffic-page-heading,
  .breakdown-heading { align-items: stretch; flex-direction: column; }
  .page-heading > button { width: 100%; }
  .traffic-controls { align-items: stretch; flex-direction: column; }
  .segmented-control { display: grid; grid-template-columns: repeat(3, 1fr); }
  .account-toolbar { grid-template-columns: 1fr; }
  .metric-strip { grid-template-columns: 1fr 1fr; }
  .metric-strip article { padding: 14px; }
  .metric-strip strong { font-size: 21px; }
  .usage-rank-row { grid-template-columns: 1fr auto; gap: 10px; }
  .usage-rank-bar { grid-column: 1 / -1; grid-row: 2; }
  .usage-rank-value { grid-column: 2; grid-row: 1; }
  .editor-dialog .account-form { grid-template-columns: 1fr; }
  .editor-dialog .account-form > label,
  .editor-dialog .account-form > label:nth-last-of-type(1),
  .editor-dialog .form-actions { grid-column: 1; }
  .node-access-grid { grid-template-columns: 1fr; }
  .subscription-dialog .client-actions { grid-template-columns: 1fr; }
  .disclosure-panel > summary { flex-wrap: wrap; }
  .azure-summary-inline { margin-left: 0; text-align: left; }
}

/* ========================================================================
   getsub.console · integrated concise theme
   Appended as a compatibility layer so all legacy/dynamic classes remain
   covered by the original stylesheet above.
   ======================================================================== */

:root {
  color: #17131f;
  background: #f3f2f6;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  --ink: #17131f;
  --blue: #6238d7;
  --blue-dark: #4d28bb;
  --line: #24202c;
  --line-soft: rgba(36, 32, 44, .10);
  --muted: #716b7c;
  --surface: rgba(255, 255, 255, .78);
  --success: #23875b;
  --danger: #b83d49;
  --warning: #9d6818;
  --accent: #6238d7;
  --accent-soft: rgba(98, 56, 215, .09);
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

html {
  min-width: 320px;
  background: #f3f2f6;
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  background:
    repeating-linear-gradient(to bottom, rgba(98, 56, 215, .018) 0 2px, transparent 2px 4px),
    linear-gradient(180deg, #faf9fc 0%, #f1f0f5 100%);
  color: var(--ink);
}

button,
input,
select,
code {
  font-family: var(--mono);
}

button {
  border: 1.5px solid var(--line);
  border-radius: 0;
  background: var(--ink);
  color: #fff;
  min-height: 38px;
  padding: 8px 14px;
  box-shadow: 2px 2px 0 rgba(23, 19, 31, .10);
  font-size: 12px;
  font-weight: 700;
  transition: transform 120ms ease, background 120ms ease, box-shadow 120ms ease;
}

button:hover {
  background: #2d2737;
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0 rgba(23, 19, 31, .12);
}

button:active {
  transform: translate(0, 0);
  box-shadow: 1px 1px 0 rgba(23, 19, 31, .10);
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible,
canvas:focus-visible {
  outline: 3px solid rgba(98, 56, 215, .22);
  outline-offset: 2px;
}

.button-secondary {
  border-color: rgba(36, 32, 44, .42);
  background: rgba(255, 255, 255, .76);
  color: var(--ink);
}

.button-secondary:hover {
  background: #fff;
  color: var(--ink);
}

.button-danger {
  border-color: #9d303b;
  background: #fff;
  color: #9d303b;
}

.button-danger:hover {
  background: #fff5f5;
  color: #8d2630;
}

input,
select {
  min-height: 40px;
  border: 1.5px solid rgba(36, 32, 44, .32);
  border-radius: 0;
  background: rgba(255, 255, 255, .88);
  color: var(--ink);
  padding: 8px 10px;
}

input:focus,
select:focus {
  border-color: var(--accent);
  outline: 3px solid rgba(98, 56, 215, .10);
}

.topbar {
  min-height: 68px;
  border-bottom: 2px solid var(--line);
  background: rgba(250, 249, 252, .92);
  padding: 12px max(18px, calc((100vw - 1380px) / 2));
  backdrop-filter: blur(12px);
}

.brand {
  align-items: baseline;
  gap: 12px;
}

.brand h1 {
  font-family: var(--mono);
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -.035em;
}

.brand span {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.page-shell {
  width: min(1380px, calc(100% - 32px));
  max-width: none;
  margin: 0 auto;
  padding: 20px 0 56px;
}

.login-shell {
  min-height: calc(100vh - 68px);
}

.login-card {
  width: min(460px, 100%);
  border: 2px solid var(--line);
  border-radius: 0;
  background: rgba(255, 255, 255, .80);
  box-shadow: 7px 7px 0 rgba(23, 19, 31, .08);
  padding: 34px 30px 28px;
}

.login-card h2 {
  margin: 9px 0 4px;
  font-size: 32px;
  letter-spacing: -.04em;
}

.login-card > p,
.login-card > small {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
}

.login-card form {
  gap: 16px;
  margin: 24px 0 14px;
}

.login-card label {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
}

.workspace-bar {
  position: sticky;
  z-index: 10;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
  border-bottom: 2px solid var(--line);
  background: rgba(243, 242, 246, .92);
  backdrop-filter: blur(12px);
}

.workspace-bar .toolbar {
  display: flex;
  align-items: center;
  gap: 14px;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 7px 0;
}

.workspace-bar .toolbar button {
  min-height: 32px;
  padding: 5px 11px;
}

.section-nav {
  gap: 2px;
  margin: 0;
  border: 0;
}

.section-nav button {
  min-height: 48px;
  border: 0;
  border-bottom: 3px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  padding: 12px 18px 10px;
  box-shadow: none;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 650;
}

.section-nav button:hover {
  background: var(--accent-soft);
  color: var(--ink);
  transform: none;
  box-shadow: none;
}

.section-nav button.active {
  border-bottom-color: var(--accent);
  color: var(--ink);
}

.status {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
}

.status::before {
  width: 8px;
  height: 8px;
  border-radius: 0;
  box-shadow: 1px 1px 0 rgba(23, 19, 31, .12);
}

.page-heading {
  align-items: flex-end;
  margin: 0 0 18px;
}

.page-heading .page-kicker,
.page-kicker {
  color: var(--accent);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .13em;
}

.page-heading h2 {
  margin: 6px 0 2px;
  color: var(--ink);
  font-size: clamp(36px, 4vw, 54px);
  line-height: .95;
  letter-spacing: -.055em;
}

.page-heading p {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.panel,
.toolbar,
.summary-grid,
.metric-strip {
  border: 2px solid var(--line);
  border-radius: 0;
  background: var(--surface);
  box-shadow: 6px 6px 0 rgba(23, 19, 31, .065);
  backdrop-filter: blur(8px);
}

.panel {
  margin-top: 22px;
  padding: 24px 22px 20px;
}

.metric-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 0;
  overflow: hidden;
}

.metric-strip article {
  min-width: 0;
  padding: 18px 20px 16px;
}

.metric-strip article + article {
  border-left: 1px solid rgba(36, 32, 44, .12);
}

.metric-strip span,
.metric-strip small {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .04em;
}

.metric-strip strong {
  display: block;
  margin: 8px 0 5px;
  color: var(--ink);
  font-family: var(--mono);
  font-size: clamp(22px, 2.4vw, 34px);
  font-weight: 750;
  letter-spacing: -.045em;
  font-variant-numeric: tabular-nums;
}

.account-toolbar {
  grid-template-columns: minmax(240px, 1fr) 160px;
  gap: 12px;
  margin-bottom: 12px;
}

.account-toolbar label {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
}

.table-scroll {
  scrollbar-color: rgba(36, 32, 44, .32) transparent;
}

table {
  color: var(--ink);
  font-size: 12px;
}

th,
td {
  border-bottom-color: rgba(36, 32, 44, .09);
  padding: 12px 10px;
}

th {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .035em;
  text-transform: uppercase;
}

tbody tr {
  transition: background 100ms ease;
}

tbody tr:hover {
  background: rgba(98, 56, 215, .035);
}

.account-name-cell strong,
.usage-rank-name strong {
  color: var(--ink);
}

.account-name-cell small,
.last-used-cell,
.usage-rank-name span,
.usage-rank-value span {
  color: var(--muted);
  font-family: var(--mono);
}

.usage-bar,
.usage-rank-bar {
  border-radius: 0;
  background: rgba(36, 32, 44, .08);
}

.usage-bar i,
.usage-rank-bar i {
  border-radius: 0;
  background: var(--accent);
}

.usage-rank-row:nth-child(2) .usage-rank-bar i { background: #8060df; }
.usage-rank-row:nth-child(3) .usage-rank-bar i { background: #2d9a68; }
.usage-rank-row:nth-child(4) .usage-rank-bar i { background: #ba6c35; }
.usage-rank-row:nth-child(5) .usage-rank-bar i { background: #6b7e9b; }

.badge {
  border-radius: 0;
  border: 1px solid currentColor;
  background: transparent;
  padding: 3px 7px;
  font-family: var(--mono);
  font-size: 10px;
}

.action-menu summary {
  border: 1px solid rgba(36, 32, 44, .32);
  border-radius: 0;
  background: rgba(255, 255, 255, .84);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 10px;
}

.action-menu-popover {
  border: 1.5px solid var(--line);
  border-radius: 0;
  box-shadow: 5px 5px 0 rgba(23, 19, 31, .08);
}

.action-menu-popover button {
  min-height: 34px;
  border: 0;
  box-shadow: none;
  font-size: 11px;
}

.action-menu-popover button:hover {
  transform: none;
  box-shadow: none;
}

.traffic-controls {
  align-items: center;
}

.segmented-control {
  border: 1.5px solid rgba(36, 32, 44, .32);
  border-radius: 0;
  background: rgba(255, 255, 255, .70);
  padding: 3px;
}

.segmented-control button {
  min-height: 32px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  box-shadow: none;
  font-family: var(--mono);
  font-size: 11px;
}

.segmented-control button:hover {
  background: rgba(98, 56, 215, .07);
  color: var(--ink);
  transform: none;
  box-shadow: none;
}

.segmented-control button.active {
  background: var(--ink);
  color: #fff;
}

.chart-panel-primary {
  padding: 34px 30px 22px;
}

.chart-heading {
  align-items: flex-start !important;
  margin-bottom: 7px;
}

.chart-heading h2 {
  margin: 8px 0 4px;
  color: var(--ink);
  font-size: clamp(32px, 4vw, 50px);
  line-height: .98;
  letter-spacing: -.055em;
}

.chart-kicker {
  display: inline-block;
  margin-bottom: 2px;
}

.chart-meta {
  display: grid;
  justify-items: end;
  gap: 12px;
  padding-top: 3px;
}

.freshness-note {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
}

.freshness-note:empty {
  display: none;
}

.chart-reset {
  min-height: 32px;
  padding: 5px 10px;
  font-size: 10px;
}

.chart-panel .chart-wrap,
.chart-wrap {
  min-height: 0;
  border: 0;
  border-radius: 0;
  background:
    linear-gradient(rgba(255, 255, 255, .52), rgba(255, 255, 255, .52)),
    repeating-linear-gradient(to bottom, rgba(98, 56, 215, .018) 0 2px, transparent 2px 4px);
  padding: 6px 0 0;
}

.chart-panel .chart-wrap canvas,
.chart-wrap canvas {
  height: auto;
  border-radius: 0;
  touch-action: none;
}

.chart-wrap canvas:focus-visible {
  box-shadow: inset 0 0 0 2px rgba(98, 56, 215, .25);
}

.chart-legend {
  justify-content: flex-start;
  min-height: 27px;
  margin-top: 6px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
}

.chart-legend-item {
  border: 1px solid transparent;
  border-radius: 0;
  box-shadow: none;
  font-family: var(--mono);
  font-size: 10px;
}

.chart-legend-item:hover {
  border-color: rgba(36, 32, 44, .12);
  background: rgba(255, 255, 255, .62);
  transform: none;
  box-shadow: none;
}

.chart-legend-item i {
  width: 15px;
  height: 3px;
  border-radius: 0;
}

.chart-tooltip {
  min-width: 172px;
  border: 1.5px solid var(--line);
  border-radius: 0;
  background: rgba(255, 255, 255, .96);
  box-shadow: 4px 4px 0 rgba(23, 19, 31, .08);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 10px;
}

.chart-tooltip > strong {
  color: var(--ink);
  font-family: var(--mono);
  font-size: 10px;
}

.chart-tooltip i {
  border-radius: 0;
}

.traffic-lower-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
  gap: 22px;
  align-items: start;
}

.traffic-lower-grid > .panel {
  min-width: 0;
}

.breakdown-heading h2,
.compact-heading h2,
.disclosure-panel > summary strong,
.help-panel .section-heading h2 {
  color: var(--ink);
  font-size: 21px;
  letter-spacing: -.025em;
}

.breakdown-heading p,
.compact-heading p,
.section-description {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
}

.usage-rank-row {
  grid-template-columns: minmax(110px, 1fr) minmax(140px, 1.5fr) 104px;
  gap: 14px;
  min-height: 64px;
  border-bottom-color: rgba(36, 32, 44, .09);
}

.usage-rank-value strong {
  font-family: var(--mono);
  font-size: 12px;
}

.inline-disclosure {
  border-top: 1px solid rgba(36, 32, 44, .12);
  background: transparent;
}

.inline-disclosure > summary {
  padding: 12px 0;
}

.inline-disclosure > summary span,
.inline-disclosure > summary small,
.inline-disclosure > summary::after {
  font-family: var(--mono);
  font-size: 10px;
}

.inline-disclosure-body {
  padding: 6px 0 0;
}

.chart-wrap-secondary,
.chart-wrap-azure {
  background: rgba(255, 255, 255, .48);
}

.monthly-server-panel {
  overflow: visible;
}

.compact-heading {
  margin-bottom: 8px;
}

.compact-table-scroll {
  max-height: 430px;
  overflow: auto;
}

.scope-note {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
}

.disclosure-panel {
  padding: 0;
}

.disclosure-panel > summary {
  min-height: 72px;
  padding: 18px 22px;
}

.disclosure-panel > summary span,
.disclosure-panel > summary small {
  font-family: var(--mono);
}

.disclosure-panel > summary::after {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
}

.azure-summary-inline strong {
  color: var(--accent);
  font-family: var(--mono);
  font-size: 16px;
}

.collection-state {
  border: 1px solid rgba(36, 32, 44, .18);
  border-radius: 0;
  background: rgba(255, 255, 255, .56);
}

.collection-indicator {
  border-radius: 0;
}

.collection-copy strong,
.collection-copy p,
.collection-times dt,
.collection-times dd {
  font-family: var(--mono);
}

.tutorial-grid article {
  border-top-color: rgba(36, 32, 44, .10);
}

.tutorial-grid h3 {
  color: var(--ink);
  font-size: 15px;
}

.tutorial-grid p {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
}

.concise-help {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px 26px;
}

.editor-dialog,
.subscription-dialog,
.qr-dialog,
.confirm-dialog {
  border: 2px solid var(--line);
  border-radius: 0;
  background: #fbfafc;
  box-shadow: 8px 8px 0 rgba(23, 19, 31, .13);
}

.editor-dialog::backdrop,
.subscription-dialog::backdrop,
.qr-dialog::backdrop,
.confirm-dialog::backdrop {
  background: rgba(16, 12, 23, .48);
  backdrop-filter: blur(3px);
}

.editor-dialog .account-form,
.confirm-dialog form {
  background: #fbfafc;
}

.editor-dialog .account-form > label,
.node-access-fieldset legend,
.confirm-dialog label,
.dialog-description {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
}

.editor-dialog .account-form > .monthly-reset-field,
.node-access-fieldset,
.node-access-grid label,
.subscription-dialog code {
  border-radius: 0;
  background: rgba(255, 255, 255, .68);
}

.node-access-grid strong,
.dialog-head > div strong,
.dialog-head > strong {
  color: var(--ink);
}

.subscription-dialog code {
  border: 1px solid rgba(36, 32, 44, .14);
  color: var(--ink);
  font-family: var(--mono);
}

@media (max-width: 1080px) {
  .traffic-lower-grid {
    grid-template-columns: 1fr;
  }

  .monthly-server-panel {
    min-height: 0;
  }
}

@media (max-width: 820px) {
  .page-shell {
    width: min(100% - 22px, 1380px);
  }

  .metric-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metric-strip article:nth-child(3) {
    border-left: 0;
    border-top: 1px solid rgba(36, 32, 44, .12);
  }

  .metric-strip article:nth-child(4) {
    border-top: 1px solid rgba(36, 32, 44, .12);
  }

  .chart-panel-primary {
    padding: 30px 18px 18px;
  }

  .chart-heading {
    align-items: flex-start !important;
    flex-direction: column;
  }

  .chart-meta {
    justify-items: start;
  }

}

@media (max-width: 620px) {
  .topbar {
    padding-inline: 12px;
  }

  .page-heading,
  .traffic-page-heading {
    align-items: stretch;
  }

  .brand {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
  }

  .page-shell {
    width: calc(100% - 16px);
    padding-top: 12px;
  }

  .workspace-bar {
    position: static;
    align-items: stretch;
    flex-direction: column;
    gap: 0;
    margin-bottom: 22px;
  }

  .section-nav {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
  }

  .section-nav button {
    width: 100%;
    padding-inline: 8px;
  }

  .workspace-bar .toolbar {
    justify-content: space-between;
    padding: 8px 0;
  }

  .page-heading h2 {
    font-size: 40px;
  }

  .metric-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metric-strip article {
    padding: 14px 13px;
  }

  .metric-strip strong {
    font-size: 22px;
  }

  .panel {
    padding: 22px 14px 16px;
  }

  .account-toolbar {
    grid-template-columns: 1fr;
  }

  .traffic-controls {
    width: 100%;
  }

  .traffic-controls .segmented-control {
    flex: 1;
  }

  .chart-heading h2 {
    font-size: 36px;
  }

  .usage-rank-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .concise-help {
    grid-template-columns: 1fr;
  }

  .collection-state {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .collection-actions {
    grid-column: 2;
  }
}

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

/* Atomic data modules: labels, values and units never break apart. */
.value-group {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 5px 14px;
  min-width: 0;
  margin: 0;
  font-family: var(--mono);
}

.value-group-nowrap {
  flex-wrap: nowrap;
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: thin;
}

.value-pair {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: baseline;
  gap: 5px;
  white-space: nowrap;
}

.value-pair dt,
.value-pair dd {
  margin: 0;
}

.value-pair dt {
  color: var(--muted);
  font-size: 9px;
}

.value-pair dd {
  color: var(--ink);
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.meta-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  min-width: 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
}

.meta-token {
  flex: 0 0 auto;
  white-space: nowrap;
}

.meta-token-primary {
  color: var(--ink);
  font-weight: 700;
}

.monthly-server-table {
  min-width: 720px;
}

.monthly-server-name {
  white-space: nowrap;
}

.monthly-server-table td:nth-child(2) {
  min-width: 125px;
}

.monthly-server-table td:nth-child(3) {
  min-width: 310px;
}

.monthly-server-table td:last-child {
  min-width: 145px;
}

.server-location-meta,
.server-source-meta,
.period-meta,
.freshness-meta,
.trend-summary-meta {
  flex-wrap: nowrap;
}

.account-node-access {
  margin-top: 4px;
}

.account-usage-values {
  margin-bottom: 7px;
}

.last-used-cell,
.account-table td:nth-child(4),
.chart-tooltip em,
.cluster-route-card dd,
.certificate-row > div:last-child,
.cluster-event time {
  white-space: nowrap;
}

.usage-rank-row {
  grid-template-columns: minmax(110px, .8fr) minmax(90px, 1fr) minmax(240px, auto);
}

.usage-rank-value {
  min-width: 0;
}

.usage-rank-values {
  justify-content: flex-end;
}

.usage-rank-meta {
  margin-top: 4px;
}

.probe-budget-values,
.probe-attempt-values {
  justify-content: flex-end;
}

.event-main {
  flex: 1;
}

.meta-token-state {
  border: 1px solid currentColor;
  padding: 2px 5px;
}

@media (max-width: 620px) {
  .usage-rank-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .usage-rank-name,
  .usage-rank-value,
  .usage-rank-bar {
    grid-column: 1;
  }

  .usage-rank-name { grid-row: 1; }
  .usage-rank-value { grid-row: 2; text-align: left; }
  .usage-rank-bar { grid-row: 3; }
  .usage-rank-values { justify-content: flex-start; }
}

.chart-wrap canvas { cursor: crosshair; }
.chart-wrap canvas.is-dragging { cursor: grabbing; }
#probe-failure-chart { touch-action: pan-y; }
.probe-failure-chart-panel { padding-bottom: 18px; }
.probe-failure-chart-panel .compact-heading { margin-bottom: 4px; }
.probe-failure-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}
.probe-failure-range {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.probe-failure-grouping {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.probe-failure-chart-legend { display: flex; }
.chart-legend-item i.is-dashed,
.chart-tooltip i.is-dashed {
  background: repeating-linear-gradient(
    to right,
    var(--legend-color) 0 6px,
    transparent 6px 10px
  ) !important;
}
.chart-tooltip-heading {
  color: var(--muted);
  font-size: 9px;
  white-space: nowrap;
}
.chart-legend-bar i { height: 7px; opacity: .55; }
@media (min-width: 1081px) {
  .traffic-lower-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Cluster health is intentionally status-led: source loss is purple/gray, never failure red. */
.health-metrics article:nth-child(1) strong { color: var(--success); }
.health-metrics article:nth-child(2) strong { color: var(--warning); }
.health-metrics article:nth-child(3) strong { color: #6f5c8f; }

.cluster-route-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.cluster-route-card {
  min-width: 0;
  border: 1px solid rgba(36, 32, 44, .14);
  border-left: 5px solid #8a8393;
  background: rgba(255, 255, 255, .58);
  padding: 15px 14px 13px;
}

.cluster-route-card.tone-positive { border-left-color: #27865d; }
.cluster-route-card.tone-warning { border-left-color: #c18416; background: #fffaf0; }
.cluster-route-card.tone-danger { border-left-color: #c23b33; background: #fff5f4; }
.cluster-route-card.tone-observer { border-left-color: #735f96; background: #f8f5fc; }

.cluster-route-heading,
.certificate-row,
.cluster-event {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.cluster-route-heading > span,
.cluster-route-card p,
.certificate-row span,
.cluster-event,
.probe-budget-copy span,
.cluster-empty {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
}

.cluster-route-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
}

.cluster-route-heading > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cluster-state-badge {
  flex: 0 0 auto;
  border: 1px solid currentColor;
  color: #615b6c;
  padding: 3px 6px;
  font-family: var(--mono);
  font-size: 9px;
}

.tone-positive .cluster-state-badge { color: #19704c; }
.tone-warning .cluster-state-badge { color: #946200; }
.tone-danger .cluster-state-badge { color: #aa2d26; }
.tone-observer .cluster-state-badge { color: #735f96; }

.cluster-route-card h3 {
  margin: 14px 0 12px;
  font-size: 16px;
  letter-spacing: -.025em;
}

.cluster-route-card dl {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px 12px;
  margin: 0;
  font-family: var(--mono);
  font-size: 10px;
}

.cluster-route-card dt { color: var(--muted); }
.cluster-route-card dd { margin: 0; color: var(--ink); font-variant-numeric: tabular-nums; }
.cluster-route-card p { min-height: 2.8em; margin: 13px 0 0; line-height: 1.45; }

.health-lower-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}

.probe-budget-copy {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 22px 0 11px;
}

.probe-budget-copy > div { min-width: 0; }
.probe-budget-track { height: 9px; background: rgba(36, 32, 44, .09); overflow: hidden; }
.probe-budget-track i { display: block; width: 0; height: 100%; background: #27865d; transition: width 180ms ease; }
.probe-budget-track i.near-budget { background: #c18416; }
.probe-budget-track i.over-budget { background: #c23b33; }

.certificate-list,
.cluster-event-list { display: grid; gap: 0; margin-top: 13px; }
.certificate-row { border-top: 1px solid rgba(36, 32, 44, .10); padding: 12px 0; }
.certificate-row > div { display: grid; gap: 3px; }
.certificate-row > div:first-child { min-width: 0; }
.certificate-row > div:first-child span { overflow-wrap: anywhere; }
.certificate-row > div:last-child { justify-items: end; }
.certificate-row strong { font-family: var(--mono); font-size: 11px; }
.certificate-row.tone-warning > div:last-child strong { color: #946200; }
.certificate-row.tone-serious > div:last-child strong { color: #b25814; }
.certificate-row.tone-danger > div:last-child strong { color: #aa2d26; }
.certificate-row.tone-observer > div:last-child strong { color: #735f96; }

.cluster-event { flex-wrap: wrap; justify-content: flex-start; border-top: 1px solid rgba(36, 32, 44, .10); padding: 10px 0; }
.cluster-event i { width: 8px; height: 8px; background: #8a8393; }
.cluster-event.tone-positive i { background: #27865d; }
.cluster-event.tone-warning i { background: #c18416; }
.cluster-event.tone-danger i { background: #c23b33; }
.cluster-event.tone-observer i { background: #735f96; }
.cluster-event > .event-main { flex: 1; }
.cluster-event time { margin-left: auto; color: #8a8393; font-variant-numeric: tabular-nums; }
.cluster-empty { margin: 16px 0 4px; }

@media (max-width: 980px) {
  .cluster-route-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 680px) {
  .cluster-route-grid,
  .health-lower-grid { grid-template-columns: 1fr; }
  .probe-budget-copy { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 620px) {
  .probe-failure-chart-panel .section-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .probe-failure-chart-panel .chart-meta {
    width: 100%;
    justify-items: stretch;
  }

  .probe-failure-controls {
    display: grid;
    width: 100%;
    grid-template-columns: minmax(0, 1fr);
  }

  .probe-failure-range,
  .probe-failure-grouping {
    display: grid;
    width: 100%;
  }

  .probe-failure-range {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .probe-failure-grouping {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .probe-failure-range button,
  .probe-failure-grouping button,
  .probe-failure-chart-legend .chart-legend-item {
    min-height: 44px;
  }

  .probe-failure-chart-legend {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2px 4px;
  }

  .probe-failure-chart-legend .chart-legend-item {
    min-width: 0;
    justify-content: flex-start;
  }

  .probe-failure-chart-legend .chart-legend-item span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .probe-failure-chart-wrap .chart-tooltip {
    max-width: calc(100% - 16px);
    max-height: min(260px, 60vh);
    overflow-y: auto;
  }

  .probe-failure-chart-wrap .chart-tooltip > span {
    grid-template-columns: 9px minmax(0, 1fr) auto;
  }

  .probe-failure-chart-wrap .chart-tooltip b {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

/* Installed mobile shell. Browser and desktop layouts intentionally remain unchanged. */
@media (max-width: 620px) {
  html.pwa-standalone {
    --mobile-surface: rgba(255, 255, 255, .94);
    --mobile-shadow: 0 8px 28px rgba(35, 27, 55, .08);
    min-height: 100%;
    background: #f6f5f8;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
    overscroll-behavior-y: none;
  }

  html.pwa-standalone body {
    min-height: 100dvh;
    background:
      radial-gradient(circle at 92% 2%, rgba(98, 56, 215, .09), transparent 38%),
      #f6f5f8;
    font-family: inherit;
  }

  html.pwa-standalone button,
  html.pwa-standalone input,
  html.pwa-standalone select,
  html.pwa-standalone code {
    font-family: inherit;
  }

  html.pwa-standalone .topbar {
    position: sticky;
    top: 0;
    z-index: 60;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 9px;
    min-height: calc(62px + env(safe-area-inset-top));
    border: 0;
    background: rgba(246, 245, 248, .88);
    box-shadow: 0 1px 0 rgba(36, 32, 44, .06);
    padding:
      calc(9px + env(safe-area-inset-top))
      max(14px, env(safe-area-inset-right))
      9px
      max(14px, env(safe-area-inset-left));
    backdrop-filter: blur(20px) saturate(135%);
  }

  html.pwa-standalone .brand {
    min-width: 0;
    justify-content: flex-start;
  }

  html.pwa-standalone .brand h1 {
    overflow: hidden;
    font-family: inherit;
    font-size: 20px;
    font-weight: 750;
    letter-spacing: -.035em;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  html.pwa-standalone .pwa-network-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 32px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .76);
    color: #6e6877;
    padding: 5px 9px;
    font-size: 11px;
    white-space: nowrap;
  }

  html.pwa-standalone .pwa-network-status i {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #8d8796;
  }

  html.pwa-standalone .pwa-network-status[data-state="online"] i { background: #27865d; }
  html.pwa-standalone .pwa-network-status[data-state="checking"] i { background: #c18416; }
  html.pwa-standalone .pwa-network-status[data-state="offline"] i,
  html.pwa-standalone .pwa-network-status[data-state="unreachable"] i { background: #c23b33; }

  html.pwa-standalone .topbar > #logout {
    min-width: 48px;
    min-height: 40px;
    border: 0;
    border-radius: 14px;
    background: rgba(255, 255, 255, .82);
    box-shadow: none;
    padding: 7px 10px;
  }

  html.pwa-standalone .login-shell {
    min-height: calc(100dvh - 62px - env(safe-area-inset-top));
    padding: 20px max(16px, env(safe-area-inset-right)) calc(24px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  }

  html.pwa-standalone .login-card {
    border: 0;
    border-radius: 24px;
    background: var(--mobile-surface);
    box-shadow: var(--mobile-shadow);
    padding: 28px 22px 24px;
  }

  html.pwa-standalone .login-card h2 {
    font-size: 30px;
    font-weight: 760;
  }

  html.pwa-standalone .page-shell {
    width: 100%;
    padding:
      14px
      max(14px, env(safe-area-inset-right))
      calc(96px + env(safe-area-inset-bottom))
      max(14px, env(safe-area-inset-left));
  }

  html.pwa-standalone .workspace-bar {
    position: static;
    display: block;
    margin: 0 0 18px;
    border: 0;
    background: transparent;
    backdrop-filter: none;
  }

  html.pwa-standalone .workspace-bar .toolbar {
    align-items: center;
    flex-direction: row;
    justify-content: space-between;
    gap: 10px;
    min-height: 48px;
    border: 0;
    border-radius: 18px;
    background: rgba(255, 255, 255, .72);
    box-shadow: none;
    padding: 7px 8px 7px 13px;
  }

  html.pwa-standalone .workspace-bar .toolbar button,
  html.pwa-standalone .page-heading > button,
  html.pwa-standalone .traffic-controls > button {
    min-height: 44px;
    border: 0;
    border-radius: 14px;
    box-shadow: none;
  }

  html.pwa-standalone .section-nav {
    position: fixed;
    z-index: 70;
    right: 0;
    bottom: 0;
    left: 0;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px;
    margin: 0;
    border: 0;
    background: rgba(255, 255, 255, .92);
    box-shadow: 0 -8px 28px rgba(35, 27, 55, .08);
    padding:
      7px
      max(10px, env(safe-area-inset-right))
      calc(7px + env(safe-area-inset-bottom))
      max(10px, env(safe-area-inset-left));
    backdrop-filter: blur(22px) saturate(140%);
  }

  html.pwa-standalone .section-nav button {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    min-height: 56px;
    border: 0;
    border-radius: 18px;
    background: transparent;
    box-shadow: none;
    color: #77717f;
    padding: 9px 5px;
    font-family: inherit;
    font-size: 12px;
    font-weight: 650;
  }

  html.pwa-standalone .section-nav button::before {
    display: block;
    flex: 0 0 auto;
    width: 21px;
    height: 21px;
    background: currentColor;
    content: "";
    -webkit-mask-position: center;
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-size: contain;
    mask-position: center;
    mask-repeat: no-repeat;
    mask-size: contain;
  }

  html.pwa-standalone .section-nav button[data-view="accounts"]::before {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 12a4 4 0 1 0 0-8 4 4 0 0 0 0 8Zm-7 8a7 7 0 0 1 14 0v1H5v-1Z'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 12a4 4 0 1 0 0-8 4 4 0 0 0 0 8Zm-7 8a7 7 0 0 1 14 0v1H5v-1Z'/%3E%3C/svg%3E");
  }

  html.pwa-standalone .section-nav button[data-view="traffic"]::before {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 20V9h4v11H4Zm6 0V4h4v16h-4Zm6 0v-7h4v7h-4Z'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 20V9h4v11H4Zm6 0V4h4v16h-4Zm6 0v-7h4v7h-4Z'/%3E%3C/svg%3E");
  }

  html.pwa-standalone .section-nav button[data-view="health"]::before {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 13h4l2-6 4 11 2-5h6v2h-4.6L13 23 9 12l-.6 3H3v-2Z'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 13h4l2-6 4 11 2-5h6v2h-4.6L13 23 9 12l-.6 3H3v-2Z'/%3E%3C/svg%3E");
  }

  html.pwa-standalone .section-nav button[data-view="help"]::before {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20Zm0 16.3a1.3 1.3 0 1 1 0-2.6 1.3 1.3 0 0 1 0 2.6ZM13 14h-2c0-3 3-2.8 3-5a2 2 0 0 0-4 0H8a4 4 0 0 1 8 0c0 3.4-3 3.5-3 5Z'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20Zm0 16.3a1.3 1.3 0 1 1 0-2.6 1.3 1.3 0 0 1 0 2.6ZM13 14h-2c0-3 3-2.8 3-5a2 2 0 0 0-4 0H8a4 4 0 0 1 8 0c0 3.4-3 3.5-3 5Z'/%3E%3C/svg%3E");
  }

  html.pwa-standalone .section-nav button:hover {
    background: rgba(98, 56, 215, .07);
    transform: none;
  }

  html.pwa-standalone .section-nav button.active,
  html.pwa-standalone .section-nav button[aria-current="page"] {
    border: 0;
    background: rgba(98, 56, 215, .12);
    color: #5730c2;
  }

  html.pwa-standalone .page-heading {
    margin: 8px 2px 18px;
  }

  html.pwa-standalone .page-heading h2,
  html.pwa-standalone .chart-heading h2 {
    font-family: inherit;
    font-size: clamp(34px, 11vw, 46px);
    font-weight: 780;
    line-height: 1.02;
    letter-spacing: -.055em;
  }

  html.pwa-standalone button {
    border-radius: 14px;
    box-shadow: none;
  }

  html.pwa-standalone button:hover,
  html.pwa-standalone button:active {
    transform: none;
    box-shadow: none;
  }

  html.pwa-standalone input,
  html.pwa-standalone select {
    min-height: 48px;
    border: 1px solid rgba(36, 32, 44, .12);
    border-radius: 14px;
    background: rgba(255, 255, 255, .90);
  }

  html.pwa-standalone .panel,
  html.pwa-standalone .metric-strip,
  html.pwa-standalone .framed,
  html.pwa-standalone .collection-state,
  html.pwa-standalone .cluster-route-card {
    border: 0;
    border-radius: 24px;
    background: var(--mobile-surface);
    box-shadow: var(--mobile-shadow);
  }

  html.pwa-standalone .panel {
    margin-top: 16px;
    padding: 20px 16px 17px;
  }

  html.pwa-standalone .metric-strip {
    gap: 9px;
    background: transparent;
    box-shadow: none;
    overflow: visible;
  }

  html.pwa-standalone .metric-strip article {
    min-height: 102px;
    border: 0 !important;
    border-radius: 20px;
    background: var(--mobile-surface);
    box-shadow: 0 5px 20px rgba(35, 27, 55, .055);
    padding: 15px 14px;
  }

  html.pwa-standalone .metric-strip span,
  html.pwa-standalone .metric-strip small,
  html.pwa-standalone .status,
  html.pwa-standalone th {
    font-family: inherit;
  }

  html.pwa-standalone .metric-strip strong {
    font-family: inherit;
    font-size: 22px;
  }

  html.pwa-standalone .table-scroll,
  html.pwa-standalone .compact-table-scroll {
    border-radius: 16px;
    overscroll-behavior-x: contain;
  }

  html.pwa-standalone .segmented-control {
    border: 0;
    border-radius: 16px;
    background: rgba(36, 32, 44, .06);
    padding: 4px;
  }

  html.pwa-standalone .segmented-control button {
    min-height: 44px;
    border-radius: 12px;
    font-family: inherit;
  }

  html.pwa-standalone .segmented-control button.active {
    background: #fff;
    box-shadow: 0 3px 12px rgba(35, 27, 55, .09);
    color: #5730c2;
  }

  html.pwa-standalone .chart-panel .chart-wrap,
  html.pwa-standalone .chart-wrap {
    min-height: 180px;
    border-radius: 18px;
    background: #faf9fc;
    overflow: hidden;
    padding: 8px 4px 2px;
  }

  html.pwa-standalone .chart-panel .chart-wrap canvas,
  html.pwa-standalone .chart-wrap canvas {
    height: 200px;
    max-height: 220px;
  }

  html.pwa-standalone .chart-tooltip,
  html.pwa-standalone .action-menu-popover {
    border: 0;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(35, 27, 55, .14);
  }

  html.pwa-standalone .cluster-route-card {
    border-left: 5px solid #8a8393;
    padding: 17px 15px;
  }

  html.pwa-standalone .cluster-route-card.tone-positive { border-left-color: #27865d; }
  html.pwa-standalone .cluster-route-card.tone-warning { border-left-color: #c18416; }
  html.pwa-standalone .cluster-route-card.tone-danger { border-left-color: #c23b33; }
  html.pwa-standalone .cluster-route-card.tone-observer { border-left-color: #735f96; }

  html.pwa-standalone .editor-dialog,
  html.pwa-standalone .subscription-dialog,
  html.pwa-standalone .qr-dialog,
  html.pwa-standalone .confirm-dialog {
    width: calc(100vw - 24px);
    max-height: calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 24px);
    border: 0;
    border-radius: 26px;
    background: #fbfafc;
    box-shadow: 0 20px 60px rgba(35, 27, 55, .20);
  }

  html.pwa-standalone .editor-dialog .account-form,
  html.pwa-standalone .confirm-dialog form {
    border-radius: 26px;
    background: #fbfafc;
  }
}
