/* ============================================================
   mobile.css — CoinScanner v1.4.34 — full PWA + 5-tab bottom-nav
   Loaded ONLY ≤ 768px via media-query <link>.
   ============================================================ */

/* =========================================================
   1. TOPBAR — компакт
   ========================================================= */
.topbar{
  display: flex !important; flex-wrap: nowrap !important;
  align-items: center !important; gap: 6px !important;
  padding: 8px 8px !important;
  position: sticky; top: 0; z-index: 100;
  background: var(--bg, #03030e);
  border-bottom: 1px solid var(--border, #1a1a2e);
  overflow: visible !important;
  min-height: 50px !important; max-height: 50px !important;
}
.topbar-logo, .topbar-brand, .tb-brand{
  flex: 0 0 auto !important;
  font-size: 13px !important; white-space: nowrap;
  max-width: 105px; overflow: hidden;
}
.topbar-actions{
  display: flex !important; flex-wrap: nowrap !important;
  align-items: center !important; gap: 6px !important;
  flex: 1 1 auto !important; min-width: 0 !important;
  overflow: visible !important; justify-content: flex-end !important;
}
.access-pill{
  flex: 0 1 auto !important;
  font-size: 0 !important; padding: 6px 10px !important;
  white-space: nowrap !important;
  display: inline-flex !important; align-items: center !important;
  gap: 4px !important; min-width: 0 !important; overflow: hidden !important;
}
.access-pill.trial::before, .access-pill.active::before { content: '⚡'; font-size: 13px; }
.access-pill.pending::before{ content: '📧'; font-size: 13px; }
.access-pill.expired::before{ content: '⚠️'; font-size: 13px; }
.access-pill .timer{
  font-size: 13px !important; font-weight: 700 !important;
  font-family: 'Space Mono', monospace !important; color: inherit !important;
}
/* tb-icon на топе скрыты (живут в bottom-nav) */
.topbar-actions > .btn-secondary.tb-icon{ display: none !important; }
.topbar-actions > .btn-primary{
  flex: 0 0 auto !important; font-size: 12px !important;
  padding: 7px 11px !important; min-height: 36px !important;
  white-space: nowrap !important;
}
/* Logout — SVG иконка двери */
.topbar-actions > .btn-secondary:last-child{
  flex: 0 0 auto !important; font-size: 0 !important; padding: 0 !important;
  width: 36px !important; min-height: 36px !important; height: 36px !important;
  background: rgba(255, 80, 100, 0.10) !important;
  border: 1px solid rgba(255, 80, 100, 0.30) !important;
  border-radius: 10px !important; position: relative !important;
  display: inline-flex !important; align-items: center !important; justify-content: center !important;
}
.topbar-actions > .btn-secondary:last-child::before{
  content: '' !important;
  width: 18px; height: 18px; background-color: #ff7a8a;
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'><path d='M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4'/><polyline points='16 17 21 12 16 7'/><line x1='21' y1='12' x2='9' y2='12'/></svg>") center/contain no-repeat;
          mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'><path d='M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4'/><polyline points='16 17 21 12 16 7'/><line x1='21' y1='12' x2='9' y2='12'/></svg>") center/contain no-repeat;
  display: block;
}

/* =========================================================
   2. BOTTOM-NAV — 5 кнопок (Signals · Friends · Wheel · Guide · More)
   Реализуется через JS-инжект в HTML (см. inline ниже),
   а тут стилизуем .bnav-bar / .bnav-btn.
   ========================================================= */
body::after{
  content: ''; display: block;
  height: calc(env(safe-area-inset-bottom, 0) + 70px);
}

.bnav-bar{
  position: fixed !important;
  bottom: 0 !important; left: 0 !important; right: 0 !important;
  height: calc(env(safe-area-inset-bottom, 0) + 64px) !important;
  background: linear-gradient(180deg, rgba(8,8,20,0.85), rgba(3,3,14,0.99)) !important;
  backdrop-filter: blur(22px) saturate(160%) !important;
  -webkit-backdrop-filter: blur(22px) saturate(160%) !important;
  border-top: 1px solid rgba(110, 120, 200, 0.18) !important;
  z-index: 95 !important;
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.4) !important;
  display: flex !important;
  align-items: stretch !important;
  justify-content: space-around !important;
  padding: 6px 4px calc(env(safe-area-inset-bottom, 0) + 4px) 4px !important;
}
.bnav-btn{
  flex: 1 1 0 !important;
  display: flex !important; flex-direction: column !important;
  align-items: center !important; justify-content: center !important;
  gap: 3px !important;
  background: transparent !important; border: none !important;
  color: rgba(220, 220, 240, 0.7) !important;
  font-size: 10px !important; font-weight: 600 !important;
  padding: 4px 0 !important;
  cursor: pointer !important;
  border-radius: 12px !important;
  transition: all 0.15s ease;
  position: relative;
  letter-spacing: 0.2px;
  -webkit-tap-highlight-color: transparent;
}
.bnav-btn:active{ transform: scale(0.92); background: rgba(120,140,255,0.10) !important; color: #fff !important; }
.bnav-btn.active{
  color: #00ff88 !important;
  background: rgba(0, 255, 136, 0.08) !important;
}
.bnav-icon{ font-size: 22px !important; line-height: 1 !important; }
.bnav-label{ font-size: 10px !important; line-height: 1.1 !important; }
.bnav-badge{
  position: absolute !important;
  top: 4px !important; right: 18%;
  background: linear-gradient(135deg, #ff7a3d, #ff3b6e) !important;
  color: #fff !important; font-size: 9px !important; font-weight: 700 !important;
  padding: 1px 5px !important; border-radius: 10px !important;
  min-width: 16px !important; text-align: center !important; line-height: 1.4 !important;
}

/* MORE-menu (выезжает снизу) */
.more-sheet{
  position: fixed !important;
  bottom: 0 !important; left: 0 !important; right: 0 !important;
  background: linear-gradient(180deg, #0a0a18, #03030e) !important;
  border-top: 1px solid rgba(110,120,200,0.25) !important;
  border-radius: 24px 24px 0 0 !important;
  padding: 16px 16px calc(env(safe-area-inset-bottom, 0) + 80px) 16px !important;
  z-index: 200 !important;
  max-height: 80vh !important;
  overflow-y: auto !important;
  transform: translateY(100%);
  transition: transform 0.25s cubic-bezier(.2,.7,.3,1);
  box-shadow: 0 -8px 40px rgba(0,0,0,0.6);
}
.more-sheet.open{ transform: translateY(0); }
.more-backdrop{
  position: fixed !important; inset: 0 !important;
  background: rgba(0,0,0,0.5);
  z-index: 199;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.more-backdrop.open{ opacity: 1; pointer-events: auto; }
.more-handle{
  width: 40px; height: 4px;
  background: rgba(255,255,255,0.25);
  border-radius: 2px; margin: 0 auto 14px;
}
.more-title{ font-size: 13px; color: rgba(255,255,255,0.55); margin: 14px 0 6px; text-transform: uppercase; letter-spacing: 1px; }
.more-item{
  display: flex !important; align-items: center !important;
  gap: 14px !important;
  padding: 14px 12px !important;
  border-radius: 12px !important;
  color: #fff !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  background: rgba(255,255,255,0.04) !important;
  border: 1px solid rgba(255,255,255,0.06) !important;
  cursor: pointer !important;
  margin-bottom: 8px !important;
  transition: all 0.15s;
  -webkit-tap-highlight-color: transparent;
  width: 100% !important; text-align: left !important;
}
.more-item:active{ transform: scale(0.98); background: rgba(120,140,255,0.10) !important; }
.more-item-icon{ font-size: 22px; min-width: 28px; text-align: center; }
.more-item-sub{ display: block; font-size: 11px; color: rgba(255,255,255,0.5); font-weight: 400; margin-top: 2px; }
.more-section-title{
  font-size: 11px; color: rgba(255,255,255,0.4);
  text-transform: uppercase; letter-spacing: 1.2px;
  margin: 16px 4px 8px;
}

/* =========================================================
   3. ALERTS — РЕАЛЬНО edge-to-edge
   ========================================================= */
.app-shell{ display: flex !important; flex-direction: column !important; min-height: 100vh !important; }
.main{ display: flex !important; flex-direction: column !important; width: 100% !important; padding: 0 !important; margin: 0 !important; }
.feed, .feed-area, .signals-feed{
  width: 100% !important; order: 1 !important;
  padding: 4px 4px 8px !important;  /* минимум-минимум */
  margin: 0 !important;
}
.signal-card, .sig-card, .signal{
  padding: 14px 12px !important;
  font-size: 14px !important;
  margin: 0 0 6px 0 !important;
  width: 100% !important; box-sizing: border-box !important;
  border-radius: 14px !important;
}
.signal-card .sig-symbol, .sig-symbol, .sig-pair{ font-size: 16px !important; font-weight: 700 !important; }
.signal-card .sig-price, .sig-price{ font-size: 15px !important; font-weight: 600 !important; }
.signal-card iframe, .sig-card iframe, .tv-mini-chart{
  width: 100% !important; max-width: 100% !important; height: 200px !important;
}
.sig-arrow, .signal-arrow{
  font-size: 30px !important; min-height: 54px !important; padding: 10px 8px !important;
}

/* =========================================================
   4. SIDEBAR — под фидом
   ========================================================= */
.sidebar, .side, .left-col{
  position: static !important; width: 100% !important;
  max-height: none !important; overflow: visible !important;
  height: auto !important; padding: 4px !important; order: 2 !important;
}
.side-section{ margin-bottom: 8px !important; padding: 12px !important; border-radius: 12px !important; }
.stat-block{ font-size: 12px !important; padding: 8px !important; }
.stat-block .v{ font-size: 18px !important; }
select{ font-size: 16px !important; min-height: 44px !important; padding: 10px !important; width: 100% !important; }

/* =========================================================
   5. AI BUBBLE
   ========================================================= */
.ai-bubble, .ai-fab, .assistant-bubble, #ai-bubble{
  bottom: calc(env(safe-area-inset-bottom, 0) + 80px) !important;
  right: 12px !important; width: 48px !important; height: 48px !important; z-index: 90 !important;
}
.pagination, .pager, .page-nav{
  margin-bottom: calc(env(safe-area-inset-bottom, 0) + 80px) !important;
  display: flex !important; flex-wrap: wrap !important;
  justify-content: center !important; gap: 8px !important;
}

/* =========================================================
   6. iOS safe-area + zoom prevent
   ========================================================= */
input, textarea, select{ font-size: 16px !important; }
html, body{ min-height: 100vh !important; height: auto !important; overflow-x: hidden !important; }
body{
  padding-top: env(safe-area-inset-top, 0);
  padding-left: env(safe-area-inset-left, 0);
  padding-right: env(safe-area-inset-right, 0);
  overscroll-behavior-y: contain;
}

/* =========================================================
   7. MODALS — отступ под bottom-nav
   ========================================================= */
.modal-overlay{ padding: 0 !important; align-items: flex-start !important; z-index: 1000 !important; touch-action: manipulation; }
.modal{
  width: 100% !important; max-width: 100% !important;
  min-height: 100vh !important; max-height: 100vh !important; height: 100vh !important;
  margin: 0 !important; border-radius: 0 !important;
  overflow-y: auto !important; -webkit-overflow-scrolling: touch !important;
  padding: 70px 16px calc(env(safe-area-inset-bottom, 0) + 84px) !important;
  position: relative !important;
}
.modal-title{ font-size: 18px !important; }
.modal-close{
  position: fixed !important;
  top: calc(env(safe-area-inset-top, 0) + 12px) !important; right: 12px !important;
  width: 44px !important; height: 44px !important; font-size: 22px !important;
  border-radius: 12px !important;
  background: rgba(255, 59, 92, 0.15) !important; color: #ff7088 !important;
  border: 1px solid rgba(255, 59, 92, 0.35) !important;
  z-index: 9999 !important;
  display: flex !important; align-items: center !important; justify-content: center !important;
  font-weight: 700 !important; cursor: pointer !important;
  touch-action: manipulation !important; -webkit-tap-highlight-color: transparent;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}
.modal-close:active{ transform: scale(0.92); background: rgba(255, 59, 92, 0.30) !important; }
.ai-panel-close{
  position: fixed !important; top: calc(env(safe-area-inset-top, 0) + 12px) !important; right: 12px !important;
  width: 44px !important; height: 44px !important; font-size: 22px !important;
  z-index: 9999 !important;
  background: rgba(255, 59, 92, 0.15) !important; color: #ff7088 !important;
  border: 1px solid rgba(255, 59, 92, 0.35) !important; border-radius: 12px !important;
  display: flex !important; align-items: center !important; justify-content: center !important;
}

/* =========================================================
   8. LUCKY WHEEL
   ========================================================= */
.wheel-wrap{
  width: min(85vw, 320px) !important; height: min(85vw, 320px) !important;
  max-width: 320px !important; max-height: 320px !important;
  margin: 0 auto 18px !important; position: relative !important;
}
.wheel{ width: 100% !important; height: 100% !important; aspect-ratio: 1 / 1 !important; }
.wheel-pointer{ font-size: 26px !important; }
.wheel-sector{ font-size: 12px !important; }
.wheel-meta{ font-size: 13px !important; padding: 0 8px; }
.wheel-disclaimer{ font-size: 10px !important; padding: 0 16px; }

/* =========================================================
   9. Friends / Pricing — 1 column
   ========================================================= */
.friends-grid, .refs-grid, .plans, .plan-grid, .plans-grid{
  grid-template-columns: 1fr !important; gap: 10px !important;
}
.checkout-opt{ min-height: 70px !important; padding: 14px !important; font-size: 13px !important; }
.plan-card{ padding: 14px !important; min-height: 90px !important; }

/* =========================================================
   10. ULTRA-SMALL (≤380px)
   ========================================================= */
@media (max-width: 380px){
  .topbar-logo{ max-width: 92px !important; font-size: 12px !important; }
  .topbar-actions > .btn-primary{ font-size: 11px !important; padding: 6px 9px !important; }
  .access-pill .timer{ font-size: 12px !important; }
  .bnav-icon{ font-size: 20px !important; }
}
