/* Mobile styles (<1024px) ──────────────────────────────────────────────────── */
@media (max-width: 1023px) {
  .nexus-shell {
    --topbar-h: 52px;
    --statusbar-h: 36px;
    --sidebar-left-w: 0px;
    --sidebar-right-w: 0px;
    grid-template-columns: 0px 1fr 0px;
  }

  .nexus-topbar { height: var(--topbar-h); }
  .nexus-statusbar { height: var(--statusbar-h); }

  /* Sidebars become overlay drawers */
  .nexus-sidebar-left {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 280px !important;
    transform: translateX(-100%);
    transition: transform 220ms cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 300;
    box-shadow: var(--shadow-xl);
  }
  .nexus-sidebar-left.open {
    transform: translateX(0);
  }

  .nexus-sidebar-right {
    position: fixed;
    right: 0;
    top: 0;
    bottom: 0;
    width: 300px !important;
    transform: translateX(100%);
    transition: transform 220ms cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 300;
    box-shadow: var(--shadow-xl);
  }
  .nexus-sidebar-right.open {
    transform: translateX(0);
  }

  /* Ensure touch targets are ≥44px */
  .btn { min-height: 44px; padding: 10px 16px; }
  .btn-sm { min-height: 36px; }
  .btn-icon { min-width: 44px; min-height: 44px; width: 44px; height: 44px; }
  .sidebar-nav-item { min-height: 44px; padding: 10px 16px; }
  .topbar-btn { width: 44px; height: 44px; }

  /* Prevent iOS input zoom */
  .form-input, .form-textarea, .form-select, .search-input {
    font-size: 16px;
  }

  /* Safe areas */
  .nexus-statusbar { padding-bottom: env(safe-area-inset-bottom); }

  /* Toast at bottom-center on mobile */
  #toast-container {
    bottom: calc(var(--statusbar-h, 36px) + 12px + env(safe-area-inset-bottom));
    right: 50%;
    transform: translateX(50%);
    width: calc(100vw - 32px);
    max-width: 400px;
    align-items: center;
  }

  /* Bottom sheet */
  .bottom-sheet {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-surface-2);
    border-top: 1px solid var(--border-strong);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    padding-bottom: env(safe-area-inset-bottom);
    z-index: 400;
    transform: translateY(100%);
    transition: transform 240ms cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: var(--shadow-xl);
  }
  .bottom-sheet.open { transform: translateY(0); }

  .bottom-sheet-handle {
    width: 36px;
    height: 4px;
    background: var(--border-strong);
    border-radius: var(--radius-full);
    margin: 12px auto 8px;
  }

  .bottom-sheet-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    color: var(--text-primary);
    font-size: 0.9375rem;
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
  }
  .bottom-sheet-item:hover { background: var(--bg-surface-3); }
  .bottom-sheet-item.danger { color: var(--danger); }

  /* Kanban horizontal scroll on mobile */
  .kanban-board {
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
  }
  .kanban-col { scroll-snap-align: start; }

  /* Hide desktop-only elements */
  .desktop-only { display: none !important; }

  /* Tooltips disabled on mobile */
  [data-tooltip]::after { display: none; }
}

@media (min-width: 768px) and (max-width: 1023px) {
  /* Tablet layout adjustments */
  .nexus-shell { --sidebar-left-w: 64px; }
}
