/* ── Tablet ─────────────────────────────────────────────────────── */
@media (max-width: 1280px) {
  .id-role { display: none; }
  .ws-name { display: none; }
  .export { grid-template-columns: 220px minmax(0, 1fr) 300px; }
}
@media (max-width: 1100px) {
  .workspaces button small { display: none; }
  .export { grid-template-columns: minmax(0, 1fr) 300px; }
  .ex-dest { display: none; }
  .app[data-workspace="color"] .ws { grid-template-columns: var(--x) minmax(0, 1fr) 280px; }
}

/* ── Phone / narrow: stacked editor ─────────────────────────────── */
@media (max-width: 900px) {
  :root { --titlebar-h: 44px; --wsbar-h: 40px; --status-h: 0px; }
  html, body { height: auto; }
  body { overflow-x: hidden; overflow-y: visible; }
  .app { position: static; display: block; min-height: 100%; }
  .titlebar { position: sticky; top: 0; height: var(--titlebar-h); padding: 0 10px; gap: 8px; }
  .menubar { display: none; }
  .mobile-menu-btn { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 6px; color: var(--text-hi); order: 3; }
  .mobile-menu-btn:hover { background: var(--panel-3); }
  .app-logo { width: 28px; height: 28px; font-size: 13px; }
  .title-center { display: flex; flex: 1; justify-content: flex-start; padding: 0; gap: 8px; }
  .id-name { font-size: 14px; }
  .simple-btn { display: none; }
  .cv-btn { height: 30px; padding: 0 10px; }
  .doc-path, .doc-ext { display: none; }
  .title-right { order: 2; }
  .hire-btn span { display: none; }
  .hire-btn { width: 34px; height: 34px; padding: 0; justify-content: center; border-radius: 17px; }
  .hire-btn .i { width: 16px; height: 16px; }
  .wsbar { position: sticky; top: var(--titlebar-h); z-index: 19; height: var(--wsbar-h); padding: 0 6px; gap: 6px; }
  .modes { display: none; }
  .wsbar-right { display: none; }
  .workspaces { gap: 0; }
  .workspaces .mode-tab { height: 32px; padding: 0 12px; }
  .workspaces .mode-tab b { font-size: 14px; }
  .workspaces .mode-tab small { display: none; }
  .wsbar-right { display: flex !important; }
  .wsbar-right .icon-btn, .ws-name { display: none; }
  .statusbar { display: none; }

  .ws { display: flex !important; flex-direction: column; gap: 6px; padding: 6px; }
  .ws .pg { width: 100%; }
  .splitter, .pg-tools, .pg-meters { display: none !important; }
  .pg-tabs { height: 36px; }
  .pg-tab { font-size: 14px; }

  /* order of panels on a phone */
  #pg-program { order: 1; } #pg-timeline { order: 2; } #pg-source { order: 3; } #pg-project { order: 4; }
  #pg-learn { order: 3; } #pg-egfx { order: 2; } #pg-lumetri { order: 4; } #pg-scopes { order: 6; }
  #pg-viewer { order: 1; } #pg-photos { order: 2; }
  .app[data-workspace="color"] #pg-timeline { order: 9; }
  #pg-reader { display: none !important; }

  .app[data-workspace="color"] #pg-scopes { display: none !important; }

  #pg-program { flex: none; }
  #pg-program .pg-body { flex: none; }
  #pg-program .panel { position: relative; inset: auto; }
  #pg-program .monitor { height: auto; }
  #pg-program .mon-view { flex: none; container-type: inline-size; padding: 0; }
  #pg-program .mon-frame { width: 100%; }
  .mon-transport { flex-wrap: wrap; gap: 4px; }
  .mon-transport .tbtn { width: 38px; height: 36px; }
  .mon-transport .tbtn .i { width: 18px; height: 18px; }
  .mon-transport .tbtn.play { width: 48px; }
  .mon-transport .tbtn[data-cmd="program.lift"], .mon-transport .tbtn[data-cmd="program.compare"], .mon-transport .tbtn[data-cmd="marker.in"], .mon-transport .tbtn[data-cmd="marker.out"] { display: none; }
  .mon-ruler { height: 30px; }
  .mon-info .dd { display: none; }

  #pg-timeline { flex: none; height: 300px; }
  .tl { --th: 84px; }
  .tl-tcbox { padding: 4px; }
  .tl-tcbox .tc-edit { width: 100%; font-size: 12px; }
  .th { grid-template-columns: 1fr; padding: 0 4px; }
  .th .patch, .th .tbtns, .th .lk, .th .vol { display: none !important; }
  .tl-tcbox .tc { font-size: 14px; }
  .tl-tools { display: none; }
  .tl-hint { display: none; }

  #pg-project { flex: none; height: auto; min-height: 420px; }
  #pg-project .pg-body { height: auto; }
  #pg-project .panel { position: relative; inset: auto; }
  .proj { height: auto; }
  .proj-scroll { max-height: none; overflow: visible; }
  .proj-top { flex-wrap: wrap; }
  .proj-top .search { width: 100%; max-width: none; order: 3; }
  .proj-top .search .field { height: 32px; font-size: 14px; }
  .proj-grid { --tile: 150px !important; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .tile .name { font-size: 13px; }
  .panel-bar .range { display: none; }

  #pg-source { flex: none; max-height: 70vh; }
  #pg-source .pg-body { min-height: 0; }
  #pg-source .panel { position: relative; inset: auto; max-height: calc(70vh - 36px); }
  .md-deep { padding-left: 16px; padding-right: 16px; }
  .md-desc, .md-credits, .md-software { margin-left: 16px; padding-left: 0; }
  #pg-egfx, #pg-lumetri, #pg-learn, #pg-photos { flex: none; }
  #pg-egfx .pg-body, #pg-lumetri .pg-body, #pg-learn .pg-body, #pg-photos .pg-body { height: auto; }
  #pg-egfx .panel, #pg-lumetri .panel, #pg-learn .panel, #pg-photos .panel { position: relative; inset: auto; }
  #pg-photos .proj-scroll { overflow: visible; }
  #pg-viewer { flex: none; height: 62vh; position: sticky; top: calc(var(--titlebar-h) + var(--wsbar-h)); z-index: 4; }
  .photo-grid { --tile: 140px !important; }
  .photo-grid.stills { --tile: 100px !important; }
  .pv-cap .pv-tip { display: none; }
  .pv-nav { width: 40px; height: 40px; }
  .eg-head { position: static; }
  .lum { height: auto; }

  .ab-name { font-size: 8cqw; }

  #pg-export { flex: none; }
  .app[data-workspace="export"] .ws { padding: 0; }
  .export { display: block; }
  .export > * { overflow: visible; padding: 14px; }
  .ex-dest { display: block; border: 0; border-bottom: 1px solid #161616; }
  .ex-side { border: 0; }
  .ex-field { grid-template-columns: 1fr; }
  .ex-hint { grid-column: 1; }
  .ex-field .field { height: 40px; font-size: 16px; }
  .ex-field .ex-msg { font-size: 16px; }

  .menu { min-width: 0; width: min(320px, calc(100vw - 16px)); font-size: 15px; }
  .menu-item { min-height: 36px; }
  .menu-item .kbd { display: none; }
  .dialog { max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px); }
  .about { grid-template-columns: 1fr; }
  .about-art { min-height: 110px; border-right: 0; border-bottom: 1px solid #2c2c2c; }
  .boot-card { grid-template-columns: 1fr; }
  .boot-art { min-height: 150px; }
  .toast-layer { left: 12px; right: 12px; bottom: 12px; }
  .toast { max-width: none; }
}
@media (max-width: 420px) {
  .id-otw { font-size: 0; padding: 4px; gap: 0; }
}
