/* Telefon üçün tətbiq görünüşü: yuxarı panel (appbar), aşağı-sağda dairəvi burger və aşağıdan açılan menyu.
   820px-dən geniş ekranlarda bu elementlərin hamısı gizlidir, saytın masaüstü görünüşü dəyişmir. */
.appbar, .tabbar, .sheet, .sheet-bg, .toast-wrap, .ios-hint { display: none; }

@media (max-width: 820px) {
  :root { --sab: env(safe-area-inset-bottom, 0px); --sat: env(safe-area-inset-top, 0px); }
  html { scroll-padding-top: calc(64px + var(--sat)); -webkit-text-size-adjust: 100%; }
  body { -webkit-tap-highlight-color: transparent; padding-bottom: calc(80px + var(--sab)); overscroll-behavior-y: none; }
  a, button, .btn { touch-action: manipulation; }
  input, select, textarea { font-size: 16px; }   /* iOS-da fokusda böyütməsin */
  .top { display: none; }
  .wrap { width: min(1160px, 100% - 32px); }
  section { padding: 52px 0; }
  main { animation: pgin .28s ease both; }
  @keyframes pgin { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

  /* yuxarı panel */
  .appbar {
    display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 60;
    padding: calc(var(--sat) + 6px) 14px 6px; min-height: calc(56px + var(--sat));
    background: rgba(11,13,11,.94); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(255,255,255,.08); color: #fff;
  }
  .ab-logo { display: flex; align-items: center; gap: 10px; font-family: "Sora", sans-serif; font-weight: 700; font-size: 1.02rem; letter-spacing: -.01em; }
  .ab-logo b { color: var(--green); font-weight: 800; }
  .ab-logo img { border-radius: 9px; }
  .ab-act { display: flex; align-items: center; gap: 4px; }
  .ab-ic { position: relative; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; color: rgba(255,255,255,.9); }
  .ab-ic:active { background: rgba(255,255,255,.1); }
  .ab-login { padding: 9px 18px; border-radius: 999px; background: var(--green); color: var(--black); font-weight: 800; font-size: .88rem; }
  .nbadge { position: absolute; top: 4px; right: 3px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--green); color: var(--black); font: 800 .68rem/18px "Manrope", sans-serif; text-align: center; font-style: normal; box-shadow: 0 0 0 2px #0b0d0b; }
  .nbadge[hidden] { display: none; }

  /* aşağı naviqasiya paneli: ağ, ekranın dibinə birləşik, yalnız ikonlar; aktiv bölmə yaşıl ikon + qara xətt */
  .tabbar { display: flex; align-items: stretch; justify-content: space-around; position: fixed; z-index: 120; left: 0; right: 0; bottom: 0;
    padding: 6px 8px calc(6px + var(--sab)); background: #fff; border-radius: 22px 22px 0 0; border-top: 1px solid var(--line);
    box-shadow: 0 -8px 28px rgba(11,13,11,.14); }
  .tb-bg { display: none; }
  .tab { position: relative; flex: 1; display: grid; place-items: center; height: 52px; padding: 0; border: 0; background: none; cursor: pointer;
    color: var(--ink); font: inherit; -webkit-tap-highlight-color: transparent; transition: color .25s; }
  .tab .ti { position: relative; display: grid; place-items: center; width: 26px; height: 26px; transition: transform .25s cubic-bezier(.3,1.4,.5,1); }
  .tab .ti svg { width: 25px; height: 25px; }
  .tab em { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }   /* yalnız ekran oxuyucu üçün */
  .tab::after { content: ""; position: absolute; left: 50%; bottom: 3px; width: 0; height: 3px; border-radius: 2px; background: var(--black); transform: translateX(-50%); transition: width .28s cubic-bezier(.3,1.3,.5,1); }
  .tab:active .ti { transform: scale(.86); }
  .tab.on, .tab.tab-menu[aria-expanded="true"] { color: var(--green-dark); }
  .tab.on .ti, .tab.tab-menu[aria-expanded="true"] .ti { transform: translateY(-2px); }
  .tab.on::after, .tab.tab-menu[aria-expanded="true"]::after { width: 22px; }
  .tab .nbadge { top: -5px; right: -7px; box-shadow: 0 0 0 2px #fff; }
  .tab .fab-x { display: none; }
  .tab.tab-menu[aria-expanded="true"] .fab-b { display: none; }
  .tab.tab-menu[aria-expanded="true"] .fab-x { display: block; }

  /* aşağıdan açılan menyu */
  .sheet-bg { display: block; position: fixed; inset: 0; z-index: 100; background: rgba(5,8,5,.58); opacity: 0; transition: opacity .28s; -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
  .sheet-bg[hidden] { display: none; }
  .sheet-bg.show { opacity: 1; }
  .sheet {
    display: block; position: fixed; z-index: 110; left: 0; right: 0; bottom: 0; max-height: 84vh; overflow-y: auto; overscroll-behavior: contain;
    background: #fff; border-radius: 28px 28px 0 0; padding: 0 16px calc(92px + var(--sab));
    transform: translateY(105%); transition: transform .34s cubic-bezier(.22,.9,.3,1); box-shadow: 0 -18px 50px rgba(0,0,0,.28);
    visibility: hidden;
  }
  .sheet.open { transform: translateY(0); visibility: visible; }
  .sheet.drag { transition: none; }
  .sheet-handle { position: sticky; top: 0; z-index: 2; padding: 12px 0 8px; background: #fff; cursor: grab; touch-action: none; }
  .sheet-handle span { display: block; width: 44px; height: 5px; border-radius: 3px; background: #d5dbd2; margin: 0 auto; }
  .sheet-user { display: flex; align-items: center; gap: 12px; padding: 6px 4px 14px; }
  .sheet-user img { border-radius: 11px; }
  .sheet-user b { display: block; font-family: "Sora", sans-serif; font-size: 1rem; }
  .sheet-user small { color: var(--muted); font-weight: 600; }
  .tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
  .tile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 86px; padding: 12px 6px; border-radius: 18px; background: #f3f6f1; color: var(--ink); font-weight: 700; font-size: .78rem; text-align: center; line-height: 1.2; transition: transform .15s, background .15s; }
  .tile svg { color: var(--green-dark); }
  .tile:active { transform: scale(.95); background: #e5efe1; }
  .tile.on { background: var(--black); color: #fff; } .tile.on svg { color: var(--green); }
  .tile[hidden] { display: none; }
  .sheet-out { margin-top: 14px; }
  .sheet-out button { width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 14px; border-radius: 16px; border: 1.5px solid #f0c4c4; background: #fff; color: #a32020; font: inherit; font-weight: 800; cursor: pointer; }

  /* toast */
  .toast-wrap { display: flex; flex-direction: column; gap: 8px; position: fixed; z-index: 200; left: 12px; right: 12px; top: calc(var(--sat) + 64px); pointer-events: none; }
  .toast { pointer-events: auto; display: flex; gap: 12px; align-items: flex-start; padding: 13px 14px; border-radius: 18px; background: var(--black); color: #fff; box-shadow: 0 16px 40px -10px rgba(0,0,0,.55); border: 1px solid rgba(255,255,255,.1); animation: tin .35s cubic-bezier(.2,1.2,.4,1) both; }
  .toast.out { animation: tout .25s ease both; }
  .toast i { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.1); font-style: normal; font-size: 1.05rem; }
  .toast.coin i { background: linear-gradient(145deg, #f6d35a, #d9a400); color: #4a3500; }
  .toast b { display: block; font-size: .92rem; } .toast span { display: block; font-size: .82rem; color: rgba(255,255,255,.75); margin-top: 1px; }
  @keyframes tin { from { opacity: 0; transform: translateY(-18px) scale(.96); } to { opacity: 1; transform: none; } }
  @keyframes tout { to { opacity: 0; transform: translateY(-12px); } }

  /* iOS quraşdırma təlimatı */
  .ios-hint { position: fixed; z-index: 210; left: 12px; right: 12px; bottom: calc(86px + var(--sab)); padding: 16px; border-radius: 20px; background: var(--black); color: #fff; box-shadow: 0 20px 50px rgba(0,0,0,.5); }
  .ios-hint:not([hidden]) { display: block; }
  .ios-hint p { margin: 6px 0 12px; color: rgba(255,255,255,.8); font-size: .9rem; } .ios-hint span { color: var(--green); font-weight: 800; }
  .ios-hint button { padding: 10px 20px; border-radius: 999px; border: 0; background: var(--green); font: inherit; font-weight: 800; }

  /* ümumi tətbiq hissi */
  .btn { min-height: 48px; }
  .phero { padding: 34px 0 30px; }
  .phero h1 { font-size: clamp(1.9rem, 8vw, 2.4rem); }
  .card, .box, .prod, .form, .sumbox { border-radius: 20px; }
  footer { padding: 28px 0 8px; }
  footer .row { flex-direction: column; align-items: flex-start; gap: 14px; }
  .fnav { flex-wrap: wrap; gap: 6px 16px; }
  .disc { font-size: .78rem; }
  .tbl, .tw { -webkit-overflow-scrolling: touch; }

  /* statistika kartları: telefonda sıx və qısa (balans kartları uzanmasın) */
  .stats { gap: 10px; margin-bottom: 18px; }
  .stat { padding: 14px; border-radius: 18px; }
  .stat span { display: block; font-size: .64rem; letter-spacing: .06em; line-height: 1.25; }
  .stat b { font-size: 1.5rem; margin-top: 4px; line-height: 1.15; }
  .stat b small { font-size: .7rem; }
  .stat > small { display: block; font-size: .7rem; line-height: 1.3; margin-top: 3px; }
  .card > .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 12px 0 14px; }
  .card > .stats .stat:first-child { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px; }
  .card > .stats .stat:first-child span { font-size: .72rem; }
  .card > .stats .stat:first-child b { font-size: 1.9rem; margin: 0; white-space: nowrap; }
  .card > .stats .stat:nth-child(2) b, .card > .stats .stat:nth-child(3) b { font-size: 1.12rem; }
  .card > .stats .stat:last-child { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; }
  .card > .stats .stat:last-child span { flex: 0 0 100%; }
  .card > .stats .stat:last-child b { margin: 0; }
  .card > .stats .stat:last-child > small { margin: 0; }
  #upgrade .wact { grid-template-columns: 1fr !important; gap: 8px; }
  #upgrade .wact form { display: block; }
  #upgrade .wact .btn { border-radius: 18px; padding: 12px 16px; min-height: 0; flex-direction: row !important; justify-content: space-between; text-align: left; }
  #upgrade .wact .btn span { font-size: .95rem; }
  #upgrade .wact .btn small { white-space: nowrap; font-size: .78rem; }
  .rates .rate { gap: 8px; }
  .rates .rate span { width: 84px !important; font-size: .78rem; line-height: 1.2; }
}
@media (max-width: 820px) and (display-mode: standalone) {
  footer { display: none; }
}
@media (prefers-reduced-motion: reduce) { .sheet, .sheet-bg, .tabbar, .tab .ti, .toast, main { transition: none !important; animation: none !important; } }

.notice[data-push-banner]:not([hidden]) { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; justify-content: space-between; }

/* daxili balans: son qazanclar kart siyahısı (yalnız telefonda) */
.comm-list { display: none; }
@media (max-width: 820px) {
  .desk-only { display: none !important; }
  .comm-list { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
  .citem { display: grid; grid-template-columns: 40px 1fr auto; gap: 12px; align-items: center; padding: 12px 14px; border: 1px solid var(--line); border-radius: 18px; background: #fff; }
  .cic { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font: 800 .8rem "Sora", sans-serif; background: #eef2ec; color: #4b524a; }
  .cic-referal { background: #e3f5df; color: #1b6a12; } .cic-mb { background: #dff3f0; color: #0d6b5f; } .cic-binar { background: var(--black); color: var(--green); } .cic-matching { background: #fff4d6; color: #7a5a00; }
  .cmid { min-width: 0; }
  .cmid b { display: block; font-size: .92rem; line-height: 1.25; }
  .cmid small { display: block; color: var(--muted); font-size: .76rem; line-height: 1.3; margin-top: 1px; overflow-wrap: anywhere; }
  .cmid em { display: block; font-style: normal; color: #8a9288; font-size: .72rem; margin-top: 2px; }
  .camt { font-family: "Sora", sans-serif; font-size: .98rem; white-space: nowrap; text-align: right; }
  .camt small { font-size: .66rem; opacity: .7; font-weight: 700; }
  .camt.pos { color: var(--green-dark); } .camt.neg { color: var(--ink); }

  /* digər cədvəllər: hər sətir kartdır (başlıqlar xanaların üstündə kiçik yazı kimi) */
  .tbl { overflow: visible; }
  .tbl table, .tbl tbody { display: block; width: 100%; }
  .tbl thead { display: none; }
  .tbl tr { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; padding: 13px 14px; margin-bottom: 10px; border: 1px solid var(--line); border-radius: 18px; background: #fff; }
  .tbl td { display: block; padding: 0; border: 0; font-size: .92rem; min-width: 0; overflow-wrap: anywhere; }
  .tbl td::before { content: attr(data-label); display: block; margin-bottom: 2px; font-size: .64rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
  .tbl td:last-child:nth-child(n+4) { grid-column: 1 / -1; }
  .tbl td:only-child { grid-column: 1 / -1; }
}
@media (max-width: 820px) { .tbl td.td-empty { display: none; } }

@media (max-width: 820px) {
  .card { padding: 20px 16px; }
  .wact { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 8px; }
  .wact .btn { white-space: normal; padding: 12px 8px; font-size: .82rem; line-height: 1.2; min-height: 52px; }
  .citem { grid-template-columns: 38px minmax(0, 1fr) auto; gap: 10px; padding: 11px 12px; }
  .cic { width: 38px; height: 38px; font-size: .74rem; }
  .cmid b { font-size: .88rem; }
  .camt { font-size: .88rem; }
}
@media (max-width: 820px) { .tbl td { line-height: 1.4; } .tbl td[data-label="Status"] { grid-column: 1 / -1; } }
@media (max-width: 900px) { .cartgrid > *, .reg > *, .detail > *, .cabgrid > *, .row2 > * { min-width: 0; } .cform input, .cform textarea, .form input, .form select, .form textarea { max-width: 100%; } }
