/* insta.ton-adoption.xyz — UI theme ("subterranean trading terminal") */

:root {
  --bg-base:       #0a0a0c;
  --bg-elevated:   #131318;
  --bg-surface:    #1a1a22;
  --bg-hover:      #20202a;
  --border:        #26262f;
  --border-strong: #383843;
  --text:          #ebe9e0;
  --text-muted:    #807e74;
  --text-dim:      #4a4a52;
  --accent:        #bdfd54;
  --accent-soft:   #94c93b;
  --accent-glow:   rgba(189, 253, 84, 0.18);
  --info:          #7cd6f2;
  --warn:          #ffa83a;
  --danger:        #ff5d5d;
  --magenta:       #ff5dbe;

  --font-display: "Fraunces", "Times New Roman", serif;
  --font-ui:      "Geist", "Söhne", system-ui, sans-serif;
  --font-mono:    "JetBrains Mono", ui-monospace, "SF Mono", monospace;

  --radius-sm: 4px;
  --radius:    6px;
  --radius-lg: 10px;
}

/* ---------- foundations ---------- */

* { box-sizing: border-box; }

html, body {
  background: var(--bg-base);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "ss01", "ss02", "cv11";
  letter-spacing: -0.005em;
}

body {
  min-height: 100vh;
  background-image:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(189, 253, 84, 0.04), transparent 70%),
    radial-gradient(ellipse 60% 40% at 80% 100%, rgba(124, 214, 242, 0.04), transparent 70%),
    linear-gradient(180deg, #0a0a0c 0%, #08080a 100%);
  background-attachment: fixed;
}

/* noise overlay */
body::before {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none;
  opacity: 0.035;
  z-index: 1;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160' viewBox='0 0 160 160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.6 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  mix-blend-mode: overlay;
}

/* faint grid */
body::after {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.45;
  background-image:
    linear-gradient(rgba(40, 40, 50, 0.18) 1px, transparent 1px),
    linear-gradient(90deg, rgba(40, 40, 50, 0.18) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 90%);
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }

button, input, select, textarea { font: inherit; color: inherit; }

/* ---------- typography ---------- */

.font-display { font-family: var(--font-display); font-optical-sizing: auto; }
.font-mono    { font-family: var(--font-mono); font-feature-settings: "calt", "ss01", "zero"; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 500;
}

.numeric {
  font-variant-numeric: tabular-nums;
  font-family: var(--font-mono);
}

.display-xl {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(56px, 8vw, 104px);
  line-height: 0.92;
  letter-spacing: -0.035em;
  font-variation-settings: "opsz" 144, "SOFT" 30;
}

.display-lg {
  font-family: var(--font-display);
  font-weight: 420;
  font-size: clamp(36px, 5vw, 56px);
  line-height: 1;
  letter-spacing: -0.025em;
  font-variation-settings: "opsz" 100, "SOFT" 20;
}

.title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 28px;
  letter-spacing: -0.025em;
}

.italic-display { font-family: var(--font-display); font-style: italic; }

/* ---------- layout ---------- */

.shell {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: 100vh;
}

.topbar {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 28px;
  border-bottom: 1px solid var(--border);
  background: rgba(10, 10, 12, 0.72);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 50;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 14px;
}
.brand-mark {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.28em;
  font-weight: 600;
  color: var(--text);
}
.brand-mark .dot {
  display: inline-block;
  width: 7px; height: 7px;
  background: var(--accent);
  border-radius: 50%;
  margin-right: 10px;
  box-shadow: 0 0 0 0 var(--accent-glow);
  animation: pulse 2.4s ease-out infinite;
}
.brand-tag {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(189, 253, 84, 0.55); }
  60%  { box-shadow: 0 0 0 9px rgba(189, 253, 84, 0); }
  100% { box-shadow: 0 0 0 0 rgba(189, 253, 84, 0); }
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 22px;
}
.clock {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  /* Reserved width so the topbar doesn't reflow when the placeholder
   * "— : — UTC" is replaced by "21:34 UTC". JetBrains Mono is monospace
   * but the dash glyph is wider than digits — tabular-nums + min-width
   * lock the box. */
  min-width: 78px;
  text-align: right;
}
.balance-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border: 1px solid var(--border-strong);
  background: linear-gradient(180deg, rgba(189, 253, 84, 0.08), rgba(189, 253, 84, 0.02));
  border-radius: 999px;
  color: var(--accent);
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 12.5px;
  letter-spacing: 0.02em;
}
.balance-pill .pill-label {
  color: var(--text-muted);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

/* ---------- side nav ---------- */

.sidenav {
  border-right: 1px solid var(--border);
  padding: 24px 14px;
  background: rgba(11, 11, 14, 0.4);
}
.nav-section {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  color: var(--text-dim);
  text-transform: uppercase;
  padding: 14px 12px 8px;
}
.nav-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 12px;
  border-radius: var(--radius);
  font-size: 13.5px;
  color: var(--text-muted);
  margin-bottom: 2px;
  transition: background 0.18s, color 0.18s;
  position: relative;
}
.nav-item:hover { background: var(--bg-elevated); color: var(--text); }
.nav-item.active {
  background: var(--bg-elevated);
  color: var(--text);
}
.nav-item.active::before {
  content: "";
  position: absolute; left: -14px; top: 4px; bottom: 4px;
  width: 2px;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
}
.nav-item .badge {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-dim);
}

/* ---------- main content ---------- */

main.content {
  padding: 36px 40px 120px;  /* extra bottom so .statusline footer never overlaps */
  max-width: 1500px;
  width: 100%;
}

/* Tables inside panels: scroll horizontally when columns don't fit instead of pushing the layout. */
.panel-body { overflow-x: auto; }
.panel-body > table.data { min-width: 100%; }

.page-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 24px;
  margin-bottom: 36px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--border);
}
.page-head .title-block { display: flex; flex-direction: column; gap: 8px; }
.page-head .h1 {
  font-family: var(--font-display);
  font-size: 44px;
  font-weight: 380;
  letter-spacing: -0.03em;
  line-height: 1;
}
.page-head .h1 em { font-style: italic; color: var(--accent); font-weight: 350; }
.page-head .crumb { font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); letter-spacing: 0.12em; text-transform: uppercase; }

/* ---------- stat cards ---------- */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
  margin-bottom: 36px;
}
.stat {
  position: relative;
  background: linear-gradient(180deg, rgba(255,255,255,0.015), transparent 80%), var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px 22px 20px;
  overflow: hidden;
}
.stat::before, .stat::after {
  content: "";
  position: absolute;
  width: 10px; height: 10px;
  border: 1px solid var(--text-dim);
  opacity: 0.55;
}
.stat::before { top: 8px; left: 8px;  border-right: 0; border-bottom: 0; }
.stat::after  { top: 8px; right: 8px; border-left: 0; border-bottom: 0; }
.stat .label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 12px;
}
.stat .value {
  font-family: var(--font-display);
  font-weight: 420;
  font-size: 52px;
  line-height: 0.96;
  letter-spacing: -0.025em;
  color: var(--text);
  font-variation-settings: "opsz" 100, "SOFT" 25;
}
.stat.accent .value { color: var(--accent); }
.stat.info   .value { color: var(--info); }
.stat .sub {
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-muted);
}
.stat .ribbon {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent) 50%, transparent);
  opacity: 0.35;
}

/* ---------- panels ---------- */

.panel {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.panel-head {
  padding: 16px 22px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.panel-head .title-row { display: flex; align-items: baseline; gap: 12px; }
.panel-head h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 20px;
  letter-spacing: -0.02em;
}
.panel-head h2 em { font-style: italic; color: var(--accent); }
.panel-body { padding: 0; }

/* ---------- tables ---------- */

table.data {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}
table.data thead th {
  text-align: left;
  font-weight: 500;
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,0.01);
}
table.data tbody td {
  padding: 12px 18px;
  border-bottom: 1px dashed rgba(56, 56, 67, 0.55);
  color: var(--text);
  vertical-align: middle;
}
table.data tbody tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover { background: var(--bg-hover); }
table.data tbody td.num { text-align: right; }
table.data tbody td.muted { color: var(--text-muted); }
table.data tbody td .name-row { display: flex; flex-direction: column; }
table.data tbody td .name-row .sub { color: var(--text-muted); font-size: 10.5px; margin-top: 2px; }

/* ---------- status pills ---------- */

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 9px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid transparent;
}
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.completed { color: var(--accent);  background: rgba(189,253,84,0.07); border-color: rgba(189,253,84,0.25); }
.pill.progress  { color: var(--info);    background: rgba(124,214,242,0.07); border-color: rgba(124,214,242,0.25); }
.pill.pending   { color: var(--warn);    background: rgba(255,168,58,0.07);  border-color: rgba(255,168,58,0.25); }
.pill.canceled  { color: var(--text-muted); background: rgba(128,126,116,0.05); border-color: rgba(128,126,116,0.25); }
.pill.partial   { color: var(--magenta); background: rgba(255,93,190,0.07);   border-color: rgba(255,93,190,0.22); }
.pill.error     { color: var(--danger);  background: rgba(255,93,93,0.07);    border-color: rgba(255,93,93,0.25); }

/* ---------- buttons ---------- */

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 16px;
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 500;
  border: 1px solid var(--border-strong);
  background: var(--bg-surface);
  color: var(--text);
  cursor: pointer;
  transition: background 0.18s, border-color 0.18s, color 0.18s;
}
.btn:hover { background: var(--bg-hover); border-color: #4a4a55; color: var(--text); }
.btn.primary {
  background: var(--accent);
  color: #0a0a0c;
  border-color: var(--accent);
  font-weight: 600;
  box-shadow: 0 0 30px var(--accent-glow);
}
.btn.primary:hover { background: var(--accent-soft); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-muted); }
.btn.ghost:hover { color: var(--text); }

/* ---------- forms ---------- */

.field { display: flex; flex-direction: column; gap: 8px; }
.field > label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.field > input,
.field > select,
.field > textarea {
  background: var(--bg-base);
  border: 1px solid var(--border-strong);
  color: var(--text);
  padding: 11px 13px;
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 13px;
  outline: none;
  transition: border-color 0.18s, box-shadow 0.18s;
}
.field > input:focus,
.field > select:focus,
.field > textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

/* ---------- search bar ---------- */

.search-row {
  display: flex; gap: 10px; align-items: center;
  margin-bottom: 18px;
}
.search-row input {
  flex: 1;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 14px;
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 12.5px;
}
.search-row input:focus { outline: none; border-color: var(--accent); }
.search-row select {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 14px;
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 12.5px;
}

/* ---------- balance hero ---------- */

.balance-hero {
  position: relative;
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 0;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 36px;
}
.balance-hero .left  { padding: 32px 36px; border-right: 1px solid var(--border); position: relative; }
.balance-hero .right { padding: 28px 32px; display: flex; flex-direction: column; gap: 20px; background: rgba(255,255,255,0.012); }

.balance-hero .left::after {
  content: "";
  position: absolute; bottom: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent) 50%, transparent);
  opacity: 0.4;
}

.balance-hero .upstream-name {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.22em;
  color: var(--text-muted);
  text-transform: uppercase;
}
.balance-hero .amount {
  font-family: var(--font-display);
  font-style: italic;        /* signature italic — kept only here */
  font-size: clamp(64px, 9vw, 112px);
  font-weight: 370;
  line-height: 0.92;
  letter-spacing: -0.045em;
  color: var(--accent);
  margin: 14px 0 10px;
  text-shadow: 0 0 50px rgba(189, 253, 84, 0.18);
  font-variation-settings: "opsz" 144;
}
.balance-hero .amount sup {
  font-family: var(--font-mono);
  font-style: normal;
  font-size: 14px;
  color: var(--text-muted);
  letter-spacing: 0.16em;
  vertical-align: top;
  margin-left: 10px;
}
.balance-hero .meta { display: flex; gap: 26px; margin-top: 14px; }
.balance-hero .meta .item .lbl {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--text-muted);
}
.balance-hero .meta .item .val {
  font-family: var(--font-mono); font-size: 13px; color: var(--text); margin-top: 4px;
}

.miniprogress {
  display: flex; flex-direction: column; gap: 6px;
}
.miniprogress .head { display: flex; justify-content: space-between; align-items: baseline; }
.miniprogress .head .lbl {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.2em;
  color: var(--text-muted); text-transform: uppercase;
}
.miniprogress .head .val {
  font-family: var(--font-display);
  font-weight: 430;
  font-size: 26px; line-height: 1; color: var(--text);
  font-variation-settings: "opsz" 72;
}
.miniprogress .head .val em { color: var(--accent); }
.miniprogress .bar { height: 3px; background: var(--bg-hover); border-radius: 2px; overflow: hidden; }
.miniprogress .bar > span {
  display: block; height: 100%;
  background: linear-gradient(90deg, var(--accent-soft), var(--accent));
  box-shadow: 0 0 12px var(--accent-glow);
}

/* ---------- micro elements ---------- */

.crosshair { color: var(--text-dim); }

.empty {
  padding: 56px 24px;
  text-align: center;
  color: var(--text-muted);
}
.empty .h {
  font-family: var(--font-display); font-weight: 420; font-size: 28px;
  color: var(--text); margin-bottom: 8px;
  font-variation-settings: "opsz" 72;
}

.scanline {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-strong) 20%, var(--border-strong) 80%, transparent);
  margin: 8px 0;
}

footer.statusline {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  padding: 6px 24px;
  background: rgba(10,10,12,0.85);
  backdrop-filter: blur(8px);
  border-top: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  z-index: 60;
  display: flex; gap: 18px; justify-content: space-between;
}
footer.statusline .dotgreen { color: var(--accent); }
footer.statusline .sep { color: var(--text-dim); }

/* ---------- scrollbar ---------- */

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-strong); }

/* ---------- responsive trim ---------- */

@media (max-width: 980px) {
  .shell { grid-template-columns: 1fr; }
  .sidenav { display: none; }
  main.content { padding: 24px 18px 80px; }
  .balance-hero { grid-template-columns: 1fr; }
  .balance-hero .left { border-right: 0; border-bottom: 1px solid var(--border); }
}

/* ===================================================================
   Language switcher + small bits
   =================================================================== */

.lang-switch {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.18em;
  color: var(--text-dim);
}
.lang-switch a { color: var(--text-muted); transition: color 0.15s; padding: 0 2px; }
.lang-switch a:hover  { color: var(--text); }
.lang-switch a.active { color: var(--accent); }
.lang-switch .sep { color: var(--text-dim); margin: 0 2px; }

.balance-pill.error {
  color: var(--danger);
  border-color: rgba(255, 93, 93, 0.3);
  background: rgba(255, 93, 93, 0.05);
}

/* ===================================================================
   Chips (platform / type filters)
   =================================================================== */

.chips-row {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}
.chips-label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-right: 6px;
}
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-muted);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  letter-spacing: 0.03em;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.chip:hover { color: var(--text); border-color: var(--border-strong); }
.chip.active {
  color: #0a0a0c;
  background: var(--accent);
  border-color: var(--accent);
}
.chip.active .chip-count { color: rgba(10, 10, 12, 0.55); }
.chip-count {
  font-size: 10px;
  color: var(--text-dim);
  letter-spacing: 0.05em;
}

/* ===================================================================
   Storefront — public-facing pages
   =================================================================== */

body.surface-store { font-size: 15px; }

.store-topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px clamp(20px, 4vw, 56px);
  border-bottom: 1px solid var(--border);
  background: rgba(10, 10, 12, 0.78);
  backdrop-filter: blur(10px);
}
.store-brand { display: flex; align-items: baseline; gap: 14px; }
.store-nav   {
  display: flex; gap: 28px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}
.store-nav a:hover { color: var(--text); }
.store-nav a.muted { color: var(--text-dim); }
.store-actions { display: flex; align-items: center; gap: 22px; }

.store-main { position: relative; z-index: 2; }

/* Hero */

.hero {
  position: relative;
  padding: clamp(80px, 14vh, 160px) clamp(20px, 6vw, 80px) clamp(80px, 12vh, 140px);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}
.hero-inner { position: relative; z-index: 2; max-width: 1100px; }
.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 22px;
}
.hero-eyebrow::before {
  content: "● ";
  color: var(--accent);
  letter-spacing: 0;
}
.hero-title {
  font-family: var(--font-display);
  font-weight: 380;
  font-size: clamp(56px, 11vw, 152px);
  line-height: 0.92;
  letter-spacing: -0.045em;
  margin: 0;
  color: var(--text);
  font-variation-settings: "opsz" 144, "SOFT" 30;
}
.hero-title em {
  font-style: italic;
  color: var(--accent);
  font-weight: 360;
  text-shadow: 0 0 50px rgba(189, 253, 84, 0.18);
}
.hero-sub {
  font-family: var(--font-ui);
  font-size: 17px;
  line-height: 1.55;
  color: var(--text-muted);
  max-width: 620px;
  margin: 28px 0 0;
}
.hero-sub-strong { color: var(--text); font-weight: 500; }
.hero-actions { display: flex; gap: 12px; margin-top: 36px; }
.btn.big { padding: 14px 22px; font-size: 12.5px; }

.hero-grid-overlay {
  position: absolute; inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(189, 253, 84, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(189, 253, 84, 0.05) 1px, transparent 1px);
  background-size: 96px 96px;
  mask-image: radial-gradient(ellipse 80% 60% at 70% 70%, black 0%, transparent 80%);
}

/* Generic store section */

.store-section {
  position: relative;
  padding: clamp(56px, 10vh, 100px) clamp(20px, 6vw, 80px);
  max-width: 1280px;
  margin: 0 auto;
}
.store-section.narrow-head { padding-bottom: 0; }
.section-head { display: flex; flex-direction: column; gap: 10px; margin-bottom: 36px; }
.section-head .eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.section-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(36px, 5vw, 60px);
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--text);
  margin: 0;
}
.section-title em { font-style: italic; color: var(--accent); font-weight: 380; }
.section-sub {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  margin: 0;
  letter-spacing: 0.05em;
}

/* Platform tiles */

.platform-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}
.platform-tile {
  position: relative;
  display: flex; flex-direction: column; gap: 10px;
  padding: 22px 22px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(255,255,255,0.015), transparent 80%), var(--bg-elevated);
  color: var(--text);
  transition: border-color 0.18s, background 0.18s, transform 0.18s;
  overflow: hidden;
  min-height: 168px;
}
.platform-tile:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  color: var(--text);
}
.platform-tile::before, .platform-tile::after {
  content: ""; position: absolute; width: 10px; height: 10px;
  border: 1px solid var(--text-dim); opacity: 0.45;
}
.platform-tile::before { top: 8px; left: 8px;  border-right: 0; border-bottom: 0; }
.platform-tile::after  { top: 8px; right: 8px; border-left: 0; border-bottom: 0; }
.tile-row {
  display: flex; justify-content: space-between; align-items: baseline;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-muted);
  letter-spacing: 0.12em;
}
.tile-id { color: var(--text-dim); }
.tile-count .dim { color: var(--text-dim); }
.tile-name {
  font-family: var(--font-display);
  font-weight: 420;
  font-size: 36px;
  line-height: 1;
  letter-spacing: -0.025em;
  color: var(--text);
  margin-top: 26px;
  font-variation-settings: "opsz" 100, "SOFT" 25;
}
.tile-cta {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  margin-top: auto;
}

/* Service cards */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
}
.service-card {
  position: relative;
  display: flex; flex-direction: column;
  padding: 20px 20px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
  color: var(--text);
  transition: border-color 0.18s, background 0.18s;
  overflow: hidden;
  min-height: 200px;
}
.service-card:hover { border-color: var(--accent); color: var(--text); }
.sc-top {
  display: flex; justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-muted);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.sc-platform { color: var(--text); }
.sc-name {
  margin: 14px 0 10px;
  font-size: 15px;
  line-height: 1.35;
  color: var(--text);
}
.sc-meta {
  display: flex; gap: 6px; flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
}
.sc-price {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px dashed var(--border);
  display: flex; align-items: baseline; gap: 6px;
}
.sc-price .amt {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 26px;
  line-height: 1;
  letter-spacing: -0.01em;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.sc-price .unit {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.06em;
}
.sc-cta {
  margin-top: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--text-muted);
}

/* Why us */

.why-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
}
.why-card {
  position: relative;
  padding: 24px 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
}
.why-card .why-num {
  position: absolute; top: 18px; right: 22px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--text-dim);
}
.why-card h3 {
  font-family: var(--font-display);
  font-weight: 420;
  font-size: 24px;
  letter-spacing: -0.02em;
  color: var(--text);
  margin: 0 0 8px;
  font-variation-settings: "opsz" 72;
}
.why-card p {
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-muted);
  margin: 0;
}

/* Footer */

.store-footer {
  position: relative; z-index: 2;
  border-top: 1px solid var(--border);
  margin-top: 60px;
  background: rgba(10, 10, 12, 0.5);
}
.footer-inner {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 32px;
  padding: 44px clamp(20px, 6vw, 80px) 30px;
  max-width: 1280px;
  margin: 0 auto;
}
.footer-inner.four-col {
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
}
.footer-link-btn {
  background: none; border: 0; padding: 0;
  font-family: var(--font-mono); font-size: 12px;
  color: var(--text-muted); letter-spacing: 0.06em;
  cursor: pointer; text-align: left;
}
.footer-link-btn:hover { color: var(--accent); }
.footer-col { display: flex; flex-direction: column; gap: 8px; }
.footer-col a { font-family: var(--font-mono); font-size: 12px; color: var(--text-muted); letter-spacing: 0.06em; }
.footer-col a:hover { color: var(--accent); }
.footer-col a.muted { color: var(--text-dim); }
.footer-label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.2em;
  color: var(--text-dim);
  text-transform: uppercase;
  margin-bottom: 4px;
}
.footer-line {
  font-family: var(--font-ui);
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
  max-width: 360px;
}
.footer-base {
  padding: 14px clamp(20px, 6vw, 80px);
  border-top: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-dim);
  text-align: right;
}

.mono { font-family: var(--font-mono); }
.dim  { color: var(--text-dim); }

/* ===================================================================
   User-pill in storefront topbar + small button variant
   =================================================================== */

.user-pill {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 7px 12px 7px 14px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(189,253,84,0.08), rgba(189,253,84,0.02));
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--accent);
  transition: border-color 0.18s, background 0.18s;
}
.user-pill:hover { border-color: var(--accent); }
.user-pill .up-label {
  font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--text-muted);
}
.user-pill .up-amt { font-weight: 600; letter-spacing: 0.02em; }

.btn.btn-sm { padding: 6px 12px; font-size: 10.5px; letter-spacing: 0.1em; }

/* Destructive action button — for permanent delete flows. */
.btn.btn-danger {
  color: var(--danger);
  border-color: rgba(255,93,93,0.35);
  background: rgba(255,93,93,0.06);
}
.btn.btn-danger:hover:not([disabled]) {
  border-color: var(--danger);
  background: rgba(255,93,93,0.14);
  color: #fff;
}
.btn.btn-danger[disabled] {
  opacity: 0.4;
  cursor: not-allowed;
}

.delete-form .confirm-row {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-mono); font-size: 13px;
  color: var(--text);
}
.delete-form .confirm-row input[type="checkbox"] {
  width: 16px; height: 16px; accent-color: var(--danger);
  cursor: pointer;
}

/* ===================================================================
   Banners
   =================================================================== */

.banner {
  display: flex; align-items: center;
  padding: 12px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 12.5px;
  margin: 0 0 20px;
  letter-spacing: 0.02em;
}
.banner.ok   { color: var(--accent); border-color: rgba(189,253,84,0.30); background: rgba(189,253,84,0.06); }
.banner.err  { color: var(--danger); border-color: rgba(255,93,93,0.30);  background: rgba(255,93,93,0.06);  }
.banner a { color: inherit; text-decoration: underline; }

/* ===================================================================
   "Big money" — universal mono price display
   =================================================================== */

.big-money {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 44px;
  line-height: 1;
  letter-spacing: -0.01em;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.big-money.huge  { font-size: 80px; }
.big-money.small { font-size: 30px; }
.big-money .cur {
  font-size: 0.32em;
  color: var(--text-muted);
  font-weight: 500;
  margin-left: 8px;
  letter-spacing: 0.18em;
}

/* ===================================================================
   Auth pages
   =================================================================== */

.auth-section {
  display: flex; justify-content: center; padding: 60px 20px 100px;
}
.auth-card {
  width: 100%; max-width: 480px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px 40px 32px;
}
.auth-card.wide { max-width: 620px; }
.auth-card .section-title { font-size: 36px; margin: 6px 0 24px; }
.auth-form { display: grid; gap: 18px; margin-top: 8px; }
.auth-form button[type=submit] { margin-top: 8px; justify-self: stretch; justify-content: center; }
.auth-foot {
  margin-top: 24px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
}
.auth-foot a { color: var(--accent); }

.auth-prompt {
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  padding: 20px 22px;
  background: rgba(255,255,255,0.012);
}
.auth-prompt-title {
  font-family: var(--font-display);
  font-weight: 420;
  font-size: 22px;
  margin: 0 0 6px;
  color: var(--text);
  font-variation-settings: "opsz" 72;
}
.auth-prompt p {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 13.5px;
  color: var(--text-muted);
}

/* ===================================================================
   Service-page order form: cost-box + balance row
   =================================================================== */

.cost-box {
  display: flex; align-items: baseline; justify-content: space-between;
  padding: 14px 16px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(189,253,84,0.05), transparent);
}
.cost-box .cost-lbl {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.cost-box .cost-amt {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 26px;
  letter-spacing: -0.01em;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.balance-row {
  display: flex; justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}
.balance-row .numeric { color: var(--text); }

/* ===================================================================
   Account dashboard
   =================================================================== */

.account-hero {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-elevated);
}
.account-balance {
  padding: 36px 40px;
  border-right: 1px solid var(--border);
  position: relative;
}
.account-balance::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent) 50%, transparent);
  opacity: 0.35;
}
.account-balance .big-money.huge { margin: 12px 0 22px; }
.account-stats {
  padding: 24px 28px;
  display: flex; flex-direction: column; gap: 18px;
  background: rgba(255,255,255,0.012);
}
.stat-row {
  display: flex; align-items: baseline; justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--text);
}

/* ===================================================================
   Order-done key/value rows
   =================================================================== */

.kv-row {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 10px 0;
  border-bottom: 1px dashed rgba(56, 56, 67, 0.55);
  font-family: var(--font-mono);
  font-size: 12.5px;
}
.kv-row:last-child { border-bottom: 0; }
.kv-row .eyebrow { font-size: 10.5px; letter-spacing: 0.2em; color: var(--text-muted); }
.kv-row .numeric { color: var(--text); font-variant-numeric: tabular-nums; }
.kv-row.big { margin: 8px 0 4px; }

/* ===================================================================
   Admin: credit form in users table
   =================================================================== */

.credit-form {
  display: flex; gap: 8px; align-items: center;
}
.credit-form input.mini {
  background: var(--bg-base);
  border: 1px solid var(--border-strong);
  color: var(--text);
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 11.5px;
  width: 92px;
}
.credit-form input.mini:focus { outline: none; border-color: var(--accent); }

/* ===================================================================
   Admin: /admin/users — wide table + filter bar + identity cell
   =================================================================== */

.users-filter {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,0.015);
}
.users-filter .mini {
  background: var(--bg-base);
  border: 1px solid var(--border-strong);
  color: var(--text);
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 11.5px;
}
.users-filter .mini:focus { outline: none; border-color: var(--accent); }
.users-filter-q { flex: 1; min-width: 200px; }

/* Users-table is wide — explicitly mark its min-width so the panel-body
   horizontal scroll kicks in cleanly on narrower viewports. Below 720px
   the table switches to .responsive-cards card-mode anyway, so this width
   only matters in the tablet 720–980px band. */
table.users-table { min-width: 1480px; }

/* Tablet (720–980px): users-table loses its hard min-width and selectively
   hides lower-priority columns so the most actionable ones (login, balance,
   orders, credit form, actions) stay visible without horizontal scroll. */
@media (max-width: 980px) and (min-width: 721px) {
  table.users-table { min-width: 0; }
  table.users-table .col-spent,
  table.users-table .col-created,
  table.users-table .col-lastseen,
  table.users-table .col-invited { display: none; }
}

.user-id-cell {
  display: flex; flex-direction: column; gap: 3px;
  line-height: 1.35;
}
.user-id-cell .user-login {
  color: var(--text);
  font-family: var(--font-mono);
  font-weight: 500;
  text-decoration: none;
  font-size: 12.5px;
}
.user-id-cell .user-login:hover { color: var(--accent); }
.user-id-cell .chip-tag {
  align-self: flex-start;
  font-size: 9.5px;
  padding: 1px 7px;
}
.user-id-cell .user-tg-link,
.user-id-cell .user-tg-name {
  color: var(--text-muted);
  font-size: 11px;
  font-family: var(--font-mono);
  overflow-wrap: anywhere;
}
.user-id-cell .user-tg-link { text-decoration: none; }
.user-id-cell .user-tg-link:hover { color: var(--info); }

.ref-cell {
  display: flex; flex-direction: column; gap: 2px;
  line-height: 1.3;
}
.ref-cell .ref-code {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text);
  background: rgba(255,255,255,0.04);
  padding: 1px 6px;
  border-radius: 3px;
  align-self: flex-start;
}
.ref-cell .ref-inviter {
  font-size: 10.5px;
  color: var(--text-muted);
  overflow-wrap: anywhere;
}

.user-actions {
  display: flex; flex-direction: column; gap: 6px; align-items: stretch;
}
.user-actions .btn.btn-sm { text-align: center; }

/* ===================================================================
   Admin: /admin/users/<id> — detail grid + invited list
   =================================================================== */

.user-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 18px;
  margin-bottom: 4px;
}
@media (max-width: 1100px) {
  .user-detail-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 780px) {
  .user-detail-grid { grid-template-columns: 1fr; }
}

.invited-list {
  display: flex; flex-direction: column; gap: 4px;
  max-height: 260px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px;
  background: rgba(255,255,255,0.015);
}
.invited-row {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 8px;
  border-radius: 3px;
  text-decoration: none;
  color: var(--text);
  font-size: 11.5px;
  font-family: var(--font-mono);
}
.invited-row:hover { background: rgba(189,253,84,0.05); color: var(--accent); }
.invited-row .invited-login { font-weight: 500; }
.invited-row .num { min-width: 36px; }

.topup-info {
  padding: 14px 18px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  margin: 4px 0 20px;
}
.topup-info p {
  margin: 6px 0 0;
  font-family: var(--font-ui);
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.55;
}

.hint {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-dim);
  letter-spacing: 0.04em;
  margin-top: 4px;
}

.rub-hint {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
  display: inline-block;
  margin-top: 2px;
}

/* ===================================================================
   Dual-currency price block — produced by Jinja global `{{ price(...) }}`
   =================================================================== */

.price {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  cursor: help;
}
.price-row {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
}
.price-amt {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 26px;
  line-height: 1;
  letter-spacing: -0.01em;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.price-unit {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  font-weight: 500;
}
.price-sec {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
}
.price.big .price-amt  { font-size: 44px; line-height: 1; letter-spacing: -0.015em; }
.price.big .price-unit { font-size: 13px; }
.price.big .price-sec  { font-size: 12.5px; margin-top: 4px; }

.price.huge .price-amt  { font-size: 76px; line-height: 0.92; letter-spacing: -0.025em; }
.price.huge .price-unit { font-size: 14px; }
.price.huge .price-sec  { font-size: 14px; margin-top: 6px; }

/* ===================================================================
   Telegram WebApp adaptation
   When the page is opened inside the bot's Mini App we collapse our
   own chrome so we don't double-up with Telegram's native top bar
   and back button. Class is added by JS in _base_*.html.
   =================================================================== */

/* Pre-login flash protection.
   ``tg-mini-prelogin`` is set synchronously in <head> the moment we
   spot ``tgWebAppData`` in the URL hash — long before our async
   auto-login fetch returns. We render a fullscreen loader instead of
   the unauthenticated shell so first-time users never see a "Sign in"
   button for a second before reload. */
.tg-auth-loader { display: none; }
html.tg-mini-prelogin body > *:not(.tg-auth-loader) { visibility: hidden; }
html.tg-mini-prelogin .tg-auth-loader {
  display: flex;
  position: fixed;
  inset: 0;
  z-index: 9999;
  align-items: center;
  justify-content: center;
  background: var(--bg, #0a0a0c);
  visibility: visible;
}
.tg-auth-loader-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.tg-auth-loader-spinner {
  width: 28px;
  height: 28px;
  border: 2px solid rgba(255, 255, 255, 0.12);
  border-top-color: var(--accent, #bdfd54);
  border-radius: 50%;
  animation: tg-auth-spin 0.9s linear infinite;
}
.tg-auth-loader-text {
  font-family: var(--font-ui), system-ui, sans-serif;
  font-size: 12.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted, #888);
}
@keyframes tg-auth-spin {
  to { transform: rotate(360deg); }
}

/* Storefront inside TG-WebApp: keep brand-mark visible (so the user
 * knows which site they're on), but kill the language switch (TG passes
 * the user's locale through initData; we already honour it), and bring
 * the auth buttons closer. ``html.is-tg-webapp`` is the persistent
 * synchronous flag (set in the <head> pre-paint script); the
 * ``body.is-tg-webapp`` variant is the async-JS belt-and-braces. */
html.is-tg-webapp .lang-switch,
body.is-tg-webapp.surface-store .lang-switch { display: none; }
html.is-tg-webapp .store-topbar,
body.is-tg-webapp.surface-store .store-topbar {
  padding-top: 8px;
  padding-bottom: 8px;
}
html.is-tg-webapp .store-footer .footer-base,
body.is-tg-webapp.surface-store .store-footer .footer-base { display: none; }

/* Inside the Mini App the web-only auth chrome is meaningless — the
 * user is already inside Telegram. We hide:
 *   - the "✈ TG" header CTA (would just bounce them back to the bot),
 *   - the Sign in / Sign up buttons (login flows over initData here),
 *   - the "Open in Telegram" hero CTA (same reason).
 * If auto-login fails, the dedicated fallback banner below provides the
 * Retry / Restart-bot / Continue-as-guest CTAs instead. */
html.is-tg-webapp .tg-cta,
body.is-tg-webapp .tg-cta,
html.is-tg-webapp .store-actions a[href="/login"],
html.is-tg-webapp .store-actions a[href="/signup"],
body.is-tg-webapp .store-actions a[href="/login"],
body.is-tg-webapp .store-actions a[href="/signup"] { display: none !important; }

/* Logout inside the Mini App would just drop the cookie and force a
 * re-auth round-trip on the next tap — and on a flaky WebView, the
 * round-trip might not re-fire cleanly (initData is stale by then).
 * Identity in the Mini App is tied to the Telegram account, not a site
 * cookie, so a "Log out" button is meaningless there. Hide the form
 * everywhere it appears; the user can still log out from a real
 * browser if they need to switch accounts. */
html.is-tg-webapp .logout-form,
body.is-tg-webapp .logout-form { display: none !important; }

/* Auto-login failure banner. Hidden by default; shown when the JS adds
 * ``html.tg-auth-failed`` after the auth round-trip failed. Lives as an
 * overlay so it appears above whatever shell already rendered. */
.tg-auth-fallback { display: none; }
html.tg-auth-failed .tg-auth-fallback {
  display: flex;
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  z-index: 9998;
  max-width: min(560px, calc(100vw - 24px));
  width: 100%;
  padding: 14px 16px 14px 16px;
  background: var(--bg-elevated, #14141a);
  border: 1px solid var(--border, #2a2a32);
  border-radius: 12px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
  align-items: stretch;
  justify-content: center;
}
.tg-auth-fallback-inner {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}
.tg-auth-fallback-head {
  font-weight: 600;
  font-size: 14px;
  color: var(--text, #f5f5f7);
}
.tg-auth-fallback-sub {
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--text-muted, #888);
  overflow-wrap: anywhere;
}
.tg-auth-fallback-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 2px;
}
.tg-auth-fallback-actions .btn { flex: 1 1 auto; }
@media (max-width: 480px) {
  html.tg-auth-failed .tg-auth-fallback { bottom: 8px; padding: 12px 12px; }
  .tg-auth-fallback-head { font-size: 13px; }
  .tg-auth-fallback-sub  { font-size: 12px; }
}

/* Admin inside TG-WebApp: drop the topbar entirely (Telegram already
 * provides title + BackButton in its native chrome), drop the
 * statusline footer (debug-y info no admin reads on a phone), and
 * pull the hamburger so it stays reachable as a floating button. */
body.is-tg-webapp.surface-admin .topbar { display: none; }
body.is-tg-webapp.surface-admin .statusline { display: none; }
/* The fixed statusline normally claims 120px of bottom padding on
 * main.content; with it gone we can pull that back to reclaim screen. */
body.is-tg-webapp.surface-admin main.content { padding-bottom: 24px; }

/* On phones the floating hamburger needs ~56px clearance at the top of
 * the content so the circle doesn't overlap the page-head crumb. */
@media (max-width: 980px) {
  body.is-tg-webapp.surface-admin main.content { padding-top: 56px; }
}

/* Re-expose the hamburger as a floating circle in the top-left corner
 * since the topbar that used to host it is gone. We force display:flex
 * because the desktop baseline rule sets .nav-toggle { display: none }
 * (it normally only appears at ≤980px). Inside TG-WebApp we always
 * need it because the topbar that hosted the sidebar entry point is
 * gone. */
body.is-tg-webapp.surface-admin .nav-toggle {
  position: fixed;
  top: 10px;
  left: 10px;
  width: 40px;
  height: 40px;
  background: var(--bg-elevated, #14141a);
  border: 1px solid var(--border, #2a2a32);
  border-radius: 999px;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 3px;
  margin: 0;  /* kill the desktop margin-right: 10px */
}
body.is-tg-webapp.surface-admin .nav-toggle span {
  width: 16px;
  height: 1.5px;
  background: var(--text);
}
/* On desktop-width TG WebApp the sidebar is already visible as a left
 * column (.shell stays 220px / 1fr at >980px). The floating hamburger
 * is redundant there and only blocks content — hide it. */
@media (min-width: 981px) {
  body.is-tg-webapp.surface-admin .nav-toggle { display: none; }
}

/* Long settings-page paragraphs hard-code max-width inline. On phones
 * that combines awkwardly with our padding to look indented. Force them
 * back to the full content width below 720px. */
@media (max-width: 720px) {
  body.is-tg-webapp.surface-admin .panel-body p[style*="max-width"],
  body.surface-admin .panel-body p[style*="max-width"] {
    max-width: none !important;
  }
}

/* Per-1000 footnote inside .price-sec. Slightly dimmer than the
 * dual-currency reference and on its own line on narrow screens so it
 * never wraps the main converted-currency value. */
.price-per1k {
  color: var(--text-dim);
  opacity: 0.85;
}
@media (max-width: 480px) {
  .price-per1k {
    display: block;
    margin-top: 2px;
    padding-left: 0;
  }
  /* Drop the "·" separator on its own line. */
  .price-per1k::before { content: ""; }
}

/* ===================================================================
   Small ?-tooltip helper
   =================================================================== */

.ttip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px; height: 14px;
  border: 1px solid var(--text-dim);
  border-radius: 50%;
  font-family: var(--font-mono);
  font-size: 9px;
  line-height: 1;
  color: var(--text-muted);
  cursor: help;
  vertical-align: 1px;
  margin-left: 4px;
  transition: color 0.15s, border-color 0.15s;
  user-select: none;
  /* anchor for the absolute-positioned popover */
  position: relative;
}
.ttip:hover, .ttip:focus { color: var(--accent); border-color: var(--accent); outline: none; }

/* CSS tooltip popover.
 *
 * Critical: ``position: fixed`` on the ::after — NOT absolute — because
 * many of our containers (panels, tables, .data, .users-table card
 * mode) end up with ``overflow: hidden`` or ``overflow-x: clip`` for
 * their own reasons. An absolutely-positioned popover would get
 * clipped inside those. Fixed positioning is relative to the viewport
 * so the popover escapes every container.
 *
 * Coordinates come from CSS custom properties --tip-x / --tip-y which
 * the JS handler sets after measuring the chip's getBoundingClientRect().
 * Without JS the popover defaults to (0, 0) — that's fine, JS attaches
 * the moment hover/focus/tap fires.
 */
.ttip[data-tip]::after {
  content: attr(data-tip);
  position: fixed;
  top: var(--tip-y, -9999px);
  left: var(--tip-x, -9999px);
  transform: translate(-50%, -100%) translateY(-8px);
  z-index: 9999;
  width: max-content;
  max-width: min(280px, calc(100vw - 24px));
  padding: 8px 10px;
  background: var(--bg-elevated, #14141a);
  color: var(--text, #f5f5f7);
  font-family: var(--font-ui, system-ui, sans-serif);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.45;
  letter-spacing: 0;
  text-transform: none;
  text-align: left;
  white-space: normal;
  border: 1px solid var(--border, #2a2a32);
  border-radius: 8px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55);
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.12s ease, transform 0.12s ease;
}
.ttip[data-tip]:hover::after,
.ttip[data-tip]:focus::after,
.ttip[data-tip].ttip-open::after {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -100%) translateY(-4px);
}

/* Caret pointing down at the chip — also fixed, also driven by the
 * same --tip-x / --tip-y so it always lines up. */
.ttip[data-tip]::before {
  content: "";
  position: fixed;
  top: var(--tip-y, -9999px);
  left: var(--tip-x, -9999px);
  transform: translate(-50%, -100%) translateY(-2px);
  width: 0; height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid var(--border, #2a2a32);
  z-index: 10000;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.12s ease;
}
.ttip[data-tip]:hover::before,
.ttip[data-tip]:focus::before,
.ttip[data-tip].ttip-open::before {
  opacity: 1;
  visibility: visible;
}

/* Spec list — replaces the inline metric "block" on the service page sidebar */
.spec-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-family: var(--font-mono);
  font-size: 11.5px;
}
.spec-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 4px 0;
  border-bottom: 1px dashed rgba(56, 56, 67, 0.4);
}
.spec-row:last-child { border-bottom: 0; }
.spec-lbl { color: var(--text-muted); letter-spacing: 0.04em; display: inline-flex; align-items: center; }
.spec-val { color: var(--text); font-variant-numeric: tabular-nums; }

/* Storefront card price block (.sc-price-block wraps the {{ price() }} call) */
.sc-price-block {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px dashed var(--border);
}
.sc-price-block .price-amt { font-size: 26px; }

/* Replaces the old .sc-price layout but kept for any leftover usage. */
.sc-price { display: none; }

/* =====================================================================
   Catalog page — sticky filter bar + row-based service list
   ===================================================================== */

.catalog-filter {
  position: sticky;
  top: 60px;
  z-index: 20;
  background: rgba(10, 10, 12, 0.92);
  backdrop-filter: blur(10px);
  padding: 18px 0 14px;
  border-bottom: 1px solid var(--border);
  margin: 12px 0 24px;
}

.filter-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 14px;
  align-items: center;
  margin-bottom: 14px;
}
.filter-row .search {
  position: relative;
  display: flex;
  gap: 6px;
}
.filter-row .search input {
  flex: 1;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  color: var(--text);
  padding: 11px 14px;
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 13px;
}
.filter-row .search input:focus { outline: none; border-color: var(--accent); }
.search-go {
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  color: var(--text-muted);
  padding: 11px 18px;
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.search-go:hover { border-color: var(--accent); color: var(--accent); }

.sort-block {
  display: flex; align-items: center; gap: 10px;
}
.filter-lbl {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.sort-block select {
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  color: var(--text);
  padding: 10px 14px;
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 12.5px;
  cursor: pointer;
}
.sort-block select:focus { outline: none; border-color: var(--accent); }

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
  padding: 10px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--bg-elevated);
  transition: border-color 0.15s, color 0.15s;
}
.toggle:hover { color: var(--text); border-color: #4a4a55; }
.toggle input { accent-color: var(--accent); }
.toggle:has(input:checked) { border-color: var(--accent); color: var(--text); }

/* Type tabs — segmented control */
.type-tabs {
  display: flex; flex-wrap: wrap; gap: 6px;
  font-family: var(--font-mono);
}
.type-tabs .tab {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 14px;
  border-radius: var(--radius);
  font-size: 12px;
  color: var(--text-muted);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.type-tabs .tab:hover { color: var(--text); border-color: var(--border-strong); }
.type-tabs .tab.active {
  color: #0a0a0c;
  background: var(--accent);
  border-color: var(--accent);
  font-weight: 600;
}
.type-tabs .tab.active .tab-count { color: rgba(10,10,12,0.5); }
.tab-count {
  font-size: 10px;
  color: var(--text-dim);
  letter-spacing: 0.05em;
}

/* Service list — one row per variant */
.srv-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.srv-row {
  display: grid;
  grid-template-columns: 56px 1fr auto auto;
  gap: 18px;
  align-items: center;
  padding: 16px 20px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  color: var(--text);
  transition: border-color 0.15s, transform 0.15s, background 0.15s;
}
.srv-row:hover {
  border-color: var(--accent);
  background: var(--bg-surface);
  color: var(--text);
}
.srv-id {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.05em;
}
.srv-main { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.srv-title {
  display: flex; align-items: baseline; gap: 8px;
  font-family: var(--font-display);
  font-weight: 420;
  font-size: 22px;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--text);
  font-variation-settings: "opsz" 72;
}
.srv-sep { color: var(--text-dim); }
.srv-platform { color: var(--text-muted); font-weight: 400; }
.srv-tags { display: flex; flex-wrap: wrap; gap: 5px; }

.chip-tag {
  display: inline-flex; align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.04em;
  border: 1px solid transparent;
  white-space: nowrap;
}
.chip-tag.chip-refill   { color: var(--accent);  background: rgba(189,253,84,0.10); border-color: rgba(189,253,84,0.30); }
.chip-tag.chip-quality  { color: var(--info);    background: rgba(124,214,242,0.10); border-color: rgba(124,214,242,0.28); }
.chip-tag.chip-geo      { color: var(--magenta); background: rgba(255,93,190,0.08); border-color: rgba(255,93,190,0.26); }
.chip-tag.chip-gender   { color: var(--magenta); background: rgba(255,93,190,0.06); border-color: rgba(255,93,190,0.20); }
.chip-tag.chip-volume   { color: var(--warn);    background: rgba(255,168,58,0.08); border-color: rgba(255,168,58,0.24); }
.chip-tag.chip-content  { color: var(--text);    background: rgba(255,255,255,0.04); border-color: var(--border-strong); }
.chip-tag.chip-modifier { color: var(--text-muted); background: rgba(255,255,255,0.03); border-color: var(--border-strong); }
.chip-tag.chip-default  { color: var(--text-dim); background: rgba(255,255,255,0.02); border-color: var(--border); }

.srv-meta {
  display: flex; flex-wrap: wrap; gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.srv-meta .sep { color: var(--text-dim); }
.srv-meta .ok  { color: var(--accent); }

.srv-price { text-align: right; }
.srv-price .price-amt { font-size: 22px; }
.srv-price .price-sec { font-size: 11px; margin-top: 3px; }

.srv-cta {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  padding: 10px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}
.srv-row:hover .srv-cta {
  color: #0a0a0c;
  background: var(--accent);
  border-color: var(--accent);
}

@media (max-width: 900px) {
  .filter-row { grid-template-columns: 1fr; }
  .srv-row { grid-template-columns: 1fr; gap: 12px; padding: 14px 16px; }
  .srv-id { display: none; }
  .srv-price { text-align: left; }
  .srv-cta { align-self: flex-start; }
}

/* =====================================================================
   Home page — stat strip, type tiles, how-it-works
   ===================================================================== */

.dot-pulse {
  display: inline-block;
  width: 6px; height: 6px;
  background: var(--accent);
  border-radius: 50%;
  margin-right: 8px;
  animation: pulse 2.4s ease-out infinite;
  vertical-align: 1px;
}

.stat-strip {
  position: relative;
  z-index: 2;
  border-bottom: 1px solid var(--border);
}
.stat-strip-inner {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px clamp(20px, 6vw, 80px);
}
.ss-item {
  display: flex; flex-direction: column; gap: 6px;
  border-left: 1px solid var(--border);
  padding-left: 22px;
}
.ss-item:first-child { border-left: 0; padding-left: 0; }
.ss-val {
  font-family: var(--font-display);
  font-weight: 420;
  font-size: 28px;
  line-height: 1;
  color: var(--text);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  font-variation-settings: "opsz" 72;
}
.ss-lbl {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

/* Service-type tiles — replaces both old "Choose platform" and featured cards */
.type-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
}
.type-tile {
  position: relative;
  display: grid;
  grid-template-rows: auto auto 1fr auto auto;
  gap: 6px;
  padding: 22px 22px 18px;
  background: linear-gradient(180deg, rgba(255,255,255,0.018), transparent 80%), var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  color: var(--text);
  overflow: hidden;
  transition: border-color 0.18s, background 0.18s, transform 0.18s;
}
.type-tile:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  color: var(--text);
}
.type-tile::before, .type-tile::after {
  content: ""; position: absolute; width: 10px; height: 10px;
  border: 1px solid var(--text-dim); opacity: 0.45;
}
.type-tile::before { top: 8px; left: 8px;  border-right: 0; border-bottom: 0; }
.type-tile::after  { top: 8px; right: 8px; border-left: 0; border-bottom: 0; }
.tt-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 6px;
}
.tt-name {
  font-family: var(--font-display);
  font-weight: 420;
  font-size: 26px;
  line-height: 1;
  letter-spacing: -0.025em;
  color: var(--text);
  font-variation-settings: "opsz" 100;
}
.tt-count {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}
.tt-from {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-top: 14px;
}
.tt-price {
  display: flex; align-items: baseline; gap: 8px;
  margin-top: -2px;
}
.tt-amt {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 30px;
  line-height: 1;
  letter-spacing: -0.015em;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.tt-unit {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.06em;
}
.tt-sec {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-dim);
  letter-spacing: 0.04em;
}
.tt-cta {
  margin-top: 14px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--text-muted);
}

/* How-it-works — 3-step strip */
.how-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
}
.how-card {
  position: relative;
  padding: 24px 22px 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
}
.how-num {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 360;
  font-size: 44px;
  line-height: 1;
  color: var(--accent);
  letter-spacing: -0.02em;
  margin-bottom: 14px;
  font-variation-settings: "opsz" 144;
}
.how-card h3 {
  font-family: var(--font-display);
  font-weight: 430;
  font-size: 22px;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--text);
  margin: 0 0 8px;
  font-variation-settings: "opsz" 72;
}
.how-card p {
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-muted);
  margin: 0;
}
.how-link {
  display: inline-block;
  margin-top: 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--accent);
}
.how-link:hover { text-decoration: underline; }

@media (max-width: 800px) {
  .stat-strip-inner { grid-template-columns: 1fr 1fr; gap: 18px 14px; }
  .ss-item { border-left: 0; padding-left: 0; }
}

/* =====================================================================
   /easy — "Просто хочу" big-button grid
   ===================================================================== */

.hero-style {
  font-size: clamp(48px, 7vw, 80px) !important;
}

.easy-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
  margin-top: 24px;
}
.easy-card {
  position: relative;
  display: flex; flex-direction: column;
  padding: 26px 26px 22px;
  background: linear-gradient(180deg, rgba(189,253,84,0.04), transparent 80%), var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  color: var(--text);
  overflow: hidden;
  transition: border-color 0.2s, transform 0.2s, background 0.2s;
}
.easy-card:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
  background: linear-gradient(180deg, rgba(189,253,84,0.10), transparent 80%), var(--bg-elevated);
  color: var(--text);
}
.easy-card::before, .easy-card::after {
  content: ""; position: absolute; width: 12px; height: 12px;
  border: 1px solid var(--accent); opacity: 0.55;
}
.easy-card::before { top: 10px; left: 10px;  border-right: 0; border-bottom: 0; }
.easy-card::after  { top: 10px; right: 10px; border-left: 0; border-bottom: 0; }
.easy-want {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.easy-type {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 380;
  font-size: 48px;
  line-height: 0.96;
  letter-spacing: -0.03em;
  color: var(--accent);
  font-variation-settings: "opsz" 144;
  margin-bottom: 18px;
}
.easy-from {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.easy-price {
  display: flex; align-items: baseline; gap: 8px;
  margin-top: 2px;
  margin-bottom: 6px;
}
.easy-amt {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 30px;
  line-height: 1;
  letter-spacing: -0.015em;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.easy-unit {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.06em;
}
.easy-secondary {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-dim);
  letter-spacing: 0.04em;
  margin: 4px 0 0;
}
.easy-meta {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-muted);
  margin-bottom: 16px;
}
.easy-cta {
  margin-top: auto;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--accent);
  padding-top: 12px;
  border-top: 1px dashed var(--border);
}

/* ===================================================================
   Storefront responsive trim
   =================================================================== */

@media (max-width: 800px) {
  .store-nav { display: none; }
  .footer-inner { grid-template-columns: 1fr; }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .hero-actions .btn { justify-content: center; }
  .account-hero { grid-template-columns: 1fr; }
  .account-balance { border-right: 0; border-bottom: 1px solid var(--border); }
}

/* =====================================================================
   Mobile polish — storefront-wide
   Goal: nothing extends past viewport, no accidental horizontal scroll,
   inputs don't trigger iOS zoom, every tappable target ≥40px.
   ===================================================================== */

html, body {
  overflow-x: clip;
  max-width: 100%;
}

/* Long URLs / unbroken strings shouldn't push the layout */
.section-sub,
.hero-sub,
.panel-body p,
.topup-info p,
.auth-prompt p {
  overflow-wrap: anywhere;
  word-break: normal;
}

/* Service page two-column grid → collapses to one column on narrow screens */
.service-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 28px;
  align-items: flex-start;
  margin-top: 24px;
}

/* Order form vertical stack. Replaces inline ``style="display: grid;
   grid-template-columns: ..."`` on the <form> tag — keeps the spacing
   driven by CSS so the mobile breakpoints below can adjust it. */
.order-form-grid {
  display: grid;
  gap: 18px;
}

/* Order form CTA row + order-done buttons row */
.order-actions,
.done-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 6px;
}
.done-actions { justify-content: center; }

/* Order-done / trial-done link: break long URLs cleanly */
.kv-link {
  font-family: var(--font-mono);
  color: var(--text);
  word-break: break-all;
  overflow-wrap: anywhere;
  text-align: right;
  max-width: 60%;
  font-size: 12px;
}

/* ------ tablet ≤ 980px ------ */
@media (max-width: 980px) {
  .service-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }
}

/* ------ phone-large ≤ 720px ------ */
@media (max-width: 720px) {

  /* Topbar — tighten everything */
  .store-topbar {
    padding: 12px 14px;
    gap: 10px;
  }
  .store-brand .brand-mark {
    font-size: 11px;
    letter-spacing: 0.18em;
  }
  .store-actions { gap: 10px; }

  .user-pill {
    padding: 6px 10px 6px 12px;
    gap: 6px;
    font-size: 11px;
  }
  .user-pill .up-label { display: none; }
  .lang-switch { font-size: 10px; letter-spacing: 0.12em; }
  .btn.btn-sm {
    padding: 7px 11px;
    font-size: 10px;
    letter-spacing: 0.06em;
  }

  /* Hero — tighten padding and big type */
  .hero {
    padding: clamp(48px, 9vh, 80px) 18px clamp(48px, 9vh, 70px);
  }
  .hero-title {
    font-size: clamp(40px, 12.5vw, 72px);
    line-height: 0.96;
  }
  .hero-sub {
    font-size: 14.5px;
    line-height: 1.55;
    margin-top: 22px;
  }
  .hero-eyebrow {
    font-size: 10px;
    letter-spacing: 0.18em;
    margin-bottom: 14px;
  }
  .hero-actions { gap: 10px; margin-top: 24px; }

  /* Generic store-section — tighter side padding, smaller titles */
  .store-section {
    padding: clamp(36px, 8vh, 60px) 18px;
  }
  .section-title {
    font-size: clamp(28px, 7.5vw, 44px);
  }
  .section-head { margin-bottom: 24px; }

  /* Auth pages — phone padding */
  .auth-section { padding: 32px 14px 60px; }
  .auth-card { padding: 26px 22px 22px; }
  .auth-card .section-title { font-size: 28px; }

  /* Account hero compact */
  .account-balance { padding: 26px 22px; }
  .account-balance .big-money.huge { font-size: 54px; }
  .account-stats { padding: 22px; }
  .big-money.huge { font-size: 58px; }

  /* Catalog filter — adjust sticky offset for mobile topbar */
  .catalog-filter {
    top: 52px;
    padding: 14px 0 10px;
    margin: 8px 0 18px;
  }
  .filter-row { gap: 10px; }
  .sort-block { flex-wrap: wrap; gap: 8px; }
  .sort-block .filter-lbl { flex: 1 1 100%; }
  .sort-block select { flex: 1 1 auto; width: 100%; }
  .toggle { padding: 10px 12px; font-size: 11.5px; width: 100%; justify-content: center; }
  .type-tabs { gap: 5px; }
  .type-tabs .tab { padding: 8px 11px; font-size: 11px; }

  /* Buttons — bigger tap targets, no awkward letter-spacing on small caps */
  .btn { min-height: 40px; }
  .btn.big { padding: 13px 18px; font-size: 11.5px; }

  /* Inputs — prevent iOS auto-zoom by enforcing ≥16px */
  body.surface-store .field > input,
  body.surface-store .field > select,
  body.surface-store .field > textarea,
  body.surface-store .filter-row .search input,
  body.surface-store .sort-block select {
    font-size: 16px;
    padding: 12px 14px;
  }
  body.surface-store .credit-form input.mini { font-size: 14px; }

  /* Tables — force horizontal scroll inside .panel-body instead of squeezed columns */
  .panel-body { -webkit-overflow-scrolling: touch; }
  table.data { min-width: 560px; }
  table.data thead th,
  table.data tbody td { padding: 10px 14px; }

  /* Footer */
  .footer-base { text-align: center; padding: 14px 18px; }
  .footer-inner { padding: 32px 18px 20px; gap: 28px; }
  .footer-inner.four-col { grid-template-columns: 1fr; }

  /* Tooltips — slightly bigger touch dot */
  .ttip { width: 16px; height: 16px; font-size: 10px; }
}

/* ------ phone-small ≤ 480px ------ */
@media (max-width: 480px) {

  /* Even tighter topbar — compact pill + tiny brand */
  .store-topbar { padding: 10px 12px; gap: 8px; }
  .store-brand .brand-mark { font-size: 10.5px; letter-spacing: 0.16em; }
  .store-actions { gap: 8px; }
  .lang-switch { font-size: 9.5px; }
  .lang-switch .sep { margin: 0 1px; }
  .btn.btn-sm { padding: 7px 9px; font-size: 9.5px; }

  /* Stat strip — 2x2 grid, smaller numbers */
  .stat-strip-inner {
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    padding: 20px 18px;
  }
  .ss-val { font-size: 22px; }
  .ss-lbl { font-size: 10px; }

  /* Type / easy tiles — tighten interior */
  .type-tile { padding: 18px 18px 16px; }
  .tt-name { font-size: 22px; }
  .tt-amt { font-size: 26px; }
  .easy-card { padding: 22px 20px 18px; }
  .easy-type { font-size: 38px; }
  .easy-amt { font-size: 26px; }

  /* Cost box / balance row — let label and amount wrap */
  .cost-box {
    flex-wrap: wrap;
    gap: 6px 12px;
    align-items: center;
    padding: 12px 14px;
  }
  .cost-box .cost-lbl { font-size: 10px; flex: 1 1 100%; }
  .cost-box .cost-amt,
  .cost-box .cost-vals .cost-amt { font-size: 22px; }
  .cost-box .rub-hint { font-size: 10.5px; }
  .balance-row { flex-wrap: wrap; gap: 4px 12px; }

  /* Order form action row — full-width stacked buttons */
  .order-actions { flex-direction: column; align-items: stretch; }
  .order-actions .btn { justify-content: center; width: 100%; }

  .done-actions { flex-direction: column; align-items: stretch; }
  .done-actions .btn { justify-content: center; width: 100%; }

  /* Hero actions — already stacked at 800px; ensure same here */
  .hero-actions .btn { width: 100%; }

  /* KV rows — let key and value stack on very narrow screens */
  .kv-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 10px 0;
  }
  .kv-link {
    max-width: 100%;
    text-align: left;
    font-size: 12px;
  }
  .kv-row .pill { font-size: 9.5px; }

  /* Service rows in catalog — even more compact */
  .srv-row { padding: 14px 14px; gap: 10px; }
  .srv-title { font-size: 19px; gap: 6px; }
  .srv-price .price-amt { font-size: 20px; }
  .srv-cta {
    padding: 10px 12px;
    font-size: 10.5px;
    text-align: center;
    align-self: stretch;
  }

  /* Service-page tag chips — give title chips room to wrap nicely */
  .srv-tags { gap: 4px; }
  .chip-tag { font-size: 10px; padding: 2px 8px; }

  /* Section title huge clamps — keep readable on 320px */
  .section-title { font-size: clamp(26px, 8.5vw, 36px); }
  .hero-style { font-size: clamp(36px, 11vw, 54px) !important; }

  /* Footer brand-mark / lines */
  .footer-line { font-size: 12.5px; }
  .footer-col a { font-size: 12px; }

  /* Spec list values can be long ("100 000 — 1 000 000") */
  .spec-row { flex-wrap: wrap; gap: 4px; padding: 6px 0; }
  .spec-val { font-size: 11px; }
}

/* ------ ultra-narrow ≤ 360px ------ */
@media (max-width: 360px) {
  .store-topbar { padding: 9px 10px; gap: 6px; }
  .lang-switch { display: none; }
  /* Header already has Sign in + Sign up; the TG paper-plane is recoverable
   * from the footer / /trial CTA, so hide it on ultra-narrow to keep the two
   * primary auth buttons from wrapping. */
  .tg-cta { display: none; }
  .store-brand .brand-mark { font-size: 10px; letter-spacing: 0.12em; }
  .btn.btn-sm { padding: 6px 8px; font-size: 9px; letter-spacing: 0.04em; }
  .user-pill { font-size: 10.5px; padding: 5px 9px; }
  .easy-type { font-size: 32px; }
  .section-title { font-size: clamp(24px, 9vw, 32px); }
  .hero-title { font-size: clamp(36px, 13vw, 56px); }
}

/* ---------- Telegram bot integration ---------- */

/* Header CTA: small "✈ TG" pill that pulls visitors into the bot. */
.tg-cta {
  border-color: #2aabee !important;
  color: #2aabee !important;
}
.tg-cta:hover {
  background: rgba(42, 171, 238, 0.12) !important;
}

/* Account-page panel showing link state. Inherits .panel for the frame; we
 * just adjust the title-row pill colour to read clean against dark bg. */
.tg-panel .pill.completed {
  background: rgba(189, 253, 84, 0.16);
  color: var(--accent);
}
.tg-panel .pill.pending {
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
}

/* .panel-body has padding:0 by default (it hosts edge-to-edge tables in the
 * order/transaction panels). Inside the TG panel we host banners, identity
 * rows and forms instead — these MUST have their own padding or they kiss
 * the panel border on every breakpoint. */
.tg-panel .panel-body { padding: 22px 24px 24px; }

@media (max-width: 720px) {
  .tg-panel .panel-body { padding: 18px 16px 20px; }
}
@media (max-width: 480px) {
  /* On phones the TG-CTA in the unauthed header is the third button after
   * Sign in / Sign up — let it shrink first when space is tight. */
  .tg-cta { padding: 5px 8px; }
  .tg-panel .panel-body { padding: 16px 14px 18px; }
}

/* Referral page — shareable link rows. The whole row collapses to one
 * column on phones; the link itself is overflow-wrap so long URLs don't
 * blow the viewport. */
.ref-link-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ref-link-label {
  font-size: 12px;
  color: var(--text-muted, #888);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.ref-link-value {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.ref-link-code {
  flex: 1 1 260px;
  min-width: 0;
  font-family: var(--font-mono);
  font-size: 13px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border, #2a2a32);
  border-radius: 8px;
  overflow-wrap: anywhere;
  word-break: break-all;
}
@media (max-width: 480px) {
  .ref-link-code { font-size: 12px; padding: 7px 8px; }
}

/* Two-column "Telegram identity / Site login" — collapses on phones */
.tg-identity-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  padding: 4px 0 2px;
}
.tg-identity-block { min-width: 0; }
.tg-identity-block .tg-id-value {
  font-family: var(--font-mono);
  font-size: 13.5px;
  margin-top: 4px;
  overflow-wrap: anywhere;
  line-height: 1.4;
}
.tg-identity-block .tg-id-value .muted {
  color: var(--text-muted);
  font-weight: 400;
}
@media (max-width: 640px) {
  .tg-identity-row { grid-template-columns: 1fr; gap: 12px; }
}

/* Action buttons row under the identity block ("Open bot", "Unlink Telegram").
 * The <form> wrapper used to rely on inline margin-left, which collapsed
 * awkwardly on narrow screens. .tg-actions gives us flex + gap + wrap. */
.tg-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
.tg-actions form { display: inline-flex; margin: 0; }

.tg-divider {
  border: 0;
  border-top: 1px dashed var(--border);
  margin: 22px 0 18px;
}
.tg-action-h {
  font-family: var(--font-display, var(--font-ui));
  font-size: 18px;
  margin: 0 0 6px;
  font-weight: 500;
  overflow-wrap: anywhere;
  line-height: 1.3;
}
.tg-merge-form {
  display: grid;
  gap: 12px;
  max-width: 380px;
}
.tg-merge-form button[type=submit] { justify-self: start; }

@media (max-width: 720px) {
  .tg-divider { margin: 16px 0 14px; }
  .tg-action-h { font-size: 16.5px; }
  /* Fill the panel width — the desktop 380px cap squeezes the form into
   * a third of a 360px viewport otherwise. */
  .tg-merge-form { max-width: 100%; }
  .tg-merge-form button[type=submit] { width: 100%; justify-self: stretch; justify-content: center; }
}

/* Login Widget block on /login and /signup */
.tg-login-block {
  margin-bottom: 22px;
  /* The Telegram widget renders as an iframe with a hard-coded pixel width;
   * clip the overflow so it never pushes the auth card past the viewport. */
  overflow: hidden;
}
/* When the Telegram block sits BELOW the password form (the new layout),
   reverse the spacing — separator above, no bottom margin. */
.tg-login-block.tg-login-block--below {
  margin-top: 22px;
  margin-bottom: 0;
}
.tg-login-block.tg-login-block--below .auth-or-sep {
  margin: 0 0 14px;
}
.tg-login-block iframe { max-width: 100%; }
.tg-login-block .auth-or-label {
  font-family: var(--font-ui);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.tg-login-block .auth-or-sep {
  position: relative;
  text-align: center;
  margin: 18px 0 6px;
  color: var(--text-muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}
.tg-login-block .auth-or-sep::before,
.tg-login-block .auth-or-sep::after {
  content: "";
  position: absolute;
  top: 50%;
  width: calc(50% - 60px);
  height: 1px;
  background: var(--border);
}
.tg-login-block .auth-or-sep::before { left: 0; }
.tg-login-block .auth-or-sep::after  { right: 0; }
.tg-login-block .auth-or-sep span {
  background: var(--bg-elevated, var(--bg));
  padding: 0 12px;
  position: relative;
  z-index: 1;
}
@media (max-width: 480px) {
  .tg-login-block .auth-or-sep::before,
  .tg-login-block .auth-or-sep::after { width: calc(50% - 48px); }
}
/* Fallback row when telegram-widget.js fails to load (iOS ITP, corporate
   network blocking *.telegram.org). The deep-link still works because it
   leaves to t.me. */
.tg-login-block .auth-tg-fallback {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.tg-login-block .auth-tg-fallback .hint {
  font-size: 12px;
  color: var(--text-muted);
}
@media (max-width: 480px) {
  .tg-login-block .auth-tg-fallback { flex-direction: column; align-items: stretch; }
  .tg-login-block .auth-tg-fallback .btn { width: 100%; text-align: center; }
}

/* ===================================================================
   Admin — mobile / Telegram WebApp readiness
   Sokolyansky админит с телефона (включая TG WebApp). Все правила —
   ТОЛЬКО под body.surface-admin, чтобы не зацепить storefront.
   =================================================================== */

/* hamburger sits inside .brand (baseline-aligned) — keep it centered */
body.surface-admin .topbar .brand { align-items: center; }

/* hamburger button — hidden on desktop, shown via media-query below */
body.surface-admin .nav-toggle {
  display: none;
  width: 38px; height: 38px;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  padding: 0;
  margin-right: 10px;
  flex: 0 0 auto;
}
body.surface-admin .nav-toggle span {
  display: block;
  width: 18px; height: 1.5px;
  background: var(--text);
  transition: transform 0.2s, opacity 0.2s;
}
body.surface-admin .nav-toggle:hover { border-color: var(--border-strong); }
body.surface-admin .nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(6.5px) rotate(45deg);
}
body.surface-admin .nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
body.surface-admin .nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-6.5px) rotate(-45deg);
}

body.surface-admin .nav-scrim {
  position: fixed;
  inset: 0;
  background: rgba(5, 5, 8, 0.6);
  backdrop-filter: blur(2px);
  z-index: 70;
}

/* New-order grid (was inline-style 1.5fr 1fr) */
body.surface-admin .new-order-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 28px;
  align-items: flex-start;
}
body.surface-admin .form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

/* ------ tablet ≤ 980px ------ */
@media (max-width: 980px) {
  body.surface-admin .nav-toggle { display: inline-flex; }

  /* sidenav becomes an off-canvas drawer, NOT display:none anymore */
  body.surface-admin .sidenav {
    display: block;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: min(280px, 82vw);
    z-index: 80;
    background: rgba(11, 11, 14, 0.98);
    backdrop-filter: blur(14px);
    border-right: 1px solid var(--border-strong);
    padding: 80px 16px 24px;
    overflow-y: auto;
    transform: translateX(-100%);
    transition: transform 0.22s ease;
    box-shadow: 4px 0 32px rgba(0, 0, 0, 0.5);
  }
  body.surface-admin.nav-open .sidenav { transform: translateX(0); }

  /* slightly larger tap targets in drawer */
  body.surface-admin .sidenav .nav-item {
    padding: 12px 14px;
    font-size: 14px;
    min-height: 44px;
  }
  body.surface-admin .sidenav .nav-section { padding: 14px 14px 6px; }

  body.surface-admin .new-order-grid { grid-template-columns: 1fr; gap: 18px; }
}

/* ------ phone-large ≤ 720px ------ */
@media (max-width: 720px) {

  /* Topbar — tighten everything, drop clock + brand-tag */
  body.surface-admin .topbar {
    padding: 10px 12px;
    gap: 8px;
  }
  body.surface-admin .topbar .brand a { gap: 8px; }
  body.surface-admin .brand-tag { display: none; }
  body.surface-admin .clock     { display: none; }
  body.surface-admin .topbar-right { gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
  body.surface-admin .balance-pill {
    padding: 6px 10px;
    font-size: 11px;
    gap: 6px;
  }
  body.surface-admin .balance-pill .pill-label { display: none; }

  /* Main content padding shrinks */
  body.surface-admin main.content { padding: 18px 14px 80px; }

  /* Page-head — stack title above action buttons */
  body.surface-admin .page-head {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    margin-bottom: 22px;
    padding-bottom: 16px;
  }
  body.surface-admin .page-head .h1 { font-size: 32px; line-height: 1.02; }
  body.surface-admin .page-head .crumb { font-size: 10px; letter-spacing: 0.16em; }
  body.surface-admin .page-head > div:last-child {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }
  body.surface-admin .page-head .btn { flex: 1 1 auto; justify-content: center; min-height: 42px; }

  /* Stat-grid → single column for readability; numbers shrink */
  body.surface-admin .stat-grid {
    grid-template-columns: 1fr;
    gap: 10px;
    margin-bottom: 22px;
  }
  body.surface-admin .stat { padding: 18px 18px 16px; }
  body.surface-admin .stat .value { font-size: 38px; }

  /* Balance hero — stack and shrink huge italic number */
  body.surface-admin .balance-hero { grid-template-columns: 1fr; }
  body.surface-admin .balance-hero .left {
    padding: 22px 20px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }
  body.surface-admin .balance-hero .right { padding: 20px; gap: 18px; }
  body.surface-admin .balance-hero .amount {
    font-size: clamp(56px, 16vw, 80px);
    margin: 10px 0 8px;
  }
  body.surface-admin .balance-hero .meta {
    flex-wrap: wrap;
    gap: 14px 22px;
    margin-top: 12px;
  }

  /* Panels — tighter heads */
  body.surface-admin .panel-head {
    padding: 14px 16px;
    flex-wrap: wrap;
    gap: 8px;
  }
  body.surface-admin .panel-head h2 { font-size: 17px; }
  body.surface-admin .panel-body[style*="padding"] { padding: 18px 16px !important; }

  /* Tables — horizontal scroll, tighter padding */
  body.surface-admin .panel-body { -webkit-overflow-scrolling: touch; }
  body.surface-admin table.data { min-width: 640px; }
  body.surface-admin table.data thead th,
  body.surface-admin table.data tbody td { padding: 10px 12px; }

  /* Inputs — 16px to dodge iOS zoom; tappable */
  body.surface-admin .field > input,
  body.surface-admin .field > select,
  body.surface-admin .field > textarea,
  body.surface-admin .search-row input,
  body.surface-admin .search-row select,
  body.surface-admin .credit-form input.mini {
    font-size: 16px;
    padding: 12px 14px;
    min-height: 44px;
  }
  body.surface-admin .credit-form input.mini { width: 100%; }

  /* Search row stacks if needed */
  body.surface-admin .search-row { flex-wrap: wrap; gap: 8px; }
  body.surface-admin .search-row input { flex: 1 1 100%; }

  /* Settings forms — drop the max-width clamp so they fit the screen */
  body.surface-admin .panel-body form[style*="max-width"] { max-width: none !important; }

  /* Credit-form in users table — stack vertically inside cell */
  body.surface-admin .credit-form {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  body.surface-admin .credit-form .btn { width: 100%; justify-content: center; min-height: 42px; }

  /* Buttons — bigger tap targets across the admin */
  body.surface-admin .btn { min-height: 42px; }

  /* Chips — wrap nicely, tappable */
  body.surface-admin .chips-row { gap: 6px; }
  body.surface-admin .chip { padding: 7px 11px; font-size: 11px; min-height: 32px; }

  /* Toggle blocks (settings page) — full-width on mobile */
  body.surface-admin .toggle { width: 100%; justify-content: center; }

  /* Statusline footer — collapse second metadata line on mobile */
  body.surface-admin footer.statusline {
    padding: 6px 12px;
    font-size: 9.5px;
    letter-spacing: 0.06em;
    gap: 8px;
  }
  body.surface-admin footer.statusline > span:last-child { display: none; }
}

/* ------ phone-small ≤ 480px ------ */
@media (max-width: 480px) {
  body.surface-admin .topbar { padding: 9px 10px; }
  body.surface-admin .brand-mark { font-size: 10.5px; letter-spacing: 0.16em; }
  body.surface-admin .brand-mark .dot { width: 6px; height: 6px; margin-right: 7px; }
  body.surface-admin .lang-switch { font-size: 10px; letter-spacing: 0.12em; }
  body.surface-admin .nav-toggle { width: 36px; height: 36px; margin-right: 6px; }
  body.surface-admin .balance-pill {
    font-size: 10.5px;
    padding: 5px 9px;
  }

  body.surface-admin main.content { padding: 14px 10px 70px; }

  body.surface-admin .page-head .h1 { font-size: 26px; }
  body.surface-admin .stat .value { font-size: 32px; }
  body.surface-admin .stat .label { font-size: 9.5px; letter-spacing: 0.18em; }

  /* Balance hero numbers stay readable at 360 */
  body.surface-admin .balance-hero .amount {
    font-size: clamp(44px, 14vw, 64px);
  }
  body.surface-admin .balance-hero .left  { padding: 18px 16px; }
  body.surface-admin .balance-hero .right { padding: 16px; }

  body.surface-admin table.data { min-width: 580px; font-size: 11.5px; }
  body.surface-admin table.data thead th { font-size: 9.5px; padding: 9px 10px; }
  body.surface-admin table.data tbody td { padding: 9px 10px; }

  /* New-order form row of 2 inputs → stack */
  body.surface-admin .form-row-2 { grid-template-columns: 1fr; gap: 14px; }
}

/* ------ ultra-narrow ≤ 360px ------ */
@media (max-width: 360px) {
  body.surface-admin .lang-switch { display: none; }
  body.surface-admin .balance-pill { font-size: 10px; padding: 4px 8px; }
  body.surface-admin .brand-mark { font-size: 10px; letter-spacing: 0.12em; }
  body.surface-admin .page-head .h1 { font-size: 24px; }
  body.surface-admin .stat .value { font-size: 28px; }
}

/* ===================================================================
   Responsive tables — classic "table → cards" pattern at ≤720px.

   Markup contract:
     <table class="data responsive-cards">
       <thead><tr><th>Col</th>…</tr></thead>
       <tbody>
         <tr><td data-label="Col">…</td>…</tr>
       </tbody>
     </table>

   On phones we hide <thead>, turn every <tr> into a bordered card and
   every <td> into a labeled row whose label comes from `data-label`.
   This lets the same markup serve as a 12-column desktop power-table
   AND a vertical KV stack on 360px, no JS, no duplicate templates.

   Override §10 (`overflow-x: clip`) by collapsing instead of scrolling.
   =================================================================== */

@media (max-width: 720px) {
  body.surface-admin table.responsive-cards,
  body.surface-admin table.responsive-cards tbody,
  body.surface-admin table.responsive-cards tr,
  body.surface-admin table.responsive-cards td {
    display: block;
    width: 100%;
    min-width: 0;
  }
  /* Hide <thead> visually but keep it for a11y / screen readers. */
  body.surface-admin table.responsive-cards thead {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
  }
  /* Each <tr> = a card. */
  body.surface-admin table.responsive-cards tbody tr {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: rgba(255,255,255,0.012);
    padding: 10px 12px;
    margin: 0 0 10px;
  }
  body.surface-admin table.responsive-cards tbody tr:last-child { margin-bottom: 0; }
  body.surface-admin table.responsive-cards tbody tr:hover { background: rgba(255,255,255,0.022); }

  /* Each <td> = a labeled KV row. */
  body.surface-admin table.responsive-cards tbody td {
    border: 0;
    padding: 6px 0;
    text-align: left !important;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    overflow-wrap: anywhere;
  }
  body.surface-admin table.responsive-cards tbody td::before {
    content: attr(data-label);
    font-family: var(--font-mono);
    font-size: 9.5px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--text-muted);
    flex: 0 0 auto;
    align-self: center;
  }
  /* Empty label → skip the gap (e.g. label-less cells). */
  body.surface-admin table.responsive-cards tbody td[data-label=""]::before,
  body.surface-admin table.responsive-cards tbody td:not([data-label])::before {
    display: none;
  }
  /* Numeric cells in cards keep their right-aligned vibe via flex justify. */
  body.surface-admin table.responsive-cards tbody td.num {
    font-variant-numeric: tabular-nums;
  }
  /* Identity / credit-form / actions cells: stack vertically so the inner
     widgets get full width on a phone. */
  body.surface-admin table.responsive-cards tbody td.col-identity,
  body.surface-admin table.responsive-cards tbody td.col-credit,
  body.surface-admin table.responsive-cards tbody td.col-actions,
  body.surface-admin table.responsive-cards tbody td.col-ref {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }
  body.surface-admin table.responsive-cards tbody td.col-credit .credit-form,
  body.surface-admin table.responsive-cards tbody td.col-actions .user-actions {
    width: 100%;
  }
  body.surface-admin table.responsive-cards tbody td.col-credit .credit-form input.mini,
  body.surface-admin table.responsive-cards tbody td.col-credit .credit-form .btn {
    width: 100%;
  }
  body.surface-admin table.responsive-cards tbody td.col-actions .user-actions {
    flex-direction: row;
    gap: 8px;
  }
  body.surface-admin table.responsive-cards tbody td.col-actions .user-actions .btn {
    flex: 1 1 0;
  }

  /* users-table card mode: drop the artificial min-width entirely, the
     surrounding .panel-body overflow-x stops being relevant. */
  body.surface-admin table.responsive-cards.users-table { min-width: 0; }
  body.surface-admin .panel-body:has(> table.responsive-cards) { overflow-x: visible; }
}

/* KV-tables (settings "Прочее", user_delete_confirm summary):
   on phones the muted key column becomes a small caps label above the value.
   Markup: <td class="kv-key">label</td><td>value</td>. */
@media (max-width: 720px) {
  body.surface-admin table.kv-table,
  body.surface-admin table.kv-table tbody,
  body.surface-admin table.kv-table tr,
  body.surface-admin table.kv-table td {
    display: block;
    width: 100%;
    min-width: 0;
  }
  body.surface-admin table.kv-table tr {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
  }
  body.surface-admin table.kv-table tr:last-child { border-bottom: 0; }
  body.surface-admin table.kv-table td {
    border: 0;
    padding: 2px 0;
    overflow-wrap: anywhere;
    text-align: left;
  }
  body.surface-admin table.kv-table td.kv-key {
    font-family: var(--font-mono);
    font-size: 9.5px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 2px;
  }
}

/* Soft scroll hint shadow on the right edge of any admin .panel-body that
   actually overflows horizontally (data-heavy tables like /admin/orders
   and /admin/services that we deliberately keep scrollable rather than
   collapsing 11 columns into a stack). Pure CSS — no JS measurement. */
@media (max-width: 980px) {
  body.surface-admin .panel-body {
    background:
      linear-gradient(to right, var(--bg-elevated) 30%, rgba(19,19,24,0)) left center / 24px 100% no-repeat local,
      linear-gradient(to left,  var(--bg-elevated) 30%, rgba(19,19,24,0)) right center / 24px 100% no-repeat local,
      radial-gradient(farthest-side at 0 50%, rgba(0,0,0,0.55), rgba(0,0,0,0)) left center / 14px 100% no-repeat scroll,
      radial-gradient(farthest-side at 100% 50%, rgba(0,0,0,0.55), rgba(0,0,0,0)) right center / 14px 100% no-repeat scroll;
  }
  /* Panels that host a card-mode table don't need the hint — clean bg. */
  body.surface-admin .panel-body:has(> table.responsive-cards),
  body.surface-admin .panel-body:has(> table.kv-table) {
    background: none;
  }
}

/* ===================================================================
   Account v2 — command-center polish (greet · quick-actions · feed
   · sticky bottom-bar · avatar circles)
   =================================================================== */

/* ---- Greeting bar ---- */
.account-greet {
  margin: 4px 0 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.account-greet-line {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
  font-family: var(--font-display);
  font-size: clamp(22px, 5vw, 30px);
  font-weight: 400;
  line-height: 1.1;
  color: var(--text);
}
.account-greet-hi {
  color: var(--text-muted);
  font-style: italic;
}
.account-greet-name {
  color: var(--accent);
  font-weight: 500;
}
.account-greet-wave {
  font-size: 0.85em;
}
.account-greet-sub { font-size: 11.5px; }

/* ---- Pulse-dot for active-orders count ---- */
.pulse-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
  margin-right: 6px;
  vertical-align: middle;
  animation: pulse-ring 1.6s ease-in-out infinite;
  box-shadow: 0 0 0 0 rgba(189, 253, 84, 0.65);
}
@keyframes pulse-ring {
  0%   { box-shadow: 0 0 0 0 rgba(189, 253, 84, 0.55); }
  70%  { box-shadow: 0 0 0 8px rgba(189, 253, 84, 0); }
  100% { box-shadow: 0 0 0 0 rgba(189, 253, 84, 0); }
}

/* ---- Quick-actions grid ----
   Mobile-first: 2x2 grid. From 720px up to 980px we keep 2 columns
   but tiles get wider. From 980px up — 4 columns in a row. */
.quick-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
@media (min-width: 980px) {
  .quick-grid { grid-template-columns: repeat(4, 1fr); gap: 14px; }
}
.quick-tile {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 4px;
  padding: 16px 16px 14px;
  min-height: 92px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.15s, transform 0.1s, background 0.15s;
}
.quick-tile:hover {
  border-color: var(--border-strong);
  background: rgba(255,255,255,0.025);
}
.quick-tile:active { transform: scale(0.985); }
.quick-tile.accent {
  border-color: rgba(189, 253, 84, 0.28);
  background: linear-gradient(135deg, rgba(189, 253, 84, 0.06), rgba(189, 253, 84, 0.015));
}
.quick-tile.accent:hover {
  border-color: rgba(189, 253, 84, 0.55);
}
.quick-icon {
  font-size: 22px;
  line-height: 1;
  margin-bottom: 2px;
}
.quick-label {
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}
.quick-sub {
  font-size: 11px;
  letter-spacing: 0.02em;
}

/* ---- Empty-state hero for brand-new users ---- */
.account-empty-hero {
  text-align: center;
  padding: 28px 22px 26px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(ellipse at center top, rgba(189, 253, 84, 0.06), transparent 70%),
    var(--bg-elevated);
}
.account-empty-icon { font-size: 36px; line-height: 1; margin-bottom: 8px; }
.account-empty-h {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 22px;
  margin: 0 0 8px;
  color: var(--text);
}
.account-empty-sub {
  color: var(--text-muted);
  margin: 0 auto 16px;
  max-width: 460px;
  font-size: 13.5px;
  line-height: 1.5;
}
.account-empty-actions {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

/* ---- Telegram avatar circle (initial monogram) ---- */
.tg-avatar-circle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #5ec1ff, #b87dff);
  color: #0a0a0c;
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 14px;
  flex-shrink: 0;
  text-transform: uppercase;
  user-select: none;
}
.tg-avatar-circle.small {
  width: 22px;
  height: 22px;
  font-size: 11px;
}
.tg-id-with-avatar {
  display: flex !important;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.tg-identity-meta { min-width: 0; word-break: break-word; }

/* ---- Referral mini leaderboard ---- */
.ref-leaderboard { margin: 16px 0 4px; }
.ref-mini-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ref-mini-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.012);
  font-size: 12.5px;
}
.ref-mini-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--font-mono);
  color: var(--text);
}
.ref-mini-date { font-size: 11px; }

/* ---- Activity feed ---- */
.activity-feed {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.activity-item {
  display: grid;
  grid-template-columns: 32px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px 4px;
  border-bottom: 1px dashed rgba(56, 56, 67, 0.5);
}
.activity-item:last-child { border-bottom: 0; }
.activity-emoji {
  font-size: 20px;
  line-height: 1;
  text-align: center;
  width: 32px;
}
.activity-main { min-width: 0; }
.activity-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.activity-title {
  font-family: var(--font-ui);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}
.activity-sub {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 11px;
  margin-top: 3px;
  letter-spacing: 0.02em;
}
.activity-amt {
  font-family: var(--font-mono);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  font-size: 13.5px;
  white-space: nowrap;
}
.pill.pill-sm {
  font-size: 9.5px;
  padding: 2px 6px;
  letter-spacing: 0.08em;
}
.pill.muted-pill {
  background: rgba(255,255,255,0.04);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

/* Raw-tables disclosure */
.raw-history-toggle { margin-top: 18px; }
.raw-history-toggle > summary {
  cursor: pointer;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 8px 0;
  list-style: none;
}
.raw-history-toggle > summary::-webkit-details-marker { display: none; }
.raw-history-toggle > summary::before {
  content: "▸ ";
  font-size: 10px;
  display: inline-block;
  transition: transform 0.15s;
}
.raw-history-toggle[open] > summary::before { content: "▾ "; }

/* ---- Mini-App sticky bottom-bar ----
   Hidden by default (regular browsers). Only shows when the document
   carries the Telegram-WebApp class. Plays the role of an iOS tab-bar:
   key destinations + close. */
.tg-bottom-bar { display: none; }
html.is-tg-webapp .tg-bottom-bar,
body.is-tg-webapp.surface-store .tg-bottom-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  position: fixed;
  left: 0; right: 0; bottom: 0;
  background: rgba(10, 10, 12, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  z-index: 50;
}
.tg-bb-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 6px 4px;
  background: none;
  border: 0;
  color: var(--text-muted);
  text-decoration: none;
  font-family: var(--font-ui);
  font-size: 10.5px;
  letter-spacing: 0.02em;
  cursor: pointer;
  min-height: 44px;
}
.tg-bb-item:hover, .tg-bb-item:active { color: var(--text); }
.tg-bb-item.accent { color: var(--accent); }
.tg-bb-icon { font-size: 18px; line-height: 1; }
.tg-bb-label { font-size: 10px; }

/* Reserve space at the bottom of the page so the sticky bar doesn't
   cover the footer / last panel content when inside the Mini App. */
html.is-tg-webapp body.surface-store .store-main,
body.is-tg-webapp.surface-store .store-main {
  padding-bottom: calc(72px + env(safe-area-inset-bottom));
}

/* ---- Mobile fine-tune (≤480px) ---- */
@media (max-width: 480px) {
  .quick-tile { min-height: 84px; padding: 14px 12px 12px; }
  .quick-icon { font-size: 20px; }
  .quick-label { font-size: 13px; }
  .quick-sub { font-size: 10.5px; }
  .activity-item {
    grid-template-columns: 28px 1fr auto;
    gap: 10px;
    padding: 10px 2px;
  }
  .activity-emoji { font-size: 18px; width: 28px; }
  .activity-title { font-size: 12.5px; }
  .activity-amt { font-size: 12.5px; }
  .account-greet-line { font-size: 22px; }
  .tg-bb-label { display: none; }
  .tg-bb-icon { font-size: 20px; }
}

