
:root {
  color-scheme: light;
  --background: #f9f8f4;
  --surface: #fff;
  --raised: #fcfbf8;
  --inset: #f3f1ea;
  --text: #171715;
  --muted: #57534c;
  --border: #ddd8ce;
  --accent: #006dcc;
  --accent-fill: #006dcc;
  --accent-hover: #005caf;
  --accent-ink: #fff;
  --accent-surface: #eaf4fc;
  --signal: #f84c35;
  --positive: #235b43;
  --positive-surface: #e7f2e9;
  --warning: #8a460f;
  --warning-surface: #fff0d9;
  --paper-warm: #f4eddf;
  --paper-cool: #eaf3f8;
  --outline-ink: var(--text);
  --radius: 16px;
  --radius-inner: 10px;
  --outline: 2px solid var(--outline-ink);
  --lift: 0 2px 0 var(--outline-ink);
  --sans: Geist, 'Upso Chinese', 'PingFang SC', 'Microsoft YaHei', system-ui, sans-serif;
  --mono: ui-monospace, 'SFMono-Regular', Consolas, 'Upso Chinese', monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --background: #191714;
    --surface: #231f19;
    --raised: #2b261f;
    --inset: #1d1a16;
    --text: #fbf3e5;
    --muted: #c6bbab;
    --border: #504638;
    --accent: #81c2ff;
    --accent-surface: #23364a;
    --signal: #ff6c56;
    --positive: #a0e0bf;
    --positive-surface: #24382e;
    --warning: #ffd29a;
    --warning-surface: #47331e;
    --paper-warm: #2e261d;
    --paper-cool: #202b34;
    --outline-ink: #c6b59c;
  }
}
@font-face {
  font-family: Geist;
  src: url('/geist-latin.woff2') format('woff2');
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Upso Chinese';
  src: url('/ui-font.woff2') format('woff2');
  font-style: normal;
  font-weight: 400 750;
  font-display: swap;
  unicode-range: U+3000-303F, U+3400-9FFF, U+FF00-FFEF;
}
*, *::before, *::after { box-sizing: border-box; }
html { background: var(--background); scroll-padding-top: calc(env(safe-area-inset-top, 0px) + 69px); }
body { margin: 0; color: var(--text); background: radial-gradient(ellipse 420px 430px at 0 0, var(--paper-warm), transparent), radial-gradient(ellipse 360px 390px at 100% 510px, var(--paper-cool), transparent), var(--background); font: 14px/1.55 var(--sans); }
button, input { font: inherit; }
a { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
main { --content-width: min(100% - 36px, 1080px); margin-inline: auto; width: var(--content-width); }
.dashboard { width: 100%; }
.dashboard > :not(.jump-bar) { width: var(--content-width); margin-inline: auto; }
.dashboard > .topbar { padding-top: calc(10px + env(safe-area-inset-top, 0px)); }
h1, h2, h3, p { margin: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
h2 { font-size: 18px; line-height: 1.3; font-weight: 650; }
h3 { font-size: 15px; line-height: 1.4; font-weight: 650; overflow-wrap: anywhere; }
.muted { color: var(--muted); overflow-wrap: anywhere; }
.topbar { min-height: 68px; display: flex; justify-content: space-between; align-items: center; gap: 10px; padding-block: 10px; }
.brand { display: inline-flex; align-items: center; gap: 6px; flex: none; color: var(--text); font-size: 24px; line-height: 1; font-weight: 750; letter-spacing: -.065em; }
.brand-mark { display: block; flex: none; width: 32px; height: 32px; }
.actions { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.button { display: inline-flex; justify-content: center; align-items: center; gap: 7px; min-height: 44px; padding: 8px 12px; border: var(--outline); border-radius: 12px; background: var(--surface); color: var(--text); box-shadow: var(--lift); text-decoration: none; font-weight: 600; cursor: pointer; transition: background .15s, box-shadow .15s, translate .15s; }
.button svg { flex: none; width: 16px; height: 16px; }
.button.subtle { border-color: transparent; background: transparent; box-shadow: none; color: var(--muted); }
.button.primary { background: var(--accent-fill); color: var(--accent-ink); }
.button:not(.subtle):active { box-shadow: none; translate: 0 2px; }
@media (hover: hover) {
  .button:hover { background: var(--accent-surface); color: var(--text); }
  .button.primary:hover { background: var(--accent-hover); color: var(--accent-ink); }
}
.hero { padding-block: 8px 18px; text-align: center; }
.header-illustration { display: block; margin-inline: auto; width: min(100%, 420px); height: auto; }
.hero-meta { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 4px 9px; margin-top: 5px; }
.updated { min-height: 17px; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.preview-label { padding: 1px 7px; border-radius: 5px; background: var(--inset); font-size: 11px; color: var(--muted); }
.jump-bar { position: sticky; z-index: 1; top: 0; margin-bottom: 20px; padding: calc(8px + env(safe-area-inset-top, 0px)) max(12px, env(safe-area-inset-right, 0px)) 8px max(12px, env(safe-area-inset-left, 0px)); border-bottom: 1px solid var(--border); background: var(--background); }
.jump-nav { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; width: min(100%, 480px); margin-inline: auto; }
.jump-link { min-height: 44px; border-radius: var(--radius-inner); display: flex; justify-content: center; align-items: center; gap: 6px; text-decoration: none; color: var(--text); font-weight: 600; white-space: nowrap; }
.jump-link svg { flex: none; width: 16px; height: 16px; }
.jump-link:hover { background: var(--accent-surface); color: var(--accent); }
.jump-link[aria-current='location'] { background: var(--text); color: var(--surface); }
.grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.grid > section:not(.quotas) { min-width: 0; padding: 16px; background: var(--surface); border: var(--outline); border-radius: var(--radius); }
.quota-section-heading, .group-heading { border-top: var(--outline); padding-top: 12px; }
.quota-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.quota-section-heading h2, .group-heading h2, #profiles h2, #nodes h2 { font-size: 22px; font-weight: 700; }
.quota-section-heading p, .group-heading p, .section-heading p { margin-top: 3px; font-size: 13px; color: var(--muted); }
.section-count { flex: none; color: var(--muted); font-size: 11px; border: 1px solid var(--border); border-radius: 100px; padding: 3px 8px; background: var(--raised); }
.cards { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.card { display: grid; min-width: 0; align-content: start; gap: 10px; padding: 14px; border: 1px solid var(--border); border-radius: var(--radius-inner); background: var(--raised); }
.quota-cards { grid-template-columns: repeat(auto-fit, minmax(min(170px, 100%), 1fr)); }
.quota-card { gap: 9px; border: var(--outline); border-radius: var(--radius); background: var(--surface); padding: 12px; box-shadow: var(--lift); }
.quota-heading { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }
.quota-heading h3 { flex: 1 1 50px; font-size: 12px; }
.quota-icon, .section-icon { display: grid; flex: none; place-items: center; width: 32px; height: 32px; color: var(--accent); border: 1px solid currentColor; border-radius: 50%; background: var(--accent-surface); }
.quota-icon { width: 22px; height: 22px; }
.quota-icon svg { width: 13px; height: 13px; }
.quota-percent { padding: 2px 5px; border-radius: 5px; color: var(--accent); background: var(--accent-surface); font-size: 11px; font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
.quota-value { display: flex; flex-direction: column; align-items: baseline; gap: 2px 6px; font-variant-numeric: tabular-nums; }
.quota-value strong { font-size: clamp(23px, 5.9vw, 33px); line-height: 1.14; letter-spacing: -.045em; }
.quota-value span { color: var(--muted); font-size: 11px; }
.progress, .progress-empty { appearance: none; display: block; width: 100%; height: 6px; border: 0; border-radius: 8px; background: var(--inset); overflow: hidden; }
.progress::-webkit-progress-bar { background: var(--border); border-radius: 8px; }
.progress::-webkit-progress-value { background: var(--accent); border-radius: 8px; }
.progress::-moz-progress-bar { background: var(--accent); border-radius: 8px; }
.quota-card[data-warning] .quota-percent { color: var(--warning); background: var(--warning-surface); }
.quota-card[data-warning] .progress::-webkit-progress-value { background: var(--warning); }
.quota-card[data-warning] .progress::-moz-progress-bar { background: var(--warning); }
.quota-reset { display: flex; flex-wrap: wrap; gap: 1px 9px; justify-content: space-between; padding-top: 7px; border-top: 1px solid var(--border); color: var(--muted); font-size: 11px; }
.quota-reset > :last-child { font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.quota-card > .muted { font-size: 11px; }
.usage-trend{display:grid;gap:6px;border-top:1px solid var(--border);padding-top:12px}
.trend-heading,.trend-legend{display:flex;align-items:center;flex-wrap:wrap;gap:8px 12px;font-size:12px}
.trend-heading{justify-content:space-between}.trend-ok{color:var(--positive)}.trend-warn{color:var(--warning)}
.trend-plot{display:block;width:100%;height:auto;overflow:visible}
.trend-plot text{fill:var(--muted);font-size:11px}
.trend-plot line,.trend-plot polyline{fill:none;vector-effect:non-scaling-stroke}
.trend-axis{stroke:var(--border)}.trend-limit{stroke:var(--warning);stroke-dasharray:2 4}
.trend-actual{stroke:var(--accent);stroke-width:2;stroke-linejoin:round}
.trend-forecast{stroke:var(--muted);stroke-width:2;stroke-dasharray:5 4}
.trend-now{fill:var(--accent)}.trend-hit{fill:transparent}
.trend-legend span{display:inline-flex;align-items:center;gap:5px}
.trend-legend span::before{content:'';width:15px;border-top:2px solid var(--accent)}
.trend-legend .legend-forecast::before{border-color:var(--muted);border-top-style:dashed}
.trend-legend .legend-limit::before{border-color:var(--warning);border-top-style:dotted}
.trend-summary,.trend-note{font-size:12px;font-variant-numeric:tabular-nums}
.group-heading { margin-top: 14px; }
.section-heading { display: flex; align-items: center; gap: 10px; margin-bottom: 11px; }
#profiles, #nodes { margin-top: 8px; }
.notice { padding: 11px 12px; border: 1px dashed var(--muted); border-radius: var(--radius-inner); color: var(--muted); background: var(--inset); font-size: 13px; overflow-wrap: anywhere; }
.row { min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 0; }
.row > div { min-width: 0; overflow-wrap: anywhere; }
.row + .row, .network-node + .network-node, #node-list > .row:first-child { border-top: 1px solid var(--border); }
.row .muted { margin-top: 1px; font-size: 12px; }
.pill { display: inline-flex; align-items: center; gap: 5px; flex: none; padding: 3px 8px; border-radius: 100px; color: var(--muted); background: var(--raised); font-size: 11px; font-weight: 650; }
.pill::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.pill.ok { color: var(--positive); background: var(--positive-surface); }
.pill.stale { color: var(--warning); background: var(--warning-surface); }
.metric-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.metric { display: grid; align-content: start; gap: 2px; border-radius: 8px; padding: 8px; background: var(--inset); min-width: 0; }
.metric.wide { grid-column: 1 / -1; }
.metric span, .card > .muted { font-size: 11px; }
.metric strong { font: 600 13px/1.45 var(--mono); overflow-wrap: anywhere; }
.network-node { padding: 8px 0; }
.network-node h3 { margin-bottom: 8px; }
.profile-group + .profile-group { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); }
.profile-group-title { color: var(--muted); font-size: 13px; margin-bottom: 9px; }
.profile-heading { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.profile-type { font-size: 10px; font-weight: 650; letter-spacing: .04em; color: var(--accent); background: var(--accent-surface); padding: 2px 6px; border-radius: 4px; }
.profile-meta:empty { display: none; }
.status:empty { position: absolute; width: 1px; height: 1px; margin: 0; padding: 0; overflow: hidden; clip-path: inset(50%); }
.profile-details { border-top: 1px solid var(--border); }
.profile-details summary { display: flex; justify-content: space-between; align-items: center; gap: 6px; min-height: 44px; color: var(--muted); cursor: pointer; list-style: none; }
.profile-details summary::-webkit-details-marker { display: none; }
.profile-details summary svg { flex: none; }
.profile-details[open] summary svg { transform: rotate(180deg); }
.qr { display: block; max-width: 100%; height: auto; padding: 8px; border-radius: 8px; background: #fff; }
.url { display: flex; align-items: center; min-height: 44px; margin-top: 4px; overflow-wrap: anywhere; }
.form { display: flex; align-items: end; flex-wrap: wrap; gap: 10px; margin: 13px 0; }
.form label { display: grid; flex: 1 1 185px; gap: 5px; color: var(--muted); font-size: 13px; }
.form input { width: 100%; min-height: 44px; padding: 8px 10px; font-size: 16px; background: var(--raised); color: var(--text); border: var(--outline); border-radius: 12px; }
.form input::placeholder { color: var(--muted); }
.status { margin: 10px 0; padding: 10px 12px; color: var(--text); background: var(--accent-surface); border-radius: 8px; overflow-wrap: anywhere; }
.footer { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 28px; padding: 16px 0 max(24px, env(safe-area-inset-bottom)); border-top: var(--outline); color: var(--muted); font-size: 12px; }
.footer .brand { font-size: 16px; }
.footer .brand-mark { width: 24px; height: 24px; }
.login { min-height: 100svh; max-width: 520px; display: flex; flex-direction: column; padding-bottom: max(28px, env(safe-area-inset-bottom)); }
.login-badge { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; }
.login-badge svg { width: 14px; height: 14px; }
.login-panel { margin-block: clamp(32px, 11vh, 100px) auto; border: var(--outline); border-radius: var(--radius); background: var(--surface); box-shadow: var(--lift); }
.login-content { padding: clamp(22px, 7vw, 36px); text-align: center; }
.login-content > p:not(.status) { max-width: 26em; margin: 18px auto 0; color: var(--muted); }
.login h1 { margin-top: 15px; font-size: clamp(27px, 7vw, 34px); line-height: 1.2; letter-spacing: -.035em; }
.login .header-illustration { width: min(100%, 270px); }
.login-content .button { width: 100%; max-width: 280px; margin-top: 22px; }
@media (min-width: 640px) {
  main { --content-width: min(100% - 64px, 1080px); }
  .topbar { min-height: 76px; }
  .hero { padding-block: 10px 22px; }
  .jump-bar { margin-bottom: 26px; }
  .grid { gap: 14px; }
  .grid > section:not(.quotas) { padding: 18px; }
  .cards { grid-template-columns: repeat(auto-fit, minmax(min(230px, 100%), 1fr)); }
  .quota-card { padding: 16px; }
  .quota-value { flex-flow: row wrap; }
}
@media (min-width: 920px) {
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .span12 { grid-column: 1 / -1; }
}
@media (max-width: 359px) {
  main { --content-width: calc(100% - 24px); }
  .topbar .button { padding-inline: 8px; }
  .jump-link { font-size: 13px; gap: 4px; }
  .jump-link svg { width: 14px; height: 14px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; } }
