/* ── Warm Ink Mobile Responsive ── */

/* ══ Bottom Navigation Bar (mobile only) ══ */
#mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 56px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  z-index: 30;
  flex-direction: row;
  align-items: center;
  justify-content: space-around;
  padding: 0 0.5rem;
  box-shadow: 0 -2px 12px var(--shadow);
}

.m-nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  flex: 1;
  height: 100%;
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  padding: 0.25rem 0;
  border-radius: var(--radius);
  transition: color var(--duration-fast);
  font-family: var(--font-ui);
  font-size: 0.6rem;
  font-weight: 500;
}
.m-nav-btn svg {
  width: 20px;
  height: 20px;
}
.m-nav-btn.active {
  color: var(--accent);
}
.m-nav-btn span {
  font-size: 0.58rem;
  letter-spacing: 0.02em;
}

/* ══ 768px breakpoint ══ */
@media (max-width: 768px) {
  /* Show bottom nav */
  #mobile-bottom-nav {
    display: flex;
  }

  /* Push content up so it's not hidden by bottom nav */
  #status-bar {
    display: none;
  }
  #app {
    padding-bottom: 56px;
  }

  /* Topbar: hide desktop-only buttons */
  .topbar-desktop-only {
    display: none !important;
  }

  /* Binder and inspector become full-screen on mobile */
  #binder-panel {
    width: 100%;
    bottom: 56px;
  }
  #inspector-panel {
    width: 100%;
    bottom: 56px;
  }
  #settings-panel {
    width: 100%;
    bottom: 56px;
  }

  /* Editor padding adjust for mobile */
  #editor-panel {
    padding: 1.5rem 1rem 4rem;
  }

  /* Library grid: single column */
  .library-grid {
    grid-template-columns: 1fr;
    padding: 1rem 1rem 2rem;
  }
  .library-header {
    padding: 1.5rem 1rem 1rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }
  .library-controls {
    padding: 0.75rem 1rem 0.5rem;
  }
  .library-stats-bar {
    padding: 0.6rem 1rem;
    gap: 1rem;
    overflow-x: auto;
  }

  /* Settings panel full-width */
  #settings-panel {
    width: 100%;
    right: 0;
  }

  /* Player pill repositioned */
  #player-bar {
    bottom: calc(56px + 8px);
    right: 0.75rem;
  }

  /* Floating toolbar — smaller on mobile */
  #floating-toolbar {
    padding: 3px 4px;
  }
  .ftb-btn {
    width: 32px;
    height: 32px;
  }
}

/* ══ 480px breakpoint ══ */
@media (max-width: 480px) {
  /* Topbar: collapse title */
  .topbar-chapter {
    display: none;
  }
  .topbar-sep {
    display: none;
  }

  /* Smaller topbar */
  #topbar {
    padding: 0 0.75rem;
    gap: 0.25rem;
  }

  /* Tighter editor */
  #editor-panel {
    padding: 1rem 0.75rem 4rem;
  }

  /* Library compact */
  .library-wordmark {
    font-size: 1.6rem;
  }

  /* Settings full screen */
  #settings-panel {
    top: 0;
    border-radius: 0;
  }
}

/* ══ Landscape mobile ══ */
@media (max-width: 768px) and (orientation: landscape) {
  #mobile-bottom-nav {
    height: 44px;
  }
  #app {
    padding-bottom: 44px;
  }
  #binder-panel,
  #inspector-panel,
  #settings-panel {
    bottom: 44px;
  }
  #player-bar {
    bottom: calc(44px + 8px);
  }
}
