/* Tab24 — feature-phone plastic + LCD */
:root {
  --plastic: #e4e8ee;
  --plastic-2: #d3d9e2;
  --card: #f6f8fb;
  --ink: #1b2230;
  --ink-2: #4a5468;
  --line: #c3cad6;
  --lcd: #c6d9ad;
  --lcd-ink: #2c3a20;
  --signal: #2457d6;
  --signal-ink: #ffffff;
  --ok: #1f8f4e;
  --warn: #c7731f;
  --bad: #c33b3b;
  --shadow: 0 1px 0 #ffffff inset, 0 2px 6px rgba(27, 34, 48, .10);
  --radius: 14px;
  --display: 'Bricolage Grotesque', 'Be Vietnam Pro', system-ui, sans-serif;
  --body: 'Be Vietnam Pro', system-ui, sans-serif;
  --lcd-font: 'VT323', ui-monospace, monospace;
  --screen-maxh: 72vh;
  color-scheme: light;
}
/* Dark follows the system unless the header toggle forced a theme (data-theme on <html>). */
:root[data-theme="dark"] {
    --plastic: #171b22;
    --plastic-2: #222833;
    --card: #1d222b;
    --ink: #e7ebf2;
    --ink-2: #9aa5b8;
    --line: #333b48;
    --lcd: #9fb585;
    --lcd-ink: #1e2a14;
    --signal: #5b86f0;
    --shadow: 0 1px 0 rgba(255,255,255,.04) inset, 0 2px 8px rgba(0,0,0,.35);
    color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --plastic: #171b22;
    --plastic-2: #222833;
    --card: #1d222b;
    --ink: #e7ebf2;
    --ink-2: #9aa5b8;
    --line: #333b48;
    --lcd: #9fb585;
    --lcd-ink: #1e2a14;
    --signal: #5b86f0;
    --shadow: 0 1px 0 rgba(255,255,255,.04) inset, 0 2px 8px rgba(0,0,0,.35);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font: 15px/1.55 var(--body);
  color: var(--ink);
  background: var(--plastic);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--signal); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-family: var(--display); line-height: 1.12; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(30px, 5vw, 52px); font-weight: 800; }
h2 { font-size: clamp(22px, 3vw, 30px); font-weight: 700; }
h3 { font-size: 17px; font-weight: 700; }
p { margin: 0 0 1em; }
:focus-visible { outline: 3px solid var(--signal); outline-offset: 2px; border-radius: 6px; }
.muted { color: var(--ink-2); }
.small { font-size: 13px; }
.mono { font-family: var(--lcd-font); font-size: 1.15em; letter-spacing: .02em; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.hidden { display: none !important; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--plastic) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.topbar .wrap { display: flex; align-items: center; gap: 18px; height: 58px; max-width: none; padding: 0 24px; }
.brand { font: 800 20px var(--display); color: var(--ink); display: flex; align-items: center; gap: 8px; }
.brand:hover { text-decoration: none; }
.brand i {
  width: 22px; height: 28px; border-radius: 5px; background: var(--ink); position: relative; display: inline-block;
}
.brand i::after { content: ''; position: absolute; inset: 4px 4px 12px; background: var(--lcd); border-radius: 2px; }
.nav { display: flex; gap: 4px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.nav a { color: var(--ink-2); padding: 6px 10px; border-radius: 8px; white-space: nowrap; font-weight: 500; }
.nav a.on, .nav a:hover { color: var(--ink); background: var(--plastic-2); text-decoration: none; }
.wallet { font-weight: 600; white-space: nowrap; }
.wallet .mono { color: var(--ok); }

/* ---------- controls ---------- */
.btn {
  appearance: none; border: 1px solid var(--line); background: var(--card); color: var(--ink);
  font: 600 14px var(--body); padding: 9px 16px; border-radius: 10px; cursor: pointer;
  box-shadow: var(--shadow); display: inline-flex; align-items: center; gap: 6px; text-decoration: none;
  transition: transform .06s ease;
}
.btn:hover { text-decoration: none; border-color: var(--ink-2); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--signal); border-color: var(--signal); color: var(--signal-ink); }
.btn.danger { color: var(--bad); }
.btn.sm { padding: 5px 10px; font-size: 13px; border-radius: 8px; }
.btn[disabled] { opacity: .55; cursor: default; }
input, select, textarea {
  font: 15px var(--body); color: var(--ink); background: var(--card);
  border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; width: 100%;
}
textarea { min-height: 90px; font-family: ui-monospace, monospace; font-size: 13px; }
label { display: block; font-weight: 600; font-size: 13px; margin: 12px 0 4px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row > * { flex: 0 0 auto; }
.grow { flex: 1 1 auto !important; }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow);
}
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.page { padding-top: 28px; padding-bottom: 60px; }
.page-head { display: flex; align-items: end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head h1 { font-size: clamp(26px, 3.5vw, 36px); margin: 0; }

.pill {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600;
  padding: 2px 9px; border-radius: 99px; background: var(--plastic-2); color: var(--ink-2);
}
.pill::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.ok { color: var(--ok); background: color-mix(in srgb, var(--ok) 12%, transparent); }
.pill.warn { color: var(--warn); background: color-mix(in srgb, var(--warn) 14%, transparent); }
.pill.bad { color: var(--bad); background: color-mix(in srgb, var(--bad) 12%, transparent); }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; color: var(--ink-2); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.table-wrap { overflow-x: auto; }
.num { text-align: right; font-variant-numeric: tabular-nums; }

.toast {
  position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 99;
  background: var(--ink); color: var(--plastic); padding: 10px 16px; border-radius: 10px;
  font-weight: 500; max-width: calc(100% - 32px); box-shadow: 0 6px 24px rgba(0,0,0,.25);
}
.toast.bad { background: var(--bad); color: #fff; }
.empty { text-align: center; padding: 40px 16px; }
.empty p { color: var(--ink-2); }
.notice { background: var(--lcd); color: var(--lcd-ink); padding: 10px 14px; border-radius: 10px; margin-bottom: 16px; font-weight: 500; }

/* ---------- the phone (signature) ---------- */
.phone {
  width: 250px; padding: 22px 18px 18px; border-radius: 34px;
  background: linear-gradient(160deg, #2b3343, #161b25);
  box-shadow: 0 20px 50px rgba(15, 20, 30, .35), inset 0 1px 0 rgba(255,255,255,.12);
  margin: 0 auto; position: relative;
}
.phone::before { content: ''; display: block; width: 46px; height: 5px; border-radius: 4px; background: #0c0f15; margin: 0 auto 14px; }
.lcd {
  background: var(--lcd); color: var(--lcd-ink); border-radius: 8px; padding: 12px 12px 10px;
  font-family: var(--lcd-font); font-size: 20px; line-height: 1.15;
  box-shadow: inset 0 2px 6px rgba(0,0,0,.25);
  background-image: repeating-linear-gradient(0deg, rgba(0,0,0,.035) 0 1px, transparent 1px 3px);
}
.lcd .t { font-size: 15px; opacity: .75; display: flex; justify-content: space-between; }
.lcd .big { font-size: 34px; }
.lcd .line { display: flex; justify-content: space-between; border-top: 1px dashed rgba(44,58,32,.3); padding-top: 3px; margin-top: 3px; }
.lcd .blink { animation: blink 1.2s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.keys-mini { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin-top: 16px; }
.keys-mini span { height: 20px; border-radius: 8px; background: #3a4356; box-shadow: inset 0 -2px 0 rgba(0,0,0,.35); }

/* ---------- landing ---------- */
.hero { padding: 48px 0 40px; }
.hero .wrap { display: grid; grid-template-columns: 1.25fr 1fr; gap: 40px; align-items: center; }
.hero .lede { font-size: 18px; color: var(--ink-2); max-width: 34em; }
.hero .cta { display: flex; gap: 10px; flex-wrap: wrap; margin: 22px 0 10px; }
.hero .chips { display: flex; gap: 14px; flex-wrap: wrap; color: var(--ink-2); font-size: 14px; }
.hero .chips span::before { content: '✓ '; color: var(--ok); font-weight: 700; }
.live { color: var(--ok); font-weight: 600; font-size: 14px; display: inline-flex; gap: 8px; align-items: center; margin-bottom: 10px; }
.live::before { content: ''; width: 9px; height: 9px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ok) 20%, transparent); }
section.band { padding: 44px 0; border-top: 1px solid var(--line); }
.feat { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 22px 28px; }
.feat h3 { margin-bottom: 4px; }
.feat p { color: var(--ink-2); margin: 0; }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; counter-reset: s; }
.steps .card { position: relative; padding-top: 44px; }
.steps .card::before {
  counter-increment: s; content: counter(s); position: absolute; top: 12px; left: 18px;
  font: 28px var(--lcd-font); color: var(--lcd-ink); background: var(--lcd); padding: 0 9px; border-radius: 6px;
}
.prices { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }
.price .amount { font: 800 30px var(--display); }
.price ul { padding-left: 18px; color: var(--ink-2); margin: 10px 0 16px; }
.faq details { border-bottom: 1px solid var(--line); padding: 12px 0; }
.faq summary { cursor: pointer; font-weight: 600; }
.faq details p { margin: 8px 0 0; color: var(--ink-2); }
footer { border-top: 1px solid var(--line); padding: 22px 0 40px; color: var(--ink-2); font-size: 14px; }
footer .wrap { display: flex; gap: 16px; flex-wrap: wrap; justify-content: space-between; }

/* ---------- auth ---------- */
.auth { max-width: 400px; margin: 40px auto; }

/* ---------- tab cards ---------- */
.tab-card { display: flex; flex-direction: column; gap: 10px; }
.tab-card .top { display: flex; justify-content: space-between; align-items: start; gap: 8px; }
.tab-card h3 { margin: 0; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; background: var(--lcd); color: var(--lcd-ink); border-radius: 8px; padding: 8px 10px; }
.stats div { font-family: var(--lcd-font); font-size: 22px; line-height: 1; }
.stats small { display: block; font: 11px var(--body); opacity: .75; margin-top: 3px; }

/* ---------- viewer ---------- */
.screen-wrap { position: relative; background: #000; border-radius: 6px; overflow: hidden; line-height: 0; touch-action: none; }
.screen-wrap canvas {
  display: block; height: auto; margin: 0 auto;
  /* Fit the width, but never taller than --screen-maxh, so the keypad stays on screen. */
  width: min(100%, calc(var(--screen-maxh) * var(--ar, .75)));
}
.screen-wrap.pixel canvas { image-rendering: pixelated; }
.screen-wrap .overlay {
  position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 20px;
  background: rgba(10,12,18,.72); color: #fff; line-height: 1.4; font-size: 14px;
}
.events { list-style: none; padding: 0; margin: 0; max-height: 260px; overflow: auto; font-size: 13px; }
.events li { padding: 6px 0; border-bottom: 1px dashed var(--line); }
.events time { color: var(--ink-2); font-variant-numeric: tabular-nums; margin-right: 6px; }
.kbd-help { font-size: 12px; color: var(--ink-2); }
kbd { font: 12px ui-monospace, monospace; background: var(--plastic-2); border: 1px solid var(--line); border-radius: 4px; padding: 0 4px; }

.qr { width: 240px; max-width: 100%; border-radius: 12px; background: #fff; padding: 8px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; font-size: 14px; }
.kv dt { color: var(--ink-2); }
.kv dd { margin: 0; font-weight: 600; word-break: break-all; }

.admin-nav { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 18px; }
.admin-nav a { padding: 6px 12px; border-radius: 8px; color: var(--ink-2); font-weight: 600; font-size: 14px; }
.admin-nav a.on { background: var(--ink); color: var(--plastic); text-decoration: none; }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin-bottom: 18px; }
.kpis .card b { display: block; font: 800 26px var(--display); }
.kpis .card span { color: var(--ink-2); font-size: 13px; }


/* ---------- tab as a phone: apps, text entry, extra keys ---------- */
.apps { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 8px; }
.apps li { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 12px; border: 1px solid var(--line); }
.apps li.active { border-color: color-mix(in srgb, var(--ok) 55%, var(--line)); background: color-mix(in srgb, var(--ok) 7%, transparent); }
.apps .grow { min-width: 0; }
.apps .pill { white-space: nowrap; }
.apps b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-icon {
  flex: 0 0 auto; width: 40px; height: 40px; border-radius: 10px; position: relative; overflow: hidden;
  display: grid; place-items: center; background: var(--lcd); color: var(--lcd-ink); font: 22px var(--lcd-font);
}
.app-icon img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; image-rendering: pixelated; background: var(--lcd); }
.app-more { position: relative; }
.app-more summary { list-style: none; }
.app-more summary::-webkit-details-marker { display: none; }
.app-more .menu {
  position: absolute; right: 0; top: calc(100% + 4px); z-index: 5; display: grid; gap: 6px; min-width: 260px; max-width: 80vw;
  background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.2);
}
.add-form { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); }
.add-form label:first-child { margin-top: 0; }

.screen-wrap .textbox {
  position: absolute; left: 8px; right: 8px; bottom: 8px; display: grid; gap: 8px; line-height: 1.4;
  background: var(--card); color: var(--ink); border-radius: 12px; padding: 12px; box-shadow: 0 8px 30px rgba(0,0,0,.45);
}
.screen-wrap .textbox input { font-size: 16px; }
.screen-wrap .textbox small { color: var(--ink-2); font-size: 12px; }

.live-typing {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 8px;
  color: var(--ink-2); font-size: 13px; justify-content: center;
}
.live-typing #live-q { color: var(--warn); }
.chip { appearance: none; border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: 99px; padding: 2px 10px; font: 600 12px var(--body); cursor: pointer; }
/* Focusable but invisible: it only exists to summon the phone keyboard. 16px stops iOS zooming. */
.live-in { position: absolute; left: 50%; bottom: 0; width: 1px; height: 1px; opacity: 0; font-size: 16px; padding: 0; border: 0; pointer-events: none; }

/* ---------- tab: use screen ---------- */
.play { display: flex; flex-direction: column; min-height: calc(100vh - 59px); min-height: calc(100svh - 59px); --screen-maxh: 76vh; }
.play.with-keys { --screen-maxh: 46vh; }
.play-bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 16px;
  border-bottom: 1px solid var(--line); background: var(--card);
}
.play-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; margin-right: auto; }
.play-title b { font: 700 17px var(--display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 40vw; }
.play-status { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.play-actions { display: flex; gap: 6px; }
.icon-btn {
  appearance: none; border: 1px solid var(--line); background: var(--card); color: var(--ink); cursor: pointer;
  width: 36px; height: 36px; border-radius: 10px; display: inline-grid; place-items: center; font-size: 17px; flex: 0 0 auto;
}
.icon-btn:hover { text-decoration: none; border-color: var(--ink-2); }
.icon-btn.on { background: var(--signal); border-color: var(--signal); color: var(--signal-ink); }
.app-switch { position: relative; }
.switch-btn {
  appearance: none; display: flex; align-items: center; gap: 8px; max-width: 240px; height: 36px; padding: 0 10px 0 4px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--plastic-2); color: var(--ink); font: 600 14px var(--body); cursor: pointer;
}
.switch-btn .app-icon { width: 28px; height: 28px; border-radius: 7px; font-size: 16px; }
.switch-btn span:not(.app-icon) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.switch-btn i { font-style: normal; color: var(--ink-2); }
.switch-menu {
  position: absolute; z-index: 30; top: calc(100% + 6px); right: 0; min-width: 250px; max-width: 86vw; padding: 6px;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 32px rgba(0,0,0,.25);
}
.switch-menu button, .switch-menu a {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 6px; border: 0; border-radius: 8px;
  background: none; color: var(--ink); font: 14px var(--body); text-align: left; cursor: pointer;
}
.switch-menu button:hover, .switch-menu a:hover { background: var(--plastic-2); text-decoration: none; }
.switch-menu button.on { background: color-mix(in srgb, var(--ok) 10%, transparent); }
.switch-menu b { display: block; font-weight: 600; }
.switch-menu small { color: var(--ink-2); }
.switch-menu .manage { border-top: 1px solid var(--line); border-radius: 0 0 8px 8px; margin-top: 4px; padding: 10px 6px 6px; color: var(--signal); }
.play-stage { flex: 1; display: grid; place-items: start center; padding: 16px; background: var(--plastic); }
.play-stage:fullscreen { place-items: center; padding: 8px; --screen-maxh: 92vh; }
.with-keys .play-stage:fullscreen { --screen-maxh: 56vh; }
.device { position: relative; width: min(100%, calc(var(--screen-maxh) * var(--ar, .75))); }
.device .screen-wrap { border-radius: 4px; }
.with-keys .device {
  width: min(100%, max(358px, calc(var(--screen-maxh) * var(--ar, .75) + 28px))); padding: 14px 14px 18px; border-radius: 30px;
  background: linear-gradient(170deg, #2e3646 0%, #1a1f2a 55%, #141821 100%);
  box-shadow: 0 18px 40px rgba(15,20,30,.35), inset 0 1px 0 rgba(255,255,255,.1);
}
.with-keys .device .live-typing { color: #c9d2e0; }
.with-keys .screen-wrap { width: fit-content; max-width: 100%; margin: 0 auto; }
.with-keys .screen-wrap canvas { width: min(calc(100vw - 48px), calc(var(--screen-maxh) * var(--ar, .75))); }


/* ---------- tab: settings ---------- */
.settings-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.settings-col { display: grid; gap: 14px; }
.switch-row { display: flex; gap: 12px; align-items: flex-start; font-weight: 400; margin: 14px 0 0; cursor: pointer; }
.switch-row input { width: 18px; height: 18px; margin-top: 3px; flex: 0 0 auto; accent-color: var(--signal); }
.switch-row b { display: block; font-size: 14px; }
.switch-row small { color: var(--ink-2); font-size: 13px; }
.danger-zone { border-color: color-mix(in srgb, var(--bad) 35%, var(--line)); }

@media (max-width: 860px) {
  .hero .wrap { grid-template-columns: 1fr; }
  .settings-grid { grid-template-columns: minmax(0, 1fr); }
    }
@media (max-width: 560px) {
  .play { --screen-maxh: 66svh; }
  .play.with-keys { --screen-maxh: 34svh; }
  /* Two rows: back · name+status · settings / app switcher · run controls · typing · fullscreen */
  .play-bar { padding: 6px 10px; gap: 6px; }
  .play-bar .back { order: 0; }
  .play-title { order: 1; flex: 1 1 calc(100% - 96px); margin-right: 0; gap: 6px; flex-wrap: nowrap; }
  .play-title b { max-width: 30vw; font-size: 15px; flex: 0 1 auto; }
  .play-status { flex-wrap: nowrap; overflow: hidden; }
  .play-status .pill { font-size: 11px; padding: 1px 7px; white-space: nowrap; }
  .play-bar .settings { order: 2; }
  .app-switch { order: 3; flex: 1 1 120px; min-width: 0; }
  .switch-menu { right: auto; left: 0; }
  .switch-btn { max-width: 100%; width: 100%; }
  .play-actions { order: 4; }
  #typing { order: 5; }
  #full { order: 6; }
  .play-actions .lbl, .hide-sm { display: none; }
  .play-actions .btn { width: 36px; height: 36px; justify-content: center; padding: 0; }
  .play-stage { padding: 10px 8px; }
  .with-keys .device { padding: 10px 10px 14px; border-radius: 24px; }
  .pk-top { grid-template-columns: 1fr 118px 1fr; }
  .dpad { width: 118px; height: 118px; grid-template-columns: 1fr 48px 1fr; grid-template-rows: 1fr 48px 1fr; }
  .pk-num { gap: 8px 10px; margin-top: 12px; }
  .pk.num { height: 40px; }
  :root { --screen-maxh: 40svh; }
          .wallet .label { display: none; }
  .topbar .wrap { gap: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .lcd .blink { animation: none; }
  .btn { transition: none; }
}


/* ================= thuetab-style customer area ================= */
.bad-text { color: var(--bad); }
.small-b { font-size: 15px !important; line-height: 1.3; font-weight: 700 !important; font-family: var(--body) !important; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 0 12px; }
.pill-btn.on, .seg button.on { background: var(--signal); border-color: var(--signal); color: var(--signal-ink); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.seg button { appearance: none; border: 0; background: var(--card); color: var(--ink); font: 600 13px var(--body); padding: 6px 10px; cursor: pointer; }
.seg button + button { border-left: 1px solid var(--line); }
.quote { margin: 16px 0 12px; }
.quote .kv dd { text-align: right; }
.amounts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 6px; }
.amounts .btn { justify-content: center; }
.toggle { position: relative; display: inline-block; width: 40px; height: 22px; margin: 0; }
.toggle input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.toggle span { position: absolute; inset: 0; border-radius: 99px; background: var(--line); transition: background .15s; pointer-events: none; }
.toggle span::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; }
.toggle input:checked + span { background: var(--ok); }
.toggle input:checked + span::after { transform: translateX(18px); }
.toggle input:disabled + span { opacity: .45; }
.toggle input:focus-visible + span { outline: 3px solid var(--signal); outline-offset: 2px; }
dialog.dialog { max-width: min(460px, calc(100vw - 32px)); border: 1px solid var(--line); color: var(--ink); }
dialog.dialog.wide { max-width: min(620px, calc(100vw - 32px)); }
dialog.dialog::backdrop { background: rgba(10, 12, 18, .55); }
.rules { line-height: 1.6; }

/* tab list (#/) */
.home { display: flex; flex-direction: column; gap: 12px; padding-top: 20px; }
.home > .notice { margin: 0; }
.stats-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px 14px; display: grid; align-content: start; gap: 2px; }
.stat-label { color: var(--ink-2); font-size: 13px; }
.stat-val { font: 700 22px/1.25 var(--display); }
.stats-row .stat:last-child { background: color-mix(in srgb, var(--signal) 9%, var(--card)); border-color: color-mix(in srgb, var(--signal) 35%, var(--line)); }
.stats-row .stat:last-child .stat-val { font-size: 18px; }
.host-card { margin: 0; }
.row-form { display: grid; grid-template-columns: 1fr 1fr auto auto auto; gap: 8px; align-items: center; margin-bottom: 4px; }
.row-form > input, .row-form > select { min-width: 0; }
.row-form .btn.primary { height: 40px; }
.count-field { display: flex; align-items: center; gap: 6px; margin: 0; font-weight: 400; }
.count-field span { white-space: nowrap; }
.count-field input { width: 64px; }
.own-proxy, .row-form .progress { grid-column: 1 / -1; }
.row-form .progress:empty { display: none; }
.own-proxy summary { cursor: pointer; }
.own-proxy p { margin: 6px 0; }
.own-proxy textarea { width: 100%; font-family: ui-monospace, Consolas, monospace; font-size: 13px; }
.own-proxy code { background: var(--plastic-2); border-radius: 4px; padding: 0 4px; }
.own-proxy-tag { overflow-wrap: anywhere; }
.session-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr)); gap: 12px; }
.session { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px; display: grid; gap: 8px; align-content: start; }
.session .body { display: grid; gap: 8px; }
.session-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.session-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.session-meta { color: var(--ink-2); font-size: 13px; display: grid; gap: 2px; }
.online-tag { display: inline-flex; align-items: center; gap: 6px; }
.online-tag::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--ink-2); }
.online-tag.on { color: var(--ok); }
.online-tag.on::before { background: var(--ok); }
.session-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.my-games { display: grid; gap: 10px; margin-top: 8px; }
.my-games p { margin: 0; }
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.section-head h2 { font-size: 17px; margin: 0; }
.my-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.my-list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; }
.my-list li > div { display: grid; min-width: 0; }
.my-list li span { overflow-wrap: anywhere; }
@media (max-width: 860px) {
  .stats-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .row-form { grid-template-columns: 1fr; }
}
.session .events { margin: 0; }
.session .events summary { cursor: pointer; color: var(--ink-2); }
.events-list { list-style: none; padding: 0; margin: 8px 0 0; max-height: 220px; overflow: auto; }
.events-list li { padding: 4px 0; border-bottom: 1px dashed var(--line); }
.events-list li.error { color: var(--bad); }
.events-list li.warn { color: var(--warn); }
.events-list time { color: var(--ink-2); margin-right: 6px; font-variant-numeric: tabular-nums; }
.empty-line { text-align: center; padding: 24px 0; }
.drop { display: grid; place-items: center; gap: 2px; text-align: center; padding: 22px 12px; margin: 10px 0; border: 2px dashed var(--line); border-radius: 12px; cursor: pointer; font-weight: 400; }
.drop:hover, .drop.over { border-color: var(--signal); background: color-mix(in srgb, var(--signal) 6%, transparent); }
.drop.busy { opacity: .6; pointer-events: none; }


/* sync / view walls */
.sync { padding: 20px 24px 32px; }
.sync-head { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: flex-end; justify-content: space-between; margin-bottom: 14px; }
.sync-head h1 { font-size: 28px; margin: 0 0 4px; }
.sync-title { display: flex; align-items: center; gap: 10px; }
.sync-title .back { display: none; }
.sync-head p { margin: 0; max-width: 640px; }
.sync-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.sync-tools .btn { height: 38px; display: inline-flex; align-items: center; }
.sync-size { display: flex; flex-direction: row; align-items: center; gap: 6px; margin: 0; font-weight: 400; }
.sync-size select { width: auto; }
.sync-bulk { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 4px 8px; border: 1px dashed var(--line); border-radius: 12px; }
.sync-bulk .btn[disabled] { opacity: .45; }
.sync-text { margin-bottom: 14px; }
.sync-acc { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 16px; margin-bottom: 14px; }
.sync-acc-form { display: grid; gap: 10px; min-width: 0; }
.sync-acc-form p { margin: 0; }
.sync-acc-form textarea { width: 100%; min-height: 120px; font: 14px/1.5 ui-monospace, Consolas, monospace; }
.acc-formats code, .sync-acc-form code { background: var(--plastic-2); border-radius: 4px; padding: 0 4px; }
.sync-acc-opts { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: flex-end; }
.sync-acc-opts label { margin: 0; font-weight: 400; font-size: 13px; display: grid; gap: 4px; }
.sync-acc-opts .check { display: flex; align-items: center; gap: 6px; align-self: center; }
.sync-acc-opts .check input { width: 18px; height: 18px; margin: 0; accent-color: var(--signal); }
.sync-acc-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.sync-acc-plan { margin: 0; padding: 0 0 0 22px; max-height: 300px; overflow: auto; font-size: 13px; display: grid; gap: 4px; align-content: start; overflow-wrap: anywhere; }
.sync-acc-plan li.skip { color: var(--ink-2); }
.sync-acc-plan .err { color: var(--bad); }
.sync-body { display: flex; gap: 20px; align-items: flex-start; }
.sync-grid { flex: 1; min-width: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(var(--tile), 1fr)); gap: 12px; --tile: 220px; align-content: start; }
.sync-grid[data-size="s"] { --tile: 150px; }
.sync-grid[data-size="l"] { --tile: 320px; }
.sync-grid > .empty { grid-column: 1 / -1; padding: 24px; text-align: center; color: var(--ink-2); }
#tiles.sync-grid:not(.view-grid) { user-select: none; -webkit-user-select: none; }
.sync-tile { min-width: 0; display: flex; flex-direction: column; gap: 6px; padding: 8px; border-radius: var(--radius); background: var(--card); border: 2px solid var(--line); box-shadow: var(--shadow); }
.sync-tile.on { border-color: var(--signal); }
.sync-tile.marq { border-color: var(--signal); outline: 2px dashed var(--signal); outline-offset: 2px; }
.sync-grid .sync-screen { cursor: pointer; }
.view-grid .sync-screen { cursor: default; }
.view-grid .sync-tile:has(.state.ok) { border-color: var(--ok); }
.view-grid[data-size="s"] .sync-tile-head > .state { display: none; }
.sync-tile-head { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 13px; }
.sync-tile-head label { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; margin: 0; font-weight: 400; cursor: pointer; }
.sync-tile-head input { width: 20px; height: 20px; margin: 0; flex: none; accent-color: var(--signal); }
.sync-tile-head b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sync-tile-head > span, .sync-tile-head > a { flex: none; }
.sync-tile-head .state.ok { color: var(--ok); }
.sync-screen { position: relative; border-radius: 8px; overflow: hidden; background: #07080c; }
.sync-screen canvas { display: block; width: 100%; height: 100%; touch-action: none; image-rendering: pixelated; outline: none; }
.sync-screen .overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; text-align: center; padding: 10px; font-size: 13px; background: rgba(8,10,16,.78); color: #fff; }
.sync-side { flex: none; min-width: 0; display: flex; align-items: flex-start; gap: 14px; position: sticky; top: 16px; }
.sync-main-panel { width: 380px; }
.sync-main .sync-tile { padding: 0; border: 0; background: transparent; box-shadow: none; }
.sync-main .sync-tile-head input { display: none; }
.sync-main .sync-screen { width: 100%; max-width: calc((100vh - 170px) * 3 / 4); margin: 0 auto; box-shadow: 0 0 0 2px var(--signal); cursor: default; }
.sync-pad { width: 260px; }
.marquee { position: fixed; z-index: 50; border: 1px solid var(--signal); background: color-mix(in srgb, var(--signal) 15%, transparent); pointer-events: none; }

@media (max-width: 1280px) and (min-width: 761px) {
  .sync-side { flex-direction: column; width: 320px; }
  .sync-main-panel, .sync-pad { width: 100%; }
}
@media (max-width: 760px) {
  body[data-view="sync"] .topbar { display: none; }
  .sync { padding: 8px 8px 20px; }
  .sync-title .back { display: inline-grid; }
  .sync-head { margin-bottom: 8px; gap: 8px; }
  .sync-head h1 { font-size: 20px; margin: 0; }
  .sync-acc { grid-template-columns: 1fr; }
  .sync-body { flex-direction: column; gap: 12px; }
  .sync-grid { width: 100%; gap: 8px; --tile: 140px; }
  .sync-grid[data-size="s"] { --tile: 100px; }
  .sync-grid[data-size="l"] { --tile: 220px; }
  .sync-tile { padding: 6px; }
  .sync-tile-head > .state { display: none; }
  .sync-side { order: -1; position: static; width: 100%; flex-direction: column; gap: 8px; }
  .sync-main-panel, .sync-pad { width: 100%; }
  .sync-main .sync-screen { max-width: calc((100svh - 440px) * 3 / 4); }
  .sync-side .panel { padding: 0; border: 0; background: transparent; box-shadow: none; gap: 8px; }
  .sync-side .panel-head { justify-content: flex-end; }
}

/* invoice */
.invoice .card { max-width: 640px; }
@media print {
  .topbar, .no-print, .toast { display: none !important; }
  body { background: #fff; color: #000; }
  .invoice .card { box-shadow: none; border: 0; }
}

@media (max-width: 560px) {
  .cards { grid-template-columns: minmax(0, 1fr); }
  .amounts { grid-template-columns: repeat(2, 1fr); }
}
.btn.danger-solid { background: var(--bad); border-color: var(--bad); color: #fff; }
.host-card { margin-bottom: 16px; }
.host-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 8px 16px; margin: 8px 0 0; }
.host-grid dt { color: var(--ink-2); font-size: 12px; }
.host-grid dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.bar-track { display: block; height: 5px; border-radius: 3px; background: var(--plastic-2); margin-top: 4px; overflow: hidden; }
.bar-fill { display: block; height: 100%; background: var(--ok); }
.bar-fill.hot { background: var(--bad); }

/* ---------- #/play: tab list · screen · status + keypad ---------- */
.pv { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; padding: 20px 24px 32px; }
.pv-tabs { flex: 1 1 220px; max-width: 260px; display: flex; flex-direction: column; gap: 10px; }
.pv-main { flex: 999 1 480px; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.pv-side { flex: 1 1 290px; max-width: 330px; display: flex; flex-direction: column; gap: 14px; }
.panel { padding: 16px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 12px; }
.panel p { margin: 0; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.panel-head h2 { font-size: 17px; margin: 0; }
.tab-list { display: flex; flex-direction: column; gap: 8px; }
.tab-item { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); color: var(--ink); box-shadow: var(--shadow); }
.tab-item:hover { text-decoration: none; border-color: var(--ink-2); }
.tab-item[aria-current="page"] { border-color: var(--signal); background: color-mix(in srgb, var(--signal) 9%, var(--card)); }
.tab-item .row { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: nowrap; }
.tab-item b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tab-item span { font-size: 13px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--line); flex: none; }
.dot.on { background: var(--ok); }
.btn.dashed { border-style: dashed; background: transparent; justify-content: center; }

.pv-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.pv-head .back { display: none; }
.pv-title { flex: 1 1 220px; min-width: 0; display: flex; flex-direction: column; }
.title-row { display: flex; align-items: center; gap: 10px; min-width: 0; }
.pv-title h1 { font-size: 28px; margin: 0; letter-spacing: -.3px; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pv-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.pv-actions .btn { display: inline-flex; align-items: center; gap: 6px; height: 40px; }
.pv-actions .btn svg { flex: none; }
.pv-actions .btn.primary[aria-pressed="true"] { box-shadow: 0 0 0 3px color-mix(in srgb, var(--signal) 35%, transparent); }
.live-badge { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; background: color-mix(in srgb, var(--bad) 10%, var(--card)); border: 1px solid color-mix(in srgb, var(--bad) 30%, var(--line)); font: 600 12px var(--body); color: var(--bad); letter-spacing: .5px; }
.live-badge .live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--bad); animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }

.stage { padding: 20px; border-radius: 18px; background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 12px; }
.pv-screen { position: relative; width: 100%; height: clamp(360px, calc(100vh - 250px), 1000px); border-radius: 12px; background: #07080c; display: flex; align-items: center; justify-content: center; overflow: hidden; touch-action: none; }
.pv-screen:fullscreen { height: 100%; border-radius: 0; }
.pv-screen canvas { display: block; touch-action: none; border-radius: 4px; box-shadow: 0 0 0 2px var(--signal); outline: none; }
.pv-screen.pixel canvas { image-rendering: pixelated; image-rendering: crisp-edges; }
.pv-screen .overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; text-align: center; padding: 24px; background: rgba(8,10,16,.78); color: #fff; cursor: pointer; line-height: 1.45; }
.text-bar { display: grid; gap: 6px; }
.text-bar input { width: 100%; font-size: 16px; border-color: var(--signal); }
.stage-note { margin: 0; }

.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line); white-space: nowrap; color: var(--ink-2); }
.badge.running { color: var(--ok); background: color-mix(in srgb, var(--ok) 12%, transparent); border-color: transparent; }
.badge.running::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.badge.starting, .badge.backoff { color: var(--warn); }
.badge.stopped, .badge.crashed { color: var(--bad); }
.stat-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.mini { padding: 9px 12px; border-radius: 10px; background: var(--plastic-2); display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.mini span { font-size: 12px; color: var(--ink-2); }
.mini b { font: 500 15px ui-monospace, SFMono-Regular, Menlo, monospace; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.quality { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--ink-2); margin: 0; font-weight: 400; }
.quality select { width: auto; }
.pv-ctl { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pv-ctl .btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap; }

.keypad { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; user-select: none; -webkit-user-select: none; }
.keypad button { min-height: 52px; border-radius: 10px; border: 1px solid var(--line); background: var(--plastic-2); color: var(--ink); font: 600 16px var(--body); display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.15; cursor: pointer; touch-action: none; -webkit-tap-highlight-color: transparent; transition: background .08s; }
.keypad button small { font-size: 10px; font-weight: 500; letter-spacing: 1px; color: var(--ink-2); }
.keypad button.soft { background: var(--card); color: var(--signal); font-size: 13px; }
.keypad button.fire { background: var(--signal); border-color: var(--signal); color: var(--signal-ink); }
.keypad button.fire small { color: color-mix(in srgb, var(--signal-ink) 80%, transparent); }
.keypad button.down, .keypad button:active { background: color-mix(in srgb, var(--signal) 75%, #000); border-color: var(--signal); color: #fff; }
.keypad button.down small, .keypad button:active small { color: #fff; }
.keypad .digit-5 { visibility: hidden; }
.show-sm { display: none; }
.small-btn { padding: 5px 10px; font-size: 13px; }

@media (max-width: 1100px) { .pv-tabs { display: none; } }
@media (max-width: 760px) {
  body[data-view="play"] .topbar { display: none; }
  .pv { gap: 12px; padding: 8px 8px 20px; }
  .pv-side { max-width: none; flex-basis: 100%; }
  .pv-head { gap: 6px; flex-wrap: nowrap; }
  .pv-head .back { display: inline-grid; }
  .pv-title { flex: 1 1 0; }
  .pv-title .muted { display: none; }
  .pv-title h1 { font-size: 18px; }
  .live-badge { padding: 0; width: 22px; height: 22px; justify-content: center; }
  .pv-actions { flex-wrap: nowrap; gap: 6px; }
  .pv-actions .btn { width: 40px; padding: 0; justify-content: center; }
  .hide-sm { display: none !important; }
  .show-sm { display: inline-flex; }
  .stage { padding: 0; border: 0; background: transparent; box-shadow: none; gap: 8px; }
  .stage-note { display: none; }
  .pv-screen { height: clamp(260px, min(calc((100vw - 16px) * 4 / 3), calc(100svh - 360px)), 2000px); border-radius: 8px; }
  .pv-side > .keypad-panel { order: -1; }
  .stat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .mini { padding: 6px 8px; align-items: center; }
  .pv-side .panel { padding: 0; border: 0; background: transparent; box-shadow: none; gap: 8px; }
  .pv-side .panel-head { justify-content: flex-end; }
  .pv-side .panel-head:empty { display: none; }
  .keypad { gap: 6px; }
  .keypad button { min-height: 46px; }
  .keypad .digit { display: none; }
  .keypad .digit-5 { visibility: visible; }
  .keypad.digits .digit { display: flex; }
  .keypad.digits .digit-5 { visibility: hidden; }
}
@media (prefers-reduced-motion: reduce) { .live-badge .live-dot { animation: none; } }
td[data-u] { white-space: nowrap; }

/* plans / billing pages: header, current-plan bar, main column + summary column */
.stackpage { display: flex; flex-direction: column; gap: 20px; }
.stackpage h1 { font-size: 28px; margin: 0 0 4px; }
.stackpage > div > p { margin: 0; }
.stackpage h2 { font-size: 16px; margin: 0; }
.current-plan { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; }
.current-plan > div { display: flex; flex-direction: column; }
.current-plan .right { text-align: right; }
.current-plan b { font: 700 20px var(--display); }
.current-plan b.mono { font: 600 16px ui-monospace, SFMono-Regular, Menlo, monospace; }
.split { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.split-main { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.split-main > .notice { margin: 0; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.stack + .stack { padding-top: 14px; }
.card.stack > .stack:first-child { padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.stepper { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.stepper input { width: 84px; text-align: center; font-size: 18px; font-weight: 600; }
.stepper .btn { min-width: 44px; font-size: 18px; }
.pill-group { display: flex; flex-wrap: wrap; gap: 8px; }
.pill-opt { min-height: 40px; padding: 0 18px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--ink); font: 600 14px var(--body); cursor: pointer; }
.pill-opt.on { background: var(--signal); border-color: var(--signal); color: var(--signal-ink); }
.promo { display: grid; gap: 6px; max-width: 320px; margin: 0; font-weight: 500; }
.summary { flex: 1 1 320px; max-width: 380px; padding: 20px; display: flex; flex-direction: column; gap: 12px; position: sticky; top: 76px; border-color: color-mix(in srgb, var(--signal) 35%, var(--line)); }
.summary h2 { font-size: 16px; margin: 0; }
.summary p { margin: 0; }
.kv.sum { gap: 8px 12px; }
.kv.sum dd { text-align: right; font-weight: 500; word-break: normal; }
.kv.sum .mono { font: 500 14px ui-monospace, SFMono-Regular, Menlo, monospace; }
.kv.sum .total { padding-top: 10px; border-top: 1px solid var(--line); font-weight: 700; color: var(--ink); }
.kv.sum dd.total { font: 700 22px var(--display); }
.ok-text { color: var(--ok); }
.btn.lg { min-height: 48px; font-size: 16px; justify-content: center; }
.notice.warn { background: color-mix(in srgb, var(--warn) 16%, var(--card)); color: var(--warn); margin: 0; }
.empty-cell { text-align: center; padding: 24px; }
@media (max-width: 860px) {
  .summary { max-width: none; position: static; }
  .promo { max-width: none; }
  .current-plan .right { text-align: left; }
}

/* billing (#/billing) */
.pay-warn { padding: 12px 14px; border-radius: 12px; border: 1px solid color-mix(in srgb, var(--bad) 45%, var(--line)); background: color-mix(in srgb, var(--bad) 10%, var(--card)); color: var(--bad); font-size: 14px; }
.pay-warn ul { margin: 4px 0 0; padding-left: 20px; }
.split.even > * { flex: 1 1 420px; min-width: 0; }
.split.even > .topup-form { flex: 1 1 340px; }
.split.even > .qr-card { flex: 2 1 560px; border-color: color-mix(in srgb, var(--signal) 35%, var(--line)); }
.big-money { display: block; font: 800 32px var(--display); }
.amount-pick { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.amount { min-height: 44px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); color: var(--ink); font: 600 14px ui-monospace, SFMono-Regular, Menlo, monospace; cursor: pointer; }
.amount.on { border-color: var(--signal); background: color-mix(in srgb, var(--signal) 12%, var(--card)); box-shadow: 0 0 0 2px color-mix(in srgb, var(--signal) 30%, transparent); }
.field { display: grid; gap: 6px; margin: 0; font-weight: 500; font-size: 13px; }
.topup-form .bad-text:empty { display: none; }
.qr-empty { flex: 1; min-height: 220px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center; padding: 24px; border: 1px dashed var(--line); border-radius: 12px; }
.qr-empty .muted { max-width: 340px; font-size: 13px; }
.qr-empty-icon { width: 56px; height: 56px; border-radius: 14px; display: grid; place-items: center; color: var(--signal); background: color-mix(in srgb, var(--signal) 12%, var(--card)); }
.qr-wrap { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.qr-frame { display: grid; gap: 6px; justify-items: center; }
.qr-img { background: #fff; border-radius: 12px; padding: 8px; }
.qr-img img { display: block; width: 220px; height: auto; }
.qr-info { flex: 1 1 260px; display: grid; gap: 10px; min-width: 0; }
.qr-amount b { display: block; font: 800 26px var(--display); }
.qr-field { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; }
.qr-field > span { color: var(--ink-2); min-width: 110px; }
.transfer-code { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px; border-radius: 12px; border: 1px dashed var(--signal); background: color-mix(in srgb, var(--signal) 8%, var(--card)); }
.transfer-code > div { display: grid; gap: 2px; }
.transfer-code b.mono { font: 700 22px ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .04em; }
.transfer-code .req { color: var(--bad); }
.qr-card > p { margin: 0; }

/* account (#/account) */
.account-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.account-grid .card { margin: 0; }
.account-grid p { margin: 0; }
.account-grid h2 { font-size: 16px; margin: 0; }
.account-grid .field input:disabled { opacity: .7; }
.verify-card { border-color: color-mix(in srgb, var(--bad) 55%, var(--line)); }
.row-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.toggle-list { display: grid; gap: 10px; }
.toggle-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 0; font-weight: 400; font-size: 14px; cursor: pointer; }
.device-list { display: grid; gap: 8px; }
.device { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; }
.device > div { display: grid; min-width: 0; }
@media (max-width: 860px) { .account-grid { grid-template-columns: 1fr; } }
.stackpage > .page-head { margin: 0; }
