/* ==========================================================
   MOBILE · fixes pras páginas novas (Tier 1/2/3)
   Aplicado em telas <= 720px (tablet portrait + smartphone)
   ========================================================== */

@media (max-width: 720px) {
  /* ===== Hero · todas páginas ===== */
  .ff-hero {
    padding: 22px 14px 16px !important;
  }
  .ff-hero-titulo {
    font-size: 22px !important;
    line-height: 1.15 !important;
  }
  .ff-hero-sub {
    font-size: 13px !important;
    line-height: 1.45 !important;
  }
  .ff-hero-tag {
    font-size: 9px !important;
    padding: 3px 8px !important;
  }
  .ff-hero-stats {
    gap: 12px !important;
    padding-top: 10px !important;
  }
  .ff-hero-stat-num { font-size: 16px !important; }
  .ff-hero-stat-lbl { font-size: 9px !important; }
  .ff-breadcrumb { font-size: 11px !important; margin-bottom: 12px !important; }
  .ff-corpo {
    padding: 12px 12px 40px !important;
  }

  /* ===== Painel Pro · todas colunas viram full ===== */
  .col-3, .col-4, .col-6, .col-8, .col-12 {
    grid-column: span 12 !important;
  }
  .painel-grid { gap: 8px !important; }
  .painel-card { padding: 11px !important; }
  .painel-card-titulo { font-size: 9px !important; }
  .fg-mini {
    flex-direction: column !important;
    text-align: center !important;
    gap: 8px !important;
  }
  .var-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  /* ===== Hedge · 2 cols vira 1 col ===== */
  .hedge-layout-2col {
    grid-template-columns: 1fr !important;
  }
  .hedge-lista-lateral {
    max-height: 320px !important;
    margin-top: 12px;
  }
  #compare-svg {
    height: 260px !important;
  }
  .compare-stats {
    grid-template-columns: 1fr 1fr !important;
  }
  /* Tabs janela rolável horizontalmente */
  .tabs {
    overflow-x: auto !important;
    flex-wrap: nowrap !important;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
  }
  .tabs::-webkit-scrollbar { display: none; }
  .tab-btn {
    flex-shrink: 0 !important;
    font-size: 11px !important;
    padding: 6px 10px !important;
  }
  /* Matriz heatmap rolável */
  .matriz-wrap {
    max-height: 60vh !important;
    padding: 10px !important;
  }
  .matriz-table td {
    width: 22px !important;
    height: 22px !important;
    font-size: 8px !important;
  }
  .matriz-table th {
    font-size: 8px !important;
    padding: 4px 2px !important;
  }
  .matriz-table th.row-head {
    min-width: 60px !important;
    padding-right: 6px !important;
  }

  /* ===== Commodities · 2 cols vira 1 col ===== */
  .cmd-layout {
    grid-template-columns: 1fr !important;
  }
  .cmd-lista-lateral {
    max-height: 280px !important;
  }
  .cmd-detalhe { padding: 14px !important; }
  .cmd-det-header {
    flex-wrap: wrap !important;
    gap: 12px !important;
  }
  .cmd-det-icone { font-size: 36px !important; }
  .cmd-det-titulo { font-size: 18px !important; }
  .cmd-det-preco-valor { font-size: 22px !important; }
  /* Tabela empresas · esconde colunas e ajusta */
  .empresa-row {
    grid-template-columns: 60px 1fr !important;
    gap: 8px !important;
    padding: 10px !important;
  }
  .empresa-row > div:nth-child(3),
  .empresa-row > div:nth-child(4),
  .empresa-row > div:nth-child(5) { display: none !important; }
  .empresa-row.head { font-size: 9px !important; }
  .empresa-tk { font-size: 12px !important; }

  /* ===== Scanner · 2 cols vira 1 col ===== */
  .scn-layout {
    grid-template-columns: 1fr !important;
  }
  .scn-lista-lateral {
    max-height: 300px !important;
  }
  .scn-row {
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
    padding: 10px !important;
    font-size: 11px !important;
  }
  .scn-row.head {
    grid-template-columns: 1fr 1fr !important;
  }
  .scn-row > div:nth-child(3),
  .scn-row > div:nth-child(4),
  .scn-row > div:nth-child(5),
  .scn-row > div:nth-child(6) { display: none !important; }

  /* ===== Fear & Greed · gauge centralizado ===== */
  .gauge-wrap {
    grid-template-columns: 1fr !important;
    text-align: center !important;
    gap: 10px !important;
    padding: 18px 14px !important;
  }
  .gauge-info { text-align: center !important; }
  #gauge-svg { max-width: 240px !important; margin: 0 auto !important; }
  .gauge-numero { font-size: 42px !important; }
  .gauge-label { font-size: 16px !important; }
  .gauge-emoji-inline { font-size: 28px !important; }
  .fatores-grid {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }
  .fator-card { padding: 14px !important; }
  .fator-score { font-size: 28px !important; }

  /* ===== OnChain · stats + gas ===== */
  .stats-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
  }
  .stat-card { padding: 11px !important; }
  .stat-valor { font-size: 16px !important; }
  .gas-grid {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }
  .gas-card { padding: 14px !important; }
  .gas-valor { font-size: 24px !important; }
  .tx-row {
    grid-template-columns: auto 1fr auto !important;
    gap: 10px !important;
    padding: 10px !important;
  }
  .tx-row > div:nth-child(2) { display: none !important; }
  .tx-valor { font-size: 13px !important; }

  /* ===== Agro · tabs e cards ===== */
  .agro-tabs {
    overflow-x: auto !important;
    flex-wrap: nowrap !important;
  }
  .agro-tab {
    flex-shrink: 0 !important;
    font-size: 12px !important;
    padding: 10px 14px !important;
  }
  .precos-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
  }
  .preco-card { padding: 11px !important; }
  .preco-valor { font-size: 18px !important; }
  .safra-row {
    grid-template-columns: auto 1fr !important;
    gap: 10px !important;
  }
  .safra-row > div:nth-child(3),
  .safra-row > div:nth-child(4) { display: none !important; }

  /* ===== Clima Agro ===== */
  .alert-card {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
    padding: 12px 14px !important;
  }
  .alert-card > div:nth-child(3) { display: none !important; }
  .estacao-grid, .regiao-grid {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }
  .estacao-card, .regiao-card { padding: 12px !important; }

  /* ===== Fatos relevantes ===== */
  .fato-card {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
    padding: 12px 14px !important;
  }
  .fato-meta {
    flex-wrap: wrap !important;
    gap: 6px !important;
  }
  .fato-titulo { font-size: 13px !important; }

  /* ===== Social trending ===== */
  .trend-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 6px !important;
  }
  .trend-card { padding: 8px 10px !important; }
  .trend-mencoes { font-size: 16px !important; }
  .tabs-tempo {
    overflow-x: auto !important;
    flex-wrap: nowrap !important;
    padding-bottom: 4px;
  }
  .tab-tempo {
    flex-shrink: 0 !important;
    font-size: 11px !important;
    padding: 6px 10px !important;
  }

  /* ===== Comparador carteiras ===== */
  .cp-tk-row {
    grid-template-columns: 1.5fr 0.8fr auto !important;
    gap: 6px !important;
  }
  .cp-tk-row input {
    padding: 8px 10px !important;
    font-size: 12px !important;
  }
  .cp-stats {
    grid-template-columns: 1fr 1fr !important;
    gap: 6px !important;
  }
  .cp-stat-valor { font-size: 16px !important; }
  #cp-svg { height: 280px !important; }

  /* ===== Alertas preço · Newsletter · Status ===== */
  .al-form, .nl-form {
    padding: 18px !important;
  }
  .al-grupo-row {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }
  .check-row {
    grid-template-columns: auto 1fr auto !important;
    gap: 10px !important;
    padding: 10px 14px !important;
  }
  .check-latencia { display: none !important; }
  .nl-features {
    grid-template-columns: 1fr !important;
  }

  /* ===== Status · alerta overall ===== */
  .status-overall {
    flex-direction: column !important;
    text-align: center !important;
    gap: 10px !important;
    padding: 14px !important;
  }
  .status-overall-icone { font-size: 28px !important; }
  .status-overall-titulo { font-size: 15px !important; }

  /* ===== Calendário · evento ===== */
  .ce-evento {
    grid-template-columns: 50px 1fr !important;
    gap: 8px !important;
    padding: 8px 10px !important;
  }
  .ce-ev-pais { display: none !important; }
  .ce-ev-info { grid-column: 2 !important; }
  .ce-ev-imp {
    grid-column: 1 / -1 !important;
    flex-direction: row !important;
    justify-content: flex-start !important;
    gap: 6px !important;
    margin-top: 4px !important;
  }
  .ce-ev-titulo { font-size: 12px !important; }
  .ce-ev-meta { font-size: 10px !important; gap: 6px !important; }
  /* Modal calendário */
  .ce-modal {
    padding: 20px 18px !important;
    max-height: 88vh !important;
  }
  .ce-modal-titulo { font-size: 17px !important; }
  .ce-modal-impacto-grid {
    grid-template-columns: 1fr !important;
  }

  /* ===== FAB Watchlist · posição ===== */
  #wl-fab {
    bottom: 16px !important;
    right: 14px !important;
    width: 44px !important;
    height: 44px !important;
    font-size: 20px !important;
  }
  #wl-painel {
    bottom: 70px !important;
    right: 10px !important;
    left: 10px !important;
    width: auto !important;
    max-height: 70vh !important;
  }

  /* ===== Tabela genérica · scroll horizontal ===== */
  table {
    font-size: 11px !important;
  }
  /* envelopa tables em wrap rolável */
  .table-responsive, .merc-painel table {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
  }

  /* ===== Botão compartilhar Fear&Greed ===== */
  .gauge-wrap > button[onclick*="compartilhar"] {
    top: 8px !important;
    right: 8px !important;
    padding: 5px 9px !important;
    font-size: 10px !important;
  }

  /* ===== Painel Pro · gauge mini ===== */
  .fg-mini-circulo {
    width: 56px !important;
    height: 56px !important;
    font-size: 18px !important;
  }

  /* ===== Botões filtros multi-linha ===== */
  .fundos-filtros, .fatos-filtros, .ce-paises-chips {
    gap: 4px !important;
  }
  .fundos-filtro, .fato-filtro, .ce-pais-chip {
    font-size: 10px !important;
    padding: 5px 9px !important;
  }
}

/* ============================================
   Telas muito pequenas (smartphone vertical)
   ============================================ */
@media (max-width: 480px) {
  .ff-hero-titulo { font-size: 20px !important; }
  .ff-hero-sub { font-size: 12px !important; }
  .stats-grid {
    grid-template-columns: 1fr !important;
  }
  .precos-grid {
    grid-template-columns: 1fr !important;
  }
  .var-grid {
    grid-template-columns: 1fr !important;
  }
  .trend-grid {
    grid-template-columns: 1fr !important;
  }
  .cp-stats {
    grid-template-columns: 1fr !important;
  }
  /* Mantém Painel Pro compacto */
  .painel-card-titulo {
    flex-wrap: wrap !important;
    gap: 4px !important;
  }
  .painel-card-titulo a {
    flex-basis: 100% !important;
  }
}
