/* ══════════════════════════════════════════════════════════
   Dreaming Polar — Mobile Layout  (≤ 768px)
   Single-panel tab view with bottom nav bar
   ══════════════════════════════════════════════════════════ */

@media (max-width: 768px) {

  /* ── Give room for the tab bar at bottom ──────────────── */
  main.hero {
    height: calc(100dvh - var(--header-height) - 56px);
  }

  /* ── Panels: only mob-visible is shown ────────────────── */
  .hero-screens-row {
    position: relative;
    overflow: hidden;
  }

  .hero-screen {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    display: none !important;
  }

  .hero-screen.mob-visible {
    display: flex !important;
  }

  /* ── Terminal: compact on mobile ──────────────────────── */
  #terminal-panel {
    max-height: 38vh;
    flex-shrink: 0;
  }

  /* ── Header: tighten for small screens ────────────────── */
  .page-header {
    padding: 0 10px;
    gap: 6px;
  }

  .app-logo { height: 26px; }

  /* ── AI dialog: full-width, anchored below header ─────── */
  .ai-header-dialog {
    min-width: calc(100vw - 20px) !important;
    max-width: calc(100vw - 20px) !important;
    left: 50% !important;
    top: calc(var(--header-height) - 8px) !important;
    transform: translateX(-50%) !important;
  }

  /* ── Mobile tab bar ───────────────────────────────────── */
  .mob-tab-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 56px;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    z-index: 200;
    display: flex;
    align-items: stretch;
    background: var(--surface, #ffffffee);
    border-top: 1px solid var(--border, #e2e8f0);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
  }

  .mob-tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    border: none;
    background: transparent;
    color: var(--text-muted, #94a3b8);
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-family: inherit;
    cursor: pointer;
    transition: color 0.15s;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
  }

  .mob-tab-icon {
    font-size: 1.25rem;
    line-height: 1;
    transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
  }

  .mob-tab.active .mob-tab-icon { transform: scale(1.18) translateY(-1px); }
  .mob-tab.active               { color: #16a34a; }

  /* ── Theme overrides for tab bar ──────────────────────── */
  [data-theme="dark"] .mob-tab-bar,
  [data-theme="grey"] .mob-tab-bar {
    background: rgba(13,17,23,0.92);
    border-top-color: rgba(255,255,255,0.07);
  }
  [data-theme="aurora"] .mob-tab-bar {
    background: rgba(7,7,26,0.92);
    border-top-color: rgba(192,132,252,0.15);
  }

  [data-theme="dark"]   .mob-tab.active { color: #3fb950; }
  [data-theme="grey"]   .mob-tab.active { color: #57ab5a; }
  [data-theme="aurora"] .mob-tab.active { color: #c084fc; }

  /* ── Content body: tighter padding on mobile ──────────── */
  .content-screen-body {
    padding: 10px 12px 20px;
  }

  /* ── Remove inter-panel borders on mobile ─────────────── */
  .hero-screen { border-right: none !important; }
}

/* ── Desktop: never show tab bar ──────────────────────────── */
@media (min-width: 769px) {
  .mob-tab-bar { display: none !important; }
}
