/* Independent mobile IA */
.bottom-nav {
  display: none;
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: var(--z-nav);
  height: 64px;
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  background: rgba(7, 7, 10, 0.92);
  backdrop-filter: blur(18px);
  border-top: 1px solid var(--hairline);
  grid-template-columns: repeat(5, 1fr);
  gap: 2px;
}
.bottom-nav button {
  border: 0;
  background: transparent;
  color: var(--ink-mute);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: 48px;
  cursor: pointer;
  border-radius: 12px;
  transition: color 0.2s var(--ease-out), background 0.2s var(--ease-out);
}
.bottom-nav button svg { width: 20px; height: 20px; }
.bottom-nav button.is-active {
  color: var(--ink-strong);
  background: rgba(255,255,255,0.05);
}

.preview-sheet {
  display: none;
  position: fixed;
  inset: 0;
  z-index: var(--z-sheet);
  background: rgba(0,0,0,0.92);
  flex-direction: column;
  touch-action: none;
}
.preview-sheet.is-open { display: flex; }
.preview-sheet-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  padding-top: calc(12px + env(safe-area-inset-top));
}
.preview-sheet-stage {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  overflow: hidden;
}
.preview-sheet-stage img {
  max-width: 100%;
  max-height: 70dvh;
  object-fit: contain;
  transform-origin: center center;
  transition: transform 0.05s linear;
}
.preview-sheet-foot {
  padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
  text-align: center;
  color: var(--ink-soft);
}

@media (max-width: 820px) {
  :root { --bottom-nav-h: 68px; --nav-h: 56px; }
  .bottom-nav { display: grid; }
  .app-nav .brand-sub,
  .nav-actions .hide-sm { display: none; }
  .nav-search { max-width: none; }

  .wall { padding: 12px; }
  .wall-head { flex-direction: column; align-items: flex-start; }
  .wall-mosaic {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 12px;
    grid: none;
    padding-bottom: 8px;
  }
  .wall-tile,
  .wall-tile:nth-child(n) {
    flex: 0 0 min(86vw, 320px);
    min-height: 320px;
    height: auto;
    grid: none;
    scroll-snap-align: center;
  }
  .wall-tile-stats {
    max-height: 180px;
    opacity: 1;
    margin-top: 4px;
  }

  body.is-live .bottom-nav { display: none !important; }
  body.is-live { --bottom-nav-h: 0px; }

  .workspace { padding: 0 12px 24px; }
  .ws-side { grid-template-columns: 1fr; }
  .gallery-grid {
    grid-template-columns: 1fr;
  }
  .cand-card { min-height: 0; }
  .cand-preview { aspect-ratio: 16 / 11; }
  .mode-tab { min-height: 40px; padding: 0 14px; }
  .btn, .nav-btn { min-height: 44px; }

  .studio { padding: 12px; }
  .studio-rail button { min-height: 44px; }
}

@media (max-width: 820px) and (prefers-reduced-motion: no-preference) {
  .wall-tile:hover { transform: none; }
}
