/* Phone tweaks for the hub's content (the ☰ menu itself lives in index.html).
   Every rule here is phone-only. */
@media (max-width: 780px) {
  /* Date presets / filters: one row, finger-sized buttons (swipe if it ever overflows) */
  .seg { flex-wrap: nowrap; overflow-x: auto; max-width: 100%; scrollbar-width: none; }
  .seg::-webkit-scrollbar { display: none; }
  .seg button { flex: none; min-height: 36px; padding: 6px 9px; }
  .toolbar .hint { margin-left: 0; }
  .back { padding: 10px 0; }
  .xbtn { width: 28px; height: 28px; line-height: 28px; }

  /* KPI tiles: half the height */
  .kpis, .kpis.k6 { gap: 10px; margin-bottom: 18px; }
  .kpi { padding: 12px 14px; border-radius: 13px; }
  .kpi .ic { display: none; }
  .kpi .v { font-size: 21px; }
  .kpi .l { font-size: 11.5px; margin-top: 6px; }

  /* Lander cards: the four stats (profit, leads, CPL, RPL) sit in one row */
  .deal { padding: 15px 15px 14px; }
  .lcard .subs { grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 12px; }
  .lcard .sub { padding: 7px 8px; }
  .lcard .sub .sl { font-size: 8.5px; letter-spacing: 0.04em; }
  .lcard .sub .sv { font-size: 12px; }
  .rhead h2 { font-size: 22px; }
  .rhead .asof { margin-left: 0; text-align: left; }

  /* Wide tables: the first column stays put while you swipe sideways */
  .tscroll th:first-child, .tscroll td:first-child { position: sticky; left: 0; z-index: 1; background: var(--panel); box-shadow: 1px 0 0 var(--line); }
  .cap thead th:first-child { z-index: 2; }
  tr.clickable:hover td:first-child { background: #fafbfc; }
  td.adcell, td.adcell small { max-width: 190px; }

  /* iPhone zooms the page into any input under 16px — keep them at 16 */
  input, select, .tsearch input, .custom-range input, .ub-field input, .ub-field select, .tysel select { font-size: 16px; }
  .gate .box { width: min(340px, calc(100vw - 32px)); }
}

/* ---- 10/28 mobile audit (impeccable) ---- */
@media (max-width: 780px) {
  /* Date presets wrap instead of running off the right edge (the nested toolbar
     couldn't shrink, so the whole Attribution page scrolled sideways) */
  .toolbar > .toolbar { min-width: 0; max-width: 100%; }
  .seg { flex-wrap: wrap; overflow: visible; }

  /* Finger-sized targets: 44px */
  .seg button, .rp-more, .back, .tbtn { min-height: 44px; }
  .seg button { min-width: 44px; }
  .xbtn { width: 36px; height: 36px; line-height: 36px; }
  table[data-sk] th { padding-top: 14px; padding-bottom: 14px; }
  .rp-d summary, .notes-d summary { padding: 13px 0; }
  .lcard .sub .sl { font-size: 10px; letter-spacing: 0.02em; }

  /* Report: the counting notes fold under one line */
  .notes-d { margin-bottom: 18px; }
  .notes-d summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--muted); }
  .notes-d .attr-note { margin-bottom: 10px; }
}
