:root {
  --bg: #0a0a0b;
  --card: rgba(255, 255, 255, .035);
  --card-hover: rgba(255, 255, 255, .06);
  --line: rgba(255, 255, 255, .08);
  --text: #f3f5ef;
  --muted: #9ba196;
  --lime: #c4f135;
  --on-lime: #0d1200;
  --green: #2fbf71;
  --danger: #ff6b6b;
  --grad: linear-gradient(135deg, #d6ff45 0%, #a8e63a 100%);
  --radius: 18px;
  color-scheme: dark;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg); color: var(--text); min-height: 100vh; display: flex; flex-direction: column;
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; overflow-x: hidden;
}
[hidden] { display: none !important; }
svg { display: block; }
a { color: inherit; text-decoration: none; }
.wrap { width: min(100% - 32px, 640px); margin-inline: auto; }
.muted { color: var(--muted); }
.center { text-align: center; padding: 60px 0; }

.bg-fx { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.bg-fx::before {
  content: ""; position: absolute; inset: 0; opacity: .5; background-size: 56px 56px;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  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%);
}
.bg-fx::after {
  content: ""; position: absolute; width: 800px; height: 800px; left: 50%; top: -420px; transform: translateX(-50%);
  background: radial-gradient(circle, rgba(196, 241, 53, .16), rgba(196, 241, 53, .08) 40%, transparent 70%); filter: blur(20px);
}

.header { border-bottom: 1px solid var(--line); background: rgba(10, 10, 11, .75); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 60px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 19px; }
.logo-mark { width: 30px; height: 30px; flex: none; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 12px 20px;
  border-radius: 14px; font: inherit; font-weight: 700; cursor: pointer; border: 0; transition: transform .15s, box-shadow .2s, background .2s; text-align: center; }
.btn:active { transform: translateY(1px); }
.btn svg { width: 20px; height: 20px; flex: none; }
.btn-primary { background: var(--grad); color: var(--on-lime); box-shadow: 0 8px 30px rgba(196, 241, 53, .22); }
.btn-green { background: var(--green); color: #fff; box-shadow: 0 8px 30px rgba(47, 191, 113, .25); }
.btn-ghost { background: var(--card); color: var(--text); border: 1px solid var(--line); }
.btn-ghost:hover { background: var(--card-hover); }
.btn-sm { min-height: 40px; padding: 8px 14px; font-size: 15px; border-radius: 12px; }

.main { flex: 1; padding: clamp(28px, 6vw, 56px) 0; }
h1 { font-size: clamp(28px, 6vw, 40px); line-height: 1.15; font-weight: 800; letter-spacing: -.02em; overflow-wrap: anywhere; }
h2 { font-size: 18px; line-height: 1.3; margin-bottom: 4px; }
.lead { margin-top: 8px; font-size: 17px; }

.msg { margin-top: 20px; padding: 12px 16px; border-radius: 14px; border: 1px solid rgba(255, 107, 107, .35); background: rgba(255, 107, 107, .08); }
.msg.ok { border-color: rgba(196, 241, 53, .35); background: rgba(196, 241, 53, .08); }

.steps { list-style: none; display: grid; gap: 14px; margin-top: 26px; }
/* number + title in one row; text and button use the full card width (fits 320px phones) */
.step { display: grid; grid-template-columns: 32px 1fr; column-gap: 12px; align-items: center; padding: 18px;
  border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); }
.step-num { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; font-weight: 800;
  background: rgba(196, 241, 53, .12); color: var(--lime); }
.step-body { display: contents; }
.step-body h2 { margin: 0; min-width: 0; }
.step-body p { grid-column: 1 / -1; margin-top: 8px; }
.step-body .btn { grid-column: 1 / -1; margin-top: 14px; width: 100%; }

.wait { grid-column: 1 / -1; display: flex; gap: 12px; align-items: flex-start; margin-top: 14px; padding: 14px;
  border-radius: 14px; background: rgba(196, 241, 53, .06); border: 1px solid rgba(196, 241, 53, .25); }
.wait .muted { font-size: 14px; margin-top: 2px; }
.wait-links { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-top: 8px; }
.spinner { flex: none; width: 22px; height: 22px; margin-top: 2px; border-radius: 50%; border: 3px solid rgba(196, 241, 53, .25);
  border-top-color: var(--lime); animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 3s; } }
.alt { margin-top: 22px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.alt-label { font-size: 14px; color: var(--muted); }
#tg-widget { min-height: 40px; }
.hint { margin-top: 22px; font-size: 14px; text-align: center; }
.hint b { color: var(--text); }

.card { margin-top: 18px; padding: 20px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); }
.status-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.badge { display: inline-block; padding: 3px 12px; border-radius: 999px; font-size: 14px; font-weight: 700;
  background: rgba(255, 255, 255, .08); color: var(--muted); }
.badge.on { background: rgba(196, 241, 53, .14); color: var(--lime); }
.badge.off { background: rgba(255, 107, 107, .12); color: var(--danger); }
.status-main { margin-top: 12px; font-size: clamp(22px, 5vw, 28px); font-weight: 800; }
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.actions .btn:only-child { grid-column: 1 / -1; }
.soon { border-style: dashed; }

.footer-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 24px; margin-top: 28px; }
.link { background: none; border: 0; color: var(--muted); font: inherit; font-size: 15px; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.link:hover { color: var(--text); }

.footer { border-top: 1px solid var(--line); padding: 18px 0; font-size: 14px; }
.footer a { text-decoration: underline; text-underline-offset: 3px; }


/* ---- sections (stage 3) ---- */
.small { font-size: 14px; }
.hl { color: var(--lime); }
.center-text { text-align: center; margin-top: 24px; }
.sec-title { margin: 28px 0 12px; }

/* tabs: one scrollable row on phones, the page itself never scrolls sideways */
.tabs { position: sticky; top: 0; z-index: 5; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none;
  margin: -8px -16px 22px; padding: 10px 16px; background: rgba(10, 10, 11, .85); backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { flex: none; padding: 8px 14px; border-radius: 999px; font-size: 15px; font-weight: 600; color: var(--muted);
  border: 1px solid transparent; white-space: nowrap; }
.tabs a:hover { color: var(--text); }
.tabs a.active { color: var(--on-lime); background: var(--grad); }

.row-link { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.row-link:hover { background: var(--card-hover); }
.row-link b { color: var(--lime); white-space: nowrap; }
.actions.single { grid-template-columns: 1fr; }

.copy-row { display: flex; gap: 8px; margin-top: 14px; }
.copy-row input { flex: 1; min-width: 0; min-height: 44px; padding: 10px 12px; border-radius: 12px; font: inherit; font-size: 15px;
  color: var(--text); background: rgba(0, 0, 0, .35); border: 1px solid var(--line); }
.copy-row input:focus { outline: 2px solid rgba(196, 241, 53, .5); outline-offset: 1px; }
.copy-row .btn { flex: none; min-height: 44px; }

.qr { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-top: 16px; text-align: center; }
.qr canvas { width: min(264px, 100%); height: auto; aspect-ratio: 1; border-radius: 14px; background: #fff; padding: 12px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips button { min-height: 40px; padding: 8px 14px; border-radius: 999px; font: inherit; font-size: 15px; font-weight: 600; cursor: pointer;
  color: var(--text); background: var(--card); border: 1px solid var(--line); }
.chips button[aria-selected="true"] { color: var(--on-lime); background: var(--grad); border-color: transparent; }
.app-tabs { margin-top: 14px; }
.app-tabs button { font-size: 14px; min-height: 36px; padding: 6px 12px; }
.guide-step { display: grid; grid-template-columns: 32px 1fr; column-gap: 12px; margin-top: 16px; }
.guide-step .step-num { grid-row: span 3; }
.guide-step h3 { font-size: 16px; line-height: 1.35; align-self: center; min-height: 32px; display: flex; align-items: center; }
.guide-step p { font-size: 15px; color: var(--muted); }
.guide-step .btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.guide-step .btns .btn { min-height: 44px; font-size: 15px; padding: 10px 16px; }

.list { list-style: none; display: grid; gap: 10px; margin-top: 18px; }
.list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px;
  border-radius: 14px; background: var(--card); border: 1px solid var(--line); }
.list .main { min-width: 0; }
.list .title { font-weight: 600; overflow-wrap: anywhere; }
.list .sub { font-size: 14px; color: var(--muted); }
.list .empty { justify-content: center; color: var(--muted); }
.list .btn { flex: none; min-height: 40px; padding: 8px 14px; font-size: 14px; }
.pill-st { flex: none; font-size: 13px; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: rgba(255, 255, 255, .08); color: var(--muted); }
.pill-st.succeeded { background: rgba(196, 241, 53, .14); color: var(--lime); }
.pill-st.failed, .pill-st.canceled { background: rgba(255, 107, 107, .12); color: var(--danger); }

.stats2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.stats2 > div { padding: 12px; border-radius: 14px; background: rgba(0, 0, 0, .25); border: 1px solid var(--line); text-align: center; }
.stats2 b { display: block; font-size: 24px; }
.stats2 span { font-size: 13px; color: var(--muted); }
.msg { overflow-wrap: anywhere; }

@media (max-width: 380px) {
  .copy-row { flex-wrap: wrap; }
  .copy-row .btn { flex: 1 1 100%; }
  .list li { flex-wrap: wrap; }
  .list .btn { width: 100%; }
}

@media (max-width: 480px) {
  .actions { grid-template-columns: 1fr; }
  .step { padding: 16px; }
}
