:root {
  color-scheme: dark;
  --bg: #000;
  --panel: #0a0a0a;
  --surface: #111;
  --hover: #1a1a1a;
  --stroke: #1f1f1f;
  --stroke-strong: #2e2e2e;
  --text: #ededed;
  --muted: #a1a1a1;
  --dim: #6b6b6b;
  --accent: #a78bfa;
  --accent-2: #38bdf8;
  --accent-3: #f472b6;
  --accent-soft: color-mix(in srgb, var(--accent) 12%, transparent);
  --grad: linear-gradient(90deg, #a78bfa, #38bdf8 55%, #34d399);
  --grad-warm: linear-gradient(90deg, #f472b6, #a78bfa 50%, #38bdf8);
  --good: #3ddc97;
  --bad: #ff6369;
  --amber: #f5a524;
  --mono: ui-monospace, "Geist Mono", "SF Mono", Menlo, Consolas, monospace;
  --sans: "Geist", Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-6: 24px;
  --space-8: 32px;
  --space-12: 48px;
  --space-16: 64px;
  --gutter: var(--space-6);
  --panel-padding: var(--space-6);
  --section-gap: var(--space-8);
  --control-height: 44px;
  --control-height-small: 32px;
  --radius: 10px;
  --radius-lg: 16px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: var(--section-gap); background: var(--bg); }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.7 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
[hidden] { display: none !important; }
::selection { background: color-mix(in srgb, var(--accent) 35%, transparent); }
a { color: inherit; }
button, input, select { font: inherit; }
button, a, input, select { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .4; }
:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }
p, h1, h2, h3, pre, ol { margin: 0; }
code, pre { font-family: var(--mono); }

/* ambient backdrop: grid + aurora glow */
.site-frame { position: relative; min-height: 100dvh; isolation: isolate; }
.site-frame::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -2;
  background-image:
    linear-gradient(to right, rgba(255,255,255,.045) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,.045) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 75%);
}
.site-frame::after {
  content: '';
  position: fixed;
  top: -35vh;
  left: 50%;
  width: min(1100px, 140vw);
  height: 70vh;
  translate: -50% 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(40% 50% at 28% 50%, rgba(167,139,250,.38), transparent 70%),
    radial-gradient(38% 50% at 70% 45%, rgba(56,189,248,.30), transparent 70%),
    radial-gradient(30% 40% at 52% 70%, rgba(244,114,182,.20), transparent 70%);
  filter: blur(60px);
  animation: aurora 14s ease-in-out infinite alternate;
}
@keyframes aurora {
  from { transform: translateX(-4%) scale(1); }
  to { transform: translateX(5%) scale(1.12); }
}

.top, .stage { width: min(1120px, 100%); margin-inline: auto; padding-inline: var(--gutter); }
.top, .brand, .user-chip, .panel-bar, .row, .cl-head, .cl-actions, .tok-row, .done-meta, .chips {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.top {
  position: sticky;
  top: 0;
  z-index: 20;
  max-width: none;
  width: 100%;
  padding-inline: max(var(--gutter), calc((100% - 1120px) / 2 + var(--gutter)));
  min-height: 60px;
  gap: var(--space-6);
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  border-bottom: 1px solid var(--stroke);
}
.brand { text-decoration: none; flex-shrink: 0; gap: 10px; }
.brand-mark {
  width: 26px; height: 26px;
  display: grid; place-items: center;
  border-radius: 7px;
  background: var(--grad);
  color: #000;
  font: 700 13px var(--mono);
  letter-spacing: 0;
  box-shadow: 0 0 20px rgba(167,139,250,.45);
}
.brand-mark span { color: #000; }
.accent { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.word { font: 600 16px var(--sans); letter-spacing: -.03em; }
.word em { color: var(--dim); font-style: normal; }
.header-link {
  margin-left: auto;
  padding: 3px 10px;
  border: 1px solid var(--stroke-strong);
  border-radius: 999px;
  font: 11px var(--mono);
  color: var(--muted);
}
.header-link::before {
  content: '';
  display: inline-block;
  width: 6px; height: 6px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--good);
  box-shadow: 0 0 8px var(--good);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse { 50% { opacity: .35; } }
.user-chip { gap: var(--space-4); font-size: 13px; margin-left: auto; }
.user-chip .who { color: var(--muted); }
.user-chip:not([hidden]) ~ .header-link, .header-link:has(+ .user-chip:not([hidden])) { display: none; }

.stage { display: grid; gap: var(--section-gap); padding-block: var(--space-12) var(--space-8); }
.card { min-width: 0; border: 1px solid var(--stroke); border-radius: var(--radius-lg); background: rgba(10,10,10,.8); backdrop-filter: blur(8px); }
.card.bare, .card:has(#panel-login.active) { border: 0; background: transparent; backdrop-filter: none; }
.card:has(#panel-clusters.active) { border: 0; background: transparent; backdrop-filter: none; }
.panel { display: none; }
.panel.active { display: grid; gap: var(--space-6); animation: rise .5s cubic-bezier(.2,.7,.2,1) both; }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }
.panel, .cl-item, .file-card, .meta-card, .sub-box, .once, .log, .code-block { padding: var(--panel-padding); }
.panel h1, .panel h2 { font-size: 28px; line-height: 1.15; font-weight: 600; letter-spacing: -.04em; }
.sub { color: var(--muted); max-width: 64ch; }

/* ---------- hero ---------- */
#panel-login { padding: var(--space-8) 0 0; gap: var(--space-6); justify-items: center; text-align: center; }
.access-label {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 5px 14px 5px 6px;
  border: 1px solid var(--stroke-strong);
  border-radius: 999px;
  background: rgba(255,255,255,.03);
  font: 12px var(--sans);
  letter-spacing: 0;
  text-transform: none;
  color: var(--muted);
}
.access-label::before {
  content: 'NEW';
  width: auto; height: auto;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--grad);
  color: #000;
  font: 700 10px var(--mono);
  letter-spacing: .06em;
}
#login-title {
  font: 700 clamp(44px, 8.4vw, 96px)/.98 var(--sans);
  letter-spacing: -.06em;
  background: linear-gradient(180deg, #fff 30%, #8a8a8a);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
#login-title span {
  display: inline-block;
  background: var(--grad);
  background-size: 200% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: shimmer 6s linear infinite;
  padding-bottom: .08em;
}
@keyframes shimmer { to { background-position: -200% 0; } }
#panel-login .sub { max-width: 52ch; font-size: clamp(15px, 2vw, 18px); line-height: 1.6; }
#panel-login .btn.primary {
  background: var(--text); color: #000; border-color: var(--text);
  box-shadow: 0 0 0 1px rgba(255,255,255,.1), 0 8px 40px -4px rgba(167,139,250,.55);
}
#panel-login .btn.primary:hover:not(:disabled) { background: #fff; transform: translateY(-1px); box-shadow: 0 0 0 1px #fff, 0 10px 50px -2px rgba(56,189,248,.65); }
.login-invite, .cluster-notes { color: var(--dim); font: 12px/1.8 var(--mono); }

.hero-term {
  width: min(680px, 100%);
  margin-top: var(--space-6);
  border-radius: var(--radius-lg);
  border: 1px solid var(--stroke-strong);
  background: rgba(10,10,10,.85);
  box-shadow: 0 30px 80px -20px rgba(0,0,0,.9), 0 0 120px -30px rgba(167,139,250,.5);
  text-align: left;
  overflow: hidden;
  position: relative;
}
.hero-term::before {
  content: ''; position: absolute; inset: 0; border-radius: inherit; padding: 1px;
  background: linear-gradient(135deg, rgba(167,139,250,.7), transparent 35%, transparent 65%, rgba(56,189,248,.6));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  pointer-events: none;
}
.term-bar { display: flex; align-items: center; gap: 7px; padding: 12px 16px; border-bottom: 1px solid var(--stroke); }
.term-bar i { width: 11px; height: 11px; border-radius: 50%; background: #2a2a2a; }
.term-bar i:nth-child(1) { background: #ff5f57; } .term-bar i:nth-child(2) { background: #febc2e; } .term-bar i:nth-child(3) { background: #28c840; }
.term-bar span { margin-left: auto; font: 11px var(--mono); color: var(--dim); }
.term-body { margin: 0; padding: 18px 20px; font: 13px/1.9 var(--mono); color: var(--muted); overflow-x: auto; }
.term-body .p { color: var(--accent); }
.term-body .t { color: var(--text); }
.term-body .o { color: var(--good); }
.term-body .d { color: var(--dim); }
.term-body .ln { display: block; opacity: 0; animation: type .4s ease forwards; }
.term-body .ln:nth-child(1) { animation-delay: .3s; } .term-body .ln:nth-child(2) { animation-delay: .9s; }
.term-body .ln:nth-child(3) { animation-delay: 1.4s; } .term-body .ln:nth-child(4) { animation-delay: 1.8s; }
.term-body .ln:nth-child(5) { animation-delay: 2.2s; } .term-body .ln:nth-child(6) { animation-delay: 2.8s; }
@keyframes type { from { opacity: 0; transform: translateX(-6px); } to { opacity: 1; transform: none; } }
.term-body .cur { display: inline-block; width: 8px; height: 15px; vertical-align: -2px; background: var(--text); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.features {
  list-style: none; padding: 0; margin: var(--space-8) 0 0;
  width: 100%;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 1px;
  border: 1px solid var(--stroke); border-radius: var(--radius-lg);
  background: var(--stroke); overflow: hidden; text-align: left;
}
.features li { padding: var(--space-6); background: rgba(8,8,8,.92); display: grid; gap: 6px; align-content: start; transition: background .25s; }
.features li:hover { background: #101010; }
.features b { font-size: 14px; font-weight: 600; letter-spacing: -.01em; display: flex; align-items: center; gap: 10px; }
.features b svg { color: var(--accent-2); }
.features span { color: var(--muted); font-size: 13px; line-height: 1.55; }

.cluster-notes { display: grid; gap: var(--space-2); padding-top: var(--space-6); border-top: 1px solid var(--stroke); text-align: center; }
.cluster-notes code { color: var(--muted); }

/* ---------- steps ---------- */
.steps { list-style: none; display: flex; gap: var(--space-3); padding: 0; justify-content: center; }
.stage:has(#panel-login.active) .steps, .stage:has(#panel-clusters.active) .steps { display: none; }
.steps li { display: flex; gap: var(--space-2); align-items: center; color: var(--dim); font: 12px var(--mono); }
.steps li:not(:last-child)::after { content: ''; width: var(--space-8); height: 1px; background: var(--stroke-strong); }
.dot { width: 24px; height: 24px; display: grid; place-items: center; border: 1px solid var(--stroke-strong); border-radius: 50%; font-size: 11px; }
.steps .active { color: var(--text); }
.steps .active .dot { border-color: var(--accent); color: #fff; background: var(--accent-soft); box-shadow: 0 0 16px -2px var(--accent); }
.steps .done { color: var(--muted); }
.steps .done .dot { color: #000; background: var(--good); border-color: var(--good); }

/* ---------- controls ---------- */
.btn, .ghost-btn, .icon-btn, .copy-btn, .file-card .dl, input[type="text"], input[type="password"], select {
  min-height: var(--control-height);
  padding: var(--space-2) var(--space-4);
  border: 1px solid var(--stroke-strong);
  border-radius: var(--radius);
  background: #0a0a0a;
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}
.btn, .ghost-btn, .icon-btn, .copy-btn, .file-card .dl {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  font-weight: 500; text-decoration: none; white-space: nowrap;
  transition: background .18s, border-color .18s, transform .18s, box-shadow .25s;
}
.btn.primary { background: var(--text); color: #000; border-color: var(--text); font-weight: 600; }
.btn.primary:hover:not(:disabled) { background: #fff; border-color: #fff; box-shadow: 0 0 30px -4px rgba(167,139,250,.7); }
.btn.big { min-height: 52px; padding-inline: var(--space-8); font-size: 15px; border-radius: 12px; }
.btn .arrow { transition: transform .2s; }
.btn:hover:not(:disabled) .arrow { transform: translateX(3px); }
.ghost-btn:hover:not(:disabled), .copy-btn:hover, .icon-btn:hover, .file-card .dl:hover { background: var(--hover); border-color: #444; }
.btn.small, .ghost-btn.small, .copy-btn, .file-card .dl, .ttl select {
  min-height: var(--control-height-small);
  padding: var(--space-1) var(--space-3);
  font-size: 12px;
  border-radius: 8px;
}
.icon-btn { width: var(--control-height-small); min-height: var(--control-height-small); padding: var(--space-1); }
.icon-btn-icon { display: inline-flex; color: var(--muted); }
.link-btn { padding: 0; border: 0; background: none; color: var(--muted); font-size: 13px; text-underline-offset: 4px; transition: color .15s; }
.link-btn:hover { color: var(--text); }
.link-btn:not(.plain)::before { content: '← '; }
.panel > .link-btn { justify-self: start; }
.field { display: grid; gap: var(--space-2); }
.label { display: block; font-size: 13px; font-weight: 500; }
.name-row { display: flex; gap: var(--space-2); }
.name-row input, .sub-box input, .once input { min-width: 0; }
input[type="text"], input[type="password"], select { width: 100%; font-family: var(--mono); font-size: 13px; transition: border-color .15s, box-shadow .15s; }
input[type="text"]:focus, input[type="password"]:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input::placeholder { color: var(--dim); }
input.invalid { border-color: var(--bad); }
.hint { display: block; color: var(--dim); font-size: 12px; }
.bad, .hint.bad, #form-error { color: var(--bad); }
.good, .hint.good, .passkey-ok { color: var(--good); }
.check { display: flex; gap: var(--space-2); align-items: flex-start; font-size: 13px; cursor: pointer; color: var(--muted); }
.check input { margin: 4px 0 0; accent-color: var(--accent); }
.wg-options { padding-left: var(--panel-padding); border-left: 1px solid var(--stroke-strong); }
.size-grid, .files { display: grid; grid-template-columns: repeat(auto-fit, minmax(144px, 1fr)); gap: var(--space-3); }
.size-card {
  position: relative; display: grid; gap: var(--space-1); padding: var(--space-4);
  border: 1px solid var(--stroke-strong); border-radius: 12px; background: #080808; cursor: pointer;
  transition: border-color .2s, background .2s, transform .2s, box-shadow .25s;
}
.size-card:hover { border-color: #444; transform: translateY(-2px); }
.size-card:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent), 0 10px 40px -12px var(--accent); }
.size-card:has(input:focus-visible) { outline: 2px solid var(--accent-2); outline-offset: 2px; }
.size-card input { position: absolute; opacity: 0; }
.sz-name { font: 600 14px var(--mono); }
.sz-line { color: var(--muted); font-size: 12px; }

/* ---------- key ---------- */
.key-visual { display: flex; gap: var(--space-4); align-items: center; }
.key-orb { width: 64px; height: 64px; flex: none; border: 1px solid var(--stroke-strong); border-radius: 16px; display: grid; place-items: center; color: var(--accent); background: var(--surface); }
.key-orb.busy { border-color: var(--accent); box-shadow: 0 0 30px -4px var(--accent); animation: pulse 1.2s ease-in-out infinite; }
.key-orb.done { color: var(--good); border-color: var(--good); box-shadow: 0 0 30px -6px var(--good); }
.key-status { font: 13px var(--mono); color: var(--muted); }
.caret { display: inline-block; width: 7px; height: 14px; margin-left: 4px; vertical-align: -2px; background: var(--accent); animation: blink 1s steps(1) infinite; }
.keygrid { display: grid; grid-template-columns: repeat(8, 1fr); gap: var(--space-1); }
.keygrid span { font: 11px var(--mono); padding-block: var(--space-2); text-align: center; border: 1px solid var(--stroke); border-radius: 6px; color: var(--dim); transition: all .2s; }
.keygrid .lit, .keygrid .settled { color: #fff; border-color: color-mix(in srgb, var(--accent) 50%, transparent); background: var(--accent-soft); }
.meta-card, .sub-box, .once, .cl-item, .file-card, .code-block, .log { border: 1px solid var(--stroke); border-radius: 12px; background: #050505; }
.meta-card, .sub-box, .once, .cl-item, .file-card, .cluster-list { display: grid; gap: var(--space-4); }
.kv { display: flex; justify-content: space-between; gap: var(--space-4); font-size: 13px; }
.kv > span { color: var(--muted); }
.kv code { text-align: right; word-break: break-all; font-size: 12px; }
.clickable { cursor: pointer; text-decoration: underline dotted; text-underline-offset: 4px; }

/* ---------- provisioning ---------- */
.spinner-wrap { width: 36px; height: 36px; border: 2px solid var(--stroke-strong); border-top-color: var(--accent-2); border-right-color: var(--accent); border-radius: 50%; animation: spin .9s linear infinite; justify-self: center; box-shadow: 0 0 30px -6px var(--accent); }
.spinner-wrap > * { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.provision-head, .done-head { display: grid; gap: var(--space-2); text-align: center; justify-items: center; }
.percent { text-align: center; font: 600 40px var(--mono); letter-spacing: -.04em; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.progress, .qbar { background: var(--stroke); border-radius: 999px; overflow: hidden; height: 6px; }
.progress i, .qbar i { display: block; height: 100%; border-radius: inherit; background: var(--grad); background-size: 200% 100%; transition: width .35s cubic-bezier(.2,.7,.2,1); }
.progress i { width: 0; box-shadow: 0 0 16px var(--accent); animation: shimmer 3s linear infinite; }
.log { list-style: none; display: grid; gap: var(--space-2); max-height: 256px; overflow: auto; }
.log li { display: flex; align-items: center; gap: var(--space-2); font: 12px/1.75 var(--mono); color: var(--muted); animation: type .3s ease both; }
.st { flex: none; width: var(--space-4); }
.log .ok .st::after { content: '✓'; color: var(--good); }
.log .err { color: var(--bad); }
.log .err .st::after { content: '×'; }
.pending .st i { display: block; width: 12px; height: 12px; border: 1.5px solid var(--stroke-strong); border-top-color: var(--accent-2); border-radius: 50%; animation: spin .8s linear infinite; }
.ms { margin-left: auto; white-space: nowrap; color: var(--dim); }
.retry-row { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: var(--space-4); }

/* ---------- done ---------- */
.success-mark { width: 64px; height: 64px; justify-self: center; fill: rgba(61,220,151,.08); stroke: var(--good); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 0 14px rgba(61,220,151,.6)); }
.chips { flex-wrap: wrap; justify-content: center; }
.chip, .pill, .mode-chip { padding: 2px 10px; border: 1px solid var(--stroke-strong); border-radius: 999px; background: rgba(255,255,255,.03); color: var(--muted); font: 11px/1.7 var(--mono); }
.chip.gr, .pill.ok { color: var(--good); border-color: color-mix(in srgb, var(--good) 35%, transparent); background: color-mix(in srgb, var(--good) 8%, transparent); }
.pill.warn { color: var(--amber); border-color: color-mix(in srgb, var(--amber) 35%, transparent); background: color-mix(in srgb, var(--amber) 8%, transparent); }
.mode-chip.live { color: var(--good); border-color: color-mix(in srgb, var(--good) 35%, transparent); }
.file-card { transition: border-color .2s, transform .2s; }
.file-card:hover { border-color: var(--stroke-strong); transform: translateY(-2px); }
.file-card .ico { color: var(--accent-2); }
.fname { font: 12px var(--mono); overflow-wrap: anywhere; }
.fsize { font-size: 12px; color: var(--dim); }
.file-card .dl { align-self: end; }
.next-steps { display: grid; gap: var(--space-4); }
.next-steps h3 { font-size: 14px; font-weight: 600; }
.code-block { display: grid; gap: var(--space-4); min-width: 0; }
.code-block pre { grid-row: 2; overflow-x: auto; font-size: 12px; line-height: 1.9; color: var(--text); }
.code-block pre .c { color: var(--dim); }
.code-block pre .cmd { color: var(--accent-2); }
.copy-btn { grid-row: 1; justify-self: end; }
.done-meta, .panel-bar { justify-content: space-between; }
.panel-bar, .row, .cl-head, .cl-actions, .tok-row, .done-meta { flex-wrap: wrap; }

/* ---------- clusters ---------- */
#panel-clusters { padding-inline: 0; }
.ttl { display: inline-flex; align-items: center; gap: var(--space-2); color: var(--muted); font-size: 12px; }
.ttl select { width: auto; }
.cl-item { transition: border-color .2s, box-shadow .25s; background: rgba(10,10,10,.8); }
.cl-item:hover { border-color: var(--stroke-strong); box-shadow: 0 20px 60px -30px rgba(167,139,250,.5); }
.cl-name { font: 600 15px var(--mono); }
.cl-when { margin-left: auto; color: var(--dim); font-size: 11px; }
.cl-api { color: var(--muted); font: 12px/1.75 var(--mono); overflow-wrap: anywhere; }
.quota, .cl-body { display: grid; gap: var(--space-2); }
.quota-row { display: grid; grid-template-columns: var(--space-16) 1fr auto; gap: var(--space-3); align-items: center; font: 11px var(--mono); color: var(--muted); }
.qv { color: var(--text); }
.cl-body:empty { display: none; }
.once { border-color: color-mix(in srgb, var(--good) 45%, transparent); background: color-mix(in srgb, var(--good) 5%, #050505); }
.once p { color: var(--good); font-size: 13px; }
.tok-row { font-size: 12px; }
.tok-row .te, .tok-row .tl + .ghost-btn { margin-left: auto; }
.danger-ghost { color: var(--bad); }
.danger-ghost:hover:not(:disabled) { border-color: var(--bad); background: color-mix(in srgb, var(--bad) 10%, transparent); }
.empty { color: var(--muted); font-size: 14px; padding: var(--space-12) 0; text-align: center; border: 1px dashed var(--stroke-strong); border-radius: 12px; }
.toast { position: fixed; bottom: var(--space-6); left: 50%; transform: translate(-50%, var(--space-2)); padding: var(--space-3) var(--space-4); border: 1px solid var(--stroke-strong); border-radius: 10px; background: rgba(17,17,17,.9); backdrop-filter: blur(10px); color: var(--text); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 70; max-width: calc(100% - var(--space-8)); font-size: 13px; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
#confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 60; }

@media (max-width: 640px) {
  :root { --gutter: var(--space-4); --panel-padding: var(--space-4); --section-gap: var(--space-6); }
  .top { flex-wrap: wrap; gap: var(--space-3); padding-block: var(--space-3); }
  .user-chip { width: 100%; margin-left: 0; flex-wrap: wrap; }
  .stage { padding-top: var(--space-6); }
  #panel-login .btn { justify-self: stretch; width: 100%; }
  .term-body { font-size: 11.5px; padding: 14px; }
  .quota-row { grid-template-columns: var(--space-12) 1fr; }
  .qv { grid-column: 1 / -1; }
  .kv { flex-direction: column; gap: var(--space-1); }
  .kv code { text-align: left; }
  .keygrid { grid-template-columns: repeat(4, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .term-body .ln { opacity: 1; }
}
