/* styles-mobile.css - phone refinements (<=768px). Loaded last. */
.mobile-scrim { display: none; }
.mobile-nav-fab { display: none; }
@media (max-width: 768px) {
  html, body { max-width: 100%; overflow-x: hidden; }
  .app { max-width: 100vw; }
  .app[data-sidebar="expanded"], .app[data-sidebar="collapsed"] { grid-template-columns: 1fr !important; }
  .main { min-width: 0; max-width: 100vw; overflow-x: hidden; }
  .sidebar { position: fixed; top: 0; left: 0; height: 100dvh; width: min(82vw, 300px); z-index: 300; transform: translateX(-100%); transition: transform .22s ease; box-shadow: 0 0 40px rgba(0,0,0,.6); }
  .app[data-sidebar="expanded"] .sidebar { transform: translateX(0); }
  .app[data-sidebar="collapsed"] { --sidebar-w: 0px; }
  .app[data-sidebar="collapsed"] .sidebar { display: flex; transform: translateX(-100%); }
  .app[data-sidebar="collapsed"] .brand-name,
  .app[data-sidebar="collapsed"] .nav-item > span,
  .app[data-sidebar="collapsed"] .nav-section-label,
  .app[data-sidebar="collapsed"] .nav-children,
  .app[data-sidebar="collapsed"] .user-meta { display: revert !important; }
  .app[data-sidebar="collapsed"] .nav-item { justify-content: flex-start; padding: 0 12px; }
  .app[data-sidebar="expanded"] .mobile-scrim { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 290; }
  .topbar-menu { display: grid !important; place-items: center; }
  .mobile-nav-fab {
    display: flex; flex-direction: column; justify-content: center; gap: 4px;
    position: fixed; top: 10px; left: 10px; z-index: 310;
    width: 40px; height: 40px; padding: 0 9px;
    background: var(--bg-1, #1a1a1f); border: 1px solid var(--border, #333); border-radius: 9px;
    box-shadow: 0 2px 10px rgba(0,0,0,.4);
  }
  .mobile-nav-fab span { display: block; height: 2px; width: 100%; background: var(--text-1, #fff); border-radius: 2px; }
  /* Hide the FAB while the drawer is open (the drawer + scrim take over). */
  .app[data-sidebar="expanded"] .mobile-nav-fab { display: none; }
  /* Give page content room so the FAB never overlaps headings. */
  .app[data-sidebar="collapsed"] .topbar { padding-left: 58px; }
  .app[data-sidebar="collapsed"] .page > :first-child,
  .app[data-sidebar="collapsed"] .launcher-hero { padding-top: 4px; }
  .topbar { padding: 0 10px; gap: 8px; }
  .crumb { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .library-toolbar, .asset-detail-header, .panel-head, .ops-stats, .tab-group { flex-wrap: wrap !important; gap: 8px !important; }
  .tab-group { overflow-x: auto; }
  .toolbar-title { font-size: 16px; }
  .library-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 10px; }
  .library-list, .audit-table { display: block; }
  .list-row, .audit-row { min-width: 0; grid-template-columns: minmax(0, 1fr) !important; gap: 6px; }
  .list-row.head, .audit-row.head { display: none; }
  .dash-grid { grid-template-columns: 1fr !important; }
  .launcher-grid { grid-template-columns: 1fr !important; }
  .launcher-activity-grid { grid-template-columns: 1fr !important; }
  .modal { width: calc(100vw - 24px) !important; max-width: calc(100vw - 24px) !important; margin: 12px auto !important; }
  .toast-container { left: 12px; right: 12px; bottom: 12px; z-index: 400; }
  .toast { max-width: none; }
  .icon-btn, .nav-item, .btn { min-height: 40px; }
  /* Jobs: .job-row is a 9-column grid pinned to min-width:1100px, so on a phone
     it forced ~2.8x the viewport. Measured at 393px: row width 1100px. Collapse
     to stacked rows like .list-row already does, and drop the header (column
     labels are meaningless once the columns are gone). */
  .job-list, .job-table { display: block; }
  .job-row {
    min-width: 0 !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 6px !important;
  }
  .job-row.head { display: none; }
  .job-row > * { min-width: 0; overflow-wrap: anywhere; }
  /* Recorder action cluster ran to 278px inside a narrower card. */
  .recorder-controls { flex-wrap: wrap; min-width: 0; }
  .recorder-controls > * { min-width: 0; }
  /* Fixed-width settings panels (432px) overflowed a 393px viewport. */
  .panel, .settings-panel { max-width: 100% !important; min-width: 0 !important; }
  /* The real cause was the two-column settings grid: a fixed 200px nav column
     plus content forced 432px. Stack it; the nav is short enough to sit above. */
  .settings-layout {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 12px !important;
  }
  .settings-nav { position: static !important; flex-direction: row; flex-wrap: wrap; }
  /* Long identifiers (asset names, node ids) are the other overflow source. */
  .launcher-activity-item, .launcher-activity-item-name { min-width: 0; overflow-wrap: anywhere; }
  .df-mobile-hint { display: flex; }
  .page.playout { overflow-x: auto; }
}
.df-mobile-hint { display: none; }
