.workroom .screen { background:#000000 }
.screen #stage { box-shadow:0 0 0 1px #ffffff10 }

.panel-splitter {
  grid-area:splitter;
  position:relative;
  display:grid;
  place-items:center;
  min-width:0;
  cursor:row-resize;
  touch-action:none;
  user-select:none;
  background:var(--panel);
}
.panel-splitter::before {
  content:"";
  position:absolute;
  left:10px;
  right:10px;
  height:1px;
  background:#313131;
}
.panel-splitter::after {
  content:"";
  position:relative;
  width:38px;
  height:3px;
  border-radius:8px;
  background:#787878;
  box-shadow:0 0 0 3px var(--panel);
}
.panel-splitter:is(:hover,:focus-visible)::after,.resizing-panels .panel-splitter::after { background:var(--accent) }
.panel-splitter:focus-visible { z-index:3; outline:1px solid var(--accent); outline-offset:-2px }
.resizing-panels,.resizing-panels * { cursor:row-resize!important; user-select:none!important }

/* The toolbar sits outside the track viewport. Its value bubble can rise over
   the splitter while long timelines still scroll beneath the tool buttons. */
.workroom.resizable-panels .edit {
  display:grid;
  grid-template-rows:auto minmax(0,1fr);
  min-height:0;
  margin-top:0;
  overflow:visible;
}
.resizable-panels .timeline-frame {
  min-height:0; overflow-y:auto; overflow-x:hidden; scrollbar-width:thin; align-content:start;
  scroll-padding-top:var(--ruler-h);
}
.resizable-panels :is(#ruler,.ruler-gutter) {
  position:relative; z-index:6; transform:translateY(var(--lane-scroll,0px)); background-color:#1b1b1b;
}
.resizable-panels #playhead { z-index:7; top:calc(var(--cursor-cap,11px) + var(--lane-scroll,0px)) }
.resizable-panels .timeline-bar { position:relative; z-index:4; overflow:visible }
.timeline-bar .zoom-control {
  min-height:36px;
  margin-left:auto;
  padding-right:16px;
  padding-left:4px;
  gap:5px;
}
.timeline-bar .zoom-control .fb-zoom {
  width:clamp(62px,8vw,114px); height:36px;
  overflow:visible;
}
.zoom-control .fb-zoom #timeline-zoom { inset:0; width:100%; height:100%; max-height:none }
.zoom-control .fb-zoom-track { top:calc(50% - 2px) }
.zoom-control .fb-jelly { top:calc(50% - 64px); bottom:auto; height:68px }
.zoom-control .fb-zoom-value { top:calc(50% - 11px) }
.zoom-control .fb-zoom::after { bottom:calc(50% - 12px) }

@media(min-width:601px) {
  .workroom.resizable-panels,.workroom.resizable-panels:has(#layer-tracks:not([hidden])>.layer-track) {
    --splitter-size:16px;
    row-gap:0;
    grid-template-areas:"rail bin monitor inspector" "rail bin splitter inspector" "rail bin edit inspector";
    grid-template-rows:minmax(0,var(--preview-panel-height,1fr)) var(--splitter-size) minmax(0,1fr);
  }
}
@media(max-width:600px) {
  .workroom.resizable-panels,.workroom.resizable-panels:has(.fb-tool-rail) {
    grid-template-columns:45px minmax(0,1fr);
    grid-template-areas:"monitor monitor" "splitter splitter" "edit edit" "rail bin" "inspector inspector";
    grid-template-rows:minmax(0,var(--preview-panel-height,39svh)) 24px minmax(0,var(--timeline-panel-height,26svh)) auto auto;
  }
  .resizable-panels .panel-splitter::after { width:48px; height:4px }
  .resizable-panels .timeline-frame { --cursor-cap:15px }
  .timeline-bar .zoom-control { min-height:40px; padding-right:16px }
  .timeline-bar .zoom-control .fb-zoom { height:40px; width:64px }
}
@media(pointer:coarse) {
  .workroom.resizable-panels { --splitter-size:26px }
  .timeline-bar .zoom-control .fb-zoom { height:44px }
}

.timeline-scroll .track-bed {width:84%;min-width:0}
#timeline-tail {position:absolute;left:100%;top:0;bottom:0;min-height:100%;border-left:1px dashed #656565;background-color:#1a1a1a;background-image:repeating-linear-gradient(to right,#ffffff0c 0 1px,transparent 1px var(--tick,32px));cursor:crosshair;touch-action:pan-x pan-y}
#timeline-tail[data-over] {background-color:#2e2e2e}
#tail-ruler {position:relative;height:var(--ruler-h,30px);color:#a4a4a4;font:500 10px/1.2 ui-monospace,monospace;pointer-events:none;transform:translateY(var(--lane-scroll,0px));z-index:1;background:#1a1a1a}
#tail-ruler span {position:absolute;bottom:3px;transform:translateX(-50%);white-space:nowrap}
#tail-ruler span:last-child {max-width:100%;transform:translateX(-100%)}
.track-bed #playhead {z-index:4}
