/* responsive.css — consolidated responsive overrides */
/* ---------- responsive ---------- */
.only-mobile { display: none !important; }
@media (max-width: 1000px) {
  .search { width: 130px; }
  .pb-prog { width: 90px; }
}
/* ---------- mobile bottom navigation ---------- */
.mobile-nav { display: none; }

@media (max-width: 820px) {
  :root { --top: 50px; --player: 54px; }
  .only-desktop { display: none !important; }
  .only-mobile { display: inline-flex !important; }

  /* Mobile Slide-Over Sidebar Drawer */
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; width: 280px; max-width: 85vw;
    transform: translateX(-100%);
    box-shadow: 0 10px 40px rgba(0,0,0,0.65); z-index: 150;
    transition: transform .26s cubic-bezier(0.16, 1, 0.3, 1);
    background: var(--bg2);
  }
  body.nav-open .sidebar { transform: translateX(0); }
  body.nav-open .scrim {
    display: block; position: fixed; inset: 0; background: rgba(0,0,0,.68);
    backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); z-index: 140;
  }
  body.nav-collapsed .sidebar { width: 280px; }

  /* Mobile Topbar */
  .topbar { padding: 0 8px; gap: 6px; }
  .search, .search-box { display: none !important; }
  #btn-install, #btn-lock { display: none !important; }
  .topbar-sync-btn {
    height: 32px;
    padding: 0 8px;
    gap: 0;
  }
  .topbar-sync-btn #sync-badge { display: none !important; }
  .pastebar { min-height: 36px; padding: 0 4px 0 8px; }

  /* Mobile App Bottom Navigation Bar */
  .mobile-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(52px + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: color-mix(in srgb, var(--panel) 94%, transparent);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--line);
    z-index: 90;
    align-items: center;
    justify-content: space-around;
  }
  .mobile-nav-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    flex: 1;
    height: 100%;
    background: transparent;
    border: none;
    color: var(--tx3);
    cursor: pointer;
    transition: color .15s ease, transform .12s ease;
    padding: 4px 0;
    -webkit-tap-highlight-color: transparent;
  }
  .mobile-nav-btn:hover { color: var(--tx); }
  .mobile-nav-btn.active { color: var(--accent); }
  .mobile-nav-ico { font-size: 18px; line-height: 1; }
  .mobile-nav-lbl { font-size: 10.5px; font-weight: 600; letter-spacing: .02em; }

  /* Layout adjustments for mobile bottom bar */
  .statusbar { display: none !important; }
  .playerbar {
    bottom: calc(52px + env(safe-area-inset-bottom, 0px)) !important;
  }
  .main {
    padding-bottom: calc(var(--player) + 72px + env(safe-area-inset-bottom, 0px)) !important;
  }
  .toasts {
    bottom: calc(64px + var(--player) + env(safe-area-inset-bottom, 0px)) !important;
  }

  /* Sync Dropdown Popover on Mobile */
  .sync-popover {
    left: 8px !important;
    right: 8px !important;
    width: auto !important;
    max-width: none !important;
    top: calc(var(--top) + 6px) !important;
  }

  /* Settings on Mobile */
  .settings-nav {
    padding: 4px;
    gap: 4px;
    border-radius: 12px;
    -webkit-overflow-scrolling: touch;
  }
  .settings-tab-btn {
    padding: 7px 12px;
    font-size: 12px;
    gap: 6px;
  }
  .settings-tab-icon { font-size: 14px; }
  .settings-card { padding: 14px 12px; gap: 12px; }
  .sync-hero-card { padding: 14px 12px; }
  .storage-kpi-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .storage-kpi-val { font-size: 17px; }

  .page { padding: 10px 10px 24px; }
  .vgrid { grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); gap: 8px; }
  .vrow { grid-auto-columns: 178px; }
  .vcard-title { font-size: 12.2px; }
  .hero { gap: 8px; }
  .kpi-v { font-size: 1.15rem; }
  .chart-grid, .set-grid-cards, .focus-grid { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .set-grid { grid-template-columns: 1fr; }
  .page-h { flex-wrap: wrap; padding: 10px 12px; }
  .toolbar { gap: 8px; padding: 6px 8px; }
  .tb-pills { width: 100%; overflow-x: auto; padding-bottom: 2px; }
  .tb-search-wrap { flex: 1 1 140px; }
  .tb-search-input { width: 100%; }
  .tb-search-input:focus { width: 100%; }
  .tb-control { flex: 1 1 120px; }
  .tb-control .tb-select { width: 100%; }
  .tb-right { width: 100%; margin-left: 0; justify-content: flex-end; }
  .playerbar { padding: 0 7px; gap: 6px; }
  .pb-thumb { width: 54px; }
  .pb-b { width: 28px; height: 28px; font-size: 13px; }
  .pb-b.play { width: 32px; height: 32px; }
  .pb-prog, .pb-time { display: none; }
  .selbar { bottom: calc(var(--player) + 60px); padding: 5px 8px; gap: 5px; justify-content: flex-start; max-width: calc(100vw - 16px); }
  .selbar .btn { padding: 0 8px; font-size: 11.5px; }
  .modal { max-height: 90dvh; }
  .shelves-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
  .pl-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
  .pomo-ring { width: 160px; height: 160px; }
  .pomo-time { font-size: 2.1rem; }
}
@media (max-width: 680px) {
  .pb-secondary:not(.speed-btn) { display: none !important; }
  .pb-time { font-size: 10.5px; }
  .pb-thumb { width: 48px; }
  .speed-popover {
    width: calc(100vw - 20px) !important;
    left: 10px !important;
    bottom: calc(var(--player) + 8px) !important;
  }
}
@media (max-width: 480px) {
  .q-thumb-wrap { width: 72px; height: 41px; }
  .q-title { font-size: 12px; }
  .speed-grid { grid-template-columns: repeat(4, 1fr); }
  .vgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
  .vcard-body { padding: 6px 7px 8px; }
  .vcard-title { font-size: 11.6px; -webkit-line-clamp: 2; line-clamp: 2; }
  .vcard-meta { font-size: 10.2px; }
  .pastebar { min-height: 34px; max-height: 132px; padding: 0 4px 0 8px; }
  .paste-input { font-size: 12px; padding: 7px 0; }
  .paste-ico { display: none; }
  .page { padding: 8px 8px 20px; }
  .ph-thumb { width: 62px; }
  .goal-wrap { gap: 10px; }
}
@media (hover: none) {
  .vcard-play { opacity: .92; width: 36px; height: 36px; }
  .vcard-sel, .vcard-menu { opacity: .9; }
  .sec-a { opacity: 1; }
}

@media print {
  .sidebar, .topbar, .playerbar, .statusbar, .mobile-nav { display: none !important; }
}
