/* Mapleway interface.

   Three fixed themes, chosen with the picker in the top bar and remembered in
   this browser. Every colour is a token below; nothing further down names a
   colour of its own. Flat surfaces, one-pixel borders, no decorative
   gradients, no shadows, no blur: the page is a tool and reads like one.
   Status colours are pale backgrounds with dark text so they stay quiet. */

:root,
[data-theme="gpt-light"] {
  color-scheme: light;
  --bg: #ffffff;
  --surface: #f9f9f9;
  --surface-2: #f0f0f0;
  --border: #e3e3e3;
  --border-strong: #cfcfcf;
  --text: #0d0d0d;
  --muted: #5d5d5d;
  --faint: #8e8e8e;
  --accent: #10a37f;
  --accent-fg: #ffffff;
  --accent-soft: #e6f4ef;
  --ok: #0f7b5a;      --ok-bg: #e6f4ef;
  --warn: #8a5a00;    --warn-bg: #fff4d6;
  --bad: #b3261e;     --bad-bg: #fde8e6;
  --info: #2f5f9e;    --info-bg: #e8f0fb;
  --bar: #10a37f;
  --bar-2: #8fd3bf;
}

[data-theme="vs-light"] {
  color-scheme: light;
  --bg: #ffffff;
  --surface: #f8f8f8;
  --surface-2: #f0f0f0;
  --border: #e5e5e5;
  --border-strong: #cccccc;
  --text: #3b3b3b;
  --muted: #616161;
  --faint: #8b8b8b;
  --accent: #005fb8;
  --accent-fg: #ffffff;
  --accent-soft: #e5f1fb;
  --ok: #388a34;      --ok-bg: #e8f3e7;
  --warn: #bf8803;    --warn-bg: #fff6dc;
  --bad: #e51400;     --bad-bg: #fdeae7;
  --info: #005fb8;    --info-bg: #e5f1fb;
  --bar: #005fb8;
  --bar-2: #9cc4ea;
}

[data-theme="vs-dark"] {
  color-scheme: dark;
  --bg: #1f1f1f;
  --surface: #181818;
  --surface-2: #252526;
  --border: #2b2b2b;
  --border-strong: #3c3c3c;
  --text: #cccccc;
  --muted: #9d9d9d;
  --faint: #6e6e6e;
  --accent: #0078d4;
  --accent-fg: #ffffff;
  --accent-soft: #1e2f40;
  --ok: #89d185;      --ok-bg: #1f3a2a;
  --warn: #cca700;    --warn-bg: #3a3117;
  --bad: #f14c4c;     --bad-bg: #3d2323;
  --info: #4daafc;    --info-bg: #1e2f40;
  --bar: #0078d4;
  --bar-2: #2b4c6d;
}

/* ---------------------------------------------------------------- base */
* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.6 "Segoe UI", "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif;
}
[hidden] { display: none !important; }
a { color: inherit; text-decoration: none; }
p a, .tiny a, .auth-switch a, .connection-row a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
button, input, select { font: inherit; color: inherit; }
code { font-family: ui-monospace, Consolas, "Cascadia Mono", monospace; font-size: .92em; padding: 1px 5px; border-radius: 4px; background: var(--surface-2); }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: 0; }
h1 { font-size: 22px; line-height: 1.3; }
h2 { font-size: 16px; }
p { margin: 0 0 10px; }
.muted { color: var(--muted); }
.tiny { color: var(--muted); font-size: 12px; line-height: 1.6; margin: 10px 0 0; }
.tiny b, .tiny strong { color: var(--text); font-weight: 600; }
.eyebrow { margin: 0 0 6px; font-size: 12px; font-weight: 600; color: var(--accent); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.inline { display: inline; margin: 0; }

/* -------------------------------------------------------------- layout */
.shell { max-width: 1120px; margin: 0 auto; padding: 0 20px; min-height: 100vh; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 20px; height: 56px; border-bottom: 1px solid var(--border); }
.brand { font-weight: 700; font-size: 15px; letter-spacing: .02em; }
.topnav { display: flex; gap: 4px; }
.topnav a { padding: 6px 10px; border-radius: 6px; color: var(--muted); }
.topnav a:hover { background: var(--surface-2); color: var(--text); }
.topnav a[aria-current="page"] { color: var(--text); background: var(--surface-2); font-weight: 600; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.identity { color: var(--muted); font-size: 13px; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-status { color: var(--muted); font-size: 13px; }
.theme-picker select {
  appearance: none; -webkit-appearance: none;
  padding: 5px 26px 5px 10px; border: 1px solid var(--border); border-radius: 6px;
  background: var(--surface) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6'><path d='M1 1l4 4 4-4' fill='none' stroke='%23888' stroke-width='1.5'/></svg>") no-repeat right 9px center;
  color: var(--text); font-size: 12px; cursor: pointer;
}
.sitebar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.sitebar-label { color: var(--faint); margin-right: 4px; }
.sitebar .site { padding: 3px 10px; border: 1px solid var(--border); border-radius: 999px; color: var(--muted); }
.sitebar a.site:hover { background: var(--surface-2); color: var(--text); }
.sitebar .site.current { border-color: var(--accent); background: var(--accent-soft); color: var(--text); font-weight: 600; }
.sitebar .site.off { color: var(--faint); border-style: dashed; }
.sitebar-note { margin-left: auto; color: var(--faint); font-size: 12px; }
.content { flex: 1; padding: 28px 0 48px; }
.footer { display: flex; justify-content: space-between; gap: 10px; padding: 16px 0 24px; border-top: 1px solid var(--border); color: var(--faint); font-size: 12px; }

/* ------------------------------------------------------------- notices */
.notice { margin: 12px 0; padding: 10px 14px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; line-height: 1.6; background: var(--surface); }
.notice.error { background: var(--bad-bg); border-color: transparent; color: var(--bad); }
.notice.warn { background: var(--warn-bg); border-color: transparent; color: var(--warn); }
.notice b, .notice strong { font-weight: 600; }
.shell-alert { margin: 14px 0 0; }
.demo-banner { display: flex; flex-direction: column; gap: 2px; margin: 12px 0 0; padding: 10px 14px; border-radius: 8px; background: var(--warn-bg); color: var(--warn); font-size: 13px; line-height: 1.6; }
.demo-banner b { font-weight: 600; }
.empty-state { margin: 12px 0; padding: 16px; border: 1px dashed var(--border-strong); border-radius: 8px; color: var(--muted); font-size: 13px; text-align: center; }
.warn-text { color: var(--warn); }

/* ---------------------------------------------------------------- tabs */
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 18px; }
.page-head p { margin: 4px 0 0; font-size: 13px; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 18px; overflow-x: auto; }
.tabs a { padding: 8px 14px; margin-bottom: -1px; border-bottom: 2px solid transparent; color: var(--muted); white-space: nowrap; }
.tabs a:hover { color: var(--text); }
.tabs a.is-active, .tabs a[aria-current="page"] { color: var(--text); border-bottom-color: var(--accent); font-weight: 600; }
.tab-badge { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 9px; background: var(--warn-bg); color: var(--warn); font-size: 11px; text-align: center; line-height: 18px; }
.tab-panel { display: flex; flex-direction: column; gap: 14px; }
/* Without JavaScript every tab is simply shown one after another. */
.tab-panels:not(.js-tabs) .tab-panel + .tab-panel { margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--border); }

/* -------------------------------------------------------------- panels */
.panel { border: 1px solid var(--border); border-radius: 10px; background: var(--surface); padding: 18px 20px; min-width: 0; }
.panel > p { font-size: 13px; color: var(--muted); }
.panel-kicker { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; font-size: 13px; font-weight: 600; }
.panel-kicker > span:last-child:not(:first-child) { font-weight: 400; color: var(--muted); font-size: 12px; }
.panel-foot { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 4px 14px; margin-top: 10px; font-size: 12px; color: var(--muted); }
.panel-hint { margin: 10px 0 0; font-size: 12px; color: var(--muted); }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.summary-grid .span-2 { grid-column: span 2; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; margin: 6px 0 2px; }
.section-count { font-size: 12px; color: var(--muted); }

/* --------------------------------------------------------------- pills */
.status-pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; line-height: 1.6; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.status-pill.good { background: var(--ok-bg); color: var(--ok); }
.status-pill.warn { background: var(--warn-bg); color: var(--warn); }
.status-pill.danger { background: var(--bad-bg); color: var(--bad); }
.status-pill.muted { background: var(--surface-2); color: var(--muted); }
.status-pill.accent { background: var(--accent-soft); color: var(--accent); }
.pill-stack { display: flex; flex-direction: column; gap: 4px; align-items: flex-end; }

/* --------------------------------------------------------------- usage */
.usage-main { display: flex; align-items: center; gap: 22px; padding: 8px 0 14px; }
.usage-ring {
  --p: calc(var(--usage-pct) * 1%);
  position: relative; width: 112px; height: 112px; flex: none; border-radius: 50%;
  background: conic-gradient(var(--bar) var(--p), var(--surface-2) 0);
  display: grid; place-items: center;
}
.usage-ring::after { content: ""; position: absolute; inset: 9px; border-radius: 50%; background: var(--surface); }
.usage-ring > div { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; }
.usage-ring strong { font-size: 22px; line-height: 1.1; }
.usage-ring span { font-size: 11px; color: var(--muted); }
.usage-ring.flat { background: var(--surface-2); }
.usage-ring.flat strong { color: var(--muted); }
.usage-numbers { display: flex; flex-direction: column; min-width: 0; }
.usage-numbers > strong { font-size: 28px; line-height: 1.1; }
.usage-numbers > span { margin-top: 6px; font-size: 13px; color: var(--muted); }
.usage-numbers > small { margin-top: 4px; font-size: 12px; color: var(--ok); }
.usage-numbers b { font-weight: 600; color: var(--text); }
.meter { height: 6px; border-radius: 6px; background: var(--surface-2); overflow: hidden; }
.meter span { display: block; height: 100%; border-radius: 6px; background: var(--bar); transition: width .4s ease; }
.meter.small { height: 4px; margin-top: 6px; }
.big-number { margin: 6px 0 12px; }
.big-number strong { font-size: 28px; }
.big-number span { margin-left: 6px; color: var(--muted); font-size: 13px; }
.stat { display: flex; flex-direction: column; justify-content: center; }
.stat-label { font-size: 12px; color: var(--muted); }
.stat > strong { font-size: 26px; line-height: 1.2; margin: 4px 0; }
.stat p { margin: 0; font-size: 12px; color: var(--muted); }

/* -------------------------------------------------------------- signals */
.signal-list { list-style: none; margin: 0; padding: 0; }
.signal-list li { display: grid; grid-template-columns: 120px 1fr; gap: 10px; padding: 9px 0; border-top: 1px solid var(--border); font-size: 13px; }
.signal-list li:first-child { border-top: 0; }
.signal-label { color: var(--muted); }
.signal-list strong { font-weight: 600; }
.connection-row { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-top: 1px solid var(--border); font-size: 13px; }
.connection-row span { color: var(--muted); }
.connection-row strong { font-weight: 600; text-align: right; word-break: break-all; }

/* ------------------------------------------------------------ companion */
.companion-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.companion-message { margin: 10px 0 0; font-size: 13px; color: var(--muted); }
.companion-setup, .exit-setup { margin-top: 12px; font-size: 13px; color: var(--muted); }
.companion-setup summary, .exit-setup summary { cursor: pointer; color: var(--text); font-weight: 600; }
.companion-setup ol, .exit-setup ol { margin: 10px 0; padding-left: 20px; line-height: 1.7; }
.pair-row { display: flex; flex-direction: column; gap: 6px; margin: 10px 0; }
.exit-panel code { font-size: 13px; }
.exit-switch { margin: 4px 0 10px; }
.segmented { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 6px; }
.segmented .button[aria-pressed="true"] { cursor: default; }

/* ---------------------------------------------------------------- forms */
input[type="text"], input[type="password"], input[type="number"], input[type="email"] {
  width: 100%; padding: 8px 10px; border: 1px solid var(--border-strong); border-radius: 6px; background: var(--bg); color: var(--text); outline: none;
}
input:focus-visible, select:focus-visible, button:focus-visible, .tabs a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 8px 14px; border: 1px solid var(--border-strong); border-radius: 6px;
  background: var(--surface); color: var(--text); font-weight: 600; font-size: 13px; cursor: pointer; text-decoration: none;
}
.button:hover { background: var(--surface-2); }
.button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
.button.primary:hover { filter: brightness(.95); }
.button.ghost { background: transparent; }
.button.full { width: 100%; margin-top: 12px; }
.button.compact { padding: 5px 10px; font-size: 12px; }
.button.disabled, .button[disabled] { opacity: .45; cursor: default; }
.text-button { border: 0; background: transparent; padding: 6px 4px; font-size: 12px; cursor: pointer; }
.danger-text { color: var(--bad); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0; }
.stack-form { display: flex; flex-direction: column; gap: 10px; font-size: 13px; color: var(--muted); }
.stack-form label { display: flex; flex-direction: column; gap: 5px; }
.stack-form label input { width: 100%; }
.stack-form .button { align-self: flex-start; }
.inline-form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; font-size: 12px; color: var(--muted); }
.inline-form input { width: 76px; padding: 5px 8px; }
.card-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
.card-actions form { margin: 0; }
.checkbox-row { display: flex; gap: 8px; align-items: flex-start; margin: 10px 0; font-size: 13px; color: var(--muted); }
.slider-row { display: flex; flex-direction: column; gap: 8px; margin: 12px 0 4px; font-size: 13px; color: var(--muted); }
.slider-row input[type="range"] { width: 100%; accent-color: var(--accent); }
.inline-readout { font-weight: 600; color: var(--text); }
.quota-readout { display: block; font-size: 22px; font-weight: 600; margin-bottom: 4px; }
.custom-limit { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0 0; margin-top: 8px; border-top: 1px solid var(--border); font-size: 13px; color: var(--muted); }
.custom-limit > div { display: flex; align-items: center; gap: 6px; }
.custom-limit input { width: 90px; text-align: right; }

/* --------------------------------------------------------------- lists */
.history-list, .audit-list { list-style: none; margin: 0; padding: 0; }
.history-list li { display: flex; justify-content: space-between; padding: 8px 0; border-top: 1px solid var(--border); font-size: 13px; }
.history-list li:first-child { border-top: 0; }
.history-list span { color: var(--muted); }
.audit-list li { display: grid; grid-template-columns: 150px 170px 1fr; gap: 4px 14px; padding: 8px 0; border-top: 1px solid var(--border); font-size: 13px; }
.audit-list li:first-child { border-top: 0; }
.audit-list span { color: var(--muted); }
.audit-list em { grid-column: 1 / -1; font-style: normal; font-size: 12px; color: var(--faint); word-break: break-all; }
.kv { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; margin: 16px 0 0; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: var(--border); }
.kv > div { background: var(--surface); padding: 10px 14px; }
.kv dt { font-size: 12px; color: var(--muted); }
.kv dd { margin: 2px 0 0; font-size: 13px; font-weight: 600; word-break: break-all; }
.steps { list-style: none; margin: 16px 0; padding: 0; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.steps li { display: grid; grid-template-columns: 30px 1fr; gap: 12px; align-items: center; padding: 12px 14px; background: var(--surface); }
.steps li + li { border-top: 1px solid var(--border); }
.steps li > span { width: 26px; height: 26px; border-radius: 6px; border: 1px solid var(--border-strong); display: grid; place-items: center; font-size: 12px; color: var(--muted); }
.steps li.done > span { background: var(--ok-bg); color: var(--ok); border-color: transparent; }
.steps li.active > span { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
.steps li div { display: flex; flex-direction: column; gap: 2px; }
.steps b { font-size: 13px; }
.steps small { font-size: 12px; color: var(--muted); }
.demo-list { display: flex; flex-direction: column; gap: 8px; margin: 16px 0; }
.demo-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0; padding: 10px 14px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); text-align: left; }
.demo-row div { display: flex; flex-direction: column; }
.demo-row span { font-size: 12px; color: var(--muted); }

/* ---------------------------------------------------------------- charts */
.chart-block { display: flex; flex-direction: column; gap: 12px; }
.bar-chart { list-style: none; display: flex; align-items: flex-end; gap: 3px; height: 140px; margin: 0; padding: 0; overflow-x: auto; }
.bar { position: relative; flex: 1 1 0; min-width: 10px; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; }
.bar-fill { width: 100%; min-height: 2px; border-radius: 3px 3px 0 0; background: var(--bar); }
.bar b { font-size: 10px; color: var(--faint); font-weight: 500; }
.bar-unsampled .bar-fill { height: 100% !important; min-height: 0; background: repeating-linear-gradient(135deg, var(--surface-2) 0 3px, transparent 3px 6px); border-radius: 3px; }
.bar-tip { position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); white-space: nowrap; font-style: normal; font-size: 12px; padding: 4px 8px; border-radius: 6px; background: var(--bg); border: 1px solid var(--border-strong); opacity: 0; pointer-events: none; z-index: 2; }
.bar:hover .bar-tip, .bar:focus-within .bar-tip { opacity: 1; }
.bar-chart.bandwidth .bar-fill { background: var(--bar-2); }
.chart-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12px; color: var(--muted); }
.swatch { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; background: var(--bar); vertical-align: -1px; }
.swatch-unsampled { background: repeating-linear-gradient(135deg, var(--border-strong) 0 2px, transparent 2px 4px); }

/* Stacked day bars: download at the bottom, upload above, then the part
   recorded before the split existed. */
.bar-stack { display: flex; flex-direction: column-reverse; overflow: hidden; }
.bar-stack i { display: block; width: 100%; flex: none; }
.seg-down { background: var(--bar); }
.seg-up { background: var(--bar-2); }
.seg-other { background: var(--border-strong); }
.swatch-up { background: var(--bar-2); }
.swatch-other { background: var(--border-strong); }

/* ---------------------------------------------------------------- hero */
.hero { display: flex; flex-direction: column; gap: 14px; }
.hero-main { display: flex; align-items: center; gap: 14px; }
.hero-text { flex: 1; min-width: 0; }
.hero-text h2 { font-size: 20px; line-height: 1.3; }
.hero-text p { margin: 2px 0 0; font-size: 13px; color: var(--muted); }
.hero-dot { width: 14px; height: 14px; flex: none; border-radius: 50%; background: var(--faint); }
.hero[data-hero="online"] .hero-dot { background: var(--ok); }
.hero[data-hero="online"] h2 { color: var(--ok); }
.hero[data-hero="blocked"] .hero-dot { background: var(--bad); }
.hero[data-hero="blocked"] h2 { color: var(--bad); }
.hero[data-hero="setup"] .hero-dot, .hero[data-hero="unverified"] .hero-dot { background: var(--warn); }
.hero-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin: 0; }
.hero-stats > div { padding: 8px 10px; border-radius: 6px; background: var(--surface-2); min-width: 0; }
.hero-stats dt { font-size: 11px; color: var(--muted); }
.hero-stats dd { margin: 2px 0 0; font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hero .tiny { margin: 0; }
.usage-numbers > .split-line { margin-top: 6px; font-size: 12px; color: var(--muted); }
.usage-level { margin: 12px 0 0; }
.plain-list { margin: 0; padding-left: 18px; font-size: 13px; color: var(--muted); line-height: 1.7; }
.plain-list b { color: var(--text); font-weight: 600; }
.panel-kicker.spaced { margin-top: 16px; }
.ip-result { margin: 10px 0 0; font-size: 13px; font-weight: 600; }
.ip-result:empty { display: none; }
.ip-result.good { color: var(--ok); }
.ip-result.bad { color: var(--bad); }
.advanced > summary { cursor: pointer; font-size: 13px; font-weight: 600; }

/* --------------------------------------------------------------- guide */
.guide-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.guide-step { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 22px; align-items: start; padding: 20px 0; border-top: 1px solid var(--border); }
.guide-step:first-child { border-top: 0; padding-top: 4px; }
.guide-step:last-child { padding-bottom: 0; }
.guide-step h3 { display: flex; align-items: center; gap: 10px; margin: 0 0 8px; font-size: 15px; }
.guide-step p { font-size: 13px; color: var(--muted); }
.guide-step p b { color: var(--text); font-weight: 600; }
.guide-num { width: 26px; height: 26px; flex: none; border-radius: 6px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-size: 13px; font-weight: 700; }
.guide-links { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 12px; }
.guide-note { padding: 12px 14px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); }
.guide-note p:first-child { margin-bottom: 6px; }

/* Schematic drawings: every colour is a theme token, so they follow the
   picker; the red dashed ring and tag mark what to press. */
.fig { margin: 0; }
.fig svg { display: block; width: 100%; height: auto; }
.fig figcaption { margin-top: 6px; font-size: 12px; color: var(--faint); }
.fig .f-win { fill: var(--bg); stroke: var(--border-strong); }
.fig .f-bar { fill: var(--surface-2); }
.fig .f-pane { fill: var(--surface); stroke: var(--border); }
.fig .f-sel { fill: var(--accent-soft); }
.fig .f-line { fill: none; stroke: var(--border-strong); }
.fig .f-btn { fill: var(--surface); stroke: var(--border-strong); }
.fig .f-dot { fill: var(--faint); }
.fig .f-hot { fill: var(--accent); }
.fig .f-t { fill: var(--text); font-size: 13px; }
.fig .f-b { fill: var(--text); font-size: 13px; font-weight: 600; }
.fig .f-h { fill: var(--text); font-size: 18px; font-weight: 700; }
.fig .f-m { fill: var(--muted); font-size: 12px; }
.fig .f-hot-t { fill: var(--accent-fg); font-size: 13px; font-weight: 600; }
.fig .f-ring { fill: none; stroke: var(--bad); stroke-width: 2.5; stroke-dasharray: 6 4; }
.fig .f-tag { fill: var(--bad); }
.fig .f-tag-t { fill: var(--bg); font-size: 12px; font-weight: 700; }
.fig .f-arrow { fill: none; stroke: var(--muted); stroke-width: 2; }
.fig .f-arrow-head { fill: var(--muted); }

/* ---------------------------------------------------------------- admin */
.user-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.user-card { border: 1px solid var(--border); border-radius: 10px; background: var(--surface); padding: 16px 18px; min-width: 0; }
.user-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.profile-row { display: flex; align-items: center; gap: 10px; }
.profile-row > div:last-child { display: flex; flex-direction: column; min-width: 0; }
.profile-row strong { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-row span { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar { width: 36px; height: 36px; flex: none; border-radius: 8px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.user-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin: 14px 0 0; }
.user-stats > div { padding: 8px 10px; border-radius: 6px; background: var(--surface-2); min-width: 0; }
.user-stats dt { font-size: 11px; color: var(--muted); }
.user-stats dd { margin: 2px 0 0; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pending-banner { display: flex; flex-direction: column; gap: 2px; margin-top: 12px; padding: 10px 12px; border-radius: 8px; background: var(--warn-bg); color: var(--warn); font-size: 13px; }
.pending-banner small { font-size: 12px; }
.pending-banner b { font-weight: 600; }

/* ---------------------------------------------------------- auth pages */
.landing { max-width: 640px; margin: 40px auto 20px; }
.landing h1 { font-size: 30px; margin-bottom: 12px; }
.lead { font-size: 15px; color: var(--muted); line-height: 1.7; }
.feature-list { list-style: none; margin: 26px 0 0; padding: 0; border-top: 1px solid var(--border); }
.feature-list li { display: grid; grid-template-columns: 150px 1fr; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.feature-list span { color: var(--muted); }
.auth { display: flex; justify-content: center; padding: 20px 0; }
.auth-card { width: 100%; max-width: 440px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); padding: 28px 30px; }
.auth.wide .auth-card { max-width: 720px; }
.auth-card h1 { margin-bottom: 8px; }
.auth-form { display: flex; flex-direction: column; margin-top: 18px; }
.auth-form label { font-size: 13px; color: var(--muted); margin-bottom: 5px; }
.auth-form input + label, .auth-form small + label { margin-top: 14px; }
.auth-form small { color: var(--faint); font-size: 12px; line-height: 1.5; margin-top: 5px; }
.auth-form .button { margin-top: 18px; }
.auth-switch { text-align: center; margin-top: 16px; font-size: 13px; color: var(--muted); }

/* ------------------------------------------------------------ responsive */
@media (max-width: 860px) {
  .grid-2, .user-grid { grid-template-columns: 1fr; }
  .guide-step { grid-template-columns: 1fr; }
  .summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .summary-grid .span-2 { grid-column: 1 / -1; }
  .topnav { display: none; }
}
@media (max-width: 560px) {
  .shell { padding: 0 14px; }
  .content { padding: 18px 0 36px; }
  .page-head { flex-direction: column; }
  .summary-grid { grid-template-columns: 1fr; }
  .usage-main { flex-direction: column; align-items: flex-start; }
  .signal-list li { grid-template-columns: 1fr; gap: 2px; }
  .audit-list li { grid-template-columns: 1fr; }
  .user-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-main { flex-wrap: wrap; }
  .feature-list li { grid-template-columns: 1fr; gap: 2px; }
  .auth-card { padding: 22px 18px; }
  .identity { display: none; }
  .footer { flex-direction: column; }
}
