/* ═══════════════════════════════════════════════════════════════════════
   OmniaCoin · mobile.css v1.0
   App-like responsive experience — CoinMarketCap style tables
   Bottom Nav · Sticky columns · Touch UI · iOS safe area · PWA ready
   ═══════════════════════════════════════════════════════════════════════ */

/* ── Custom props ── */
:root {
  --mob-nav-h: 58px;
  --mob-safe-b: env(safe-area-inset-bottom, 0px);
  --sticky-bg: #040608;
}

/* ════════════════════════════════════════════════════════
   BODY PADDING — space for bottom nav
   ════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  body {
    padding-bottom: calc(var(--mob-nav-h) + var(--mob-safe-b) + 8px) !important;
  }
}

/* ════════════════════════════════════════════════════════
   BOTTOM NAV BAR — app-like 5-tab navigation
   ════════════════════════════════════════════════════════ */
.omnia-bnav {
  display: none;
}

@media (max-width: 768px) {
  .omnia-bnav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 10000;
    height: calc(var(--mob-nav-h) + var(--mob-safe-b));
    padding-bottom: var(--mob-safe-b);
    background: rgba(4, 6, 8, 0.96);
    backdrop-filter: blur(24px) saturate(200%);
    -webkit-backdrop-filter: blur(24px) saturate(200%);
    border-top: 1px solid rgba(0, 220, 160, 0.12);
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.5);
    align-items: stretch;
    justify-content: space-around;
  }

  .omnia-bnav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    gap: 2px;
    text-decoration: none;
    color: rgba(255, 255, 255, 0.45);
    font-family: var(--fb, 'Outfit', sans-serif);
    font-size: 8.5px;
    font-weight: 500;
    letter-spacing: 0.15px;
    transition: color 0.18s ease;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    user-select: none;
    position: relative;
    padding: 5px 1px 4px;
    min-width: 0;
  }

  .omnia-bnav-item svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: transform 0.18s ease, filter 0.18s ease;
    flex-shrink: 0;
  }

  .omnia-bnav-item span {
    line-height: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
  }

  /* Active state */
  .omnia-bnav-item.bnav-active {
    color: var(--cy, #00dca0);
  }
  .omnia-bnav-item.bnav-active svg {
    filter: drop-shadow(0 0 5px rgba(0, 220, 160, 0.45));
    transform: translateY(-1px);
  }

  /* Active indicator dot */
  .omnia-bnav-item::after {
    content: '';
    position: absolute;
    bottom: 6px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--cy, #00dca0);
    opacity: 0;
    transition: opacity 0.18s ease;
  }
  .omnia-bnav-item.bnav-active::after {
    opacity: 1;
  }

  /* Touch ripple */
  .omnia-bnav-item:active {
    color: var(--cy, #00dca0);
    transform: scale(0.93);
  }
}

/* ════════════════════════════════════════════════════════
   HEADER — compact on mobile
   ════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .omni-header-inner {
    padding: 0 10px !important;
    height: 50px !important;
    min-height: 50px !important;
  }
  /* Hide lang label, keep flag */
  .omni-lc-btn .omni-lc-label {
    display: none !important;
  }
  .omni-lc-btn {
    padding: 6px 8px !important;
    min-width: 0 !important;
  }
  .omni-auth-btn span:not(:first-child) {
    display: none !important;
  }
  .omni-auth-btn {
    padding: 6px 10px !important;
    font-size: 0.78rem !important;
  }
}

/* ════════════════════════════════════════════════════════
   TICKER STRIP
   ════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .ticker-w, .omtick-bar {
    font-size: 0.76rem !important;
  }
  .omtick-item {
    gap: 4px !important;
    padding: 0 8px !important;
  }
}

/* ════════════════════════════════════════════════════════
   ECO CALENDAR — compact
   ════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .eco-cal-wrap {
    padding: 8px 6px !important;
    border-radius: 10px !important;
  }
  .eco-cal-days {
    gap: 4px !important;
  }
  .eco-cal-day {
    min-width: 44px !important;
    padding: 6px 4px !important;
    font-size: 0.72rem !important;
  }
  .eco-cal-title {
    font-size: 0.8rem !important;
  }
  .eco-cal-scroll-hint {
    font-size: 0.7rem !important;
  }
}

/* ════════════════════════════════════════════════════════
   MACRO BAR + EXCHANGE TIMELINE — hide on small mobile
   ════════════════════════════════════════════════════════ */
@media (max-width: 520px) {
  .macro-global-wrap,
  .exchange-timeline,
  .exchange-tl-wrap {
    display: none !important;
  }
}
@media (min-width: 521px) and (max-width: 768px) {
  .macro-global-wrap,
  .exchange-timeline {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  /* Fix exchange timeline bottom clip — override overflow:hidden */
  .exchange-timeline-wrap {
    overflow: visible !important;
    padding-bottom: 6px !important;
  }
  .exchange-tl-body {
    overflow: visible !important;
  }
  /* Reduce gap between borse widget and tabs row */
  .exchange-timeline-wrap {
    margin-bottom: 0 !important;
  }
  .ind-borse-grid,
  .ind-borse-col-right {
    margin-bottom: 0 !important;
  }
}

/* ════════════════════════════════════════════════════════
   FOOTER BOTTOM — centra copyright e disclaimer
   Globale (desktop + mobile): il div flex va centrato
   ════════════════════════════════════════════════════════ */
.omni-footer-bottom {
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  gap: 4px !important;
}
.omni-footer-bottom span {
  text-align: center !important;
  display: block !important;
}

/* ════════════════════════════════════════════════════════
   CRYPTO FILTER — nascondi chain pills + chain popup
   + stk-cat-scroll grigie in mobile
   ════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  /* Chain pills (Tutte / Blockchain / DeFi / Layer2 …) nascoste su mobile */
  #chainFilterPills,
  #cryptoCategoryPills,
  .chain-pill,
  .chain-filter-pills-wrap {
    display: none !important;
  }
  /* Chain popup visibile su mobile — contiene anche il bottone Guida */
  #chainPopupWrap {
    display: inline-flex !important;
    align-items: center !important;
    gap: 5px !important;
    flex-shrink: 0 !important;
  }
  /* Stk category pills (grigie) nel tab Azioni nascoste su mobile */
  .stk-cat-scroll {
    display: none !important;
  }
  /* Combined filter row: scroll orizzontale, tutti e 3 i bottoni visibili */
  .combined-filter-row {
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
    padding: 0.3rem 0.6rem !important;
    gap: 6px !important;
    align-items: center !important;
  }
  .combined-filter-row::-webkit-scrollbar { display: none; }
  /* Categoria: no shrink */
  .cat-popup-wrap {
    flex-shrink: 0 !important;
  }
  /* Guida button sempre visibile */
  .filter-guide-unified-btn {
    display: inline-flex !important;
    flex-shrink: 0 !important;
    margin-left: 0 !important;
  }
}

/* ════════════════════════════════════════════════════════
   TABS ROW — horizontal scroll, no wrap
   ════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .tabs {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 5px !important;
    padding: 2px 8px 6px !important;
    margin: 0 -4px;
  }
  .tabs::-webkit-scrollbar { display: none; }

  .tab-b {
    flex-shrink: 0 !important;
    white-space: nowrap !important;
    font-size: 0.77rem !important;
    padding: 0.42rem 0.75rem !important;
    border-radius: 20px !important;
    touch-action: manipulation;
  }
}

/* ════════════════════════════════════════════════════════
   FILTER ROW — stack on mobile
   ════════════════════════════════════════════════════════ */
@media (max-width: 600px) {
  .comb-filter-row {
    flex-wrap: nowrap !important;
    gap: 6px !important;
    padding: 6px 4px !important;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .comb-filter-row::-webkit-scrollbar { display: none; }
  /* Hide "Cat:" and "Chain:" prefix labels — button text is self-explanatory */
  .comb-filter-label {
    display: none !important;
  }
  .cat-popup-btn,
  .chain-popup-btn {
    white-space: nowrap !important;
    flex-shrink: 0 !important;
  }
}

/* ════════════════════════════════════════════════════════
   CMC-STYLE TABLE — sticky columns + swipe
   ════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  /* Scroll container */
  .tbl-s {
    overflow-x: auto !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    border-radius: 0 0 10px 10px;
    /* Smooth momentum scrolling */
    scroll-behavior: smooth;
  }
  .tbl-s::-webkit-scrollbar { display: none; }
  .tbl-w .tbl-s { max-height: 68vh !important; }

  /* Table reset */
  .tbl-s table {
    min-width: 560px !important;
    border-collapse: collapse !important;
    table-layout: auto !important;
  }

  /* ── Sticky column 1: rank # ── */
  .tbl-s table thead tr th:nth-child(1),
  .tbl-s table tbody tr td:nth-child(1) {
    position: sticky !important;
    left: 0 !important;
    z-index: 4 !important;
    background: var(--sticky-bg) !important;
    min-width: 30px !important;
    width: 30px !important;
    padding-left: 8px !important;
    padding-right: 4px !important;
  }

  /* ── Sticky column 2: asset name ── */
  .tbl-s table thead tr th:nth-child(2),
  .tbl-s table tbody tr td:nth-child(2) {
    position: sticky !important;
    left: 30px !important;
    z-index: 4 !important;
    background: var(--sticky-bg) !important;
    min-width: 90px !important;
    max-width: 130px !important;
    padding-right: 6px !important;
  }

  /* Shadow after sticky block */
  .tbl-s table thead tr th:nth-child(2)::after,
  .tbl-s table tbody tr td:nth-child(2)::after {
    content: '';
    position: absolute;
    top: 0; right: -10px; bottom: 0;
    width: 10px;
    background: linear-gradient(to right, rgba(4,6,8,0.7), transparent);
    pointer-events: none;
  }

  /* Row hover keeps sticky bg */
  .tbl-s table tbody tr:hover td:nth-child(1),
  .tbl-s table tbody tr:hover td:nth-child(2) {
    background: rgba(0, 220, 160, 0.05) !important;
  }

  /* Touch-friendly row height */
  .tbl-s table tbody tr {
    height: 52px !important;
  }
  .tbl-s table td {
    padding: 0 0.5rem !important;
    font-size: 0.82rem !important;
    white-space: nowrap;
    vertical-align: middle !important;
  }
  .tbl-s table th {
    padding: 0.55rem 0.45rem !important;
    font-size: 0.68rem !important;
    white-space: nowrap !important;
  }

  /* Asset logo + name compact */
  .ac {
    display: flex !important;
    align-items: center !important;
    gap: 7px !important;
    min-width: 0;
  }
  .al, .alp {
    width: 28px !important;
    height: 28px !important;
    flex-shrink: 0 !important;
    border-radius: 50% !important;
  }
  .an {
    font-size: 0.83rem !important;
    font-weight: 600 !important;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 80px;
  }
  .as {
    font-size: 0.68rem !important;
    display: none !important; /* hide symbol on tiny screens */
  }
  /* Price */
  .pr {
    font-size: 0.86rem !important;
    font-weight: 700 !important;
    white-space: nowrap !important;
    font-family: var(--fm, 'JetBrains Mono', monospace) !important;
  }
  /* Change pill */
  .ch {
    font-size: 0.8rem !important;
  }
  .tv-pill {
    padding: 2px 5px !important;
    font-size: 0.72rem !important;
    border-radius: 4px !important;
  }
}

/* Extra tiny: show symbol again for readability */
@media (min-width: 360px) and (max-width: 768px) {
  .as {
    display: block !important;
    font-size: 0.68rem !important;
  }
}

/* ════════════════════════════════════════════════════════
   CMC-STYLE CRYPTO & MEME TABLE — mobile compact (≤768px)
   Layout: rank(7%) | asset(33%) | price+24h%(37%) | trend(23%)
   Fix: [data-cmc] su <table> per targetare thead th
   ════════════════════════════════════════════════════════ */

/* Default desktop: nasconde elementi solo-mobile */
.mob-ch24 { display: none; }
.an-name  { display: inline; }

@media (max-width: 768px) {

  /* ── 1. Tabella full-width — table-layout:fixed ── */
  .tbl-s table {
    min-width: unset !important;
    width: 100% !important;
    table-layout: fixed !important;
  }

  /* ── 2. Widths via [data-cmc] per thead th ── */

  /* Rank */
  [data-cmc] thead th:nth-child(1),
  #cryptoTB td:nth-child(1),
  #memeTB  td:nth-child(1) {
    width: 7% !important;
    min-width: 24px !important;
    max-width: 34px !important;
    padding-left: 8px !important;
    padding-right: 2px !important;
  }

  /* Asset — ridotta per lasciare respiro a Prezzo */
  [data-cmc] thead th:nth-child(2),
  #cryptoTB td:nth-child(2),
  #memeTB  td:nth-child(2) {
    width: 33% !important;
    min-width: 0 !important;
    max-width: 33% !important;
    overflow: hidden !important;
    padding-left: 6px !important;
    padding-right: 4px !important;
  }

  /* Prezzo + 24h% stacked — spostato a sinistra, separazione da Trend */
  [data-cmc] thead th:nth-child(3),
  #cryptoTB td:nth-child(3),
  #memeTB  td:nth-child(3) {
    width: 37% !important;
    min-width: 0 !important;
    max-width: 37% !important;
    text-align: right !important;
    padding: 0 14px 0 4px !important;
  }

  /* ── 3. NASCONDI colonne non necessarie — thead + tbody ── */
  /* 1h%, 24h% standalone, 7d%, volume, mcap, cat, chain, QN */
  [data-cmc] thead th:nth-child(4),
  [data-cmc] thead th:nth-child(5),
  [data-cmc] thead th:nth-child(6),
  [data-cmc] thead th:nth-child(7),
  [data-cmc] thead th:nth-child(8),
  [data-cmc] thead th:nth-child(9),
  [data-cmc] thead th:nth-child(10),
  [data-cmc] thead th:nth-child(12),
  #cryptoTB td:nth-child(4),
  #cryptoTB td:nth-child(5),
  #cryptoTB td:nth-child(6),
  #cryptoTB td:nth-child(7),
  #cryptoTB td:nth-child(8),
  #cryptoTB td:nth-child(9),
  #cryptoTB td:nth-child(10),
  #cryptoTB td:nth-child(12),
  #memeTB  td:nth-child(4),
  #memeTB  td:nth-child(5),
  #memeTB  td:nth-child(6),
  #memeTB  td:nth-child(7),
  #memeTB  td:nth-child(8),
  #memeTB  td:nth-child(9),
  #memeTB  td:nth-child(10),
  #memeTB  td:nth-child(12) {
    display: none !important;
  }

  /* ── 4. Trend pill ── */
  [data-cmc] thead th:nth-child(11),
  #cryptoTB td:nth-child(11),
  #memeTB  td:nth-child(11) {
    width: 23% !important;
    min-width: 0 !important;
    max-width: 23% !important;
    text-align: right !important;
    padding-left: 4px !important;
    padding-right: 8px !important;
  }

  /* ── 5. Row + cell base ── */
  #cryptoTB tr, #memeTB tr { height: 58px !important; }
  #cryptoTB td, #memeTB td {
    vertical-align: middle !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
  }

  /* ── 6. Asset cell: logo · name/symbol stacked ── */
  #cryptoTB .ac, #memeTB .ac {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    overflow: hidden !important;
    min-width: 0 !important;
  }
  #cryptoTB .al, #cryptoTB .alp,
  #memeTB  .al, #memeTB  .alp {
    width: 30px !important;
    height: 30px !important;
    flex-shrink: 0 !important;
    border-radius: 50% !important;
  }
  #cryptoTB .ai, #memeTB .ai {
    min-width: 0 !important;
    overflow: hidden !important;
    flex: 1 !important;
  }
  #cryptoTB .an, #memeTB .an {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 0 !important;
    line-height: 1 !important;
    overflow: hidden !important;
    width: 100% !important;
  }
  #cryptoTB .an-name, #memeTB .an-name {
    display: block !important;
    font-size: 0.86rem !important;
    font-weight: 700 !important;
    color: var(--t1, #e8edf2) !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    max-width: 100% !important;
    line-height: 1.2 !important;
  }
  #cryptoTB .as-sym, #memeTB .as-sym {
    display: block !important;
    font-size: 0.66rem !important;
    color: var(--tm, #8b95a5) !important;
    font-weight: 500 !important;
    letter-spacing: 0.04em !important;
    text-transform: uppercase !important;
    margin-top: 3px !important;
    white-space: nowrap !important;
    line-height: 1 !important;
  }
  /* Nascondi star e live-dot ridimensionato */
  #cryptoTB .fs, #memeTB .fs { display: none !important; }
  #cryptoTB .live-dot, #memeTB .live-dot {
    font-size: 0.45rem !important;
    margin-left: 2px !important;
    vertical-align: super !important;
  }

  /* ── 7. Price cell stacked: prezzo / 24h% ── */
  .cmc-pc { vertical-align: middle !important; }
  .cmc-pc .pr {
    display: block !important;
    font-size: 0.82rem !important;
    font-weight: 700 !important;
    font-family: 'JetBrains Mono', monospace !important;
    line-height: 1.25 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }
  .mob-ch24 {
    display: block !important;
    font-size: 0.69rem !important;
    font-weight: 600 !important;
    line-height: 1.2 !important;
    margin-top: 3px !important;
    white-space: nowrap !important;
  }
  .mob-ch24.up { color: #00dc96 !important; }
  .mob-ch24.dn { color: #ff4757 !important; }
  .mob-ch24.ne { color: #8b95a5 !important; }

  /* ── 8. Trend pill compact ── */
  #cryptoTB .tv-pill, #memeTB .tv-pill {
    font-size: 0.67rem !important;
    padding: 3px 5px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 2px !important;
    white-space: nowrap !important;
    float: right !important;
  }

  /* ── 9. Sticky rank column ── */
  [data-cmc] td:nth-child(1) {
    position: sticky !important;
    left: 0 !important;
    z-index: 3 !important;
    background: var(--sticky-bg, #060a10) !important;
  }
}

/* ════════════════════════════════════════════════════════
   TOP & FLOP TABLES — mobile compact
   Layout: rank(7%) | asset(35%) | price+24h%(32%) | 24H(16%) | trend(10%)
   td: 1=rank · 2=asset · 3=price · 4=24H · 5=cat → hide · 6=chain → hide · 7=trend
   ════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  #topTB td:nth-child(1), #flopTB td:nth-child(1) {
    width: 7% !important; min-width: 22px !important; max-width: 32px !important;
    padding-left: 8px !important; padding-right: 2px !important;
    color: var(--tm) !important; font-size: 0.72rem !important; font-weight: 600 !important;
  }
  #topTB td:nth-child(2), #flopTB td:nth-child(2) {
    width: 35% !important; max-width: 35% !important; overflow: hidden !important;
    padding-left: 6px !important; padding-right: 4px !important;
  }
  #topTB td:nth-child(3), #flopTB td:nth-child(3) {
    width: 32% !important; min-width: 0 !important; max-width: 32% !important;
    text-align: right !important; padding: 0 12px 0 4px !important;
  }
  #topTB td:nth-child(4), #flopTB td:nth-child(4) {
    width: 16% !important; min-width: 0 !important; max-width: 16% !important;
    text-align: right !important; padding: 0 8px 0 2px !important;
  }
  /* Hide cat + chain */
  #topTB td:nth-child(5), #flopTB td:nth-child(5),
  #topTB td:nth-child(6), #flopTB td:nth-child(6) { display: none !important; }
  /* Trend */
  #topTB td:nth-child(7), #flopTB td:nth-child(7) {
    width: 10% !important; min-width: 0 !important;
    text-align: right !important; padding-right: 8px !important;
  }
  /* Row height */
  #topTB tr, #flopTB tr { height: 52px !important; }
  #topTB td, #flopTB td { vertical-align: middle !important; padding-top: 0 !important; padding-bottom: 0 !important; }
  /* Trend pill compact */
  #topTB .tv-pill, #flopTB .tv-pill {
    font-size: 0.65rem !important; padding: 2px 4px !important;
    display: inline-flex !important; align-items: center !important; justify-content: center !important;
  }
  /* Asset cell */
  #topTB .ac, #flopTB .ac {
    display: flex !important; align-items: center !important;
    gap: 5px !important; overflow: hidden !important;
  }
  #topTB .an, #flopTB .an { overflow: hidden !important; }
  #topTB .an-name, #flopTB .an-name {
    display: block !important; font-size: 0.78rem !important; font-weight: 600 !important;
    white-space: nowrap !important; overflow: hidden !important; text-overflow: ellipsis !important;
    max-width: 80px !important;
  }
  #topTB .as-sym, #flopTB .as-sym {
    display: block !important; font-size: 0.65rem !important;
    color: var(--tm) !important; white-space: nowrap !important;
  }
  #topTB .al, #flopTB .al { width: 22px !important; height: 22px !important; border-radius: 50% !important; }
  #topTB .alp, #flopTB .alp { width: 22px !important; height: 22px !important; font-size: 0.65rem !important; }
  #topTB .fs, #flopTB .fs { display: none !important; }
}

/* ════════════════════════════════════════════════════════
   STOCKS TABLE — mobile compact
   Layout: asset(40%) | price+24h%(38%) | trend(22%)
   td: 1=asset · 2=price · 3=1H→hide · 4=24H→hide · 5=7D→hide
       6=mcap→hide · 7=sector→hide · 8=borsa→hide · 11=trend
   ════════════════════════════════════════════════════════ */
/* ════════════════════════════════════════════════════════
   COLGROUP — forza le width direttamente sulle colonne
   Funziona su ogni browser/WebView con table-layout:fixed
   ════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .mob-fixed-tbl col.col-asset  { width: 52% !important; }
  .mob-fixed-tbl col.col-price  { width: 27% !important; }
  .mob-fixed-tbl col.col-trend  { width: 21% !important; }
  .mob-fixed-tbl col.mob-hide-col { width: 0 !important; min-width: 0 !important; }
}

/* table-layout:fixed garantito via HTML + CSS — layout affidabile su tutti i browser */
@media (max-width: 768px) {
  .mob-fixed-tbl {
    table-layout: fixed !important;
    width: 100% !important;
  }
  /* Asset — 52% */
  #stocksTB td:nth-child(1) {
    width: 52% !important; overflow: hidden !important;
    padding-left: 10px !important; padding-right: 6px !important;
  }
  /* Price + 24h% stacked — 28% */
  #stocksTB td:nth-child(2) {
    width: 28% !important; overflow: hidden !important;
    text-align: right !important; padding: 0 8px 0 2px !important;
  }
  /* Hide: 1H(3), 24H(4), 7D(5), mcap(6), sector(7), borsa(8) */
  #stocksTB td:nth-child(3),
  #stocksTB td:nth-child(4),
  #stocksTB td:nth-child(5),
  #stocksTB td:nth-child(6),
  #stocksTB td:nth-child(7),
  #stocksTB td:nth-child(8) { display: none !important; }
  /* Trend (td11) — 20% */
  #stocksTB td:nth-child(11) {
    width: 20% !important; overflow: hidden !important;
    text-align: right !important; padding-left: 2px !important; padding-right: 8px !important;
  }
  /* Row */
  #stocksTB tr { height: 56px !important; }
  #stocksTB td { vertical-align: middle !important; padding-top: 0 !important; padding-bottom: 0 !important; }
  /* Trend pill */
  #stocksTB .tv-pill {
    font-size: 0.65rem !important; padding: 2px 4px !important;
    display: inline-flex !important; align-items: center !important; justify-content: center !important;
  }
  /* Asset cell layout */
  #stocksTB .ac { display: flex !important; align-items: center !important; gap: 5px !important; overflow: hidden !important; min-width: 0 !important; }
  #stocksTB .ai { min-width: 0 !important; overflow: hidden !important; flex: 1 !important; }
  #stocksTB .an { min-width: 0 !important; overflow: hidden !important; }
  #stocksTB .an-name {
    display: block !important; font-size: 0.78rem !important; font-weight: 600 !important;
    white-space: nowrap !important; overflow: hidden !important; text-overflow: ellipsis !important;
  }
  #stocksTB .as-sym {
    display: block !important; font-size: 0.64rem !important;
    color: var(--tm) !important; white-space: nowrap !important;
  }
  #stocksTB .al, #stocksTB .stk-logo-wrap { width: 24px !important; height: 24px !important; flex-shrink: 0 !important; }
  #stocksTB .alp { width: 24px !important; height: 24px !important; font-size: 0.65rem !important; border-radius: 6px !important; }
  #stocksTB .fs { display: none !important; }
}

/* ════════════════════════════════════════════════════════
   FOREX · INDICES · COMMODITIES — mobile compact
   Layout: asset(52%) | price+24h%(27%) | trend(21%)
   td: 1=asset · 2=price · 3=1H→hide · 4=24H→hide · 5=7D→hide
       6,7=ec-cell(già hidden) · 8=trend · 9=qn(già hidden)
   ════════════════════════════════════════════════════════ */
/* Asset — 52% */
@media (max-width: 768px) {
  #forexTB td:nth-child(1),
  #indicesTB td:nth-child(1),
  #commTB td:nth-child(1) {
    width: 52% !important; overflow: hidden !important;
    padding-left: 10px !important; padding-right: 6px !important;
  }
  /* Price + 24h% stacked — 27% */
  #forexTB td:nth-child(2),
  #indicesTB td:nth-child(2),
  #commTB td:nth-child(2) {
    width: 27% !important; overflow: hidden !important;
    text-align: right !important; padding: 0 6px 0 2px !important;
  }
  /* Hide: 1H, 24H, 7D */
  #forexTB td:nth-child(3),
  #forexTB td:nth-child(4),
  #forexTB td:nth-child(5),
  #indicesTB td:nth-child(3),
  #indicesTB td:nth-child(4),
  #indicesTB td:nth-child(5),
  #commTB td:nth-child(3),
  #commTB td:nth-child(4),
  #commTB td:nth-child(5) { display: none !important; }
  /* Trend (td8) — 21% */
  #forexTB td:nth-child(8),
  #indicesTB td:nth-child(8),
  #commTB td:nth-child(8) {
    width: 21% !important; overflow: hidden !important;
    text-align: right !important; padding-left: 2px !important; padding-right: 8px !important;
  }
  /* Row */
  #forexTB tr, #indicesTB tr, #commTB tr { height: 54px !important; }
  #forexTB td, #indicesTB td, #commTB td {
    vertical-align: middle !important; padding-top: 0 !important; padding-bottom: 0 !important;
  }
  /* Trend pill */
  #forexTB .tv-pill, #indicesTB .tv-pill, #commTB .tv-pill {
    font-size: 0.65rem !important; padding: 2px 4px !important;
    display: inline-flex !important; align-items: center !important; justify-content: center !important;
  }
  /* Asset cell layout */
  #forexTB .ac, #indicesTB .ac, #commTB .ac {
    display: flex !important; align-items: center !important;
    gap: 5px !important; overflow: hidden !important; min-width: 0 !important;
  }
  #forexTB .ai, #indicesTB .ai, #commTB .ai { min-width: 0 !important; overflow: hidden !important; flex: 1 !important; }
  #forexTB .an, #indicesTB .an, #commTB .an { min-width: 0 !important; overflow: hidden !important; }
  #forexTB .an-name, #indicesTB .an-name, #commTB .an-name {
    display: block !important; font-size: 0.78rem !important; font-weight: 600 !important;
    white-space: nowrap !important; overflow: hidden !important; text-overflow: ellipsis !important;
  }
  #forexTB .as-sym, #indicesTB .as-sym, #commTB .as-sym {
    display: block !important; font-size: 0.64rem !important;
    color: var(--tm) !important; white-space: nowrap !important;
  }
  #forexTB .al, #indicesTB .al, #commTB .al { width: 24px !important; height: 24px !important; flex-shrink: 0 !important; }
  #forexTB .alp, #indicesTB .alp, #commTB .alp { width: 24px !important; height: 24px !important; font-size: 0.65rem !important; }
  /* Forex: flag pair compact */
  #forexTB .fx-flags { display: inline-flex !important; gap: 2px !important; flex-shrink: 0 !important; }
  #forexTB .fx-flag  { width: 18px !important; height: 13px !important; border-radius: 2px !important; }
  #forexTB .fs, #indicesTB .fs, #commTB .fs { display: none !important; }
  /* Commodity icon */
  #commTB .com-logo { font-size: 1.1rem !important; flex-shrink: 0 !important; }
  /* Index flag */
  #indicesTB .idx-flag img { width: 22px !important; height: auto !important; }
}




/* ════════════════════════════════════════════════════════
   TOP & FLOP CARDS — single column on mobile
   ════════════════════════════════════════════════════════ */
@media (max-width: 600px) {
  .topflop-grid,
  .tf-grid {
    grid-template-columns: 1fr !important;
    gap: 6px !important;
  }
  .tf-card, .gainer-card, .loser-card {
    padding: 10px 12px !important;
  }
}

/* ════════════════════════════════════════════════════════
   INDICATORS ACCORDION — tap to expand
   ════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .tab-acc-bar {
    padding: 8px 10px !important;
    border-radius: 8px !important;
    touch-action: manipulation;
    min-height: 44px !important;
  }
  .ind-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 6px !important;
  }
  .ind-card {
    padding: 8px 10px !important;
  }
  .ind-card-value {
    font-size: 1.1rem !important;
  }
  .ind-recs-grid {
    grid-template-columns: 1fr !important;
  }
}

/* ════════════════════════════════════════════════════════
   MEME SCANNER — horizontal scroll
   ════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .meme-scanner-wrap {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
  }
}

/* ════════════════════════════════════════════════════════
   NEWS SECTION — single col
   ════════════════════════════════════════════════════════ */
@media (max-width: 600px) {
  .news-two-col {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }
  .news-card {
    padding: 12px !important;
  }
  .news-card img {
    height: 140px !important;
    object-fit: cover !important;
  }
}

/* ════════════════════════════════════════════════════════
   DETAIL MODAL — bottom sheet mobile (slide-up drawer)
   ════════════════════════════════════════════════════════ */

/* Handle bar — visual drag indicator */
#detP::before,
.dp::before {
  content: '';
  display: none;
}

@media (max-width: 768px) {
  /* Detail page is full-page, not a real overlay — animate the whole #detP */
  #detP.dp {
    animation: none;
  }

  /* The inner content wrapper slides up when opened */
  #detP .ctn {
    position: relative;
  }

  /* ── Overlay backdrop ── */
  .asset-modal,
  .detail-overlay {
    padding: 0 !important;
    align-items: flex-end !important;
  }

  /* ── Panel: slide-up bottom sheet ── */
  .asset-modal-inner,
  .detail-panel {
    width: 100% !important;
    max-width: 100% !important;
    height: 92vh !important;
    border-radius: 16px 16px 0 0 !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  }
  .asset-modal.open .asset-modal-inner,
  .detail-overlay.open .detail-panel {
    transform: translateY(0);
  }

  /* ── Detail header sticky ── */
  .detail-header {
    position: sticky !important;
    top: 0 !important;
    z-index: 5 !important;
    background: var(--bg0, #040608) !important;
  }

  /* ── Handle bar on #detP (full-page variant) ── */
  .dp-handle {
    display: block;
    width: 36px;
    height: 4px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.18);
    margin: 10px auto 6px;
    flex-shrink: 0;
  }

  /* ── Fade-in for full-page detail ── */
  #detP.dp {
    animation: detSlideUp 0.32s cubic-bezier(0.4, 0, 0.2, 1) both;
  }
  @keyframes detSlideUp {
    from { opacity: 0; transform: translateY(28px); }
    to   { opacity: 1; transform: translateY(0); }
  }
}

/* ════════════════════════════════════════════════════════
   SEARCH — full width on mobile
   ════════════════════════════════════════════════════════ */
@media (max-width: 600px) {
  .stk-search,
  input[type="search"],
  .search-inp {
    width: 100% !important;
    min-width: 0 !important;
  }
  .stk-row {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 6px !important;
  }
}

/* ════════════════════════════════════════════════════════
   CONTENT WRAPPER — safe margins
   ════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .content,
  .main-wrap,
  .page-wrap {
    padding-left: 8px !important;
    padding-right: 8px !important;
  }
  .section-wrap,
  .card-wrap {
    border-radius: 10px !important;
    margin-bottom: 10px !important;
  }
}

/* ════════════════════════════════════════════════════════
   SCROLLBAR GLOBAL HIDE — cleaner UI on touch
   ════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  ::-webkit-scrollbar { display: none; }
  * { scrollbar-width: none; }
}

/* ════════════════════════════════════════════════════════
   PERFORMANCE — GPU compositing hints
   ════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .omnia-bnav,
  .tbl-s,
  .tabs,
  .ticker-w,
  .omtick-bar {
    will-change: transform;
    transform: translateZ(0);
    backface-visibility: hidden;
  }
}

/* ════════════════════════════════════════════════════════
   PWA STANDALONE MODE — hide if running as installed app
   ════════════════════════════════════════════════════════ */
@media (display-mode: standalone) {
  .omni-header {
    padding-top: env(safe-area-inset-top, 0) !important;
  }
  .omnia-bnav {
    padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 4px);
  }
}

/* ════════════════════════════════════════════════════════
   FOOTER ACCORDION — mobile friendly collapsible cols
   ════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  /* Footer main layout: stack vertically */
  .omni-footer-inner {
    flex-direction: column !important;
    gap: 0 !important;
  }
  /* Brand block stays full-width and compact */
  .omni-footer-brand {
    padding-bottom: 16px !important;
    border-bottom: 1px solid rgba(255,255,255,0.06);
  }
  /* Links section: full width */
  .omni-footer-links {
    display: flex !important;
    flex-direction: column !important;
    gap: 0 !important;
    width: 100% !important;
  }
  /* Each col */
  .omni-footer-col {
    border-bottom: 1px solid rgba(255,255,255,0.06);
  }
  /* Show accordion toggle button, hide static h4 */
  .omni-footer-col h4 {
    display: none !important;
  }
  .omni-footer-col-toggle {
    display: flex !important;
  }
  /* Collapsible body */
  .omni-footer-col-body {
    max-height: 0 !important;
    overflow: hidden !important;
    transition: max-height 0.3s ease !important;
    padding-bottom: 0 !important;
  }
  .omni-footer-col.omni-col-open .omni-footer-col-body {
    max-height: 400px !important;
    padding-bottom: 10px !important;
  }
  /* Arrow rotate */
  .omni-footer-col.omni-col-open .omni-ftoggle-arrow {
    transform: rotate(180deg) !important;
  }
  /* Social icons compact */
  .omni-footer-social-grid {
    grid-template-columns: repeat(4, 38px) !important;
    gap: 7px !important;
  }
  .omni-social-btn {
    width: 38px !important;
    height: 38px !important;
    border-radius: 10px !important;
  }
  /* Tagline compact */
  .omni-footer-tagline {
    font-size: 0.82rem !important;
    margin-bottom: 12px !important;
  }
}
