/* Rugby Coaching Studio: mobile and tablet editor, shared by Classic and Coach Edition.
   The pitch stays visible; existing tools, inspector and timeline become bottom sheets. */
.mobile-workspace-nav{display:none}
@media screen and (max-width:1100px){
 body.mobile-workspace{
  --mobile-nav-height:56px;
  --mobile-sheet-height:min(54dvh,490px);
  --equipment-width:0px!important;
  --inspector-width:0px!important;
  overflow:hidden;
  grid-template-rows:auto minmax(0,1fr) auto;
 }
 body.coach-edition.mobile-workspace{grid-template-rows:auto auto minmax(0,1fr) auto}
 body.mobile-workspace > header{min-height:0;flex-wrap:wrap;gap:5px;padding:6px max(8px,env(safe-area-inset-right)) 6px max(8px,env(safe-area-inset-left))}
 body.mobile-workspace .brand{min-width:0}
 body.mobile-workspace .brand h1{font-size:clamp(14px,2vw,18px)}
 body.mobile-workspace .head-actions{flex-wrap:nowrap;overflow-x:auto;overscroll-behavior-x:contain;min-width:0;max-width:100%;width:100%;padding-bottom:3px;scrollbar-width:thin}
 body.mobile-workspace .head-actions .command-group{flex:0 0 auto}
 body.mobile-workspace .head-actions button{min-height:40px;white-space:nowrap}
 body.mobile-workspace .save-control{min-width:108px}
 body.mobile-workspace > .main{grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(0,1fr);min-width:0;min-height:0;overflow:hidden}
 body.mobile-workspace .stage{grid-column:1;grid-row:1;width:100%;min-width:0;min-height:0;display:grid;grid-template-rows:auto minmax(0,1fr) auto;padding:5px 7px;gap:5px}
 body.mobile-workspace .stage .toolbar{align-items:start;gap:5px;flex-wrap:wrap;min-height:0}
 body.mobile-workspace .board-actions{min-width:0;max-width:100%;overflow-x:auto;flex-wrap:nowrap;justify-content:flex-start;padding-bottom:3px}
 body.mobile-workspace .board-actions > *{flex:0 0 auto}
 body.mobile-workspace .board-actions button,body.mobile-workspace .board-actions select{min-height:42px}
 body.mobile-workspace .stage-heading{flex:1 0 100%;min-height:0}
 body.mobile-workspace .field-wrap{width:100%;height:100%;min-width:0;min-height:0;overflow:hidden}
 body.mobile-workspace .field-wrap > .pitch{width:100%;height:100%;touch-action:none}
 /* Expand invisible finger targets without enlarging diagram symbols or changing exports. */
 body.mobile-workspace .pitch .obj > circle:first-child{stroke:transparent;stroke-width:30px;vector-effect:non-scaling-stroke;pointer-events:all}
 body.mobile-workspace .pitch .path-hit{stroke-width:30px;vector-effect:non-scaling-stroke;pointer-events:stroke}
 body.mobile-workspace .pitch [data-waypoint],body.mobile-workspace .pitch [data-insert-point]{touch-action:none}
 .mobile-camera-controls{display:none}
 body.mobile-workspace .mobile-camera-controls{
  display:flex;align-items:center;gap:3px;position:absolute;top:7px;right:7px;
  z-index:5;padding:3px;border:1px solid #ffffff40;border-radius:10px;
  background:#13241ee8;box-shadow:0 3px 14px #0008;
 }
 body.mobile-workspace .mobile-camera-controls button{
  min-width:43px;min-height:43px;padding:6px 7px;font-size:13px;font-weight:750;
  background:#263b2f;color:var(--text);border-color:#607361;
 }
 body.mobile-workspace .mobile-camera-controls button[aria-pressed=true]{color:var(--accent);border-color:var(--accent)}
 body.mobile-workspace.presentation-mode .mobile-camera-controls{display:none!important}
 body.mobile-workspace .board-footer .note{max-height:2.8em}
 body.mobile-workspace > .main > .panel-splitter,body.mobile-workspace > .timeline > .panel-splitter{display:none!important}
 body.mobile-workspace .sidebar,body.mobile-workspace .inspector{display:none;position:absolute;z-index:12;left:0;right:0;top:auto;bottom:0;width:100%;max-width:none;height:var(--mobile-sheet-height);max-height:calc(100% - 26px);margin:0;border:1px solid var(--line);border-bottom:0;border-radius:17px 17px 0 0;background:var(--panel);box-shadow:0 -8px 35px #0009;overscroll-behavior:contain}
 body.mobile-workspace.mobile-view-tools #equipmentPanel{display:block!important;grid-column:1;grid-row:1;overflow:auto;padding:16px max(12px,env(safe-area-inset-left)) 18px max(12px,env(safe-area-inset-right))}
 body.mobile-workspace.mobile-view-edit #inspectorPanel{display:flex!important;grid-column:1;grid-row:1;flex-direction:column;overflow:hidden;padding:0}
 body.mobile-workspace .inspector-tabs{flex:0 0 auto;position:sticky;top:0;z-index:1}
 body.mobile-workspace .inspector-body{flex:1;overflow-y:auto;padding:12px 15px 28px}
 body.mobile-workspace .inspector .field input,body.mobile-workspace .inspector .field select,body.mobile-workspace .inspector .field textarea{min-height:42px}
 body.mobile-workspace .sidebar .palette,.mobile-workspace .sidebar .action-grid{grid-template-columns:repeat(auto-fit,minmax(76px,1fr));gap:8px}
 body.mobile-workspace .sidebar .palette button,body.mobile-workspace .sidebar .action-grid button{min-height:52px;font-size:12px;padding:7px}
 body.mobile-workspace .sidebar .palette svg{width:28px;height:28px}
 body.mobile-workspace > .timeline{display:none!important}
 body.mobile-workspace.mobile-view-steps:not(.presentation-mode) > .timeline{
  position:fixed;z-index:25;display:grid!important;left:0;right:0;
  bottom:calc(var(--mobile-nav-height) + env(safe-area-inset-bottom));
  width:100%;height:min(54dvh,480px)!important;max-height:calc(100dvh - var(--mobile-nav-height) - 80px);
  margin:0;padding:15px 10px 12px;overflow:hidden;
  grid-template-rows:auto auto auto minmax(0,1fr);gap:6px;
  border:1px solid var(--line);border-bottom:0;border-radius:17px 17px 0 0;
  box-shadow:0 -8px 35px #0009;background:var(--panel)
 }
 body.mobile-workspace .timeline-top{align-items:center;justify-content:flex-start;gap:7px}
 body.mobile-workspace .timeline-top .flex{gap:5px;flex-wrap:wrap}
 body.mobile-workspace .timeline-top button,body.mobile-workspace .timeline-top select{min-height:40px;padding:7px 9px;font-size:12px}
 body.mobile-workspace .scene{min-width:112px;max-width:150px;min-height:48px}
 body.mobile-workspace .scenes{touch-action:pan-x;overscroll-behavior-x:contain;scroll-snap-type:x proximity}
 body.mobile-workspace .scenes .scene{scroll-snap-align:start}
 body.mobile-workspace .timing-span{min-height:22px;top:0}
 body.mobile-workspace .timing-handle{min-width:20px;min-height:26px}
 body.mobile-workspace .mobile-workspace-nav{
  display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:2px;
  align-items:stretch;position:relative;z-index:35;
  width:100%;height:calc(var(--mobile-nav-height,56px) + env(safe-area-inset-bottom));
  padding:3px max(4px,env(safe-area-inset-right)) max(3px,env(safe-area-inset-bottom)) max(4px,env(safe-area-inset-left));
  border-top:1px solid var(--line);background:var(--panel);box-shadow:0 -2px 12px #0005
 }
 .mobile-workspace-nav button{
  min-width:0;min-height:48px;display:flex;flex-direction:column;align-items:center;justify-content:center;
  gap:2px;padding:3px 1px;border:1px solid transparent;background:transparent;
  border-radius:8px;font-size:11px;font-weight:650;line-height:1.2;color:var(--text)
 }
 .mobile-workspace-nav button > [aria-hidden]{font-size:20px;line-height:1.1}
 .mobile-workspace-nav button.selected,.mobile-workspace-nav button[aria-pressed=true]{color:var(--accent);background:var(--panel2);border-color:var(--line)}
 .mobile-workspace-nav button[data-state="saved"]{color:var(--accent)}
 .mobile-workspace-nav button:focus-visible{outline:2px solid var(--accent);outline-offset:-2px}
 body.mobile-workspace input:not([type=range]):not([type=checkbox]):not([type=radio]),body.mobile-workspace textarea,body.mobile-workspace select{font-size:16px}
 body.mobile-workspace dialog{max-height:calc(100dvh - 25px);max-width:calc(100vw - 12px);overflow-y:auto}
 body.mobile-workspace dialog .filters,body.mobile-workspace dialog .cardform{grid-template-columns:repeat(2,minmax(0,1fr))}
 body.mobile-workspace .view-menu-panel{max-height:min(65dvh,440px);overflow-y:auto}
 body.mobile-workspace.presentation-mode .mobile-workspace-nav{display:none!important}
 body.mobile-workspace.presentation-mode > .timeline{
  position:relative;display:grid!important;left:auto;right:auto;bottom:auto;
  width:100%;height:auto!important;max-height:34dvh;margin:0;padding:7px 8px;
  border-radius:0;box-shadow:none
 }
 body.mobile-workspace.presentation-mode{grid-template-rows:auto minmax(0,1fr) auto}
 body.coach-edition.mobile-workspace.presentation-mode{grid-template-rows:auto minmax(0,1fr) auto}
}
@media screen and (max-width:600px){
 body.mobile-workspace{--mobile-sheet-height:min(56dvh,490px)}
 body.mobile-workspace .brandmark{width:30px;height:30px;font-size:17px}
 body.mobile-workspace .brand small{font-size:9px}
 body.mobile-workspace .stage-heading h2{font-size:13px}
 body.mobile-workspace .board-footer .footer-narration{font-size:11px}
 body.mobile-workspace .timeline-top > div:first-child{flex:1 1 100%}
 body.mobile-workspace dialog .filters,body.mobile-workspace dialog .cardform{grid-template-columns:minmax(0,1fr)}
 body.mobile-workspace .linkadd{grid-template-columns:repeat(2,minmax(0,1fr))}
 body.mobile-workspace .coach-choice-grid,body.mobile-workspace .coach-action-cards{grid-template-columns:1fr}
}
@media screen and (max-height:510px) and (max-width:1100px){
 body.mobile-workspace{--mobile-sheet-height:min(65dvh,320px);--mobile-nav-height:50px}
 body.mobile-workspace .brand small{display:none}
 body.mobile-workspace .head-actions{max-height:46px}
 body.mobile-workspace .stage-heading{display:none}
 body.mobile-workspace .board-footer .note{display:none}
 body.mobile-workspace.mobile-view-steps:not(.presentation-mode) > .timeline{height:min(69dvh,290px)!important}
}
