.font-century{font-family:'Century Gothic','CenturyGothic','CentryGotic',Arial,sans-serif;font-weight:700}
:root{
  --bg:#070b11;
  --bg-soft:#0d141d;
  --surface:rgba(13,20,29,.72);
  --surface-strong:rgba(18,27,38,.88);
  --line:rgba(255,255,255,.09);
  --line-strong:rgba(255,255,255,.16);
  --muted:#94a3b8;
  --text:#edf5ff;
  --accent-color:#22c55e;
  --accent-2:#14b8a6;
  --accent-3:#2dd4bf;
  --danger:#fb7185;
  --success:#4ade80;
  --shadow:0 24px 70px rgba(0,0,0,.42);
  --accent-glow:rgba(34,197,94,.26);
  --accent-grad:linear-gradient(135deg,#22c55e 0%,#14b8a6 100%);
  --mobile-nav-height: 72px;
}
*{box-sizing:border-box}
html,body{min-height:100%}
body{
  margin:0;
  font-family:'Century Gothic','CenturyGothic','CentryGotic',Arial,sans-serif;
  font-weight:700;
  color:var(--text);
  background:
    linear-gradient(140deg,rgba(34,197,94,.16),transparent 34%),
    linear-gradient(225deg,rgba(20,184,166,.14),transparent 38%),
    linear-gradient(180deg,#070b11 0%,#0d141d 58%,#081017 100%);
  -webkit-font-smoothing:antialiased;
  overflow-x:hidden;
}
body::before{
  content:"";
  position:fixed;
  inset:0;
  pointer-events:none;
  background:
    linear-gradient(rgba(255,255,255,.025) 1px,transparent 1px),
    linear-gradient(90deg,rgba(255,255,255,.025) 1px,transparent 1px);
  background-size:48px 48px;
  mask-image:linear-gradient(180deg,rgba(0,0,0,.72),transparent 82%);
}
body.modal-open{overflow:hidden}
a{color:inherit}
.app{position:relative;z-index:1;display:flex;min-height:100vh}
.sidebar{
  position:sticky;
  top:0;
  width:268px;
  height:100vh;
  padding:24px 18px;
  display:flex;
  flex-direction:column;
  gap:22px;
  background:rgba(7,11,17,.62);
  border-right:1px solid var(--line);
  backdrop-filter:blur(22px);
  box-shadow:18px 0 60px rgba(0,0,0,.18);
}
.logo-row{display:flex;align-items:center;gap:12px}
.logo-mark{
  width:46px;
  height:46px;
  border-radius:8px;
  display:flex;
  align-items:center;
  justify-content:center;
  color:#04110a;
  font-weight:800;
  background:var(--accent-grad);
  box-shadow:0 14px 38px var(--accent-glow);
}
.brand{font-size:18px;font-weight:800;letter-spacing:0}
.nav{display:flex;flex-direction:column;gap:8px;margin-top:6px}
.nav-item{
  position:relative;
  color:var(--muted);
  text-decoration:none;
  padding:11px 12px;
  border-radius:8px;
  display:flex;
  align-items:center;
  gap:10px;
  border:1px solid transparent;
  transition:color .22s ease,background .22s ease,border-color .22s ease,transform .22s ease;
}

.nav-icon{width:22px;height:22px;flex-shrink:0;display:inline-block}
.btn-icon{width:18px;height:18px;flex-shrink:0;margin-right:8px;display:inline-block}
  .username-check{width:40px;height:40px;flex-shrink:0;margin-left:8px;display:inline-block;vertical-align:middle}
  .balance-icon{width:20px;height:20px;flex-shrink:0;margin-right:8px;display:inline-block;vertical-align:middle}
.nav-item:hover{
  color:var(--text);
  background:rgba(255,255,255,.055);
  border-color:var(--line);
  transform:translateX(3px);
}
.user-box{
  margin-top:auto;
  padding:12px;
  border-radius:8px;
  background:rgba(255,255,255,.045);
  border:1px solid var(--line);
  backdrop-filter:blur(18px);
}
.avatar{
  width:44px;
  height:44px;
  border-radius:8px;
  background:linear-gradient(180deg,rgba(255,255,255,.12),rgba(255,255,255,.04));
  display:flex;
  align-items:center;
  justify-content:center;
  color:var(--success);
  box-shadow:inset 0 0 0 1px var(--line);
}
.user-name{font-size:13px;color:var(--text)}
.ref-balance{font-size:12px;color:var(--muted);margin-top:3px}
.content{flex:1;padding:24px 34px 42px}
.topbar{
  position:sticky;
  top:0;
  z-index:4;
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:16px;
  margin:-8px -10px 22px;
  padding:10px;
  border-radius:8px;
  background:transparent;
  border:1px solid transparent;
  backdrop-filter:none;
}
.top-left{font-size:18px;color:var(--text)}
.top-right{display:flex;align-items:center;gap:10px;flex-wrap:wrap;justify-content:flex-end}
.container{max-width:1120px;margin:0 auto}
.dashboard{display:grid;gap:24px}
.hero-card{
  display:flex;
  flex-wrap:wrap;
  justify-content:space-between;
  align-items:stretch;
  gap:22px;
  padding:30px;
  border-radius:8px;
  background:
    linear-gradient(135deg,rgba(255,255,255,.115),rgba(255,255,255,.035)),
    linear-gradient(120deg,rgba(34,197,94,.18),rgba(20,184,166,.1) 58%,rgba(45,212,191,.08));
  border:1px solid var(--line-strong);
  box-shadow:var(--shadow);
  backdrop-filter:blur(22px);
  overflow:hidden;
}
.hero-left{min-width:260px;flex:1}
.welcome,.eyebrow{
  display:inline-flex;
  align-items:center;
  gap:6px;
  font-size:12px;
  color:#a7f3d0;
  text-transform:uppercase;
  letter-spacing:0;
}
.username{margin:8px 0 10px;font-size:34px;line-height:1.08;letter-spacing:0}
.desc{color:var(--muted);max-width:62ch;line-height:1.55;margin:0;font-weight:500}
.hero-actions{margin-top:18px;display:flex;gap:10px;flex-wrap:wrap}
.hero-actions .hero-main{flex:1 1 auto;min-width:0}
.hero-actions .hero-secondary{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.hero-actions .hero-shortcuts-row{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.hero-actions .btn-sm{min-height:42px;padding:10px 12px;border-radius:999px;font-size:13px}

/* Product card action buttons: make 'Подробнее' and 'Купить' equal width and aligned */
.product-card .actions-group{display:flex;gap:8px;align-items:center;margin-top:8px}
.product-card .actions-group .btn{flex:1 1 0;min-width:0;display:inline-flex;justify-content:center}
.product-card .actions-group .btn .btn-icon{margin-right:8px}

/* Ensure product-actions container places price above action buttons and stretches actions */
.product-actions{display:flex;flex-direction:column;align-items:stretch;gap:12px;margin-top:auto}

/* Keep equal buttons on narrow screens while stacking vertically if needed */
@media (max-width:760px){
  .product-card .actions-group{gap:8px}
  .product-card .actions-group .btn{min-height:44px}
  .product-actions{flex-direction:column;align-items:stretch}
  .product-actions .price{order:1}
  .product-actions .actions-group{order:2}
}

/* Mobile: ensure product cards are single-column and buttons are full-width and centered */
@media (max-width:480px){
  .products{grid-template-columns:1fr}
  .product-card{padding:14px}
  .product-card .product-top{gap:10px}
  .product-actions{align-items:stretch;gap:10px}
  .product-actions .price{order:1;margin:0 auto;text-align:center}
  .product-actions .actions-group{order:2;flex-direction:column;align-items:stretch;justify-content:center}
  .product-card .actions-group .btn{flex:none;width:100%;display:inline-flex;justify-content:center;min-height:48px}

  /* Make auth forms fit small screens better */
  .auth-card{max-width:96%;width:100%;padding:18px;margin:6vh 12px;min-height:auto}
  .auth-card input[type="email"], .auth-card input[type="password"], .auth-card input[type="text"], .auth-card input[type="tel"]{ text-align:center; border-radius:12px }
  .btn-login{ border-radius:12px; padding:12px 14px }
}

.inline-form{display:inline-flex;margin:0}
.hero-right{display:grid;grid-template-columns:repeat(2,minmax(132px,1fr));gap:12px;align-content:stretch}
.stat{
  min-width:132px;
  padding:14px 16px;
  border-radius:8px;
  text-align:right;
  background:rgba(7,11,17,.38);
  border:1px solid var(--line);
}
.stat .label{color:var(--muted);font-size:12px}
.stat .num{font-size:19px;margin-top:6px}
.balance{font-size:22px;font-weight:800}
.btn{
  position:relative;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  min-height:42px;
  padding:10px 17px;
  border:0;
  border-radius:999px;
  color:#03120b;
  text-decoration:none;
  font:inherit;
  font-size:14px;
  cursor:pointer;
  background:var(--accent-grad);
  background-size:180% 180%;
  box-shadow:0 12px 34px var(--accent-glow);
  transition:transform .2s ease,box-shadow .2s ease,background-position .35s ease,color .2s ease;
}
.btn:hover{
  transform:translateY(-3px);
  background-position:100% 50%;
  box-shadow:0 18px 42px rgba(20,184,166,.26);
}
.btn:active{transform:translateY(-1px) scale(.98)}
.btn:disabled{opacity:.55;cursor:not-allowed;transform:none;box-shadow:none}
.btn.ghost{
  color:var(--text);
  background:rgba(255,255,255,.055);
  border:1px solid var(--line);
  box-shadow:none;
}
.btn.ghost:hover{background:rgba(255,255,255,.09);box-shadow:0 14px 34px rgba(0,0,0,.18)}
.topup-mini{min-height:36px;padding:8px 14px;font-size:13px}
.section-title{margin:2px 0 -8px;font-size:19px}
.products{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px}
.product-card,.card,.auth-card,.topup-shell{
  border-radius:8px;
  background:var(--surface);
  border:1px solid var(--line);
  box-shadow:0 18px 52px rgba(0,0,0,.24);
  backdrop-filter:blur(20px);
}
.product-card{
  padding:18px;
  display:flex;
  flex-direction:column;
  gap:14px;
  transition:transform .22s ease,border-color .22s ease,background .22s ease;
}
.product-card:hover{
  transform:translateY(-5px);
  border-color:rgba(34,197,94,.34);
  background:rgba(18,27,38,.82);
}
.product-top{display:flex;align-items:center;gap:12px}
.product-icon{
  width:56px;
  height:56px;
  flex:0 0 56px;
  border-radius:8px;
  background:
    linear-gradient(135deg,rgba(34,197,94,.95),rgba(20,184,166,.85)),
    linear-gradient(180deg,rgba(255,255,255,.18),transparent);
  display:grid;
  place-items:center;
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.2),0 12px 30px rgba(20,184,166,.18);
}
.product-icon img{
  width:52px;
  height:52px;
  object-fit:contain;
  display:block;
}
/* gradient variant used for profile small cards to match hero styling */
.gradient-card{
  background:
    linear-gradient(135deg,rgba(255,255,255,.06),rgba(255,255,255,.02)),
    linear-gradient(120deg,rgba(34,197,94,.12),rgba(20,184,166,.06) 58%,rgba(45,212,191,.05));
  border:1px solid rgba(255,255,255,.06);
  box-shadow:0 12px 34px rgba(0,0,0,.28);
  backdrop-filter:blur(10px);
}
/* Brighter gradient for profile stat cards (ID / BALANCE / PURCHASES). */
.profile-grid .gradient-card{
  background:
    linear-gradient(135deg,rgba(255,255,255,.10),rgba(255,255,255,.03)),
    linear-gradient(120deg,rgba(34,197,94,.36),rgba(20,184,166,.24) 56%,rgba(45,212,191,.20));
  border:1px solid rgba(110,231,183,.42);
  box-shadow:
    0 14px 36px rgba(0,0,0,.26),
    0 0 0 1px rgba(134,239,172,.18) inset,
    0 0 30px rgba(20,184,166,.18);
}
.product-title{font-weight:800}
.product-desc{color:var(--muted);font-size:13px;line-height:1.45}
.product-actions{display:flex;align-items:center;gap:10px;margin-top:auto;flex-wrap:wrap}
.price{font-size:16px;color:var(--text);margin-right:auto;display:grid;gap:2px}
.price span{font-size:12px;color:#99f6e4}
.pill,.mini-pill{
  display:inline-flex;
  align-items:center;
  min-height:32px;
  padding:7px 11px;
  border-radius:999px;
  color:var(--text);
  background:rgba(255,255,255,.055);
  border:1px solid var(--line);
  font-size:13px;
}
.mini-pill{font-size:12px;color:#a7f3d0}
.auth-card{
  max-width:460px;
  padding:24px;
}
.auth-card h2,.topup-intro h2,.modal-head h2{margin:8px 0 10px;line-height:1.15}
.auth-card form{display:grid;gap:12px}
label,.input-label{color:var(--muted);font-size:13px}
input[type=text],input[type=password],input[type=email],input[type=number]{
  width:100%;
  min-height:46px;
  padding:12px 14px;
  border-radius:8px;
  border:1px solid var(--line);
  background:rgba(255,255,255,.045);
  color:var(--text);
  font:inherit;
  outline:none;
  transition:border-color .2s ease,box-shadow .2s ease,background .2s ease;
}
input:focus{
  border-color:rgba(34,197,94,.62);
  background:rgba(255,255,255,.07);
  box-shadow:0 0 0 4px rgba(34,197,94,.1);
}
.profile-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px}
.card{padding:18px}
.card.small{min-height:110px;display:flex;flex-direction:column;justify-content:center;text-align:center}
.card.full{grid-column:1/-1}
/* Empty state actions (configs page) — stack trial/choose buttons vertically, full width */
.card.empty-state .empty-actions{display:flex;flex-direction:column;gap:12px}
.card.empty-state .empty-actions form{width:100%;margin:0}
.card.empty-state .empty-actions .btn{width:100%;display:inline-flex;justify-content:center;min-height:48px}
.card.empty-state .empty-actions .btn .btn-icon{margin-right:8px}
.card.empty-state .empty-actions .btn.full-block{padding-left:12px;padding-right:12px}
.traffic-list{list-style:none;padding:0;margin:0}
.traffic-list li{display:flex;justify-content:space-between;padding:10px 0;border-top:1px solid var(--line)}
.flashes{list-style:none;padding:0;margin:8px 0 18px}
.flash{padding:12px 14px;border-radius:8px;margin-bottom:8px;border:1px solid var(--line);background:rgba(255,255,255,.055)}
.flash.success{background:rgba(74,222,128,.1);border-color:rgba(74,222,128,.2)}
.flash.danger{background:rgba(251,113,133,.1);border-color:rgba(251,113,133,.22)}
.flash.warning{background:rgba(245,158,11,.1);border-color:rgba(245,158,11,.22)}
.flash.info{background:rgba(20,184,166,.1);border-color:rgba(20,184,166,.22)}
.ref-box{
  display:flex;
  gap:12px;
  align-items:center;
  padding:12px;
  border-radius:8px;
  background:linear-gradient(90deg,rgba(34,197,94,.12),rgba(20,184,166,.055));
  border:1px solid var(--line);
}
.ref-input{flex:1}
.telegram-form{display:grid;grid-template-columns:1fr auto;gap:10px;align-items:end;margin:14px 0}
.telegram-form label{grid-column:1/-1}
.copy-btn{
  min-height:40px;
  border-radius:999px;
  padding:8px 13px;
  color:var(--text);
  background:rgba(255,255,255,.06);
  border:1px solid var(--line);
  font:inherit;
  cursor:pointer;
  transition:transform .2s ease,background .2s ease,border-color .2s ease;
}

/* Make referral input match site theme (transparent over gradient) */
.ref-box .ref-input{
  background: transparent !important;
  border: none !important;
  color: var(--text) !important;
  padding: 10px 12px !important;
  min-height: 40px !important;
  border-radius: 6px !important;
  box-shadow: none !important;
  font: inherit !important;
}
.ref-box .ref-input[readonly]{
  cursor: text;
}
.ref-box .ref-input::selection{ background: rgba(34,197,94,.12); color:var(--text); }
.ref-box .copy-btn{ background: rgba(255,255,255,.03); border:1px solid rgba(255,255,255,.04); color:var(--text); }
.copy-btn:hover{transform:translateY(-2px);background:rgba(255,255,255,.1);border-color:var(--line-strong)}
.topup-page{display:grid;gap:18px;max-width:860px}
.topup-intro{
  padding:26px;
  border-radius:8px;
  background:linear-gradient(135deg,rgba(34,197,94,.14),rgba(20,184,166,.08),rgba(255,255,255,.04));
  border:1px solid var(--line);
  backdrop-filter:blur(18px);
}
.topup-intro p,.modal-head p{margin:0;color:var(--muted);line-height:1.55}
.topup-shell{padding:18px}
.topup-form{display:grid;grid-template-columns:minmax(0,1fr) minmax(280px,.9fr);gap:16px}
.amount-panel,.methods-panel{
  padding:16px;
  border-radius:8px;
  background:rgba(255,255,255,.04);
  border:1px solid var(--line);
}
.field-head{display:flex;justify-content:space-between;align-items:flex-start;gap:14px;margin-bottom:14px}
.field-head.compact{margin-bottom:12px}
.field-head h3{margin:5px 0 0;font-size:18px}
.amount-chips{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;margin-bottom:14px}
.amount-chip{
  min-height:42px;
  border:1px solid var(--line);
  border-radius:8px;
  color:var(--text);
  background:rgba(255,255,255,.055);
  font:inherit;
  cursor:pointer;
  transition:transform .18s ease,border-color .18s ease,background .18s ease,color .18s ease;
}
.amount-chip:hover{transform:translateY(-2px);border-color:rgba(34,197,94,.42);background:rgba(34,197,94,.1)}
.amount-chip.is-active{
  color:#03120b;
  background:var(--accent-grad);
  border-color:transparent;
}
.amount-input-wrap{position:relative;margin-top:8px}
.amount-input-wrap input{padding-right:42px}
.amount-input-wrap span{position:absolute;right:15px;top:50%;transform:translateY(-50%);color:#a7f3d0}
.currency-hint{margin-top:10px;color:#99f6e4;font-size:13px}
.payment-methods{display:grid;gap:9px}
.payment-card{
  position:relative;
  min-height:70px;
  display:grid;
  grid-template-columns:22px 1fr;
  align-items:center;
  gap:12px;
  padding:12px;
  border-radius:8px;
  border:1px solid var(--line);
  background:rgba(255,255,255,.045);
  cursor:pointer;
  transition:transform .18s ease,border-color .18s ease,background .18s ease,box-shadow .18s ease;
}
.payment-card:hover{transform:translateY(-2px);border-color:rgba(20,184,166,.38);background:rgba(255,255,255,.065)}
.payment-card input{position:absolute;opacity:0;pointer-events:none}
.payment-card:has(input:checked){
  border-color:rgba(34,197,94,.58);
  background:linear-gradient(135deg,rgba(34,197,94,.16),rgba(20,184,166,.08));
  box-shadow:0 12px 32px rgba(34,197,94,.12);
}
.payment-check{
  width:20px;
  height:20px;
  border-radius:50%;
  border:2px solid rgba(255,255,255,.22);
  box-shadow:inset 0 0 0 4px rgba(7,11,17,.9);
  background:transparent;
}
.payment-card:has(input:checked) .payment-check{background:var(--accent-color);border-color:#a7f3d0}
.payment-copy{display:grid;gap:3px}
.payment-copy strong{font-size:14px}
.payment-copy small{color:var(--muted);font-size:12px;line-height:1.35}
.payment-card.is-disabled{
  cursor:not-allowed;
  opacity:.48;
  filter:saturate(.45);
}
.payment-card.is-disabled:hover{transform:none;border-color:var(--line);background:rgba(255,255,255,.045)}
.topup-submit{grid-column:1/-1;width:100%;min-height:48px}
.topup-modal{
  position:fixed;
  inset:0;
  z-index:20;
  display:grid;
  place-items:center;
  padding:20px;
  opacity:0;
  pointer-events:none;
  transition:opacity .22s ease;
}
.topup-modal[aria-hidden="false"]{opacity:1;pointer-events:auto}
.topup-modal__backdrop{
  position:absolute;
  inset:0;
  background:rgba(2,6,11,.62);
  backdrop-filter:blur(16px);
}
.topup-modal__panel{
  position:relative;
  width:min(900px,100%);
  max-height:min(92vh,820px);
  overflow:auto;
  padding:24px;
  border-radius:8px;
  background:linear-gradient(145deg,rgba(18,27,38,.92),rgba(7,11,17,.88));
  border:1px solid var(--line-strong);
  box-shadow:0 34px 100px rgba(0,0,0,.55);
  backdrop-filter:blur(24px);
  transform:translateY(18px) scale(.98);
  transition:transform .24s ease;
}
.topup-modal[aria-hidden="false"] .topup-modal__panel{transform:translateY(0) scale(1)}
.modal-close{
  position:absolute;
  top:14px;
  right:14px;
  width:38px;
  height:38px;
  border:1px solid var(--line);
  border-radius:50%;
  color:var(--text);
  background:rgba(255,255,255,.06);
  font-size:24px;
  line-height:1;
  cursor:pointer;
  transition:transform .18s ease,background .18s ease;
}
.modal-close:hover{transform:rotate(90deg);background:rgba(255,255,255,.12)}
.modal-head{padding-right:48px;margin-bottom:18px}
.modal-head h2{font-size:28px}
.empty{padding:18px;color:var(--muted);border:1px solid var(--line);border-radius:8px;background:rgba(255,255,255,.04)}
.history-list{list-style:none;margin:0;padding:0;display:grid;gap:10px}
.history-list li{padding:12px;border-radius:8px;background:rgba(255,255,255,.045);border:1px solid var(--line)}
.history-list span{display:block;margin-top:5px;color:var(--muted);font-size:13px;word-break:break-all}
.config-layout,.referral-layout,.support-layout{display:grid;gap:18px}
.config-textarea{
  width:100%;
  min-height:150px;
  resize:vertical;
  margin:8px 0 12px;
  padding:14px;
  border-radius:8px;
  border:1px solid var(--line);
  background:rgba(0,0,0,.22);
  color:var(--text);
  font:700 13px/1.5 'Century Gothic','CenturyGothic','CentryGotic',Arial,sans-serif;
}
.empty-state{display:flex;gap:10px;flex-wrap:wrap;align-items:center}
.empty-actions{display:flex;gap:12px;justify-content:center;align-items:center;flex-wrap:wrap;width:100%}
.instruction-list{margin:0;padding-left:20px;color:var(--text);line-height:1.65}
.instruction-list li::marker{color:#2dd4bf}
.support-card p{color:var(--muted)}

@media (max-width:1000px){
  .products{grid-template-columns:repeat(2,minmax(0,1fr))}
  .profile-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .topup-form{grid-template-columns:1fr}
}
@media (max-width:760px){
  .app{display:block}
  .sidebar{display:none}
  /* Make the topup modal panel as wide as possible on phones */
  .topup-modal__panel{
    width:calc(100% - 4px) !important;
    max-width:none !important;
    margin:2px auto !important;
    border-radius:12px !important;
    box-sizing:border-box;
    padding:16px !important;
  }
  .content{padding:16px}
  .topbar{position:relative;margin:0 0 16px;align-items:flex-start;flex-direction:column}
  /* Hide page title in the top-left on phones */
  .top-left{display:none}
  .top-right{justify-content:flex-start}
  .products,.profile-grid{grid-template-columns:1fr}
  .hero-card{padding:22px}
  .hero-right{grid-template-columns:1fr;width:100%}
  .stat{text-align:left}
  .amount-chips{grid-template-columns:repeat(2,minmax(0,1fr))}
  .topup-modal{padding:4px}
  .topup-modal__panel{padding:18px}
}
@media (max-width:880px){
  /* Stack hero actions vertically on small screens: main button first, secondary buttons below */
  .hero-actions{flex-direction:column;align-items:stretch}
  .hero-actions .hero-main{order:1;width:100%;margin-bottom:10px}
  .hero-actions .hero-secondary{order:2;display:flex;flex-direction:column;gap:8px;width:100%}
  .hero-actions .hero-shortcuts-row{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;width:100%}
  .hero-actions .hero-shortcuts-row .btn{width:100%;min-width:0}
  .hero-actions .hero-secondary > .btn{width:100%}

  /* Hide nav labels in the mobile bottom navigation to show icons only */
  .nav .nav-label{display:none}

  /* Hide support button in top-right on mobile to save space */
  .top-right .support-btn{display:none}

  /* Make stat cards arrange as two columns */
  .hero-right{display:flex;flex-wrap:wrap;gap:8px}
  .stat{flex:1 1 calc(50% - 8px);min-width:0;text-align:left}
}

/* Ensure trial button stretches correctly when placed inside a form */
@media (max-width:880px){
  .hero-trial-form{display:block;width:100%;margin:0;padding:0}
  .hero-trial-form .btn{width:100%;min-height:48px;padding:12px 14px}
}
@media (max-width:460px){
  .username{font-size:28px}
  .product-actions .btn{width:100%}
  .price{width:100%;margin-right:0}
  .ref-box{align-items:stretch;flex-direction:column}
  .telegram-form{grid-template-columns:1fr}
  .copy-btn{width:100%}
}

/* Mobile / app-like adjustments */
@media (max-width:880px){
  .sidebar{
    position:fixed;
    left:0;
    right:0;
    bottom:env(safe-area-inset-bottom, 0px);
    top:auto;
    height:var(--mobile-nav-height);
    width:100%;
    padding:8px 10px calc(8px + env(safe-area-inset-bottom, 0px));
    display:flex;
    flex-direction:row;
    align-items:center;
    justify-content:space-around;
    gap:0;
    border-right:none;
    border-top:1px solid var(--line);
    box-shadow:0 -16px 40px rgba(0,0,0,.36);
    z-index:60;
  }
  .logo-row{display:none}
  .nav{flex-direction:row;align-items:center;gap:6px;margin-top:0;width:100%;justify-content:space-around}
  .nav-item{padding:6px 10px;border-radius:10px;flex-direction:column;gap:6px;font-size:11px;color:var(--muted)}
  .nav-item .nav-icon{width:24px;height:24px;display:block;margin:0}
  .user-box{display:none}
  .content{padding:16px 16px calc(var(--mobile-nav-height) + 28px + env(safe-area-inset-bottom, 0px))}
  .topbar{margin:-8px -10px 12px;padding:8px}
  .top-right{
    display:flex;
    gap:8px;
    align-items:center;
    flex-wrap:wrap;
    justify-content:flex-end;
  }
  .top-right .btn{
    padding:8px 10px;
    min-height:40px;
    font-size:13px;
    border-radius:999px;
    display:inline-flex;
    align-items:center;
    gap:8px;
  }
  .top-right .btn .btn-icon{ width:16px; height:16px; margin-right:6px }
  /* Make top-right buttons span the full phone width in a single row and split evenly */
  .top-right{width:100%;flex-wrap:nowrap;justify-content:space-between}
  .top-right .btn{flex:1 1 0;min-width:0;width:auto;margin:0 6px}
  .top-right .btn:first-child{margin-left:0}
  .top-right .btn:last-child{margin-right:0}
  .hero-card{padding:16px;flex-direction:column;align-items:flex-start}
  .hero-left,.hero-right{width:100%}
  .hero-right{display:flex;flex-wrap:wrap;gap:8px}
  .products{grid-template-columns:1fr}
  .product-card{padding:12px}
  .btn{min-height:50px;padding:12px 16px;width:100%}
  .product-actions{flex-direction:row}
  .topup-modal__panel{width:calc(100% - 24px);margin:10px auto;border-radius:12px}
  .username{font-size:26px}
  .username .username-check{width:34px;height:34px}
  /* Reduce vertical size of small profile/card blocks on mobile */
  .card.small{min-height:72px;padding:12px}
  .card.small .label{font-size:13px}
  .card.small .num{font-size:20px}
  .card.full{padding:12px}
}

@media (max-width:420px){
  .sidebar{height:66px}
  .btn{min-height:48px;padding:10px 12px}
  .nav-item{font-size:10px}
  .username{font-size:24px}
  .username .username-check{width:30px;height:30px}

  /* Make .top-right buttons compact on very narrow phones (do not stretch)
     Keep them inline and small so they don't occupy full width */
  .top-right{gap:6px}
  .top-right .btn{
    flex:0 0 auto;
    min-width:36px;
    width:auto;
    padding:6px 8px;
    font-size:12px;
    white-space:nowrap;
  }
  /* Slightly reduce icon size inside compact buttons */
  .top-right .btn .btn-icon{width:16px;height:16px;margin-right:6px}
}

/* Force tariff buttons inline and equal widths across product cards */
.product-card .product-actions{display:flex;align-items:center;gap:12px;margin-top:auto}
.product-card .product-actions .actions-group{display:flex;gap:8px;align-items:center;width:100%;flex-wrap:nowrap}
.product-card .actions-group .btn{flex:1 1 0;min-width:0;display:inline-flex;justify-content:center;padding-left:12px;padding-right:12px}
@media (max-width:420px){
  .product-card .product-actions{flex-direction:row}
  .product-card .actions-group{gap:6px}
  .product-card .actions-group .btn{padding:10px;font-size:14px}
}

/* Center stat cards label and number on desktop and mobile */
.stat{
  text-align:center;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
}
.stat .label{ text-align:center; }
.stat .num{ text-align:center; margin-top:6px; }

/* Page transition helpers: fade in/out for smoother navigation */
body.is-loading .content,
body.is-loading .container{
  opacity: 0;
  transform: translateY(6px);
}

/* Ensure tariff card action buttons stay in-line on narrow phone screens
   and keep equal widths inside the product card (override broad .btn rules) */
@media (max-width:520px){
  .product-actions .actions-group{flex-direction:row;align-items:center;justify-content:center;gap:8px;flex-wrap:nowrap}
  .product-card .actions-group .btn{flex:1 1 0;min-width:0;width:auto;display:inline-flex;justify-content:center;padding-left:12px;padding-right:12px}
  .product-actions .price{order:1;margin:0 0 6px 0;text-align:center}
}

body.is-navigating .content,
body.is-navigating .container{
  opacity: 0;
  transform: translateY(-6px);
}

.content,
.container{
  transition: opacity .26s cubic-bezier(.2,.9,.2,1), transform .26s cubic-bezier(.2,.9,.2,1);
}
