/* ============================================================
   HARON VPN — Telegram Mini App
   Design tokens + component styles
   ============================================================ */

:root {
  /* Surfaces (dark base) */
  --bg-0: #0a0a0c;          /* app base */
  --bg-1: #0e0f13;
  --surface: #15161c;       /* cards */
  --surface-2: #1c1d25;     /* inputs / inner */
  --surface-3: #23242d;

  /* Borders */
  --border: rgba(255,255,255,0.07);
  --border-2: rgba(255,255,255,0.10);
  --border-gold: rgba(214,184,108,0.26);

  /* Text */
  --text: #ECEDF1;
  --text-2: #9b9ca6;
  --text-3: #6a6b75;

  /* Gold brand */
  --gold-1: #F8ECC2;
  --gold-2: #E3C57C;
  --gold-3: #C99F4E;
  --gold-4: #8c6b2e;
  --gold-grad: linear-gradient(135deg, #F8ECC2 0%, #DDB55F 42%, #B98E3D 70%, #EBCD83 100%);
  --gold-grad-v: linear-gradient(180deg, #F8ECC2 0%, #E3C06A 46%, #B68B3A 54%, #E8C97D 100%);
  --gold-soft: rgba(214,184,108,0.10);
  --gold-glow: rgba(214,184,108,0.22);

  /* Easing (по методичке Emil Kowalski — встроенные кривые слишком слабые) */
  --ease-out: cubic-bezier(.23, 1, .32, 1);       /* входы/выходы/нажатия — мгновенный отклик */
  --ease-in-out: cubic-bezier(.77, 0, .175, 1);   /* движение A→B на экране */
  --ease-drawer: cubic-bezier(.32, .72, 0, 1);    /* iOS-подобные шторки */

  /* Status (decoupled from gold) */
  --green: #45c089;
  --green-bg: rgba(69,192,137,0.13);
  --amber: #e6a93f;
  --amber-bg: rgba(230,169,63,0.14);
  --red: #e75b50;
  --red-bg: rgba(231,91,80,0.14);
  --purple: #a98bf0;
  --purple-bg: rgba(169,139,240,0.15);
  --blue: #5aa7e6;

  /* Type */
  --sans: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --serif: 'Cormorant Garamond', 'Times New Roman', serif;
  --mono: 'JetBrains Mono', 'SF Mono', ui-monospace, monospace;

  /* Geometry */
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 26px;

  /* Frame */
  --frame-w: 390px;
  --frame-h: 844px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: #050507;
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ============================================================
   Studio backdrop + phone frame
   ============================================================ */
.studio {
  min-height: 100vh;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
  background:
    radial-gradient(120% 90% at 50% -10%, #1a1b21 0%, #0c0c0f 55%, #050506 100%);
}

.frame {
  position: relative;
  width: var(--frame-w);
  height: var(--frame-h);
  border-radius: 42px;
  background: var(--bg-0);
  padding: 7px;
  box-shadow:
    0 0 0 1.5px rgba(255,255,255,0.05),
    0 0 0 8px #0a0a0c,
    0 0 0 9px rgba(214,184,108,0.10),
    0 40px 90px -20px rgba(0,0,0,0.8),
    0 8px 30px rgba(0,0,0,0.6);
}

.screen {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 35px;
  overflow: hidden;
  background:
    radial-gradient(130% 80% at 50% -5%, #16161c 0%, #0c0c10 48%, #08080a 100%);
  display: flex;
  flex-direction: column;
}

/* smoky brand texture overlay (very subtle) */
.screen::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(60% 40% at 18% 8%, rgba(214,184,108,0.05), transparent 70%),
    radial-gradient(50% 45% at 92% 4%, rgba(120,120,140,0.05), transparent 70%);
  z-index: 0;
}

/* ============================================================
   App shell — header / scroll / tabbar
   ============================================================ */
.app {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.appHeader {
  flex: 0 0 auto;
  padding: 22px 20px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.wordmark {
  display: flex;
  flex-direction: column;
  line-height: 1;
  user-select: none;
}
.wordmark .mark {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 30px;
  letter-spacing: 3px;
  background: var(--gold-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 1px 0 rgba(0,0,0,0.5));
}
.wordmark .sub {
  margin-top: 4px;
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 4.5px;
  color: var(--gold-3);
  opacity: 0.85;
  padding-left: 3px;
}

.scroll {
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 6px 16px 150px;
  scrollbar-width: none;
}
.scroll::-webkit-scrollbar { width: 0; display: none; }

/* sticky bottom dock: mainbutton + tabbar */
.dock {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  z-index: 20;
  padding: 0 14px 14px;
  background: linear-gradient(180deg, rgba(8,8,10,0) 0%, rgba(8,8,10,0.86) 32%, #08080a 70%);
  pointer-events: none;
}
.dock > * { pointer-events: auto; }

.tabbar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  background: rgba(20,21,27,0.85);
  backdrop-filter: blur(18px);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 7px 6px 8px;
  margin-top: 10px;
}
.tab {
  appearance: none;
  background: none;
  border: 0;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 6px 4px;
  border-radius: 14px;
  color: var(--text-3);
  transition: color .18s, background .18s;
  font-family: var(--sans);
}
.tab svg { width: 22px; height: 22px; }
.tab .tlabel { font-size: 10px; font-weight: 600; letter-spacing: .2px; }
.tab.active { color: var(--gold-2); }
.tab.active svg { filter: drop-shadow(0 0 6px var(--gold-glow)); }
.tab:active { transform: scale(.94); }

/* ============================================================
   Cards
   ============================================================ */
.card {
  position: relative;
  background: linear-gradient(180deg, #17181e 0%, #131319 100%);
  border: 1px solid rgba(255,255,255,0.065);
  border-radius: 20px;
  padding: 17px 18px;
  margin-bottom: 12px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.025);
}

/* new clean card header: neutral icon chip + title + right slot */
.card-head { display: flex; align-items: center; gap: 11px; margin-bottom: 15px; }
.card-head .hicon {
  width: 30px; height: 30px; border-radius: 9px; flex: 0 0 auto;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2);
  display: flex; align-items: center; justify-content: center;
}
.card-head .hicon svg { width: 16px; height: 16px; }
.card.gold .hicon { background: var(--gold-soft); border-color: var(--border-gold); color: var(--gold-2); }
.card-head .htitle { font-size: 14px; font-weight: 700; color: var(--text); letter-spacing: .2px; }
.card-head .hright { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.minibtn {
  appearance: none; cursor: pointer;
  border: 1px solid var(--border-2); background: var(--surface-2); color: var(--text-2);
  border-radius: 9px; padding: 7px 11px;
  font-family: var(--sans); font-size: 12px; font-weight: 600;
  display: inline-flex; align-items: center; gap: 6px;
  transition: transform .12s, color .15s, border-color .15s;
}
.minibtn svg { width: 14px; height: 14px; }
.minibtn:active { transform: scale(.95); }
.minibtn.spinning svg { animation: spin .8s linear infinite; }
.minibtn.done { color: var(--green); border-color: rgba(69,192,137,0.4); }

/* tariff hero block */
.tariff-hero { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.thName {
  font-size: 21px; font-weight: 800; color: var(--text);
  display: flex; align-items: center; gap: 9px; line-height: 1;
}
.thName .inf {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; border-radius: 7px;
  background: var(--purple-bg); color: var(--purple); border: 1px solid rgba(169,139,240,0.32);
}
.thName .inf svg { width: 15px; height: 15px; }
.card.gold {
  border-color: var(--border-gold);
  box-shadow: 0 0 0 1px rgba(214,184,108,0.04), 0 8px 30px -16px rgba(214,184,108,0.25);
}
.card-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--text-3);
  margin: 0 0 12px;
  display: flex;
  align-items: center;
  gap: 7px;
}
.card-title svg { width: 14px; height: 14px; color: var(--gold-3); }

.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.row + .row { margin-top: 12px; }
.rowLabel { font-size: 13px; color: var(--text-2); white-space: nowrap; }
.rowValue { font-size: 14px; color: var(--text); font-weight: 600; }
.mono { font-family: var(--mono); }
.divider { height: 1px; background: var(--border); margin: 15px -18px; }

/* ============================================================
   Status badge / pills
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 700;
  padding: 6px 11px 6px 9px;
  border-radius: 999px;
  letter-spacing: .2px;
  white-space: nowrap;
  border: 1px solid transparent;
}
.badge .dot { width: 7px; height: 7px; border-radius: 50%; box-shadow: 0 0 8px currentColor; }
.badge.green  { color: var(--green);  background: var(--green-bg);  border-color: rgba(69,192,137,0.28); }
.badge.amber  { color: var(--amber);  background: var(--amber-bg);  border-color: rgba(230,169,63,0.30); }
.badge.red    { color: var(--red);    background: var(--red-bg);    border-color: rgba(231,91,80,0.30); }
.badge.purple { color: var(--purple); background: var(--purple-bg); border-color: rgba(169,139,240,0.32); }
.badge.gold   { color: var(--gold-2); background: var(--gold-soft); border-color: var(--border-gold); }

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  appearance: none;
  font-family: var(--sans);
  cursor: pointer;
  border: 1px solid var(--border-2);
  background: var(--surface-2);
  color: var(--text);
  border-radius: 13px;
  padding: 11px 14px;
  font-size: 13.5px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform .12s, background .15s, border-color .15s;
}
.btn svg { width: 16px; height: 16px; }
.btn:active { transform: scale(.97); }
.btn.ghost { background: transparent; color: var(--text-2); }
.btn.block { width: 100%; }

/* main / gold button (Telegram MainButton) */
.mainbtn {
  width: 100%;
  appearance: none;
  cursor: pointer;
  border: 0;
  border-radius: 16px;
  padding: 16px 18px;
  font-family: var(--sans);
  font-size: 15.5px;
  font-weight: 800;
  letter-spacing: .2px;
  color: #2a1f06;
  background: var(--gold-grad);
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.12) inset,
    0 6px 22px -6px rgba(214,184,108,0.5),
    0 2px 0 rgba(0,0,0,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  transition: transform .12s, filter .15s;
}
.mainbtn svg { width: 18px; height: 18px; }
.mainbtn:active { transform: translateY(1px) scale(.99); filter: brightness(.97); }
.mainbtn:disabled { filter: grayscale(.4) brightness(.7); cursor: default; }
.mainbtn.danger {
  color: #fff;
  background: linear-gradient(135deg, #ef6a60, #d6473c);
  box-shadow: 0 0 0 1px rgba(255,255,255,0.12) inset, 0 6px 22px -6px rgba(231,91,80,0.55);
}

/* ============================================================
   Copy field (sub link / ref link / id)
   ============================================================ */
.copyfield {
  display: flex;
  align-items: stretch;
  gap: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 13px;
  padding: 10px 10px 10px 13px;
}
.copyfield .ctext {
  flex: 1 1 auto;
  min-width: 0;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--gold-1);
  letter-spacing: .2px;
  display: flex;
  align-items: center;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.copyfield .ctext.plain { color: var(--text); }
.copybtn {
  flex: 0 0 auto;
  appearance: none;
  border: 1px solid var(--border-2);
  background: var(--surface-3);
  color: var(--text-2);
  border-radius: 9px;
  width: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform .12s, color .15s, border-color .15s;
}
.copybtn svg { width: 16px; height: 16px; }
.copybtn:active { transform: scale(.9); }
.copybtn.done { color: var(--green); border-color: rgba(69,192,137,0.4); }

/* ============================================================
   Node rows (DE / SE)
   ============================================================ */
.nodes { display: flex; flex-direction: column; gap: 8px; }
.node {
  display: flex;
  align-items: center;
  gap: 11px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 11px;
}
.node .flag { width: 26px; height: 18px; border-radius: 4px; flex: 0 0 auto; box-shadow: 0 1px 3px rgba(0,0,0,.4); overflow: hidden; }
.node .ninfo { flex: 1 1 auto; min-width: 0; }
.node .nname { font-size: 13px; font-weight: 600; color: var(--text); }
.node .nsub { font-size: 11px; color: var(--text-3); font-family: var(--mono); margin-top: 2px; }
.node .ndot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 7px var(--green); flex: 0 0 auto; }

/* ============================================================
   Progress (traffic)
   ============================================================ */
.progress-wrap { margin-top: 2px; }
.progress-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.progress-used { font-size: 18px; font-weight: 800; color: var(--text); }
.progress-used .unit { font-size: 12px; font-weight: 600; color: var(--text-3); margin-left: 2px; }
.progress-total { font-size: 12px; color: var(--text-3); font-family: var(--mono); }
.progress-track {
  height: 8px;
  border-radius: 999px;
  background: var(--surface-3);
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  border-radius: 999px;
  background: var(--gold-grad);
  box-shadow: 0 0 10px var(--gold-glow);
  transition: width .6s cubic-bezier(.2,.8,.2,1);
}

/* ============================================================
   Tariff cards
   ============================================================ */
.tariffs { display: flex; flex-direction: column; gap: 11px; }
.tariff {
  position: relative;
  text-align: left;
  appearance: none;
  cursor: pointer;
  width: 100%;
  background: linear-gradient(180deg, var(--surface) 0%, #121319 100%);
  border: 1.5px solid var(--border);
  border-radius: 18px;
  padding: 15px 16px;
  transition: border-color .18s, transform .12s, box-shadow .2s;
  font-family: var(--sans);
}
.tariff:active { transform: scale(.99); }
.tariff.selected {
  border-color: var(--gold-3);
  box-shadow: 0 0 0 1px var(--gold-3), 0 10px 34px -16px rgba(214,184,108,0.5);
  background: linear-gradient(180deg, #1c1a16 0%, #14130f 100%);
}
.tariff-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.tariff-name { font-size: 16px; font-weight: 700; color: var(--text); display: flex; align-items: center; gap: 8px; }
.tariff-name .ic { width: 19px; height: 19px; color: var(--gold-2); }
.tariff-price { text-align: right; flex: 0 0 auto; }
.tariff-price .amt {
  font-size: 22px; font-weight: 800;
  background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.tariff-price .per { font-size: 11px; color: var(--text-3); margin-top: 1px; }
.tariff-meta { margin-top: 11px; display: flex; gap: 7px; flex-wrap: wrap; }
.chip {
  font-size: 11.5px; font-weight: 600; color: var(--text-2);
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 8px; padding: 4px 9px;
  display: inline-flex; align-items: center; gap: 5px;
}
.chip svg { width: 13px; height: 13px; color: var(--text-3); }
.tariff .radio {
  position: absolute; top: 15px; right: 16px;
  width: 20px; height: 20px; border-radius: 50%;
  border: 2px solid var(--border-2);
  display: none;
}
.tariff.pickable .tariff-price { display: none; }
.tariff.pickable .radio { display: block; }
.tariff.pickable.selected .radio {
  border-color: var(--gold-3);
  background: radial-gradient(circle at center, var(--gold-2) 0 5px, transparent 6px);
}

/* ============================================================
   Section heading
   ============================================================ */
.section-h {
  font-size: 11px; font-weight: 700; letter-spacing: 1.6px; text-transform: uppercase;
  color: var(--text-3); margin: 18px 4px 10px;
}

/* hero / onboarding */
.hero {
  text-align: center;
  padding: 18px 8px 6px;
}
.hero .mark {
  font-family: var(--serif); font-weight: 700; font-size: 54px; letter-spacing: 6px;
  background: var(--gold-grad-v); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 2px 1px rgba(0,0,0,0.6));
  line-height: 1;
}
.hero .rule {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  margin: 10px 0 8px;
}
.hero .rule::before, .hero .rule::after {
  content: ""; height: 1px; width: 34px;
  background: linear-gradient(90deg, transparent, var(--gold-4));
}
.hero .rule::after { background: linear-gradient(90deg, var(--gold-4), transparent); }
.hero .sub { font-size: 11px; font-weight: 700; letter-spacing: 4px; color: var(--gold-3); white-space: nowrap; }
.hero .rule::before, .hero .rule::after { width: 26px; }
.hero .slogan { font-size: 12.5px; color: var(--text-2); margin-top: 12px; letter-spacing: .3px; }
.hero .sig {
  font-family: var(--serif); font-style: italic; font-size: 19px; color: var(--gold-3);
  opacity: .75; margin-top: 6px; letter-spacing: 1px;
}

.feature {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 12px 2px;
}
.feature .fic {
  flex: 0 0 auto; width: 34px; height: 34px; border-radius: 10px;
  background: var(--gold-soft); border: 1px solid var(--border-gold);
  display: flex; align-items: center; justify-content: center;
  color: var(--gold-2);
}
.feature .fic svg { width: 18px; height: 18px; }
.feature .ftext .ft { font-size: 13.5px; font-weight: 700; color: var(--text); }
.feature .ftext .fd { font-size: 12px; color: var(--text-2); margin-top: 2px; line-height: 1.4; }

/* ============================================================
   Overlays / sheets / checkout
   ============================================================ */
.overlay {
  position: absolute; inset: 0; z-index: 40;
  background: rgba(6,6,8,0.6);
  backdrop-filter: blur(3px);
  display: flex; flex-direction: column; justify-content: flex-end;
  animation: fadeIn .2s ease;
}
.overlay.full { justify-content: stretch; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.sheet {
  background: linear-gradient(180deg, #16171d 0%, #101116 100%);
  border-top: 1px solid var(--border-gold);
  border-radius: 26px 26px 0 0;
  padding: 10px 18px calc(18px + env(safe-area-inset-bottom));
  box-shadow: 0 -20px 60px rgba(0,0,0,0.6);
  animation: sheetUp .28s cubic-bezier(.2,.9,.2,1);
}
@keyframes sheetUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.sheet .grab { width: 38px; height: 4px; border-radius: 2px; background: var(--surface-3); margin: 4px auto 14px; }
.sheet-title { font-size: 18px; font-weight: 800; color: var(--text); margin: 0 0 4px; }
.sheet-desc { font-size: 13px; color: var(--text-2); line-height: 1.5; margin: 0 0 16px; }

/* full-page (checkout / yoomoney / payment states) */
.page {
  position: relative;
  background: radial-gradient(130% 80% at 50% -5%, #14141a 0%, #0b0b0e 60%);
  height: 100%;
  display: flex; flex-direction: column;
  animation: pageIn .26s cubic-bezier(.2,.9,.2,1);
}
@keyframes pageIn { from { transform: translateX(8%); opacity: .4; } to { transform: translateX(0); opacity: 1; } }
.page-head {
  flex: 0 0 auto; padding: 20px 18px 8px;
  display: flex; align-items: center; gap: 12px;
}
.page-head .ptitle { font-size: 17px; font-weight: 800; color: var(--text); }
.iconbtn {
  appearance: none; cursor: pointer; width: 34px; height: 34px;
  border-radius: 11px; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text-2);
  display: flex; align-items: center; justify-content: center;
}
.iconbtn svg { width: 18px; height: 18px; }
.iconbtn:active { transform: scale(.92); }
.page-body { flex: 1 1 auto; overflow-y: auto; padding: 8px 18px 18px; scrollbar-width: none; }
.page-body::-webkit-scrollbar { display: none; }
.page-foot { flex: 0 0 auto; padding: 12px 18px calc(16px + env(safe-area-inset-bottom)); }

/* order summary */
.summary {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 16px; padding: 14px 16px; margin-top: 4px;
}
.summary .sline { display: flex; justify-content: space-between; align-items: center; }
.summary .sline + .sline { margin-top: 11px; }
.summary .skey { font-size: 13px; color: var(--text-2); }
.summary .sval { font-size: 14px; font-weight: 600; color: var(--text); }
.summary .total .skey { color: var(--text); font-weight: 700; font-size: 15px; }
.summary .total .sval {
  font-size: 20px; font-weight: 800;
  background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* yoomoney mock form */
.ym {
  background: #fff; color: #1a1a1a; border-radius: 16px; overflow: hidden;
  border: 1px solid rgba(0,0,0,0.1);
  font-family: var(--sans);
}
.ym-bar { background: #8b3ffd; color: #fff; padding: 12px 16px; display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 14px; }
.ym-bar .lock { width: 15px; height: 15px; opacity: .85; }
.ym-body { padding: 16px; }
.ym-merch { font-size: 12px; color: #6b6b73; margin-bottom: 2px; }
.ym-amt { font-size: 24px; font-weight: 800; color: #111; margin-bottom: 14px; }
.ym-tabs { display: flex; gap: 8px; margin-bottom: 14px; }
.ym-tab { flex: 1; text-align: center; padding: 9px; border-radius: 10px; border: 1.5px solid #e6e6ea; font-size: 12.5px; font-weight: 600; color: #555; }
.ym-tab.on { border-color: #8b3ffd; color: #8b3ffd; background: #f6efff; }
.ym-field { margin-bottom: 11px; }
.ym-field label { display: block; font-size: 11px; color: #8a8a92; margin-bottom: 5px; font-weight: 600; }
.ym-input { height: 42px; border-radius: 10px; border: 1.5px solid #e2e2e8; background: #f7f7fa; display: flex; align-items: center; padding: 0 13px; color: #b8b8c0; font-size: 14px; font-family: var(--mono); gap: 8px; }
.ym-input .card-ic { width: 22px; height: 15px; border-radius: 3px; background: linear-gradient(135deg,#ffb02e,#ff5e3a); margin-left: auto; }
.ym-row { display: flex; gap: 11px; }
.ym-row .ym-field { flex: 1; }
.ym-note { font-size: 11px; color: #9a9aa2; text-align: center; margin-top: 12px; display: flex; align-items: center; justify-content: center; gap: 6px; }
.ym-note svg { width: 13px; height: 13px; }

/* payment state (checking / success / error) */
.pstate { flex: 1 1 auto; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 24px 30px; }
.pstate .picon { width: 84px; height: 84px; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin-bottom: 22px; }
.pstate .picon svg { width: 40px; height: 40px; }
.pstate .ptitle2 { font-size: 21px; font-weight: 800; color: var(--text); margin-bottom: 10px; line-height: 1.25; }
.pstate .pdesc { font-size: 13.5px; color: var(--text-2); line-height: 1.55; max-width: 250px; }
.picon.checking { background: var(--gold-soft); border: 1px solid var(--border-gold); color: var(--gold-2); }
.picon.success { background: var(--green-bg); border: 1px solid rgba(69,192,137,0.35); color: var(--green); }
.picon.error { background: var(--red-bg); border: 1px solid rgba(231,91,80,0.35); color: var(--red); }

.spinner { width: 40px; height: 40px; border-radius: 50%; border: 3px solid rgba(214,184,108,0.2); border-top-color: var(--gold-2); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* input (name change) */
.input {
  width: 100%; height: 48px; border-radius: 13px;
  background: var(--surface-2); border: 1.5px solid var(--border-2);
  color: var(--text); font-family: var(--mono); font-size: 15px;
  padding: 0 14px; outline: none; transition: border-color .15s;
}
.input:focus { border-color: var(--gold-3); }
.input.invalid { border-color: var(--red); }
.input.valid { border-color: var(--green); }
.rules { margin: 12px 0 0; padding: 0; list-style: none; }
.rules li { font-size: 12px; color: var(--text-3); display: flex; align-items: center; gap: 8px; padding: 3px 0; }
.rules li svg { width: 14px; height: 14px; flex: 0 0 auto; }
.rules li.ok { color: var(--green); }
.rules li.bad { color: var(--red); }

/* metrics (referral) */
.metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.metric {
  background: linear-gradient(180deg, var(--surface) 0%, #121319 100%);
  border: 1px solid var(--border); border-radius: 16px; padding: 16px 14px; text-align: center;
}
.metric .mnum {
  font-size: 30px; font-weight: 800; line-height: 1;
  background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.metric .mlabel { font-size: 11.5px; color: var(--text-2); margin-top: 8px; font-weight: 600; }

/* toast */
.toast {
  position: absolute; left: 50%; bottom: 96px; transform: translateX(-50%);
  z-index: 60;
  background: rgba(28,29,37,0.97);
  border: 1px solid var(--border-gold);
  color: var(--text);
  font-size: 13px; font-weight: 600;
  padding: 11px 16px; border-radius: 13px;
  display: flex; align-items: center; gap: 9px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.5);
  animation: toastIn .25s cubic-bezier(.2,.9,.2,1);
  white-space: nowrap;
}
.toast svg { width: 16px; height: 16px; color: var(--green); }
@keyframes toastIn { from { transform: translate(-50%, 14px); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }

/* warning banner */
.warn {
  display: flex; gap: 11px; align-items: center;
  background: var(--amber-bg); border: 1px solid rgba(230,169,63,0.30);
  border-radius: 14px; padding: 12px 14px; margin-bottom: 12px;
}
.warn.red { background: var(--red-bg); border-color: rgba(231,91,80,0.30); }
.warn .wic { flex: 0 0 auto; color: var(--amber); }
.warn.red .wic { color: var(--red); }
.warn .wic svg { width: 20px; height: 20px; }
.warn .wt { font-size: 13px; font-weight: 700; color: var(--text); }
.warn .wd { font-size: 11.5px; color: var(--text-2); margin-top: 1px; }

/* small helper text */
.hint { font-size: 11.5px; color: var(--text-3); line-height: 1.5; margin-top: 10px; }
.hint a, .link { color: var(--gold-3); text-decoration: none; }

.fadeUp { animation: none; opacity: 1; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ============================================================
   HARON Admin console — hacker-terminal, Apple-optimized.
   Всё скоуплено в .adm-root, чужие экраны не затрагиваются.
   ============================================================ */
.adm-root{
  --abg:#06060a; --apanel:rgba(255,255,255,.025); --apanel2:rgba(255,255,255,.05);
  --aline:rgba(221,181,95,.18);
  --agold:#DDB55F; --agold-bright:#F8ECC2; --agold-dim:#8a7338;
  --agreen:#4dffa0; --ared:#ff4d5e; --aamber:#ffd24d; --amuted:#5d5f6b; --atxt:#c9cbd3;
  --amono: ui-monospace, 'SF Mono', SFMono-Regular, Menlo, 'JetBrains Mono', monospace;
  position:relative; min-height:100dvh; background:var(--abg); color:var(--atxt);
  font-family:var(--amono); font-size:13px; line-height:1.55;
  -webkit-font-smoothing:antialiased; -webkit-text-size-adjust:100%;
  padding-bottom:calc(86px + env(safe-area-inset-bottom));
}
.adm-root::before{content:""; position:fixed; inset:0; pointer-events:none; z-index:2;
  background:repeating-linear-gradient(0deg, rgba(0,0,0,.06) 0 1px, transparent 1px 3px)}
.adm-root > *{position:relative; z-index:3}

.adm-bar{display:flex; align-items:center; gap:8px; padding:11px 16px;
  padding-top:calc(11px + env(safe-area-inset-top));
  background:rgba(10,10,14,.72); -webkit-backdrop-filter:saturate(180%) blur(20px);
  backdrop-filter:saturate(180%) blur(20px); border-bottom:1px solid var(--aline)}
.adm-bar .dots{display:flex; gap:6px}
.adm-bar .dots i{width:11px; height:11px; border-radius:50%; display:block}
.adm-bar .dots i:nth-child(1){background:#ff5f57}
.adm-bar .dots i:nth-child(2){background:#febc2e}
.adm-bar .dots i:nth-child(3){background:#28c840}
.adm-bar .addr{color:var(--amuted); font-size:12px}
.adm-bar .addr b{color:var(--agold)}
/* Кнопка обновления. Раньше тут был бейдж «LIVE», хотя данные грузились один раз. */
.adm-bar .adm-refresh{margin-left:auto; display:flex; align-items:center; gap:5px;
  color:var(--agreen); font-size:11px; font-family:var(--amono); cursor:pointer;
  background:none; border:1px solid var(--aline); border-radius:9px; padding:5px 9px;
  min-height:30px; touch-action:manipulation;
  transition:border-color .12s var(--ease-out), transform .12s var(--ease-out)}
.adm-bar .adm-refresh:active{transform:scale(.94); border-color:rgba(77,255,160,.45)}
.adm-bar .adm-refresh[disabled]{opacity:.6; cursor:default}
.adm-bar .adm-refresh .ic{display:inline-block; font-size:13px; line-height:1}
.adm-bar .adm-refresh.busy .ic{animation:admSpin .8s linear infinite}
@keyframes admSpin{to{transform:rotate(360deg)}}
.adm-stamp{color:var(--amuted); font-size:11px; padding:2px 4px 6px; font-family:var(--amono)}

.adm-wrap{padding:16px 14px}

.adm-hero{display:flex; gap:14px; align-items:center; padding:8px 4px 18px;
  border-bottom:1px dashed var(--aline); margin-bottom:8px}
.adm-bat{font-size:10px; line-height:1.1; color:var(--agold); margin:0;
  text-shadow:0 0 12px rgba(221,181,95,.5); white-space:pre; font-family:var(--amono)}
.adm-hero .ttl{font-weight:700; letter-spacing:3px; font-size:18px; color:var(--agold-bright);
  text-shadow:0 0 14px rgba(221,181,95,.4)}
.adm-hero .sub{color:var(--agold-dim); font-size:11px; letter-spacing:.5px; margin-top:3px}

.adm-cursor{display:inline-block; width:8px; height:15px; background:var(--agold); margin-left:2px;
  vertical-align:-2px; animation:admBlink 1.05s steps(1) infinite}
@keyframes admBlink{50%{opacity:0}}

.adm-prompt{margin:18px 0 9px; color:var(--agold)}
.adm-prompt .u{color:var(--agreen)} .adm-prompt .p{color:var(--amuted)} .adm-prompt .c{color:var(--agold-bright)}
.adm-prompt .hint{color:var(--amuted); font-size:11px; margin:0 0 0 6px}

.adm-stat{display:flex; align-items:center; gap:10px; padding:11px 12px; min-height:48px;
  border:1px solid var(--aline); border-radius:14px; background:var(--apanel);
  -webkit-backdrop-filter:blur(6px); backdrop-filter:blur(6px); margin-bottom:8px; flex-wrap:wrap}
.adm-tag{font-weight:700; padding:2px 7px; border-radius:6px; font-size:12px}
.adm-tag.ok{color:var(--agreen); background:rgba(77,255,160,.1); border:1px solid rgba(77,255,160,.25)}
.adm-tag.dn{color:var(--ared); background:rgba(255,77,94,.1); border:1px solid rgba(255,77,94,.25)}
.adm-nm{color:var(--agold-bright); font-weight:500; min-width:84px}
.adm-nm small{color:var(--amuted); font-weight:400}
.adm-kv{color:var(--amuted); font-size:12px}
.adm-kv b{color:var(--atxt); font-weight:500}
.adm-asciibar{color:var(--agold); letter-spacing:-1px; font-size:12px; margin-left:auto;
  text-shadow:0 0 8px rgba(221,181,95,.35)}
.adm-summ{color:var(--amuted); font-size:12px; padding:6px 4px 2px}
.adm-summ b{color:var(--agreen)} .adm-summ .d{color:var(--ared)}

.adm-cmd{display:flex; align-items:center; gap:12px; padding:13px 12px; min-height:52px;
  border:1px solid var(--aline); border-radius:14px; background:var(--apanel);
  -webkit-backdrop-filter:blur(6px); backdrop-filter:blur(6px); margin-bottom:8px;
  user-select:none; -webkit-user-select:none; touch-action:manipulation; cursor:pointer;
  transition:transform .12s var(--ease-out), background .12s var(--ease-out), border-color .12s var(--ease-out)}
.adm-cmd:active{transform:scale(.975); background:var(--apanel2); border-color:rgba(221,181,95,.5)}
.adm-cmd .ico{font-size:16px; width:20px; text-align:center; flex:0 0 auto}
.adm-cmd .nm{color:var(--agold-bright); font-weight:700; min-width:96px; flex:0 0 auto}
.adm-cmd .nm .ast{color:var(--agreen)}
.adm-cmd .ds{color:var(--amuted); font-size:12px; flex:1; min-width:0}
.adm-cmd .go{color:var(--agold); font-weight:700; font-size:15px; flex:0 0 auto}
.adm-cmd.danger:active{border-color:rgba(255,77,94,.55)}
.adm-cmd.danger .go{color:var(--ared)}

.adm-log{border-left:2px solid var(--aline); padding-left:12px; margin:4px 0 4px 6px}
.adm-log .l{padding:5px 0; color:var(--atxt); word-break:break-word}
.adm-log .l .ts{color:var(--amuted)}
.adm-log .l.none{color:var(--agold-dim); font-style:italic}
.adm-root .sev{font-weight:700; margin-right:8px}
.adm-root .sev.crit{color:var(--ared)}
.adm-root .sev.warn{color:var(--aamber)}
.adm-root .sev.res{color:var(--agreen)}

/* A1: упавшая секция рисует плейсхолдер — панель целиком не гаснет. */
.adm-sec-err{display:flex; align-items:center; gap:9px; flex-wrap:wrap;
  border-left:2px solid rgba(255,77,94,.35); padding:8px 0 8px 12px; margin:4px 0 4px 6px;
  color:var(--amuted); font-size:12px}
.adm-sec-err .r{background:none; border:1px solid var(--aline); color:var(--agold);
  border-radius:8px; padding:4px 9px; font-size:11px; font-family:var(--amono);
  cursor:pointer; min-height:30px; touch-action:manipulation}
.adm-sec-err .r:active{border-color:rgba(221,181,95,.5)}

/* Каскадный разворот логов: max-height (надёжнее grid 0fr→1fr в старых WebView)
   + stagger по индексу через inline transition-delay. */
.adm-reveal{overflow:hidden; max-height:0; transition:max-height .42s var(--ease-out)}
.adm-reveal.open{max-height:2000px}
.adm-reveal .l.rv{opacity:0; transform:translateY(-6px);
  transition:opacity .26s ease, transform .26s var(--ease-out)}
.adm-reveal.open .l.rv{opacity:1; transform:none}

.adm-more{display:inline-flex; align-items:center; gap:6px; margin-top:2px;
  background:none; border:none; padding:7px 2px; min-height:34px;
  color:var(--agold); font-size:12px; font-family:var(--amono);
  cursor:pointer; touch-action:manipulation}
.adm-more .chev{display:inline-block; font-weight:700; transition:transform .3s var(--ease-out)}
.adm-more.open .chev{transform:rotate(90deg)}
.adm-more:active{opacity:.7}

@media (prefers-reduced-motion: reduce){
  .adm-reveal{transition:none}
  .adm-reveal .l.rv{transition:none; opacity:1; transform:none}
  .adm-more .chev{transition:none}
  .adm-bar .adm-refresh.busy .ic{animation:none}
}

.adm-retry{display:inline-block; margin-top:10px; padding:9px 16px; border-radius:10px;
  border:1px solid var(--aline); color:var(--agold); background:var(--apanel); cursor:pointer}
.adm-retry:active{transform:scale(.97)}

@media (prefers-reduced-motion: reduce){ .adm-cursor{animation:none; opacity:1} }

/* --- Фаза 4a: модалка действий (по ЦЕНТРУ, терминал-стиль) --- */
.adm-modal-back{position:fixed; inset:0; z-index:50; background:rgba(0,0,0,.55);
  -webkit-backdrop-filter:blur(3px); backdrop-filter:blur(3px);
  display:flex; align-items:center; justify-content:center; padding:18px}
.adm-modal{width:100%; max-width:430px; max-height:84dvh; display:flex; flex-direction:column;
  background:#0b0c11; border:1px solid var(--aline); overflow:hidden;
  border-radius:16px; font-family:var(--amono); animation:admPop .2s var(--ease-out)}
@keyframes admPop{from{opacity:0; transform:scale(.94)} to{opacity:1; transform:scale(1)}}
.adm-modal-bar{display:flex; align-items:center; justify-content:space-between;
  padding:14px 16px; border-bottom:1px solid var(--aline); position:sticky; top:0; background:#0b0c11}
.adm-modal-bar .ttl{color:var(--agold-bright); font-weight:700; font-size:14px}
.adm-modal-bar .x{color:var(--amuted); font-size:18px; padding:2px 10px; cursor:pointer}
.adm-modal-bar .x:active{color:var(--agold)}
.adm-modal-body{padding:16px; overflow-y:auto; -webkit-overflow-scrolling:touch;
  padding-bottom:calc(20px + env(safe-area-inset-bottom))}
.adm-msheet-load{color:var(--amuted); font-size:13px}

.adm-report{white-space:pre-wrap; word-break:break-word; color:var(--atxt); font-size:12.5px;
  line-height:1.7; font-family:var(--amono); margin:0}

.adm-usersum{color:var(--amuted); font-size:12px; margin-bottom:10px}
.adm-userrow{display:flex; align-items:center; gap:9px; padding:9px 4px;
  border-bottom:1px solid rgba(255,255,255,.05); font-size:13px}
.adm-userrow .st{flex:0 0 auto}
.adm-userrow .nm{color:var(--agold-bright); font-weight:600; flex:1; min-width:0;
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
.adm-userrow .dd{color:var(--atxt); flex:0 0 auto; font-size:12px}
.adm-userrow .id{color:var(--amuted); flex:0 0 auto; font-size:11px}

.adm-edit-cur{color:var(--amuted); font-size:13px; margin-bottom:12px}
.adm-edit-cur b{color:var(--agold-bright); font-size:16px}
.adm-edit-input{width:100%; padding:13px 14px; font-size:17px; font-family:var(--amono);
  color:var(--agold-bright); background:rgba(255,255,255,.04); border:1px solid var(--aline);
  border-radius:12px; outline:none; -webkit-appearance:none}
.adm-edit-input:focus{border-color:rgba(221,181,95,.5)}
.adm-edit-err{color:var(--ared); font-size:12px; margin-top:8px}
.adm-edit-btns{display:flex; gap:10px; margin-top:16px}
.adm-btn{flex:1; padding:13px; border-radius:12px; font-family:var(--amono); font-weight:700;
  font-size:14px; border:1px solid var(--aline); cursor:pointer; touch-action:manipulation;
  transition:transform .12s var(--ease-out)}
.adm-btn:active{transform:scale(.97)}
.adm-btn.ghost{background:transparent; color:var(--amuted)}
.adm-btn.gold{background:linear-gradient(180deg,var(--agold-bright),var(--agold)); color:#1a1407; border-color:transparent}
.adm-btn.red{background:linear-gradient(180deg,#ff6b6b,#e0384a); color:#fff; border-color:transparent}
.adm-btn:disabled{opacity:.6}

/* ============================================================
   Фаза 4c — vpn-panel (действия над юзером) + живая очередь задач.
   Моушен по скиллам Эмиля: action-sheet = Drawer (--ease-drawer),
   смена статуса = Crossfade (opacity+blur), успех = Pop.
   ============================================================ */
/* строка юзера в режиме управления — кликабельна (шеврон-афорданс) */
.adm-userrow.tap{cursor:pointer; border-radius:9px; padding-left:8px; padding-right:6px;
  transition:background .12s var(--ease-out), transform .12s var(--ease-out)}
.adm-userrow.tap:active{background:var(--apanel2); transform:scale(.99)}
.adm-userrow .go{margin-left:auto; color:var(--agold); flex:0 0 auto; font-weight:700; font-size:15px}
.adm-users-add{display:flex; align-items:center; justify-content:center; gap:8px; margin-top:14px;
  padding:12px; border:1px dashed rgba(221,181,95,.4); border-radius:12px; color:var(--agold-bright);
  font-weight:700; cursor:pointer; touch-action:manipulation;
  transition:transform .12s var(--ease-out), background .12s var(--ease-out)}
.adm-users-add:active{transform:scale(.98); background:var(--apanel2)}

/* нижняя шторка действий (iOS action sheet) */
.adm-sheet-back{position:fixed; inset:0; z-index:55; background:rgba(0,0,0,.55);
  -webkit-backdrop-filter:blur(3px); backdrop-filter:blur(3px);
  display:flex; align-items:flex-end; justify-content:center}
.adm-sheet{width:100%; max-width:460px; background:#0b0c11; border:1px solid var(--aline);
  border-bottom:none; border-radius:18px 18px 0 0; font-family:var(--amono);
  padding:8px 14px calc(16px + env(safe-area-inset-bottom));
  max-height:86dvh; overflow-y:auto; -webkit-overflow-scrolling:touch;
  animation:admSheetUp .32s var(--ease-drawer)}
@keyframes admSheetUp{from{transform:translateY(100%)} to{transform:translateY(0)}}
.adm-sheet-grab{width:38px; height:4px; border-radius:2px; background:rgba(255,255,255,.18); margin:8px auto 6px}
.adm-sheet-hd{display:flex; align-items:center; gap:9px; padding:6px 4px 12px;
  border-bottom:1px solid var(--aline); margin-bottom:6px}
.adm-sheet-hd .st{flex:0 0 auto}
.adm-sheet-hd .nm{color:var(--agold-bright); font-weight:700; font-size:15px; flex:1; min-width:0;
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
.adm-sheet-hd .meta{color:var(--amuted); font-size:11px; flex:0 0 auto}
.adm-act{display:flex; align-items:center; gap:11px; width:100%; padding:13px 8px; min-height:50px;
  background:transparent; border:none; border-bottom:1px solid rgba(255,255,255,.05);
  color:var(--atxt); font-family:var(--amono); font-size:14px; text-align:left; cursor:pointer;
  touch-action:manipulation; transition:background .12s var(--ease-out), transform .12s var(--ease-out)}
.adm-act:active{background:var(--apanel2); transform:scale(.99)}
.adm-act .ic{width:22px; text-align:center; flex:0 0 auto; font-size:16px}
.adm-act .lb{flex:1; min-width:0}
.adm-act .cur{color:var(--amuted); font-size:12px; flex:0 0 auto}
.adm-act.danger{color:var(--ared)}
.adm-seg{display:flex; align-items:center; gap:11px; padding:11px 8px; border-bottom:1px solid rgba(255,255,255,.05)}
.adm-seg .lb{flex:1; color:var(--atxt); font-size:14px}
.adm-seg .opts{display:flex; gap:6px}
.adm-seg button{padding:7px 15px; border-radius:9px; font-family:var(--amono); font-weight:700;
  font-size:13px; border:1px solid var(--aline); background:transparent; color:var(--amuted);
  cursor:pointer; touch-action:manipulation; transition:transform .12s var(--ease-out)}
.adm-seg button:active{transform:scale(.94)}
.adm-seg button.on{background:linear-gradient(180deg,var(--agold-bright),var(--agold)); color:#1a1407; border-color:transparent}
/* Четыре варианта вместо двух (привилегия «родня»): на 360px обычные отступы съедали
   подпись и она переносилась на вторую строку. Ужимаем только этот ряд. */
.adm-seg.quad .opts{gap:5px}
.adm-seg.quad button{padding:7px 9px; min-width:34px}

/* живой статус задачи */
.adm-task{display:flex; flex-direction:column; align-items:center; text-align:center; gap:14px; padding:14px 4px}
.adm-task .lbl{color:var(--agold-bright); font-weight:700; font-size:14px}
.adm-task .st{display:flex; align-items:center; gap:10px; color:var(--amuted); font-size:13px;
  animation:admCross .3s var(--ease-out)}
@keyframes admCross{from{opacity:0; filter:blur(4px)} to{opacity:1; filter:blur(0)}}
.adm-spin{width:18px; height:18px; border-radius:50%; border:2px solid rgba(221,181,95,.25);
  border-top-color:var(--agold); animation:spin .7s linear infinite; flex:0 0 auto}
.adm-task .ok{font-size:32px; color:var(--agreen); line-height:1; animation:admPopIn .34s var(--ease-out)}
.adm-task .bad{font-size:32px; color:var(--ared); line-height:1; animation:admPopIn .34s var(--ease-out)}
@keyframes admPopIn{0%{transform:scale(.3); opacity:0} 60%{transform:scale(1.12)} 100%{transform:scale(1); opacity:1}}
.adm-task .res{color:var(--atxt); font-size:12.5px; line-height:1.6; white-space:pre-wrap;
  word-break:break-word; width:100%}
.adm-task .adm-edit-btns{width:100%}

.adm-confirm-txt{color:var(--atxt); font-size:14px; line-height:1.6}
.adm-confirm-txt b{color:var(--agold-bright)}
.adm-confirm-txt .warn{color:var(--ared); display:block; margin-top:8px; font-size:12.5px}

@media (prefers-reduced-motion: reduce){
  .adm-sheet{animation:none}
  .adm-task .st, .adm-task .ok, .adm-task .bad{animation:none}
}

/* ============================================================
   «Переправа через Стикс» — кинематографичный вход в админку (styx.jsx).
   Скоуплено в .styx-* / .adm-obol. Палитра: чернила + холодный камень + золото.
   ============================================================ */

/* Обол Харона — монета-вход в карточке «Серверы» (виден только админу) */
.adm-obol-wrap{ display:flex; flex-direction:column; align-items:center; gap:6px;
  margin-top:16px; padding-top:14px; border-top:1px solid var(--border) }
.adm-obol{
  position:relative; width:46px; height:46px; border-radius:50%;
  display:flex; align-items:center; justify-content:center;
  cursor:pointer; -webkit-tap-highlight-color:transparent; touch-action:manipulation;
  background:radial-gradient(circle at 38% 30%, #f6e6b0 0%, #d8b65f 34%, #9a7531 72%, #6f5220 100%);
  box-shadow:
    inset 0 1px 1px rgba(255,245,210,.7),
    inset 0 -2px 3px rgba(60,40,10,.55),
    0 2px 7px rgba(0,0,0,.5),
    0 0 0 1px rgba(120,90,40,.6);
  transition:transform .18s var(--ease-out), box-shadow .18s var(--ease-out);
  animation:obolSheen 4.6s ease-in-out infinite;
}
.adm-obol .glyph{ width:24px; height:24px; color:#5a4117;
  filter:drop-shadow(0 1px 0 rgba(255,243,205,.55)) }
.adm-obol:active{ transform:scale(.94) rotate(-4deg);
  box-shadow:inset 0 1px 2px rgba(60,40,10,.7), 0 1px 3px rgba(0,0,0,.5) }
@keyframes obolSheen{ 0%,100%{filter:brightness(1)} 50%{filter:brightness(1.13)} }
.adm-obol-cap{ font-family:var(--serif); font-style:italic; font-size:12px;
  letter-spacing:1px; color:var(--gold-3); opacity:.7 }

/* Полноэкранный оверлей (портал в <body>): плавно гаснет → открывает панель под собой */
.styx-root{
  position:fixed; inset:0; width:100vw; height:100dvh; z-index:2147483000;
  background:#04050a; overflow:hidden;
  cursor:pointer; touch-action:manipulation; user-select:none; -webkit-user-select:none;
  opacity:1; transition:opacity .72s var(--ease-out), filter .72s var(--ease-out);
}
/* Blur-mask (Emil): размытие склеивает видео↔панель в один переход, а не два наложенных кадра */
.styx-root.sx-out{ opacity:0; filter:blur(5px); }

/* Видео сцены (бесшовный луп, H.264) на весь экран */
.styx-video{
  position:absolute; inset:0; width:100%; height:100%; display:block; background:#04050a;
  object-fit:cover; object-position:center;   /* режет чёрные поля pillarbox, сцена заполняет экран */
}
/* лёгкая виньетка для глубины */
.styx-vig{ position:absolute; inset:0; pointer-events:none; z-index:2;
  background:radial-gradient(ellipse at 50% 48%, transparent 46%, rgba(0,0,0,.4) 100%); }

/* Панель проявляется снизу видео при затухании (мягкий приход). */
.adm-root{ animation:adm-enter .5s ease both }
@keyframes adm-enter{ from{opacity:.4} to{opacity:1} }
@media (prefers-reduced-motion: reduce){
  .styx-root{ transition:none }
  .adm-root, .adm-obol{ animation:none }
}

/* ============================================================
   Дизайн-полиш v22 — флагманский Кабинет (кольцо-гейдж), свайп «Ладья через
   Стикс», Онбординг. Принципы taste+Emil на нашем стеке. GPU-safe: анимируем
   только transform/opacity/filter; blur остаётся лишь на fixed (dock/tabbar).
   ============================================================ */

/* — entry-хореография (стаггер входа) — */
.cab-enter, .ob-enter { animation: cabIn .5s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 70ms); }
@keyframes cabIn { from { opacity: 0; transform: translateY(12px); filter: blur(4px); } to { opacity: 1; transform: translateY(0); filter: blur(0); } }

/* — Double-Bezel (вложенные оболочки = «машинная» глубина) — */
.bezel {
  position: relative; padding: 6px; border-radius: var(--r-xl);
  background: rgba(255,255,255,0.035); border: 1px solid rgba(255,255,255,0.06);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05), 0 18px 44px -26px rgba(0,0,0,0.85);
  margin-bottom: 12px;
}
.bezel-core {
  border-radius: calc(var(--r-xl) - 6px);
  background: linear-gradient(180deg, #191a20 0%, #131319 100%);
  border: 1px solid rgba(255,255,255,0.05);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
  padding: 16px 16px 18px;
}
/* gold-карточка «Ключ доступа» — безель-подобная глубина без реструктуризации DOM */
.card.gold { box-shadow: 0 0 0 1px rgba(214,184,108,0.06), inset 0 1px 0 rgba(255,255,255,0.06), 0 12px 34px -18px rgba(214,184,108,0.28); }

/* — Герой-статус: кольцо-гейдж + инфо — */
.cab-hero { display: flex; align-items: center; gap: 16px; }
.status-ring { position: relative; width: 104px; height: 104px; flex: 0 0 auto; }
.status-ring svg { width: 100%; height: 100%; display: block; }
.status-ring .ring-track { fill: none; stroke: rgba(255,255,255,0.08); stroke-width: 7; }
.status-ring .ring-prog { fill: none; stroke-width: 7; stroke-linecap: round;
  filter: drop-shadow(0 0 5px var(--ring-glow, rgba(214,184,108,.5))); }
.status-ring.tone-gold  { --ring-glow: rgba(214,184,108,.5); }
.status-ring.tone-gold  .ring-prog { stroke: var(--gold-2); }
.status-ring.tone-amber { --ring-glow: rgba(230,169,63,.5); }
.status-ring.tone-amber .ring-prog { stroke: var(--amber); }
.status-ring.tone-red   { --ring-glow: rgba(231,91,80,.5); }
.status-ring.tone-red   .ring-prog { stroke: var(--red); }
.ring-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ring-num { font-size: 30px; font-weight: 800; line-height: 1; color: var(--text); letter-spacing: -1px; }
.ring-cap { font-size: 10px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--text-3); margin-top: 3px; }
.status-ring.tone-red .ring-num { color: var(--red); }
.status-ring.tone-amber .ring-num { color: var(--amber); }
.ring-inf { color: var(--gold-2); display: flex; }
.ring-inf svg { width: 36px; height: 36px; filter: drop-shadow(0 0 8px var(--gold-glow)); }

.cab-hero-info { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 9px; }
.cab-hero-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; row-gap: 6px; }
.cab-hero-top .badge { flex: 0 0 auto; }
.cab-tariff { display: inline-flex; align-items: center; gap: 7px; font-size: 16px; font-weight: 800; color: var(--text); min-width: 0; }
.cab-tariff svg { width: 17px; height: 17px; color: var(--gold-2); flex: 0 0 auto; }
.cab-hero-until { font-size: 12.5px; font-weight: 600; }
.cab-unlim { display: inline-flex; align-items: center; gap: 6px; color: var(--gold-3); }
.cab-unlim svg { color: var(--gold-2); }
.cab-hero-traffic { margin-top: 1px; }
.cab-hero-dev { align-self: flex-start; }

/* — Свайп «Ладья через Стикс» (slide-to-confirm), «живой»: сияние-свип по треку,
     бегущие шевроны, дыхание монеты, armed-подсветка у порога — */
.swipe-wrap { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); }
.swipe-track {
  position: relative; height: 52px; border-radius: 999px; overflow: hidden;
  background: var(--surface-2); border: 1px solid var(--border);
  box-shadow: inset 0 1px 3px rgba(0,0,0,.35);
  touch-action: none; user-select: none; -webkit-user-select: none; cursor: pointer;
  transition: border-color .18s var(--ease-out), box-shadow .18s var(--ease-out);
}
/* сияние-свип по треку (Emil-shimmer) */
.swipe-track::after {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none; border-radius: inherit;
  background: linear-gradient(100deg, transparent 35%, rgba(255,236,194,.10) 50%, transparent 65%);
  transform: translateX(-100%);
  animation: swipeSheen 2.9s ease-in-out infinite;
}
.swipe-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; z-index: 0;
  background: linear-gradient(90deg, rgba(214,184,108,.10), rgba(214,184,108,.26)); }
.swipe-label { position: absolute; left: 58px; right: 44px; z-index: 2; text-align: center;
  font-size: 12px; font-weight: 600; color: var(--text-3); letter-spacing: .2px; pointer-events: none; }
/* бегущие шевроны — «тяни сюда» */
.swipe-arrows { position: absolute; right: 15px; top: 0; bottom: 0; z-index: 2;
  display: flex; align-items: center; gap: 3px; pointer-events: none; }
.swipe-arrows i { width: 7px; height: 7px; transform: rotate(45deg); opacity: .22;
  border-top: 2px solid var(--gold-3); border-right: 2px solid var(--gold-3);
  animation: chevFlow 1.5s var(--ease-in-out) infinite; }
.swipe-arrows i:nth-child(2) { animation-delay: .18s; }
.swipe-arrows i:nth-child(3) { animation-delay: .36s; }
@keyframes chevFlow { 0%, 65%, 100% { opacity: .2; } 32% { opacity: .95; } }
.swipe-thumb {
  position: absolute; left: 3px; top: 3px; z-index: 3;
  width: 46px; height: 46px; border-radius: 50%; border: none; cursor: grab;
  display: flex; align-items: center; justify-content: center; color: #5a4117; touch-action: none;
  background: radial-gradient(circle at 38% 30%, #f6e6b0 0%, #d8b65f 34%, #9a7531 72%, #6f5220 100%);
  box-shadow: inset 0 1px 1px rgba(255,245,210,.7), inset 0 -2px 3px rgba(60,40,10,.55), 0 2px 7px rgba(0,0,0,.5), 0 0 0 0 rgba(214,184,108,0);
  transition: box-shadow .18s var(--ease-out);
  animation: obolSheen 3.4s ease-in-out infinite;   /* дыхание монеты (filter, не мешает drag-transform) */
}
.swipe-thumb:active { cursor: grabbing;
  box-shadow: inset 0 1px 1px rgba(255,245,210,.8), 0 0 0 5px rgba(214,184,108,.22), 0 4px 12px rgba(0,0,0,.5); }
.swipe-thumb .obol-glyph { width: 22px; height: 22px; filter: drop-shadow(0 1px 0 rgba(255,243,205,.5)); }
/* у порога (>0.9): трек «взводится» золотом — «отпускай» */
.swipe-track.swipe-armed { border-color: var(--gold-3);
  box-shadow: inset 0 1px 3px rgba(0,0,0,.35), inset 0 0 0 1px var(--gold-glow), 0 0 16px -4px var(--gold-glow); }
.swipe-track.swipe-armed .swipe-label, .swipe-track.swipe-armed .swipe-arrows { opacity: 0; }
.swipe-track.swipe-cross { animation: swipeFlash .32s var(--ease-out) forwards; }
@keyframes swipeSheen { 0% { transform: translateX(-100%); } 55%, 100% { transform: translateX(100%); } }
@keyframes swipeFlash { from { box-shadow: inset 0 0 0 rgba(214,184,108,0); } to { box-shadow: inset 0 0 48px rgba(214,184,108,.7); } }
.swipe-cap { text-align: center; font-family: var(--serif); font-style: italic; font-size: 11px; color: var(--gold-3); opacity: .6; margin-top: 8px; letter-spacing: .5px; }

/* — тактильность: Emil-easing на всех интерактивах (folds пункт 3 бэклога) — */
.copybtn { transition: transform .12s var(--ease-out), color .15s var(--ease-out), border-color .15s var(--ease-out); }
.copybtn:active { transform: scale(.94); }
.copybtn.done { animation: admPopIn .34s var(--ease-out); }
.chip { transition: transform .12s var(--ease-out); }
.btn:active, .mainbtn:active, .tariff:active, .minibtn:active, .tab:active, .iconbtn:active { transition: transform .12s var(--ease-out); }

/* — Онбординг: аура за вордмарком — */
.hero { position: relative; }
.hero .mark, .hero .rule, .hero .slogan { position: relative; z-index: 1; }
.hero::before {
  content: ""; position: absolute; left: 50%; top: 38%; transform: translate(-50%, -50%);
  width: 240px; height: 150px; pointer-events: none; z-index: 0;
  background: radial-gradient(closest-side, rgba(214,184,108,.15), transparent 72%);
}

/* — reduced-motion: убираем движение, оставляем opacity (a11y) — */
@keyframes obFade { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .cab-enter, .ob-enter { animation: obFade .3s ease both; animation-delay: 0s; }
  .swipe-track::after, .swipe-arrows i, .swipe-thumb { animation: none; }
  .swipe-arrows i { opacity: .5; }
  .status-ring .ring-prog { transition: none !important; }
}

/* ============================================================
   APPLE GLASS LAYER · v27
   Отдельным слоем в конце файла: откат = удаление этого блока,
   существующие правила не тронуты.

   Принцип: стекло видно ТОЛЬКО если под ним есть что размывать.
   Поэтому сначала атмосфера (мягкие световые пятна), потом
   полупрозрачные поверхности поверх неё.
   ============================================================ */

/* --- 1. Атмосфера под стеклом --------------------------------- */
.app-root { position: relative; isolation: isolate; }
.app-root::before {
  content: '';
  position: fixed; inset: -20% -10% auto -10%; height: 62vh;
  z-index: -1; pointer-events: none;
  background:
    radial-gradient(58% 46% at 22% 8%,  rgba(214,184,108,0.10) 0%, transparent 68%),
    radial-gradient(50% 40% at 88% 2%,  rgba(120,150,255,0.055) 0%, transparent 70%);
  filter: blur(4px);
}
.app-root::after {
  content: '';
  position: fixed; inset: auto -10% -18% -10%; height: 46vh;
  z-index: -1; pointer-events: none;
  background: radial-gradient(60% 60% at 50% 100%, rgba(169,139,240,0.05) 0%, transparent 72%);
}

/* --- 2. Стеклянные поверхности -------------------------------- */
/* Только крупные панели: backdrop-filter дорогой, на мелочи (chip/badge)
   он съел бы плавность скролла на слабых Android. */
.card {
  background: linear-gradient(180deg, rgba(30,31,39,0.72) 0%, rgba(20,20,26,0.66) 100%);
  -webkit-backdrop-filter: blur(22px) saturate(165%);
  backdrop-filter: blur(22px) saturate(165%);
  border: 1px solid rgba(255,255,255,0.085);
  border-radius: 22px;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.07),          /* блик по верхней кромке */
    inset 0 -1px 0 rgba(0,0,0,0.22),
    0 1px 2px rgba(0,0,0,0.28),
    0 12px 32px -16px rgba(0,0,0,0.55);
}
.card.gold {
  border-color: rgba(214,184,108,0.24);
  box-shadow:
    inset 0 1px 0 rgba(255,236,194,0.10),
    0 1px 2px rgba(0,0,0,0.28),
    0 14px 38px -18px rgba(214,184,108,0.20);
}
.tabbar {
  background: rgba(18,19,25,0.62);
  -webkit-backdrop-filter: blur(26px) saturate(180%);
  backdrop-filter: blur(26px) saturate(180%);
  border: 1px solid rgba(255,255,255,0.09);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06), 0 -6px 24px -12px rgba(0,0,0,0.6);
}
.dock {
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  backdrop-filter: blur(20px) saturate(150%);
}

/* --- 3. Типографика в духе SF Pro ------------------------------ */
/* Apple поджимает трекинг тем сильнее, чем крупнее кегль. */
.card-head .htitle { letter-spacing: -0.01em; }
.section-h        { letter-spacing: -0.01em; }
.slogan           { letter-spacing: -0.015em; }
.tariff-price .amt, .ring-num, .rowValue {
  letter-spacing: -0.025em;
  font-variant-numeric: tabular-nums;   /* цифры не «прыгают» при обновлении */
}
.nname, .ft { letter-spacing: -0.008em; }

/* --- 4. Микро-отклик ------------------------------------------- */
/* Нажатие «проминает» элемент — как в iOS. Кривая уже есть в теме. */
.node:active,
.tariff.pickable:active { transform: scale(0.985); }
.node, .tariff.pickable {
  transition: transform .22s var(--ease-out), border-color .22s var(--ease-out);
}
.copybtn:active { transform: scale(0.92); }
.copybtn { transition: transform .18s var(--ease-out), background .18s var(--ease-out); }

/* --- 5. Фолбэк ------------------------------------------------- */
/* Где backdrop-filter не поддержан — поверхности становятся плотными,
   иначе текст поплывёт по фону и потеряет читаемость. */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .card   { background: linear-gradient(180deg, #1b1c24 0%, #141419 100%); }
  .tabbar { background: rgba(18,19,25,0.96); }
}
/* Экономия батареи/движения: пользователь просил меньше эффектов — убираем блюр. */
@media (prefers-reduced-transparency: reduce) {
  .card, .tabbar, .dock { -webkit-backdrop-filter: none; backdrop-filter: none; }
  .card   { background: linear-gradient(180deg, #1b1c24 0%, #141419 100%); }
  .tabbar { background: rgba(18,19,25,0.96); }
}

/* ============================================================
   ВЫБОР ТАРИФА: тип переключателем, срок карточками
   Тип — вторичный выбор, поэтому компактный сегментированный контрол.
   Срок — главный, поэтому крупные карточки: и конверсия выше, и попасть
   пальцем проще (весь заход затеян ради пожилых клиентов).
   ============================================================ */

.segbar {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
}
.segbtn {
  flex: 1;
  appearance: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px 8px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text-2);
  font-family: var(--sans);
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: -0.01em;
  transition: background .18s var(--ease-out), color .18s var(--ease-out),
              box-shadow .18s var(--ease-out), transform .12s var(--ease-out);
}
.segbtn .ic { width: 15px; height: 15px; flex: 0 0 auto; }
.segbtn.on {
  background: var(--gold-soft);
  color: var(--gold-2);
  box-shadow: inset 0 0 0 1px var(--border-gold);
}
.segbtn:active { transform: scale(.97); }

.seg-note {
  margin: 9px 4px 0;
  font-size: 12px;
  color: var(--text-3);
  text-align: center;
}

/* — Карточки срока — */
.plans { display: flex; flex-direction: column; gap: 10px; }

.plan {
  position: relative;
  width: 100%;
  appearance: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  background: linear-gradient(180deg, var(--surface) 0%, #121319 100%);
  border: 1.5px solid var(--border);
  border-radius: 16px;
  padding: 14px 16px;
  font-family: var(--sans);
  transition: border-color .18s var(--ease-out), box-shadow .2s var(--ease-out),
              background .2s var(--ease-out), transform .12s var(--ease-out);
}
.plan:active { transform: scale(.985); }
.plan.selected {
  border-color: var(--gold-3);
  box-shadow: 0 0 0 1px var(--gold-3), 0 10px 34px -16px var(--gold-glow);
  background: linear-gradient(180deg, #1c1a16 0%, #14130f 100%);
}

.plan-radio {
  flex: 0 0 auto;
  width: 20px; height: 20px;
  border-radius: 50%;
  border: 2px solid var(--border-2);
  transition: border-color .18s var(--ease-out), box-shadow .18s var(--ease-out);
}
.plan.selected .plan-radio {
  border-color: var(--gold-3);
  box-shadow: inset 0 0 0 4px var(--gold-3);
}

.plan-main { flex: 1; min-width: 0; }
.plan-period {
  font-size: 15.5px; font-weight: 800; color: var(--text);
  letter-spacing: -0.015em;
}
.plan-per { font-size: 12px; color: var(--text-3); margin-top: 2px; }

.plan-right {
  display: flex; flex-direction: column; align-items: flex-end; gap: 5px;
  flex: 0 0 auto;
}
.plan-price {
  font-size: 17px; font-weight: 800; color: var(--text);
  letter-spacing: -0.025em;
  font-variant-numeric: tabular-nums;   /* цифры не «прыгают» при переключении */
}
.plan.selected .plan-price {
  background: var(--gold-grad);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* Бейдж выгоды. Пилюля, а не текст: должна читаться как ярлык со скидкой. */
.save {
  font-size: 10.5px; font-weight: 800; letter-spacing: .01em;
  color: var(--gold-2);
  background: var(--gold-soft);
  border: 1px solid var(--border-gold);
  border-radius: 999px;
  padding: 3px 8px;
  white-space: nowrap;
}

/* — Разбор выгоды в сводке заказа — */
.summary .sval.strike {
  text-decoration: line-through;
  text-decoration-color: var(--text-3);
  color: var(--text-3);
  font-weight: 600;
}
.summary .sval.save-val { color: var(--gold-2); }

/* Уважаем системную настройку «меньше движения»: убираем масштаб при нажатии,
   оставляя изменение цвета — отклик сохраняется, тряски нет. */
@media (prefers-reduced-motion: reduce) {
  .segbtn:active, .plan:active { transform: none; }
  .segbtn, .plan, .plan-radio { transition-duration: .01ms; }
}
