/* ============================================================
   LAKFINTER — mobile.css
   Applies when body[data-mode="mobile"] — set by app.js based on
   viewport width, or overridden by the mode-toggle button. Scoped
   (rather than a @media query) so the manual override actually works
   regardless of the real screen width.
   ============================================================ */

body[data-mode="mobile"] {
  .sidebar {
    display: none;
  }

  .app-shell {
    flex-direction: column;
  }

  .content-area {
    padding-bottom: 64px; /* leave room for the fixed bottom nav */
  }

  .tab-content {
    padding: var(--space-5) var(--space-4);
  }

  .bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    background: var(--paper-raised);
    border-top: 1px solid var(--rule);
    padding: var(--space-1) var(--space-2);
    padding-bottom: max(var(--space-1), env(safe-area-inset-bottom));
    z-index: 10;
  }

  .bottom-nav .nav-item {
    flex: 1;
    flex-direction: column;
    gap: var(--space-1);
    padding: var(--space-2) var(--space-1);
    font-size: 11px;
    text-align: center;
  }

  .bottom-nav .nav-icon {
    font-size: 18px;
    width: auto;
  }

  .bottom-nav .nav-item.is-active {
    background: transparent;
  }

  /* shell-controls (mode toggle + sign out) lives outside the now-hidden
     sidebar in the markup, so it floats freely as a small pill above the
     bottom nav rather than being hidden along with the sidebar. */
  .shell-controls {
    position: fixed;
    bottom: 70px;
    right: var(--space-2);
    background: var(--paper-raised);
    border: 1px solid var(--rule);
    border-radius: var(--radius-md);
    padding: var(--space-1);
    display: flex;
    flex-direction: row;
    gap: var(--space-1);
    box-shadow: 0 2px 8px rgba(43, 38, 32, 0.1);
    z-index: 10;
    width: auto;
  }

  .mode-toggle-btn,
  .sidebar-logout {
    padding: var(--space-2);
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
  }

  /* Button text stays in the DOM for screen readers but is visually
     replaced by a single glyph via ::before, rather than using font-size:0
     (which can read inconsistently across assistive tech). */
  .mode-toggle-btn span,
  .sidebar-logout span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
  }

  .mode-toggle-btn::before {
    content: "⛶";
    font-size: 14px;
  }

  .sidebar-logout::before {
    content: "⏻";
    font-size: 14px;
  }

  .home-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .mapping-grid {
    grid-template-columns: 1fr;
  }

  .section-toolbar {
    flex-direction: column;
  }

  .tree-node-row {
    flex-wrap: wrap;
    gap: var(--space-2);
  }

  .tree-node-actions {
    flex-wrap: wrap;
  }
}
