/* peak zone — palette taken 1:1 from the in-game menu (peak.lua) */
:root {
  --bg: #0e0e0e;
  --bg2: #141414;
  --bg3: #1b1b1b;
  --bg4: #242424;
  --line: #2a2a2a;
  --text: #e6e6e6;
  --sub: #787878;
  --dim: #555;
  --white: #fff;
  --r: 10px;
  --font: "Montserrat", "Gotham", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
::selection { background: #fff; color: #000; }

/* ---------- shimmer (same sine b/w wave as the menu) ---------- */
@keyframes shimmer { to { background-position: -200% 0; } }
.shimmer-text {
  background: linear-gradient(90deg, #505050 0%, #fff 25%, #505050 50%, #fff 75%, #505050 100%);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: shimmer 4s linear infinite;
}
.shimmer-bg {
  background: linear-gradient(90deg, #505050 0%, #fff 25%, #505050 50%, #fff 75%, #505050 100%);
  background-size: 200% 100%;
  animation: shimmer 4s linear infinite;
}

/* ---------- background ---------- */
.bg-grid {
  position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.028) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 100%);
}
.bg-glow {
  position: fixed; z-index: -1; pointer-events: none;
  top: -30vh; left: 50%; width: 110vw; height: 80vh; transform: translateX(-50%);
  background: radial-gradient(ellipse at center, rgba(255,255,255,.07), transparent 65%);
}

/* ---------- nav: the watermark ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px max(16px, calc((100vw - 1180px) / 2));
  background: linear-gradient(var(--bg) 40%, transparent);
}
.wm {
  display: flex; align-items: center; gap: 10px;
  height: 36px; padding: 0 6px 0 10px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 9px;
  font-size: 12px; color: var(--sub);
  white-space: nowrap;
  transition: border-color .2s;
}
.wm:hover { border-color: #444; }
.wm-logo { width: 18px; height: 18px; filter: grayscale(1) brightness(1.5) contrast(1.1); }
.wm-title { font-weight: 700; font-size: 13px; }
.wm-sep { width: 1px; height: 14px; background: var(--line); }
.wm-stat b { color: var(--text); font-weight: 600; }
.wm-chip {
  padding: 3px 9px; border-radius: 6px;
  background: var(--bg4); color: var(--text); font-weight: 600; font-size: 11px;
}
.nav-links { display: flex; align-items: center; gap: 22px; font-size: 13px; font-weight: 500; color: var(--sub); }
.nav-links a:hover { color: var(--white); }
.lang {
  display: flex; gap: 4px; align-items: center;
  height: 30px; padding: 0 10px; border: 1px solid var(--line); border-radius: 7px;
  font-size: 12px; font-weight: 700; color: var(--white);
}
.lang i { color: var(--dim); font-style: normal; }
.lang #langAlt { color: var(--dim); }
.lang:hover { border-color: #444; }

/* ---------- hero ---------- */
.hero {
  max-width: 1180px; margin: 0 auto;
  padding: 56px 16px 40px;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: 48px; align-items: center;
}
.hero-text { min-width: 0; }
.tag {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px; border: 1px solid var(--line); border-radius: 99px;
  font-size: 12px; font-weight: 600; color: var(--sub); background: var(--bg2);
}
.tag-dot, .dot-live { width: 6px; height: 6px; border-radius: 50%; background: #fff; box-shadow: 0 0 10px #fff; animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.hero-title {
  font-size: clamp(56px, 9vw, 112px);
  font-weight: 900; letter-spacing: -0.05em; line-height: .95;
  margin: 22px 0 18px;
}
.hero-sub { color: var(--sub); max-width: 460px; font-size: 16px; }

.loader {
  margin-top: 30px;
  background: var(--bg2); border: 1px solid var(--line); border-radius: var(--r);
  overflow: hidden;
}
.loader-head, .loader-foot {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 9px 14px; font-size: 12px; color: var(--sub);
}
.loader-head { border-bottom: 1px solid var(--line); }
.loader-lbl { display: flex; align-items: center; gap: 8px; font-weight: 600; color: var(--text); }
.loader-host { font-family: var(--mono); font-size: 11px; }
.loader-row { display: flex; gap: 10px; align-items: center; padding: 12px 12px 12px 14px; background: var(--bg); }
.loader-row code {
  flex: 1; min-width: 0;
  font-family: var(--mono); font-size: 12.5px; color: var(--text);
  white-space: nowrap; overflow-x: auto; scrollbar-width: none;
}
.loader-row code::-webkit-scrollbar { display: none; }
.loader-foot { border-top: 1px solid var(--line); }
.loader-foot a { white-space: nowrap; }
.loader-foot a:hover { color: var(--white); }
kbd {
  font-family: var(--font); font-size: 11px; font-weight: 700; color: var(--text);
  padding: 1px 6px; border-radius: 4px; background: var(--bg4); border: 1px solid var(--line);
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; padding: 0 16px; border-radius: 8px;
  font-size: 13px; font-weight: 700; white-space: nowrap;
  transition: transform .15s, background .2s, border-color .2s, color .2s;
}
.btn:active { transform: scale(.96); }
.btn-white { background: var(--white); color: #000; }
.btn-white:hover { background: #d8d8d8; }
.btn-white.done { background: var(--bg4); color: var(--white); }
.btn-ghost { border: 1px solid var(--line); color: var(--text); }
.btn-ghost:hover { border-color: #555; color: var(--white); }

/* ---------- menu replica ---------- */
.menu-stage { display: flex; flex-direction: column; align-items: center; gap: 14px; min-width: 0; }
.menu {
  position: relative;
  width: 100%; max-width: 680px; height: 470px;
  background: var(--bg);
  border-radius: 10px;
  display: flex; flex-direction: column;
  box-shadow: 0 40px 120px -20px rgba(0,0,0,.9), 0 0 0 1px rgba(255,255,255,.04);
  isolation: isolate;
}
/* shimmering 1px border like UIStroke + UIGradient */
.menu::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; z-index: 2; pointer-events: none;
  background: linear-gradient(90deg, #505050 0%, #fff 25%, #505050 50%, #fff 75%, #505050 100%);
  background-size: 200% 100%;
  animation: shimmer 4s linear infinite;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  opacity: .7;
}
.menu-top { display: flex; align-items: center; height: 38px; padding: 0 8px 0 14px; flex: none; }
.menu-title { font-weight: 700; font-size: 16px; }
.menu-ver { font-size: 11px; color: var(--sub); margin-left: 10px; margin-top: 2px; }
.menu-x {
  margin-left: auto; width: 24px; height: 24px; border-radius: 6px;
  display: grid; place-items: center; font-weight: 700; font-size: 13px; color: var(--sub);
  transition: .15s;
}
.menu-x:hover { background: var(--bg3); color: var(--white); }
.menu-line { height: 1px; flex: none; }
.menu-body { flex: 1; display: flex; min-height: 0; }

.menu-side {
  width: 170px; flex: none; padding: 10px 8px;
  border-right: 1px solid var(--line);
  overflow-y: auto; scrollbar-width: none;
  display: flex; flex-direction: column; gap: 3px;
}
.menu-side::-webkit-scrollbar { display: none; }
.m-tab {
  display: flex; align-items: center; gap: 10px;
  height: 32px; padding: 0 10px; border-radius: 7px; flex: none;
  font-size: 13px; font-weight: 500; color: var(--sub); text-align: left;
  transition: background .15s, color .15s;
}
.m-tab svg { width: 16px; height: 16px; flex: none; }
.m-tab:hover { color: var(--text); }
.m-tab.active { background: var(--bg3); color: var(--white); font-weight: 700; }
.m-div { height: 1px; background: var(--line); margin: 4px 6px; flex: none; }

.menu-content {
  flex: 1; min-width: 0; padding: 14px 14px 14px;
  overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--bg4) transparent;
}
.m-head { margin-bottom: 12px; }
.m-head h5 { font-size: 15px; font-weight: 700; color: var(--white); }
.m-head p { font-size: 11.5px; color: var(--sub); }
.m-sec {
  background: var(--bg2); border: 1px solid var(--line); border-radius: 8px;
  padding: 4px 12px; margin-bottom: 10px;
  animation: secIn .35s ease both;
}
@keyframes secIn { from { opacity: 0; transform: translateY(6px); } }
.m-sec-t { font-size: 11px; font-weight: 700; color: var(--dim); text-transform: uppercase; letter-spacing: .08em; padding: 8px 0 4px; }
.m-row {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 0; border-top: 1px solid rgba(255,255,255,.04);
  cursor: pointer; user-select: none;
}
.m-sec-t + .m-row { border-top: 0; }
.m-row-txt { flex: 1; min-width: 0; }
.m-row-name { font-size: 13px; font-weight: 600; color: var(--text); }
.m-row-desc { font-size: 11px; color: var(--sub); line-height: 1.35; }
.sw {
  width: 34px; height: 18px; border-radius: 99px; flex: none; position: relative;
  background: var(--bg4); transition: background .2s;
}
.sw::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 12px; height: 12px; border-radius: 50%;
  background: var(--sub); transition: transform .22s cubic-bezier(.3,1.4,.5,1), background .2s;
}
.m-row.on .sw { background: var(--white); }
.m-row.on .sw::after { transform: translateX(16px); background: #000; }
.m-row.on .m-row-name { color: var(--white); }
.m-val { font-size: 12px; font-weight: 600; color: var(--text); padding: 3px 8px; border-radius: 6px; background: var(--bg4); flex: none; }

.m-slider { padding: 8px 0 10px; }
.m-slider-top { display: flex; justify-content: space-between; font-size: 13px; font-weight: 600; margin-bottom: 8px; }
.m-slider-top span:last-child { color: var(--sub); font-weight: 500; font-size: 12px; }
.m-track { height: 4px; border-radius: 99px; background: var(--bg4); position: relative; cursor: pointer; }
.m-fill { position: absolute; inset: 0 auto 0 0; border-radius: inherit; background: var(--white); }
.m-fill::after { content: ""; position: absolute; right: -6px; top: -4px; width: 12px; height: 12px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 3px var(--bg2); }

.m-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 6px 0 10px; }
.m-map {
  aspect-ratio: 4/3; border-radius: 7px; border: 1px solid var(--line);
  display: flex; align-items: flex-end; padding: 6px 8px; font-size: 11px; font-weight: 600;
  background: linear-gradient(160deg, #262626, #121212); cursor: pointer; transition: .2s;
}
.m-map:hover, .m-map.on { border-color: #fff; color: #fff; }
.m-list-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid rgba(255,255,255,.04); font-size: 12.5px; }
.m-sec-t + .m-list-row { border-top: 0; }
.m-ava { width: 26px; height: 26px; border-radius: 50%; background: var(--bg4); display: grid; place-items: center; font-size: 11px; font-weight: 700; flex: none; }
.m-list-row .grow { flex: 1; min-width: 0; }
.m-list-row small { display: block; color: var(--sub); font-size: 11px; }
.m-btn { font-size: 11px; font-weight: 700; padding: 5px 10px; border-radius: 6px; background: var(--white); color: #000; }
.m-online { width: 7px; height: 7px; border-radius: 50%; background: #fff; box-shadow: 0 0 8px #fff; }

.menu-caption { font-size: 12px; color: var(--dim); }

/* ---------- sections ---------- */
.section { max-width: 1180px; margin: 0 auto; padding: 72px 16px; }
.sec-head { margin-bottom: 36px; }
.eyebrow { font-size: 12px; font-weight: 700; color: var(--sub); text-transform: uppercase; letter-spacing: .14em; }
.sec-head h2 { font-size: clamp(30px, 4.5vw, 46px); font-weight: 800; letter-spacing: -0.035em; line-height: 1.1; margin-top: 8px; color: var(--white); }

.feat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.card {
  background: var(--bg2); border: 1px solid var(--line); border-radius: var(--r);
  padding: 22px; position: relative; overflow: hidden;
  transition: border-color .25s, transform .25s, background .25s;
}
.card::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .3s;
  background: radial-gradient(400px circle at var(--mx, 50%) var(--my, 0%), rgba(255,255,255,.07), transparent 45%);
}
.card:hover { border-color: #3a3a3a; transform: translateY(-2px); background: #161616; }
.card:hover::after { opacity: 1; }
.card-wide { grid-column: span 2; }
.card-ico {
  width: 38px; height: 38px; border-radius: 9px; background: var(--bg3); border: 1px solid var(--line);
  display: grid; place-items: center; margin-bottom: 18px; color: var(--white);
}
.card-ico svg { width: 18px; height: 18px; }
.card h3 { font-size: 16px; font-weight: 700; color: var(--white); margin-bottom: 6px; letter-spacing: -0.01em; }
.card p { font-size: 13.5px; color: var(--sub); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; }
.chips span { font-size: 11px; font-weight: 600; padding: 4px 9px; border-radius: 6px; background: var(--bg4); color: var(--text); }

.steps { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; counter-reset: s; }
.step { background: var(--bg2); border: 1px solid var(--line); border-radius: var(--r); padding: 24px; }
.step-n { font-family: var(--mono); font-size: 12px; color: var(--dim); }
.step h4 { font-size: 17px; font-weight: 700; color: var(--white); margin: 26px 0 6px; }
.step p { font-size: 13.5px; color: var(--sub); }

.cta {
  text-align: center; padding: 64px 20px; border-radius: 14px;
  background: radial-gradient(ellipse at top, #1c1c1c, var(--bg2) 70%);
  border: 1px solid var(--line);
}
.cta-logo { width: 64px; height: 64px; filter: grayscale(1) brightness(1.5) contrast(1.1) drop-shadow(0 0 24px rgba(255,255,255,.25)); }
.cta h2 { font-size: clamp(40px, 7vw, 72px); font-weight: 900; letter-spacing: -0.05em; margin: 10px 0 8px; line-height: 1; }
.cta p { color: var(--sub); max-width: 420px; margin: 0 auto 26px; }
.cta-btns { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

.foot {
  max-width: 1180px; margin: 0 auto; padding: 28px 16px 40px;
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  border-top: 1px solid var(--line); font-size: 12.5px;
}
.foot-brand { font-weight: 800; font-size: 14px; }
.foot-dim { color: var(--dim); }
.foot-links { margin-left: auto; display: flex; gap: 18px; color: var(--sub); flex-wrap: wrap; }
.foot-links a:hover { color: var(--white); }

.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 100;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  display: flex; align-items: center; gap: 8px;
  padding: 10px 16px; border-radius: 9px;
  background: var(--white); color: #000; font-size: 13px; font-weight: 700;
  transition: .3s cubic-bezier(.3,1.3,.5,1);
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }

/* reveal on scroll */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ---------- responsive ---------- */
@media (max-width: 1000px) {
  .hero { grid-template-columns: minmax(0, 1fr); gap: 40px; padding-top: 32px; }
  .hero-sub { max-width: 560px; }
  .feat-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .hide-sm { display: none; }
  .nav-links { gap: 14px; }
  .nav-links a { display: none; }
  .wm { gap: 8px; }
  .feat-grid, .steps { grid-template-columns: 1fr; }
  .card-wide { grid-column: auto; }
  .section { padding: 56px 16px; }
  .loader-row { flex-direction: column; align-items: stretch; }
  .loader-row .btn { width: 100%; }
  .menu { height: 520px; }
  .menu-body { flex-direction: column; }
  .menu-side {
    width: auto; flex-direction: row; overflow-x: auto; overflow-y: hidden;
    border-right: 0; border-bottom: 1px solid var(--line); padding: 8px;
  }
  .m-div { width: 1px; height: auto; margin: 6px 2px; }
  .m-tab { white-space: nowrap; }
  .m-grid { grid-template-columns: repeat(2, 1fr); }
  .foot-links { margin-left: 0; width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}

/* =================================================================== cabinet / admin / plans */
[hidden] { display: none !important; }
.mono { font-family: var(--mono); }
.dim { color: var(--dim); }
.u { text-decoration: underline; text-underline-offset: 3px; }
.show-sm { display: none; }
.btn-sm { height: 30px; padding: 0 12px; font-size: 12px; }
.btn-block { width: 100%; }
.btn-danger { color: #ff7a7a; }
.btn-danger:hover { border-color: #ff7a7a; color: #ff9a9a; }
.btn:disabled { opacity: .45; pointer-events: none; }
.btn.is-busy { position: relative; color: transparent !important; }
.btn.is-busy::after { content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%; border: 2px solid #000; border-right-color: transparent; animation: spin .7s linear infinite; }
.btn-ghost.is-busy::after { border-color: #fff; border-right-color: transparent; }
.link-btn { font-size: 12.5px; font-weight: 600; color: var(--sub); padding: 2px 0; }
.link-btn:hover { color: var(--white); }
.nav-cab { height: 32px; font-size: 12.5px; }

input, textarea {
  width: 100%; font: inherit; font-size: 14px; color: var(--text);
  background: var(--bg); border: 1px solid var(--line); border-radius: 8px;
  padding: 11px 12px; outline: none; transition: border-color .15s;
}
input:focus, textarea:focus { border-color: #888; }
input::placeholder, textarea::placeholder { color: var(--dim); }
textarea { resize: vertical; min-height: 60px; }

.app { max-width: 880px; margin: 0 auto; padding: 24px 16px 80px; min-height: 70vh; position: relative; }
.app-wide { max-width: 1100px; }
.loading { display: grid; place-items: center; padding: 120px 0; }
.spin, .loading .spin { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line); border-top-color: #fff; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* auth */
.auth { display: grid; place-items: center; padding: 24px 0; }
.auth-card {
  width: 100%; max-width: 400px; text-align: center; position: relative;
  background: var(--bg2); border: 1px solid var(--line); border-radius: 14px; padding: 30px 26px 26px;
  box-shadow: 0 40px 100px -30px rgba(0,0,0,.9);
}
.auth-logo { width: 46px; height: 46px; filter: grayscale(1) brightness(1.5) contrast(1.1); }
.auth-card h1 { font-size: 34px; font-weight: 900; letter-spacing: -0.05em; margin: 6px 0 20px; }
.seg { display: flex; gap: 4px; padding: 4px; background: var(--bg); border: 1px solid var(--line); border-radius: 9px; margin-bottom: 18px; }
.seg-btn { flex: 1; height: 32px; border-radius: 6px; font-size: 13px; font-weight: 600; color: var(--sub); transition: .15s; }
.seg-btn:hover { color: var(--text); }
.seg-btn.active { background: var(--bg4); color: var(--white); }
.form { display: flex; flex-direction: column; gap: 12px; text-align: left; }
.form label { display: flex; flex-direction: column; gap: 6px; font-size: 12px; font-weight: 600; color: var(--sub); }
.form .btn-block { height: 42px; margin-top: 4px; }
.form .link-btn { align-self: center; }
.auth-hint { font-size: 13.5px; color: var(--sub); margin-bottom: 16px; }
.auth-hint b { color: var(--white); word-break: break-all; }
.code-input { text-align: center; font-family: var(--mono); font-size: 28px; letter-spacing: 12px; padding: 14px 0 14px 12px; }
.row-between { display: flex; justify-content: space-between; }
.auth-err { color: #ff8a8a; font-size: 13px; font-weight: 600; min-height: 18px; margin-top: 14px; }

/* dashboard */
.dash-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin: 16px 0 20px; flex-wrap: wrap; }
.dash-head h2 { font-size: clamp(22px, 4vw, 32px); font-weight: 800; letter-spacing: -0.03em; color: var(--white); word-break: break-all; }
.pill {
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  font-size: 11.5px; font-weight: 700; padding: 5px 10px; border-radius: 99px;
  background: var(--bg3); border: 1px solid var(--line); color: var(--sub); white-space: nowrap;
}
.pill.on { background: var(--white); color: #000; border-color: var(--white); }
.pill.bad { color: #ff8a8a; border-color: #5a2a2a; }
.dash-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 12px; margin-bottom: 12px; }
.panel { background: var(--bg2); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; margin-bottom: 12px; }
.panel-t { font-size: 11px; font-weight: 700; color: var(--dim); text-transform: uppercase; letter-spacing: .1em; margin-bottom: 10px; }
.sub-big { font-size: 30px; font-weight: 800; letter-spacing: -0.03em; color: var(--white); line-height: 1.1; }
.sub-sm { font-size: 13px; color: var(--sub); margin-top: 4px; }
.sub-bar { height: 4px; border-radius: 99px; background: var(--bg4); margin-top: 16px; overflow: hidden; }
.sub-fill { height: 100%; width: 0; background: linear-gradient(90deg, #888, #fff); border-radius: inherit; transition: width .8s cubic-bezier(.2,.8,.2,1); }
.code-box {
  font-family: var(--mono); font-size: 12.5px; line-height: 1.7; color: var(--text);
  background: var(--bg); border: 1px solid var(--line); border-radius: 8px;
  padding: 14px; margin: 14px 0; overflow-x: auto; white-space: pre;
}
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.sec-head-sm { margin: 40px 0 16px; }
.sec-head-sm h2 { font-size: 26px; }

.plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 12px; }
.plan {
  position: relative; display: flex; flex-direction: column;
  background: var(--bg2); border: 1px solid var(--line); border-radius: var(--r); padding: 22px;
  transition: border-color .2s, transform .2s;
}
.plan:hover { transform: translateY(-2px); border-color: #3a3a3a; }
.plan-hot { border-color: #555; background: linear-gradient(180deg, #1c1c1c, var(--bg2) 60%); }
.plan-hot::before {
  content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; pointer-events: none;
  background: linear-gradient(90deg, #505050 0%, #fff 25%, #505050 50%, #fff 75%, #505050 100%);
  background-size: 200% 100%; animation: shimmer 4s linear infinite;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
}
.plan-badge { position: absolute; top: 14px; right: 14px; font-size: 10.5px; font-weight: 700; padding: 3px 8px; border-radius: 6px; background: var(--white); color: #000; }
.plan-name { font-size: 14px; font-weight: 700; color: var(--sub); }
.plan-price { font-size: 44px; font-weight: 900; letter-spacing: -0.04em; color: var(--white); line-height: 1.1; margin-top: 8px; }
.plan-price span { font-size: 22px; font-weight: 700; color: var(--sub); margin-left: 3px; }
.plan-sub { font-size: 12.5px; color: var(--sub); }
.plan ul { list-style: none; margin: 18px 0 20px; display: flex; flex-direction: column; gap: 7px; flex: 1; }
.plan li { font-size: 13px; color: var(--text); padding-left: 20px; position: relative; }
.plan li::before { content: ""; position: absolute; left: 2px; top: 5px; width: 9px; height: 5px; border-left: 2px solid #fff; border-bottom: 2px solid #fff; transform: rotate(-45deg); }
.buy-how ol { padding-left: 18px; display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; color: var(--sub); }
.buy-how b { color: var(--white); word-break: break-all; }

/* admin */
.stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin: 16px 0 18px; }
.stat { background: var(--bg2); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; }
.stat-v { font-size: 28px; font-weight: 800; color: var(--white); letter-spacing: -0.03em; line-height: 1.1; }
.stat-k { font-size: 12px; color: var(--sub); margin-top: 2px; }
.toolbar { display: flex; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.toolbar input { flex: 1; min-width: 220px; }
.seg-inline { margin: 0; }
.seg-inline .seg-btn { padding: 0 12px; flex: none; }
.users { background: var(--bg2); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.urow { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 16px; text-align: left; border-top: 1px solid var(--line); transition: background .15s; }
.urow:first-child { border-top: 0; }
.urow:hover { background: var(--bg3); }
.urow-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.urow-main b { font-size: 13.5px; font-weight: 600; color: var(--white); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.urow-main small { font-size: 11.5px; color: var(--sub); }
.empty { padding: 28px; text-align: center; color: var(--dim); font-size: 13px; }
.log { padding: 6px 16px; max-height: 360px; overflow-y: auto; }
.log-row { display: flex; gap: 12px; align-items: baseline; padding: 8px 0; border-top: 1px solid rgba(255,255,255,.04); font-size: 12.5px; flex-wrap: wrap; }
.log-row:first-child { border-top: 0; }
.log-t { font-family: var(--mono); font-size: 11px; color: var(--dim); }
.log-row b { color: var(--white); font-weight: 600; }
.denied { max-width: 420px; margin: 60px auto; }

.drawer-bg { position: fixed; inset: 0; z-index: 80; background: rgba(0,0,0,.6); opacity: 0; transition: opacity .25s; backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 81; width: min(440px, 100vw);
  background: var(--bg); border-left: 1px solid var(--line); padding: 24px 22px 40px; overflow-y: auto;
  transform: translateX(100%); transition: transform .28s cubic-bezier(.2,.8,.2,1);
}
.drawer-open .drawer { transform: none; }
.drawer-open .drawer-bg { opacity: 1; }
.drawer-x { position: absolute; top: 14px; right: 14px; width: 32px; height: 32px; border-radius: 8px; font-size: 20px; color: var(--sub); }
.drawer-x:hover { background: var(--bg3); color: var(--white); }
.drawer .panel-t { margin: 24px 0 10px; }
.d-head { display: flex; gap: 12px; align-items: center; padding-right: 36px; }
.d-head h3 { font-size: 16px; color: var(--white); word-break: break-all; }
.d-head small { font-size: 12px; color: var(--sub); }
.m-ava-lg { width: 42px; height: 42px; font-size: 16px; }
.d-sub { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; font-size: 13px; }
.grant { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.grant-custom { display: flex; gap: 8px; margin-top: 8px; }
.grant-custom input { width: 90px; flex: none; padding: 0 10px; height: 38px; }
.grant-custom .btn-danger { margin-left: auto; }
.d-key { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.d-key code { font-family: var(--mono); font-size: 13px; color: var(--white); background: var(--bg2); border: 1px solid var(--line); padding: 7px 10px; border-radius: 7px; }
.d-info { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; font-size: 13px; }
.d-info dt { color: var(--sub); }
.d-info dd { color: var(--text); }
.drawer textarea { margin-bottom: 8px; }
.d-danger { display: flex; gap: 8px; margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--line); flex-wrap: wrap; }

.toast.bad { background: #ff7a7a; }

@media (max-width: 760px) {
  .plans, .dash-grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stats .stat:last-child { grid-column: span 2; }
  .urow .pill:last-child { max-width: 42%; overflow: hidden; text-overflow: ellipsis; }
}
@media (max-width: 640px) {
  .show-sm { display: inline; }
  .page-app .nav-links a { display: inline; }
  .auth-card { padding: 26px 18px 20px; }
  .btn-row .btn { flex: 1; }
}
.panel-name { border-color: #555; }
.name-form { display: flex; gap: 8px; margin-top: 14px; }
.name-form input { flex: 1; }

/* admin v2 */
.qg { position: relative; }
.qg-who { position: relative; }
.suggest {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 20;
  background: var(--bg2); border: 1px solid #3a3a3a; border-radius: 10px; overflow: hidden;
  box-shadow: 0 20px 60px -10px rgba(0,0,0,.9);
}
.sug { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; text-align: left; border-top: 1px solid var(--line); }
.sug:first-child { border-top: 0; }
.sug:hover { background: var(--bg3); }
.sug .urow-main b { font-size: 13px; }
.qg-target:not(:empty) { margin-top: 10px; }
.qg-card { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 9px; background: var(--bg); border: 1px solid #3a3a3a; }
.qg-card #qgClear { font-size: 18px; padding: 0 4px; }
.qg-plans { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin: 14px 0; }
.chip {
  display: flex; flex-direction: column; gap: 3px; padding: 10px 12px; border-radius: 9px; cursor: pointer; user-select: none;
  background: var(--bg); border: 1px solid var(--line); font-size: 13px; font-weight: 700; color: var(--text); transition: .15s;
}
.chip small { font-size: 11px; font-weight: 500; color: var(--sub); }
.chip:hover { border-color: #555; }
.chip.active { border-color: #fff; background: #1a1a1a; box-shadow: 0 0 0 1px #fff inset; }
.chip input { padding: 4px 6px; font-size: 12px; border-radius: 6px; margin-top: 2px; color-scheme: dark; }
.qg-go { width: 100%; height: 42px; }
.tabs { display: flex; gap: 4px; margin: 22px 0 12px; border-bottom: 1px solid var(--line); }
.tab { padding: 10px 14px; font-size: 13.5px; font-weight: 600; color: var(--sub); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--white); border-bottom-color: var(--white); }
.urow-static { cursor: default; }
.urow-static:hover { background: none; }
.pill.role-owner { background: #fff; color: #000; border-color: #fff; }
.pill.role-admin { color: var(--white); border-color: #666; }
.d-head h3 .pill { vertical-align: middle; margin-left: 4px; font-size: 10.5px; padding: 3px 8px; }
.log-actor { font-weight: 600; color: var(--text); }
.grant-custom { flex-wrap: wrap; }
.grant-custom input[type=date] { width: 150px; flex: none; height: 38px; padding: 0 10px; color-scheme: dark; }
.grant-custom .btn-danger { margin-left: 0; }
.d-revoke { margin-top: 10px; }
.d-role { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
#meBadge:empty { display: none; }
@media (max-width: 760px) {
  .qg-plans { grid-template-columns: repeat(2, 1fr); }
  .qg-plans .chip:last-child { grid-column: span 2; }
  .stats .stat:last-child { grid-column: auto; }
  .stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) { #meBadge { display: none; } }
.drawer .grant-custom { display: grid; grid-template-columns: 1fr 110px; gap: 8px; }
.drawer .grant-custom input, .drawer .grant-custom input[type=date] { width: 100%; }

/* buy modal */
.plan-stars { font-size: 12px; color: var(--sub); margin-top: 2px; }
.plan ul { margin-top: 14px; }
.buy-note { font-size: 12.5px; color: var(--dim); text-align: center; margin: 6px 0 0; }
.modal { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 16px; }
.modal-bg { position: absolute; inset: 0; background: rgba(0,0,0,.7); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); opacity: 0; transition: opacity .22s; }
.modal-card {
  position: relative; width: 100%; max-width: 440px; max-height: calc(100vh - 32px); overflow-y: auto;
  background: var(--bg); border-radius: 14px; padding: 24px 22px 22px;
  box-shadow: 0 40px 120px -20px rgba(0,0,0,.95);
  opacity: 0; transform: translateY(12px) scale(.97); transition: opacity .22s, transform .26s cubic-bezier(.2,1.2,.4,1);
}
.modal-card::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none;
  background: linear-gradient(90deg, #505050 0%, #fff 25%, #505050 50%, #fff 75%, #505050 100%);
  background-size: 200% 100%; animation: shimmer 4s linear infinite;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; opacity: .6;
}
.modal.open .modal-bg { opacity: 1; }
.modal.open .modal-card { opacity: 1; transform: none; }
.buy-head { margin-bottom: 18px; padding-right: 30px; }
.buy-head h3 { font-size: 24px; font-weight: 800; letter-spacing: -0.03em; color: var(--white); margin-top: 4px; }
.buy-for { font-size: 13px; color: var(--sub); }
.buy-for b { color: var(--white); }
.pay {
  display: flex; align-items: center; gap: 14px; padding: 14px; margin-bottom: 10px;
  border-radius: 11px; border: 1px solid var(--line); background: var(--bg2);
  transition: border-color .15s, transform .15s, background .15s;
}
.pay:hover { border-color: #666; background: #181818; transform: translateY(-1px); }
.pay:active { transform: scale(.985); }
.pay-ico { width: 42px; height: 42px; border-radius: 10px; flex: none; display: grid; place-items: center; background: var(--bg4); color: var(--white); }
.pay-ico svg { width: 22px; height: 22px; }
.pay-stars { border-color: #4a4a4a; background: linear-gradient(135deg, #1e1e1e, var(--bg2)); }
.pay-stars .pay-ico { background: linear-gradient(135deg, #fff, #9a9a9a); color: #111; box-shadow: 0 0 22px rgba(255,255,255,.18); }
.pay-ico-fp { font-weight: 900; font-size: 14px; letter-spacing: -0.02em; background: var(--bg4); }
.pay-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pay-main b { font-size: 15px; color: var(--white); }
.pay-main small { font-size: 12px; color: var(--sub); }
.pay-price { font-size: 16px; font-weight: 800; color: var(--white); white-space: nowrap; }
.fp-steps { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.fp-steps ol { padding-left: 18px; display: flex; flex-direction: column; gap: 8px; font-size: 13px; color: var(--sub); }
.copy-chip {
  display: inline-flex; align-items: center; gap: 6px; vertical-align: middle;
  padding: 3px 8px; border-radius: 6px; background: var(--bg4); color: var(--white);
  font-family: var(--mono); font-size: 12px; font-weight: 500;
}
.copy-chip svg { width: 12px; height: 12px; opacity: .7; }
.copy-chip:hover { background: #333; }
.hero-btns { display: flex; gap: 10px; margin-top: 30px; flex-wrap: wrap; }
.btn-lg { height: 46px; padding: 0 22px; font-size: 14px; border-radius: 10px; }
@media (max-width: 640px) { .hero-btns .btn { flex: 1; } }
