/* ==========================================================================
   Lumen — Xboard user theme
   Tokens → base → layout → components → pages
   ========================================================================== */

:root {
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI Variable Text", "Segoe UI",
    "HarmonyOS Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei",
    "Noto Sans SC", "Source Han Sans SC", system-ui, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI Variable Display", "Segoe UI",
    "HarmonyOS Sans SC", "PingFang SC", "Microsoft YaHei UI", "Microsoft YaHei", system-ui, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Mono", "JetBrains Mono", Menlo, Consolas, monospace;

  /* Light surfaces */
  --bg: #f2f3f6;
  --surface: #ffffff;
  --surface-2: #f7f8fa;
  --surface-3: #eef0f4;
  --ink: #121826;
  --ink-2: #4a5263;
  --ink-3: #848c9d;
  --line: #e2e5eb;
  --line-strong: #cfd4dd;
  --scrim: rgba(18, 24, 38, 0.42);

  /* The instrument panel (dashboard dial) */
  --dial: #111a2c;
  --dial-2: #18233a;
  --dial-ink: #edf0f6;
  --dial-ink-2: #98a2b6;
  --dial-ink-3: #5d6880;
  --dial-line: #26324b;

  /* Status — reserved, always paired with an icon or word */
  --ok: #10805a;
  --ok-soft: #e3f4ec;
  --warn: #a8590a;
  --warn-soft: #fbefdf;
  --danger: #c22b2b;
  --danger-soft: #fbe6e6;

  /* Accent (overridden by data-accent) */
  --accent: #3346d3;
  --accent-hover: #2738b8;
  --accent-ink: #ffffff;
  --accent-soft: #eaedfc;
  --accent-on-dial: #8d9bff;

  --radius-lg: 18px;
  --radius: 12px;
  --radius-sm: 9px;
  --shadow-pop: 0 18px 48px -16px rgba(18, 24, 38, 0.28), 0 2px 6px rgba(18, 24, 38, 0.06);
  --ring: 0 0 0 3px color-mix(in srgb, var(--accent) 28%, transparent);

  --topbar-h: 64px;
  --tabbar-h: 62px;
  --content-w: 1120px;
  --ease: cubic-bezier(.2, .7, .2, 1);

  color-scheme: light;
}

[data-accent="teal"]     { --accent: #0b766e; --accent-hover: #075f58; --accent-soft: #e0f2f0; --accent-on-dial: #4fd1c1; }
[data-accent="gold"]     { --accent: #8f6420; --accent-hover: #765117; --accent-soft: #f6eedf; --accent-on-dial: #e2b766; }
[data-accent="violet"]   { --accent: #6a3dd0; --accent-hover: #582fb3; --accent-soft: #efe9fc; --accent-on-dial: #b39bff; }
[data-accent="graphite"] { --accent: #1d2433; --accent-hover: #0f1420; --accent-soft: #e9ebef; --accent-on-dial: #e6e9ef; }

[data-theme="dark"] {
  --bg: #0f141d;
  --surface: #161c27;
  --surface-2: #1a212d;
  --surface-3: #212937;
  --ink: #e9ecf2;
  --ink-2: #a6aebd;
  --ink-3: #727b8c;
  --line: #262e3c;
  --line-strong: #343d4d;
  --scrim: rgba(4, 7, 12, 0.62);

  --dial: #172034;
  --dial-2: #1d2840;
  --dial-ink: #eef1f7;
  --dial-ink-2: #9aa4b8;
  --dial-ink-3: #5f6a82;
  --dial-line: #2a3652;

  --ok: #3fc18f;
  --ok-soft: rgba(63, 193, 143, 0.13);
  --warn: #e8a24f;
  --warn-soft: rgba(232, 162, 79, 0.13);
  --danger: #f07373;
  --danger-soft: rgba(240, 115, 115, 0.13);

  --accent: #7d8cff;
  --accent-hover: #97a3ff;
  --accent-ink: #0d1120;
  --accent-soft: rgba(125, 140, 255, 0.14);
  --accent-on-dial: #8d9bff;

  --shadow-pop: 0 24px 60px -18px rgba(0, 0, 0, 0.7), 0 0 0 1px var(--line);
  color-scheme: dark;
}
[data-theme="dark"][data-accent="teal"]     { --accent: #3cc4b4; --accent-hover: #5fd4c6; --accent-soft: rgba(60, 196, 180, 0.14); --accent-on-dial: #4fd1c1; }
[data-theme="dark"][data-accent="gold"]     { --accent: #d9ad5e; --accent-hover: #e6c17f; --accent-soft: rgba(217, 173, 94, 0.14); --accent-on-dial: #e2b766; }
[data-theme="dark"][data-accent="violet"]   { --accent: #ab92ff; --accent-hover: #c0aeff; --accent-soft: rgba(171, 146, 255, 0.14); --accent-on-dial: #b39bff; }
[data-theme="dark"][data-accent="graphite"] { --accent: #dfe3ea; --accent-hover: #ffffff; --accent-soft: rgba(223, 227, 234, 0.1); --accent-on-dial: #e6e9ef; }

/* ---------------------------------------------------------------- base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "tnum" 0;
  min-height: 100vh;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4 { margin: 0; font-family: var(--font-display); line-height: 1.25; letter-spacing: -0.01em; }
p { margin: 0; }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 6px; }
.num { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--font-mono); font-size: 0.92em; }
.muted { color: var(--ink-2); }
.faint { color: var(--ink-3); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.nowrap { white-space: nowrap; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.ok-text { color: var(--ok); }
.warn-text { color: var(--warn); }
.danger-text { color: var(--danger); }
.icon { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.icon.sm { width: 16px; height: 16px; }
.icon.lg { width: 22px; height: 22px; }

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

/* ---------------------------------------------------------------- boot */
.boot { min-height: 100vh; display: grid; place-items: center; }
.boot-mark { width: 40px; height: 40px; border-radius: 12px; background: var(--ink); position: relative; overflow: hidden; }
.boot-mark::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255,255,255,.35), transparent); transform: translateX(-100%); animation: sweep 1.1s var(--ease) infinite; }
@keyframes sweep { to { transform: translateX(100%); } }

/* ---------------------------------------------------------------- buttons */
.btn {
  --h: 40px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: var(--h); padding: 0 16px;
  border: 1px solid transparent; border-radius: var(--radius-sm);
  background: var(--surface-3); color: var(--ink);
  font-weight: 550; font-size: 14px; letter-spacing: 0.01em;
  white-space: nowrap; user-select: none;
  transition: background .15s, border-color .15s, color .15s, transform .1s;
}
.btn:hover { background: color-mix(in srgb, var(--surface-3) 70%, var(--line-strong)); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn.is-loading { opacity: .55; pointer-events: none; }
.btn.is-loading::before { content: ""; width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-outline { background: transparent; border-color: var(--line-strong); }
.btn-outline:hover { background: var(--surface-2); border-color: var(--ink-3); }
.btn-ghost { background: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--surface-3); color: var(--ink); }
.btn-danger { background: var(--danger-soft); color: var(--danger); }
.btn-danger:hover { background: color-mix(in srgb, var(--danger-soft) 70%, var(--danger)); color: var(--danger); }
.btn-sm { --h: 32px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.btn-lg { --h: 48px; padding: 0 22px; font-size: 15px; border-radius: var(--radius); }
.btn-block { width: 100%; }
.btn-icon { width: var(--h); padding: 0; }
.link-btn { background: none; border: 0; padding: 0; color: var(--accent); font-weight: 550; }
.link-btn:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------------------------------------------------------------- forms */
.field { display: grid; gap: 7px; }
.field + .field { margin-top: 16px; }
.label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.hint { font-size: 12.5px; color: var(--ink-3); }
.input, .select, .textarea {
  width: 100%; height: 44px; padding: 0 14px;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  transition: border-color .15s, box-shadow .15s;
  appearance: none; -webkit-appearance: none;
}
.textarea { height: auto; min-height: 120px; padding: 12px 14px; resize: vertical; line-height: 1.6; }
.select { padding-right: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23848c9d' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; }
.input:hover, .select:hover, .textarea:hover { border-color: var(--ink-3); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
.input::placeholder, .textarea::placeholder { color: var(--ink-3); }
.input-group { display: flex; align-items: stretch; }
.input-group > .input { border-top-right-radius: 0; border-bottom-right-radius: 0; flex: 1; min-width: 0; }
.input-group > .btn, .input-group > .select { border-top-left-radius: 0; border-bottom-left-radius: 0; height: 44px; margin-left: -1px; }
.input-group > .select { width: auto; flex: none; max-width: 48%; background-color: var(--surface-2); }
.input-group > .btn-outline { border-color: var(--line-strong); }
.pw-wrap { position: relative; }
.pw-wrap .input { padding-right: 44px; }
.pw-toggle { position: absolute; right: 4px; top: 4px; width: 36px; height: 36px; border: 0; background: none; color: var(--ink-3); display: grid; place-items: center; border-radius: 8px; }
.pw-toggle:hover { color: var(--ink); }
.check { display: flex; align-items: flex-start; gap: 10px; font-size: 13.5px; color: var(--ink-2); cursor: pointer; }
.check input { width: 17px; height: 17px; margin: 2px 0 0; accent-color: var(--accent); flex: none; }

.switch { position: relative; width: 42px; height: 24px; flex: none; }
.switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; background: var(--line-strong); border-radius: 999px; transition: background .2s; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; background: #fff; border-radius: 50%; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .2s var(--ease); }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(18px); }
.switch input:focus-visible + span { box-shadow: var(--ring); }

/* Segmented control — used for billing periods & filters */
.seg { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; background: var(--surface-3); border-radius: var(--radius); }
.seg button { border: 0; background: transparent; height: 34px; padding: 0 14px; border-radius: 9px; color: var(--ink-2); font-size: 13.5px; font-weight: 550; }
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(18,24,38,.08), 0 0 0 1px var(--line); }
/* Dark mode: the card colour is darker than the track, so lift the selected
   option with a tint of the accent, white text and an accent outline */
[data-theme="dark"] .seg { background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); }
[data-theme="dark"] .seg button { color: var(--ink-3); }
[data-theme="dark"] .seg button:hover { color: var(--ink); }
[data-theme="dark"] .seg button[aria-pressed="true"] { background: color-mix(in srgb, var(--accent) 24%, var(--surface-3)); color: #fff; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 70%, transparent); font-weight: 600; }

/* Choice tiles — billing period / payment method */
.choices { display: grid; gap: 10px; }
.choices.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.choices.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.choice {
  position: relative; display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; min-height: 60px;
  border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface);
  text-align: left; transition: border-color .15s, background .15s;
}
.choice:hover { border-color: var(--ink-3); }
.choice[aria-checked="true"] { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.choice-main { flex: 1; min-width: 0; display: grid; gap: 2px; }
.choice-title { font-weight: 600; font-size: 14px; }
.choice-sub { font-size: 12.5px; color: var(--ink-3); }
.choice-side { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.choice-icon { width: 30px; height: 30px; border-radius: 8px; object-fit: contain; background: var(--surface-2); flex: none; }
.choice .tick { width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--line-strong); flex: none; display: grid; place-items: center; }
.choice[aria-checked="true"] .tick { border-color: var(--accent); background: var(--accent); }
.choice[aria-checked="true"] .tick::after { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent-ink); }

/* ---------------------------------------------------------------- auth layout */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); background: var(--bg); }
.auth-art {
  position: relative; overflow: hidden;
  background: var(--dial); color: var(--dial-ink);
  display: flex; flex-direction: column;
  padding: 44px 52px;
}
.auth-copy { margin-top: clamp(64px, 15vh, 168px); }
.auth-art.has-image { background-size: cover; background-position: center; }
.auth-art.has-image::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(10,14,24,.55), rgba(10,14,24,.25) 40%, rgba(10,14,24,.75)); }
.auth-art > * { position: relative; }
.auth-globe { position: absolute !important; right: -26%; bottom: -44%; width: 108%; max-width: 820px; color: var(--dial-ink-3); pointer-events: none; }
.auth-globe .lit { color: var(--accent-on-dial); }
.auth-art.has-image .auth-globe { display: none; }
.brand { display: flex; align-items: center; gap: 12px; font-weight: 650; font-size: 17px; letter-spacing: 0.01em; }
.brand img { width: 34px; height: 34px; border-radius: 9px; object-fit: contain; }
.brand-mark { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); font-weight: 700; font-size: 16px; }
.auth-art .brand-mark { background: var(--dial-ink); color: var(--dial); }
.auth-slogan { max-width: 15em; font-family: var(--font-display); font-size: clamp(30px, 3.4vw, 46px); line-height: 1.18; font-weight: 300; letter-spacing: -0.02em; text-wrap: balance; word-break: keep-all; overflow-wrap: anywhere; }
.auth-sub { margin-top: 16px; max-width: 30em; color: var(--dial-ink-2); font-size: 15px; }
.auth-foot { margin-top: auto; font-size: 12.5px; color: var(--dial-ink-3); }
.auth-form-wrap { display: flex; flex-direction: column; justify-content: center; padding: 48px clamp(24px, 5vw, 72px); background: var(--bg); }
/* The form sits on a card over the app's grey ground */
.auth-form {
  width: 100%; max-width: 448px; margin: 0 auto;
  padding: 40px 40px 32px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 22px;
  box-shadow: 0 1px 2px rgba(18, 24, 38, 0.04), 0 28px 56px -32px rgba(18, 24, 38, 0.22);
}
[data-theme="dark"] .auth-form { box-shadow: 0 28px 56px -28px rgba(0, 0, 0, 0.6); }
.auth-form h1 { font-size: 26px; font-weight: 650; }
.auth-form .lede { margin: 8px 0 30px; color: var(--ink-2); }
.auth-form .btn-primary { margin-top: 24px; }
.auth-alt { margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 12px; font-size: 14px; color: var(--ink-2); }
.auth-mobile-brand { display: none; margin-bottom: 36px; }
.captcha-slot:empty { display: none; }
.captcha-slot { margin-top: 16px; min-height: 65px; }

@media (max-width: 880px) {
  /* Phones: the brand panel becomes a band across the top; the form card overlaps it */
  .auth { display: block; }
  .auth-art { min-height: 0; padding: calc(24px + env(safe-area-inset-top, 0px)) max(20px, env(safe-area-inset-right, 0px)) 76px max(20px, env(safe-area-inset-left, 0px)); }
  .auth-copy { margin-top: 32px; }
  .auth-slogan { font-size: 24px; max-width: none; }
  .auth-sub { margin-top: 8px; font-size: 13.5px; }
  .auth-foot { display: none; }
  .auth-globe { width: 440px; max-width: none; right: -150px; bottom: -250px; }
  .auth-form-wrap { position: relative; z-index: 1; justify-content: flex-start; margin-top: -48px; padding: 0 max(16px, env(safe-area-inset-right, 0px)) calc(32px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); background: transparent; }
  .auth-form { padding: 28px 22px 22px; border-radius: 20px; }
  .auth-form h1 { font-size: 23px; }
  .auth-form .lede { margin-bottom: 24px; }
}

/* ---------------------------------------------------------------- app shell */
.topbar {
  position: sticky; top: 0; z-index: 30;
  height: calc(var(--topbar-h) + env(safe-area-inset-top, 0px));
  padding-top: env(safe-area-inset-top, 0px);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.6) blur(14px); -webkit-backdrop-filter: saturate(1.6) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
.topbar.scrolled { border-bottom-color: var(--line); }
.topbar-inner { max-width: calc(var(--content-w) + 64px); height: var(--topbar-h); margin: 0 auto; padding-inline: max(32px, env(safe-area-inset-left, 0px)) max(32px, env(safe-area-inset-right, 0px)); display: flex; align-items: center; gap: 28px; }
.topbar .brand { color: var(--ink); font-size: 16px; }
.topbar .brand:hover { text-decoration: none; }
.nav { display: flex; gap: 2px; flex: 1; }
.nav a { position: relative; display: flex; align-items: center; height: 36px; padding: 0 13px; border-radius: 9px; color: var(--ink-2); font-size: 14px; font-weight: 550; }
.nav a:hover { color: var(--ink); background: var(--surface-3); text-decoration: none; }
.nav a[aria-current="page"] { color: var(--ink); }
.nav a[aria-current="page"]::after { content: ""; position: absolute; left: 13px; right: 13px; bottom: -14px; height: 2px; background: var(--ink); border-radius: 2px; }
.topbar-actions { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.avatar-btn { display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 6px 0 4px; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; }
.avatar-btn:hover { border-color: var(--line-strong); }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--surface-3); object-fit: cover; }
.avatar-btn .who { font-size: 13px; color: var(--ink-2); max-width: 180px; }
.menu-anchor { position: relative; }
.menu {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 40;
  width: 260px; padding: 6px;
  background: var(--surface); border-radius: 14px; box-shadow: var(--shadow-pop);
  border: 1px solid var(--line);
  transform-origin: top right; animation: pop .16s var(--ease);
}
@keyframes pop { from { opacity: 0; transform: scale(.97) translateY(-4px); } }
.menu-head { padding: 10px 12px 12px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.menu-head .email { font-weight: 600; font-size: 14px; }
.menu-head .bal { font-size: 12.5px; color: var(--ink-3); margin-top: 2px; }
.menu a, .menu button { display: flex; align-items: center; gap: 12px; width: 100%; height: 38px; padding: 0 12px; border: 0; background: none; border-radius: 9px; color: var(--ink); font-size: 14px; text-align: left; }
.menu a:hover, .menu button:hover { background: var(--surface-3); text-decoration: none; }
.menu .icon { color: var(--ink-3); }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 6px 0; }
.menu .count { margin-left: auto; font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }

.main { max-width: calc(var(--content-w) + 64px); margin: 0 auto; padding: 28px max(32px, env(safe-area-inset-right, 0px)) 80px max(32px, env(safe-area-inset-left, 0px)); }
.tabbar { display: none; }

@media (max-width: 900px) {
  .nav, .avatar-btn .who { display: none; }
  .topbar-inner { padding-inline: max(16px, env(safe-area-inset-left, 0px)) max(16px, env(safe-area-inset-right, 0px)); gap: 12px; }
  .main { padding: 18px max(16px, env(safe-area-inset-right, 0px)) calc(var(--tabbar-h) + 36px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); }
  .tabbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    display: grid; grid-template-columns: repeat(var(--tabs, 5), 1fr);
    height: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
    background: color-mix(in srgb, var(--surface) 90%, transparent);
    backdrop-filter: saturate(1.6) blur(14px); -webkit-backdrop-filter: saturate(1.6) blur(14px);
    border-top: 1px solid var(--line);
  }
  .tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--ink-3); font-size: 11px; font-weight: 550; }
  .tabbar a:hover { text-decoration: none; }
  .tabbar a[aria-current="page"] { color: var(--ink); }
  .tabbar .icon { width: 22px; height: 22px; }
  .menu { position: fixed; left: 12px; right: 12px; top: calc(var(--topbar-h) - 4px); width: auto; }
}

/* ---------------------------------------------------------------- page scaffolding */
.page { animation: enter .22s var(--ease); }
@keyframes enter { from { opacity: 0; } }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 8px 0 24px; flex-wrap: wrap; }
.page-head h1 { font-size: 28px; font-weight: 650; }
.page-head .sub { margin-top: 6px; color: var(--ink-2); font-size: 14.5px; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); font-size: 13.5px; margin-bottom: 12px; }
.back:hover { color: var(--ink); text-decoration: none; }

.section { margin-top: 36px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.section-head h2 { font-size: 17px; font-weight: 650; }
.section-head .more { font-size: 13.5px; color: var(--ink-2); }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.panel-pad { padding: 24px; }
.panel-title { font-size: 15px; font-weight: 650; margin-bottom: 4px; }
.panel-desc { font-size: 13.5px; color: var(--ink-2); margin-bottom: 18px; }

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-main { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 24px; align-items: start; }
.sticky { position: sticky; top: calc(var(--topbar-h) + 20px); }
@media (max-width: 900px) {
  .grid-2, .grid-main { grid-template-columns: minmax(0, 1fr); }
  .sticky { position: static; }
  .page-head h1 { font-size: 24px; }
  .panel-pad { padding: 18px; }
  .choices.cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Rows — the default list form */
.rows { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
.row { display: flex; align-items: center; gap: 16px; padding: 16px 20px; border-top: 1px solid var(--line); color: inherit; }
.row:first-child { border-top: 0; }
a.row:hover, button.row:hover { background: var(--surface-2); text-decoration: none; }
button.row { width: 100%; border-left: 0; border-right: 0; border-bottom: 0; background: none; text-align: left; font: inherit; }
.row-main { flex: 1; min-width: 0; }
.row-title { font-weight: 600; font-size: 14.5px; }
.row-sub { font-size: 13px; color: var(--ink-3); margin-top: 2px; }
.row-side { flex: none; text-align: right; font-variant-numeric: tabular-nums; }
.row .chev { color: var(--ink-3); }

/* Key/value list */
.kv { display: grid; grid-template-columns: auto 1fr; gap: 12px 0; font-size: 14px; }
.kv dd { padding-left: 24px; }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.kv .total-row { padding-top: 12px; border-top: 1px solid var(--line); font-weight: 650; font-size: 15px; color: var(--ink); }

/* Table */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-weight: 600; font-size: 12.5px; color: var(--ink-3); padding: 12px 20px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--surface-2); }
.table td { padding: 14px 20px; border-top: 1px solid var(--line); vertical-align: middle; }
.table tr:first-child td { border-top: 0; }
.table .r { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table tbody tr:hover td { background: var(--surface-2); }

/* Badges & tags */
.badge { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--surface-3); color: var(--ink-2); white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.plain::before { display: none; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.danger { background: var(--danger-soft); color: var(--danger); }
.badge.accent { background: var(--accent-soft); color: var(--accent); }
.tag { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 6px; font-size: 12px; color: var(--ink-2); border: 1px solid var(--line); background: var(--surface); white-space: nowrap; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.dot { display: inline-block; vertical-align: middle; width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3); flex: none; }
.dot.ok { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.dot.off { background: var(--line-strong); }

/* Callout */
.callout { display: flex; gap: 14px; align-items: center; padding: 14px 18px; border-radius: var(--radius); background: var(--warn-soft); color: var(--ink); font-size: 14px; }
.callout .icon { color: var(--warn); }
.callout.info { background: var(--accent-soft); }
.callout.info .icon { color: var(--accent); }
.callout .grow { flex: 1; }

/* Empty state */
.empty { padding: 56px 24px; text-align: center; color: var(--ink-2); }
.empty-mark { width: 44px; height: 44px; margin: 0 auto 14px; border-radius: 12px; background: var(--surface-3); display: grid; place-items: center; color: var(--ink-3); }
.empty h3 { font-size: 15px; color: var(--ink); margin-bottom: 6px; }
.empty p { font-size: 14px; max-width: 26em; margin: 0 auto; }
.empty .btn { margin-top: 18px; }

/* Skeleton */
.sk { position: relative; overflow: hidden; background: var(--surface-3); border-radius: 8px; }
.sk::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--surface) 55%, transparent), transparent); transform: translateX(-100%); animation: sweep 1.3s ease-in-out infinite; }
.sk-line { height: 14px; margin: 10px 0; }
.sk-block { height: 220px; border-radius: var(--radius-lg); }

/* ---------------------------------------------------------------- toast & modal */
.toasts { position: fixed; z-index: 100; left: 50%; top: 18px; transform: translateX(-50%); display: grid; gap: 8px; pointer-events: none; width: max-content; max-width: calc(100vw - 32px); }
.toast { display: flex; align-items: center; gap: 10px; padding: 11px 16px; border-radius: 12px; background: var(--ink); color: var(--bg); font-size: 14px; font-weight: 500; box-shadow: var(--shadow-pop); animation: toast-in .22s var(--ease); pointer-events: auto; }
.toast .icon { width: 17px; height: 17px; }
.toast.ok .icon { color: #5ee0a6; }
.toast.err .icon { color: #ff8a8a; }
[data-theme="dark"] .toast { background: #f0f2f6; color: #121826; }
[data-theme="dark"] .toast.ok .icon { color: #0c8a5a; }
[data-theme="dark"] .toast.err .icon { color: #c22b2b; }
.toast.out { opacity: 0; transform: translateY(-6px); transition: .2s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } }

.modal-root { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 24px; background: var(--scrim); animation: fade .18s ease; }
@keyframes fade { from { opacity: 0; } }
.modal { width: 100%; max-width: 460px; max-height: calc(100vh - 48px); overflow: auto; background: var(--surface); border-radius: 20px; box-shadow: var(--shadow-pop); animation: rise .24s var(--ease); }
.modal.wide { max-width: 680px; }
@keyframes rise { from { opacity: 0; transform: translateY(12px) scale(.985); } }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 22px 24px 0; }
.modal-head h3 { font-size: 18px; font-weight: 650; }
.modal-body { padding: 14px 24px 24px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 0 24px 22px; }
.modal-close { width: 34px; height: 34px; margin: -6px -8px 0 0; border: 0; background: none; border-radius: 9px; color: var(--ink-3); display: grid; place-items: center; }
.modal-close:hover { background: var(--surface-3); color: var(--ink); }
@media (max-width: 640px) {
  .modal-root { place-items: end center; padding: 0; }
  .modal, .modal.wide { max-width: none; border-radius: 20px 20px 0 0; max-height: 88vh; padding-bottom: env(safe-area-inset-bottom); animation: sheet .28s var(--ease); }
  @keyframes sheet { from { transform: translateY(40px); opacity: 0; } }
}

/* ---------------------------------------------------------------- dashboard: the instrument */
.greet { margin: 4px 0 18px; display: flex; align-items: baseline; gap: 4px 16px; flex-wrap: wrap; }
.greet h1 { font-size: 24px; font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.greet-time { color: var(--ink-3); font-size: 14px; font-variant-numeric: tabular-nums; white-space: nowrap; }

.dial {
  position: relative; overflow: hidden;
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 20px 22px 16px;
}
.dial-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.plan-chip { max-width: 60%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; height: 26px; line-height: 26px; padding: 0 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 12.5px; font-weight: 650; }
.dial-figure { margin-top: 6px; }
.dial-label { font-size: 12.5px; color: var(--ink-2); margin-bottom: 6px; display: flex; align-items: center; gap: 8px; }
.dial-figure { display: flex; align-items: baseline; gap: 10px; font-family: var(--font-display); font-variant-numeric: tabular-nums; }
.dial-figure .big { font-size: clamp(34px, 3.4vw, 44px); font-weight: 200; line-height: .95; letter-spacing: -0.045em; }
.dial-figure .unit { font-size: 16px; font-weight: 400; color: var(--ink-2); letter-spacing: 0; }

/* Traffic used, as a percentage bar */
.usage { margin-top: 14px; }
.usage-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--ink-2); }
.usage-row b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.usage-pct { font-size: 15px; }
.usage-row { margin-top: 8px; }
.usage-bar { position: relative; height: 8px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.usage-bar span { position: absolute; inset: 0 auto 0 0; width: var(--w); min-width: 0; border-radius: inherit; background: var(--accent); animation: usage-in .7s var(--ease) both; }
@keyframes usage-in { from { width: 0; } }
.usage.warn .usage-bar span { background: var(--warn); }
.usage.warn .usage-pct { color: var(--warn); }
.usage.danger .usage-bar span { background: var(--danger); }
.usage.danger .usage-pct { color: var(--danger); }

@media (max-width: 720px) {
  .dial { padding: 18px 16px 14px; }
}

/* Copyable value (invite links, login email) */
.sub-url { display: flex; align-items: center; gap: 10px; padding: 0 6px 0 14px; height: 46px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface-2); min-width: 0; }
.sub-url code { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--font-mono); font-size: 13px; color: var(--ink-2); }

/* ---------------------------------------------------------------- dashboard layout */
.dash-guide { margin-bottom: 20px; }
/* Desktop keeps the full guide on top; the folded copy is for phones only */
.dl-guide { display: none; }
.dash-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.dash-left { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.notice-panel { min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; }
.notice-panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 18px 22px 0; }
.notice-panel-head h2 { font-size: 17px; font-weight: 650; }
.notice-list { display: grid; }
.notice { padding: 18px 22px 20px; min-width: 0; }
.notice + .notice { border-top: 1px solid var(--line); }
.notice-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.notice-head h3 { font-size: 15.5px; font-weight: 650; line-height: 1.45; text-wrap: balance; min-width: 0; }
.notice-head time { flex: none; }
.notice .tags { margin-bottom: 10px; }
.notice-img { width: 100%; height: auto; border-radius: 10px; border: 1px solid var(--line); margin-bottom: 12px; }
.notice .md { font-size: 14px; line-height: 1.75; color: var(--ink-2); }
.notice .md strong { color: var(--ink); }
.notice-more:empty { display: none; }
.notice-more { padding: 0 22px 20px; }
.notice-panel .empty { padding: 40px 24px; }
@media (max-width: 900px) {
  /* Phones: plan status, guide, announcements, then account */
  .dash-grid { display: flex; flex-direction: column; align-items: stretch; }
  .dash-left { display: contents; }
  .dl-status { order: 1; }
  .dl-guide { display: block; order: 2; }
  .dash-guide.desktop-only { display: none; }
  .dash-right { order: 3; }
  .dl-account { order: 4; }
  .notice-panel-head, .notice { padding-left: 18px; padding-right: 18px; }
  .notice-more { padding: 0 18px 18px; }
}

/* ---------------------------------------------------------------- setup guide */
.dash-stack { display: grid; gap: 20px; }
.accent-text { color: var(--accent); }
.guide { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; overflow: hidden; }
.guide-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px 24px; flex-wrap: wrap; padding: 22px 24px 20px; border-bottom: 1px solid var(--line); }
.guide-head h2 { font-size: 18px; font-weight: 650; }
.guide.collapsed .guide-head { border-bottom: 0; align-items: center; padding-block: 18px; }
[data-act="guide-toggle"] .icon { width: 14px; height: 14px; transition: transform .2s var(--ease); }
[data-act="guide-toggle"][aria-expanded="true"] .icon { transform: rotate(180deg); }
.guide-head .sub { margin-top: 4px; font-size: 14px; color: var(--ink-2); }
.guide-plat { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.gsteps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: auto 1fr auto auto; }
.gstep { display: grid; grid-row: span 4; grid-template-rows: subgrid; row-gap: 12px; padding: 22px 24px 24px; min-width: 0; }
.gstep + .gstep { border-left: 1px solid var(--line); }
.gstep.now { background: color-mix(in srgb, var(--accent-soft) 60%, var(--surface)); }
.gstep-top { display: flex; align-items: center; gap: 12px; min-width: 0; }
.gstep h3 { font-size: 16px; font-weight: 650; }
.gnum { width: 30px; height: 30px; flex: none; display: grid; place-items: center; border-radius: 50%; border: 1.5px solid var(--line-strong); color: var(--ink-3); font-size: 14px; font-weight: 650; font-variant-numeric: tabular-nums; background: var(--surface); }
.gnum .icon { width: 15px; height: 15px; stroke-width: 2.4; }
.gstep.now .gnum { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.gstep.done .gnum { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.gstate { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 600; color: var(--ink-3); white-space: nowrap; }
.gstate .icon { width: 14px; height: 14px; }
.gdesc { font-size: 14px; line-height: 1.7; color: var(--ink-2); }
.gstep.locked h3, .gstep.locked .gdesc { color: var(--ink-3); }
.gact { display: flex; min-width: 0; }
.account-chip { display: flex; align-items: center; gap: 10px; width: 100%; min-width: 0; height: 44px; padding: 0 6px 0 14px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); }
.account-chip .hint { flex: none; }
.account-chip code { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--font); font-size: 14px; font-weight: 600; color: var(--ink); }
.gextra:empty { display: none; }
.gextra .hint { line-height: 1.6; }
.glink { font-size: 13.5px; font-weight: 550; }
@media (max-width: 900px) {
  .gsteps { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; }
  .gstep { grid-row: auto; grid-template-rows: none; display: flex; flex-direction: column; padding: 20px 18px; }
  .gstep + .gstep { border-left: 0; border-top: 1px solid var(--line); }
  .guide-head, .guide.collapsed .guide-head { padding: 18px; align-items: flex-start; flex-direction: column; }
  .guide-plat { width: 100%; }
  .guide-plat .seg { width: 100%; display: grid; grid-template-columns: repeat(var(--n, 5), minmax(0, 1fr)); }
  .guide-plat .seg button { padding: 0 4px; font-size: 13px; }
  .gstep.locked .gact, .gstep.locked .gextra { display: none; }
}

.dl-account .section-head { margin-bottom: 10px; }

/* ---------------------------------------------------------------- plans */
.plan-list .row { padding: 20px 24px; gap: 24px; }
.plan-name { font-size: 16px; font-weight: 650; }
.plan-specs { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 6px; font-size: 13px; color: var(--ink-2); }
.plan-specs span { display: inline-flex; align-items: center; gap: 6px; }
.plan-specs .icon { width: 15px; height: 15px; color: var(--ink-3); }
.plan-price { text-align: right; }
.plan-price .amt { font-family: var(--font-display); font-size: 26px; font-weight: 300; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.plan-price .cur { font-size: 15px; margin-right: 2px; color: var(--ink-2); }
.plan-price .unit { font-family: var(--font); font-size: 13px; font-weight: 400; color: var(--ink-3); margin-left: 3px; letter-spacing: 0; }
.plan-price .per { font-size: 12.5px; color: var(--ink-3); margin-top: 2px; }
.plan-traffic { width: 112px; flex: none; }
.plan-traffic .v { font-family: var(--font-display); font-size: 22px; font-weight: 300; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.plan-traffic .k { font-size: 12px; color: var(--ink-3); }
.plan-list .soldout { opacity: .6; }
@media (max-width: 720px) {
  .plan-list .row { flex-wrap: wrap; padding: 18px; gap: 12px 16px; }
  .plan-list .row-main { flex-basis: 100%; order: -1; }
  .plan-traffic { width: auto; }
  .plan-price { margin-left: auto; }
}

.md { font-size: 14.5px; line-height: 1.75; color: var(--ink); overflow-wrap: anywhere; }
.md > :first-child { margin-top: 0; }
.md > :last-child { margin-bottom: 0; }
.md h1, .md h2, .md h3, .md h4 { margin: 1.6em 0 .6em; font-weight: 650; }
.md h1 { font-size: 22px; } .md h2 { font-size: 19px; } .md h3 { font-size: 16.5px; } .md h4 { font-size: 15px; }
.md p, .md ul, .md ol, .md blockquote, .md pre, .md table { margin: 0 0 1em; }
.md ul, .md ol { padding-left: 1.4em; }
.md li + li { margin-top: .3em; }
.md img { max-width: 100%; height: auto; border-radius: 10px; border: 1px solid var(--line); margin: .4em 0; }
.md code { font-family: var(--font-mono); font-size: .88em; padding: .15em .4em; border-radius: 5px; background: var(--surface-3); }
.md pre { padding: 14px 16px; border-radius: 10px; background: var(--surface-3); overflow-x: auto; }
.md pre code { padding: 0; background: none; font-size: 13px; }
.md blockquote { padding: 2px 0 2px 16px; border-left: 3px solid var(--line-strong); color: var(--ink-2); }
.md hr { border: 0; border-top: 1px solid var(--line); margin: 1.6em 0; }
.md table { border-collapse: collapse; width: 100%; font-size: 14px; display: block; overflow-x: auto; }
.md th, .md td { border: 1px solid var(--line); padding: 8px 12px; text-align: left; }
.md th { background: var(--surface-2); }
.md a { word-break: break-all; }
.md .v2board-no-access { padding: 14px 16px; border-radius: 10px; background: var(--warn-soft); color: var(--warn); font-weight: 550; }
.feature-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.feature-list li { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; }
.feature-list .icon { margin-top: 3px; width: 16px; height: 16px; }
.feature-list .yes .icon { color: var(--ok); }
.feature-list .no { color: var(--ink-3); }

.summary .price-big { font-family: var(--font-display); font-size: 40px; font-weight: 250; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.summary .price-big .cur { font-size: 20px; color: var(--ink-2); margin-right: 4px; }

/* ---------------------------------------------------------------- order / pay */
.qr-box { display: grid; justify-items: center; gap: 14px; padding: 8px 0 4px; text-align: center; }
.qr-box .qr { width: 220px; height: 220px; padding: 12px; background: #fff; border-radius: 14px; border: 1px solid var(--line); }
.qr-box .qr svg { width: 100%; height: 100%; }
.pay-wait { display: grid; justify-items: center; gap: 12px; padding: 6px 0 2px; text-align: center; }
.pay-icon { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.pay-lead { font-size: 15px; color: var(--ink); max-width: 24em; }
.pay-meta { font-size: 13px; color: var(--ink-2); }
.pay-meta b { color: var(--ink); font-weight: 650; font-variant-numeric: tabular-nums; }
.pay-meta .mono { font-size: 12.5px; }
.pay-state { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-size: 13px; color: var(--ink-3); }
.live-dot { width: 8px; height: 8px; flex: none; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 50%, transparent); animation: live 1.6s ease-out infinite; }
@keyframes live { 70% { box-shadow: 0 0 0 7px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.steps { display: flex; gap: 0; margin-bottom: 24px; }
.step { flex: 1; display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: var(--ink-3); }
.step .n { width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid var(--line-strong); display: grid; place-items: center; font-size: 12px; font-weight: 650; flex: none; }
.step.done { color: var(--ink-2); }
.step.done .n { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.step.now { color: var(--ink); font-weight: 600; }
.step.now .n { border-color: var(--accent); color: var(--accent); }
.step + .step::before { content: ""; flex: 0 0 24px; height: 1.5px; background: var(--line-strong); margin-right: 10px; }

/* ---------------------------------------------------------------- invite */
.stat-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.stat-strip > div { padding: 20px 24px; border-left: 1px solid var(--line); }
.stat-strip > div:first-child { border-left: 0; }
.stat-strip .v { font-family: var(--font-display); font-size: 28px; font-weight: 300; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1.15; }
.stat-strip .v small { font-size: 14px; color: var(--ink-2); margin-left: 2px; }
.stat-strip .k { font-size: 13px; color: var(--ink-3); margin-top: 4px; }
@media (max-width: 720px) {
  .stat-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-strip > div:nth-child(3) { border-left: 0; }
  .stat-strip > div:nth-child(n+3) { border-top: 1px solid var(--line); }
  .stat-strip > div { padding: 16px 18px; }
}

/* ---------------------------------------------------------------- docs */
.doc-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 36px; align-items: start; }
.doc-cats { position: sticky; top: calc(var(--topbar-h) + 20px); display: grid; gap: 2px; }
.doc-cats button { text-align: left; border: 0; background: none; height: 36px; padding: 0 12px; border-radius: 9px; color: var(--ink-2); font-size: 14px; font-weight: 550; }
.doc-cats button:hover { background: var(--surface-3); color: var(--ink); }
.doc-cats button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 0 0 1px var(--line); }
.article { max-width: 760px; }
.article h1 { font-size: 28px; font-weight: 650; margin-bottom: 8px; }
.article .meta { color: var(--ink-3); font-size: 13px; margin-bottom: 28px; }
@media (max-width: 900px) {
  .doc-layout { grid-template-columns: 1fr; gap: 16px; }
  .doc-cats { position: static; display: flex; overflow-x: auto; gap: 6px; padding-bottom: 4px; scrollbar-width: none; }
  .doc-cats button { flex: none; background: var(--surface); box-shadow: 0 0 0 1px var(--line); }
}

/* ---------------------------------------------------------------- tickets */
.thread { display: grid; gap: 14px; padding: 4px 0 8px; }
.msg { max-width: min(560px, 86%); display: grid; gap: 4px; }
.msg .bubble { padding: 12px 16px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14.5px; line-height: 1.65; }
.msg .time { font-size: 12px; color: var(--ink-3); padding: 0 6px; }
.msg.me { justify-self: end; }
.msg.me .bubble { background: var(--ink); color: var(--bg); border-color: var(--ink); border-bottom-right-radius: 6px; }
.msg.me .time { text-align: right; }
.msg.them .bubble { border-bottom-left-radius: 6px; }
.composer { display: flex; gap: 10px; align-items: flex-end; margin-top: 18px; padding: 10px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 16px; }
.composer textarea { flex: 1; border: 0; background: none; resize: none; min-height: 44px; max-height: 200px; padding: 10px 8px; line-height: 1.55; }
.composer textarea:focus { outline: none; }
.composer:focus-within { border-color: var(--accent); box-shadow: var(--ring); }

/* ---------------------------------------------------------------- traffic chart */
.chart { position: relative; }
.chart svg { width: 100%; height: 220px; overflow: visible; }
.chart .grid line { stroke: var(--line); stroke-width: 1; }
.chart .axis text { fill: var(--ink-3); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart .bar { fill: var(--accent); }
.chart .bar-hit { fill: transparent; cursor: default; }
.chart .bar-hit:hover + .bar, .chart .bar.is-hover { fill: var(--accent-hover); }
.chart-tip { position: absolute; pointer-events: none; transform: translate(-50%, calc(-100% - 10px)); padding: 8px 12px; border-radius: 10px; background: var(--ink); color: var(--bg); font-size: 12.5px; line-height: 1.5; white-space: nowrap; box-shadow: var(--shadow-pop); }
.chart-tip b { font-weight: 650; font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- profile */
.setting { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 18px 0; border-top: 1px solid var(--line); }
.setting:first-of-type { border-top: 0; padding-top: 4px; }
.setting .t { font-weight: 600; font-size: 14.5px; }
.setting .d { font-size: 13px; color: var(--ink-3); margin-top: 2px; }
.balance-figure { font-family: var(--font-display); font-size: 40px; font-weight: 250; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.balance-figure .cur { font-size: 20px; color: var(--ink-2); margin-right: 4px; }

/* Mobile "more" page */
.me-head { display: flex; align-items: center; gap: 14px; margin: 4px 0 20px; }
.me-head .avatar { width: 52px; height: 52px; }
.me-head .email { font-weight: 650; font-size: 16px; }

/* Utility spacing */
.mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.gap-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.hide-mobile { }
@media (max-width: 900px) { .hide-mobile { display: none !important; } }
.show-mobile { display: none !important; }
@media (max-width: 900px) { .show-mobile { display: revert !important; } }

.status { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }

@media (max-width: 640px) {
  .choices.cols-2 { grid-template-columns: minmax(0, 1fr); }
  .steps { margin-bottom: 18px; }
  .step { gap: 6px; font-size: 12.5px; white-space: nowrap; }
  .step + .step::before { flex-basis: 10px; margin-right: 6px; }
  .table th, .table td { padding: 12px 14px; }
}

/* Plan card: expiry and reset as tiles, actions as equal buttons */
.stat-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 10px; margin-top: 16px; }
.stat-tile { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 12px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); }
.st-icon { width: 32px; height: 32px; flex: none; display: grid; place-items: center; border-radius: 10px; background: var(--accent-soft); color: var(--accent); }
.st-body { min-width: 0; }
.st-v { font-family: var(--font-display); font-size: 19px; font-weight: 400; line-height: 1.2; font-variant-numeric: tabular-nums; color: var(--ink); white-space: nowrap; }
.st-v small { font-size: 12.5px; color: var(--ink-2); margin-left: 2px; }
.st-k { font-size: 12px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-tile.warn .st-v { color: var(--warn); }
.stat-tile.warn .st-icon { background: var(--warn-soft); color: var(--warn); }
.stat-tile.danger .st-v { color: var(--danger); }
.stat-tile.danger .st-icon { background: var(--danger-soft); color: var(--danger); }
.dial-actions { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 8px; margin-top: 14px; }
.dial-actions .btn { padding: 0 8px; }

/* Account: 2×2 tiles */
.acct-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.acct-tile { position: relative; display: grid; gap: 2px; align-content: start; min-width: 0; padding: 16px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); color: var(--ink); transition: border-color .15s; }
.acct-tile:hover { border-color: var(--line-strong); text-decoration: none; }
.acct-icon { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 11px; background: var(--accent-soft); color: var(--accent); margin-bottom: 10px; }
.acct-title { font-size: 14.5px; font-weight: 600; }
.acct-sub { font-size: 12.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-badge { position: absolute; top: 14px; right: 14px; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--danger); color: #fff; font-size: 12px; font-weight: 650; line-height: 20px; text-align: center; font-variant-numeric: tabular-nums; }

/* Folded guide (phones, once set up) */
.gc { display: flex; align-items: center; gap: 12px; padding: 18px 18px 14px; }
.gc-icon { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border-radius: 12px; background: var(--accent-soft); color: var(--accent); }
.gc-text { flex: 1; min-width: 0; }
.gc-text h2 { font-size: 16px; font-weight: 650; }
.gc-text .sub { font-size: 13px; color: var(--ink-2); margin-top: 2px; }
.gc .btn { flex: none; }
.gc-action { padding: 0 18px 18px; }

/* Announcements folded on phones */
.notice.clamped:not(.expanded) .md { max-height: 118px; overflow: hidden; -webkit-mask-image: linear-gradient(#000 55%, transparent); mask-image: linear-gradient(#000 55%, transparent); }
.notice-toggle { margin-top: 6px; padding: 0; border: 0; background: none; color: var(--accent); font-size: 13.5px; font-weight: 600; }

/* Support chat button (phones only; desktop keeps the chat's own bubble) */
.support-btn { display: none; position: relative; }
.support-btn.has-unread::after { content: ""; position: absolute; top: 8px; right: 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); box-shadow: 0 0 0 2px var(--bg); }
/* 联系客服 tile and rows (shown in place of 工单 when tickets are switched off) */
button.acct-tile { width: 100%; font: inherit; text-align: left; cursor: pointer; -webkit-appearance: none; appearance: none; }
.acct-tile.has-unread::after, .row.has-unread .row-title::after, .menu [data-support].has-unread::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); }
.acct-tile.has-unread::after { position: absolute; top: 16px; right: 16px; }
.row.has-unread .row-title::after { display: inline-block; margin-left: 8px; vertical-align: 2px; }
.menu [data-support].has-unread::after { margin-left: auto; flex: none; }

@media (max-width: 900px) {
  .support-btn { display: inline-flex; }
  .greet { margin-bottom: 14px; }
  .greet h1 { font-size: 21px; }
  .greet-time { font-size: 13px; }
  .dash-grid, .dash-left { gap: 16px; }
  .dash-guide { margin-bottom: 16px; }
  .dial { padding: 18px 16px 16px; }
  .acct-grid { gap: 10px; }
  .acct-tile { padding: 14px; }
  .stat-tile { padding: 10px; gap: 8px; }
  .st-icon { width: 28px; height: 28px; border-radius: 9px; }
  .st-k { font-size: 11.5px; }
}

@media (max-width: 380px) {
  .stat-tile .st-icon { display: none; }
}
