/* Ride Film Studio (Labs). Mobile first: one column (picture, transport, camera deck, settings);
   from 1024px the settings move into a side column. Built on rider-log.css / rider-cinema.css tokens:
   solid panels, theme colours, one accent (--route-highlight), 44px+ targets. */

body.fs-in-studio .rl-main{ padding:0; max-width:none; }
.fs-picker .rl-log-head h1{ margin-top:0; }

.fs-studio{ display:flex; flex-direction:column; color:var(--text-primary); }
.fs-studio[hidden]{ display:none; }

/* ---------- top bar ---------- */
.fs-bar{
  position:sticky; top:0; z-index:30; display:flex; align-items:center; gap:8px;
  padding:8px max(10px, env(safe-area-inset-right)) 8px max(10px, env(safe-area-inset-left));
  background:var(--bg-panel); border-bottom:1px solid var(--border-strong);
}
.fs-iconbtn{
  flex:none; width:44px; height:44px; display:grid; place-items:center; border-radius:10px; cursor:pointer;
  background:transparent; border:1px solid transparent; color:var(--text-primary);
}
.fs-iconbtn:hover{ background:var(--bg-panel-hover); }
.fs-bar-title{ flex:1; min-width:0; }
.fs-bar-title h1{
  margin:0; font-family:var(--font-display); font-weight:700; font-size:22px; line-height:1.05;
  text-transform:uppercase; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.fs-bar-title small{ display:block; margin-top:2px; font-size:12px; color:var(--text-muted); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; font-variant-numeric:tabular-nums; }
.fs-bar-poster{ display:none; }

/* ---------- picture ---------- */
.fs-body{ display:flex; flex-direction:column; }
.fs-stagecol{ display:flex; flex-direction:column; min-width:0; }
.fs-viewer{
  position:relative; height:min(46dvh, 620px); min-height:240px; display:grid; place-items:center; overflow:hidden;
  background:var(--bg-panel-raised);
}
.fs-frame{ position:relative; overflow:hidden; background:#e9eef2; touch-action:none; cursor:grab; outline:none; }
.fs-frame.is-dragging{ cursor:grabbing; }
.fs-map{ position:absolute; inset:0; background:linear-gradient(180deg, #9cc3e4 0%, #d9e6f0 55%, #e9eef2 100%); }
.fs-frame .fs-map.maplibregl-map{ position:absolute; inset:0; }
.fs-map .maplibregl-canvas{ outline:none; }
.fs-overlay{ position:absolute; inset:0; width:100%; height:100%; z-index:2; pointer-events:none; }
.fs-chip, .fs-hint{
  position:absolute; left:50%; top:10px; z-index:4; transform:translateX(-50%); max-width:calc(100% - 20px);
  padding:7px 12px; border-radius:8px; background:var(--bg-panel); color:var(--text-primary); border:1px solid var(--border-strong);
  font-size:12px; font-weight:600; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; pointer-events:none;
  box-shadow:0 2px 8px rgba(0,0,0,0.18);
}
.fs-hint{ top:auto; bottom:12px; }
.fs-chip[hidden], .fs-hint[hidden]{ display:none; }
.fs-loader{ z-index:5; }

/* ---------- transport ---------- */
.fs-transport{
  display:grid; grid-template-columns:auto 1fr; grid-template-areas:"play time" "line line"; gap:8px 12px; align-items:center;
  padding:10px 12px 12px; background:var(--bg-panel); border-bottom:1px solid var(--border-strong);
}
.fs-transport .rl-play{ grid-area:play; }
.fs-time{ grid-area:time; display:flex; align-items:baseline; gap:6px; font-variant-numeric:tabular-nums; }
.fs-tc{ font-family:var(--font-mono); font-size:22px; font-weight:700; letter-spacing:-0.02em; }
.fs-time small{ font-family:var(--font-mono); font-size:13px; color:var(--text-muted); }
.fs-timeline-wrap{ grid-area:line; position:relative; height:100px; }
.fs-timeline{ position:absolute; inset:0; width:100%; height:100%; display:block; cursor:ew-resize; touch-action:none; }
#fsPlayhead{ position:absolute; inset:0; pointer-events:none; border-radius:6px; }
#fsPlayhead:focus-visible{ outline:2px solid var(--route-highlight); outline-offset:2px; }

/* ---------- camera deck ---------- */
.fs-deck{ padding:12px 12px 14px; background:var(--bg-panel); border-bottom:1px solid var(--border-strong); }
.fs-deck-head{ display:grid; grid-template-columns:1fr auto; gap:2px 12px; align-items:center; margin-bottom:10px; }
.fs-deck-head h2{ margin:0; font-family:var(--font-display); font-size:20px; font-weight:700; text-transform:uppercase; line-height:1.1; }
.fs-deck-head p{ grid-column:1; margin:0; font-size:13px; line-height:1.4; color:var(--text-muted); }
.fs-deck-clear{ grid-column:2; grid-row:1 / span 2; }
.fs-deck-clear[hidden]{ display:none; }
.fs-cams{
  display:grid; grid-auto-flow:column; grid-auto-columns:76px; gap:8px; overflow-x:auto; padding-bottom:4px;
  scroll-snap-type:x proximity; scrollbar-width:thin; scrollbar-color:var(--border-strong) transparent;
}
.fs-cam{
  scroll-snap-align:start; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:6px;
  min-height:76px; padding:8px 4px; border-radius:12px; cursor:pointer; text-align:center;
  background:var(--bg-panel-raised); border:1px solid var(--border-strong); color:var(--text-primary);
  font-family:var(--font-body); font-size:11px; font-weight:600; line-height:1.15;
  transition:background-color 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}
.fs-cam svg{ width:30px; height:30px; flex:none; }
.fs-cam:hover{ background:var(--bg-panel-hover); }
.fs-cam:active{ transform:translateY(1px); }
.fs-cam:focus-visible{ outline:2px solid var(--route-highlight); outline-offset:2px; }
.fs-cam.is-live{ background:var(--route-highlight); border-color:var(--route-highlight); color:var(--route-highlight-ink); }
.fs-cam.is-cut{ animation:fs-cut 0.32s cubic-bezier(0.16, 1, 0.3, 1); }
@keyframes fs-cut{ from{ transform:scale(0.92); } to{ transform:none; } }
.fs-cutbar{
  display:flex; align-items:center; gap:8px; flex-wrap:wrap; margin-top:10px; padding:8px 8px 8px 12px; border-radius:10px;
  background:var(--bg-panel-raised); border:1px solid var(--route-highlight);
}
.fs-cutbar[hidden]{ display:none; }
.fs-cutbar span{ flex:1; min-width:140px; font-size:14px; font-weight:600; font-variant-numeric:tabular-nums; }

.fs-cutbar-group{ display:contents; }
.fs-cutbar-group[hidden]{ display:none; }
.fs-mini{ display:flex; flex-direction:column; gap:3px; font-size:11px; font-weight:600; color:var(--text-muted); }
.fs-mini select{
  min-height:40px; padding:0 8px; border-radius:8px; border:1px solid var(--border-strong);
  background:var(--bg-panel); color:var(--text-primary); font-family:var(--font-body); font-size:14px; font-weight:500;
}
.fs-mini select:focus-visible{ outline:2px solid var(--route-highlight); outline-offset:1px; }
.fs-seg-sm button{ min-height:40px; font-size:13px; padding:0 10px; }
.fs-seg[hidden]{ display:none; }

/* ---------- clip editor ---------- */
.fs-reel{ display:flex; align-items:flex-end; gap:10px; flex-wrap:wrap; padding:12px; margin-bottom:12px; border-radius:12px; background:var(--bg-panel-raised); border:1px solid var(--border-strong); }
.fs-reel small{ flex:1 1 220px; font-size:13px; line-height:1.4; color:var(--text-muted); }
.fs-source-wrap{ position:relative; height:64px; border-radius:10px; overflow:hidden; background:var(--bg-panel-raised); border:1px solid var(--border-strong); }
.fs-source{ position:absolute; inset:0; width:100%; height:100%; display:block; cursor:crosshair; touch-action:none; }
.fs-chips{ display:flex; flex-wrap:wrap; gap:8px; margin-bottom:10px; }
.fs-chips .rl-btn{ min-height:44px; }
.fs-cliplist{ list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:8px; }
.fs-clip{
  display:flex; flex-wrap:wrap; align-items:flex-end; gap:8px; padding:8px; border-radius:12px;
  background:var(--bg-panel-raised); border:1px solid var(--border-strong);
}
.fs-clip.is-selected{ border-color:var(--route-highlight); box-shadow:inset 0 0 0 1px var(--route-highlight); }
.fs-clip-go{
  flex:1 1 180px; display:flex; align-items:center; gap:10px; min-height:44px; padding:4px 6px; border:0; border-radius:8px;
  background:transparent; color:var(--text-primary); text-align:left; cursor:pointer; font-family:var(--font-body);
}
.fs-clip-go:focus-visible{ outline:2px solid var(--route-highlight); outline-offset:1px; }
.fs-clip-go b{ flex:none; width:30px; height:30px; display:grid; place-items:center; border-radius:8px; background:var(--text-primary); color:var(--bg-panel); font-family:var(--font-display); font-size:17px; }
.fs-clip-go span{ font-size:14px; font-weight:600; font-variant-numeric:tabular-nums; }
.fs-clip-go small{ display:block; font-size:12px; font-weight:400; color:var(--text-muted); }
.fs-clip-tools{ display:flex; gap:2px; }
.fs-clip-tools .fs-iconbtn:disabled{ opacity:0.35; cursor:default; }

/* ---------- settings ---------- */
/* ---------- edit tabs (under the timeline) ---------- */
.fs-sr{ position:absolute; width:1px; height:1px; margin:-1px; padding:0; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; border:0; }
.fs-worktabs{
  display:flex; gap:0; padding:0 8px; min-height:50px; background:var(--bg-panel); border-bottom:1px solid var(--border-strong);
  overflow-x:auto; overflow-y:hidden; scrollbar-width:none;
}
.fs-worktabs::-webkit-scrollbar{ display:none; }
.fs-worktabs button{
  flex:1 0 auto; min-height:48px; padding:0 14px; border:0; border-bottom:3px solid transparent; background:none; cursor:pointer;
  color:var(--text-muted); font-family:var(--font-body); font-size:15px; font-weight:700;
}
.fs-worktabs button[aria-selected="true"]{ color:var(--text-primary); border-bottom-color:var(--route-highlight); }
.fs-worktabs button:focus-visible{ outline:2px solid var(--route-highlight); outline-offset:-2px; }
.fs-count{
  display:inline-grid; place-items:center; min-width:20px; height:20px; margin-left:4px; padding:0 5px; border-radius:10px; vertical-align:1px;
  background:var(--text-primary); color:var(--bg-panel); font-size:12px; font-variant-numeric:tabular-nums;
}
.fs-count:empty{ display:none; }
.fs-deck[hidden]{ display:none; }

/* ---------- clips: source scrubber + marks ---------- */
.fs-clips .fs-source-wrap{ height:72px; }
.fs-source:focus-visible{ outline:2px solid var(--route-highlight); outline-offset:-2px; }
.fs-markbar{ display:flex; align-items:center; flex-wrap:wrap; gap:8px; margin:10px 0 6px; }
.fs-srcplay{ width:44px; height:44px; flex:none; }
.fs-srcclock{ min-width:92px; font-family:var(--font-mono); font-size:15px; font-weight:700; font-variant-numeric:tabular-nums; }
.fs-marks{ display:flex; gap:6px; }
.fs-mark{
  display:flex; flex-direction:column; align-items:flex-start; justify-content:center; gap:1px; min-width:96px; min-height:44px; padding:4px 10px;
  border-radius:10px; border:1px solid var(--border-strong); background:var(--bg-panel-raised); color:var(--text-primary); cursor:pointer;
  font-family:var(--font-body); text-align:left;
}
.fs-mark b{ font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:0.04em; color:var(--text-muted); }
.fs-mark span{ font-family:var(--font-mono); font-size:13px; font-weight:700; font-variant-numeric:tabular-nums; }
.fs-mark:not(.is-set) span{ font-family:var(--font-body); color:var(--text-muted); }
.fs-mark[aria-pressed="true"]{ border-color:var(--route-highlight); box-shadow:inset 0 0 0 1px var(--route-highlight); }
.fs-mark:focus-visible{ outline:2px solid var(--route-highlight); outline-offset:2px; }
.fs-nudge{ display:flex; gap:0; border:1px solid var(--border-strong); border-radius:10px; overflow:hidden; background:var(--bg-panel-raised); }
.fs-nudge .fs-iconbtn{ border-radius:0; }
.fs-nudge .fs-iconbtn + .fs-iconbtn{ border-left:1px solid var(--border-strong); }
.fs-clipcut{ min-width:88px; margin-left:auto; }
.fs-clipcut:disabled{ opacity:0.45; cursor:not-allowed; }
.fs-clips-head{ margin-top:6px; padding-top:12px; border-top:1px solid var(--border-strong); }
.fs-sel{ margin:0 0 12px; font-size:13px; line-height:1.4; color:var(--text-muted); font-variant-numeric:tabular-nums; min-height:1.4em; }

/* ---------- effects deck ---------- */
.fs-fxactions{ display:flex; flex-wrap:wrap; gap:8px; margin-bottom:12px; }
.fs-fxdeck .fs-h{ margin:10px 0 8px; }
.fs-fxlist{ list-style:none; margin:0 0 6px; padding:0; display:flex; flex-direction:column; gap:8px; }
.fs-fx{
  display:grid; grid-template-columns:auto 1fr auto; grid-template-areas:"on main tools" "mix mix mix"; gap:6px 10px; align-items:center;
  padding:8px 8px 10px 12px; border-radius:12px; border:1px solid var(--border-strong); background:var(--bg-panel-raised);
}
.fs-fx.is-off .fs-fx-main, .fs-fx.is-off .fs-fx-mix{ opacity:0.5; }
.fs-fx-on{ grid-area:on; display:grid; place-items:center; width:32px; height:44px; cursor:pointer; }
.fs-fx-on input{ width:22px; height:22px; margin:0; accent-color:var(--route-highlight); }
.fs-fx-main{ grid-area:main; min-width:0; }
.fs-fx-main b{ display:block; font-size:15px; overflow-wrap:anywhere; }
.fs-fx-main small{ display:block; font-size:12px; color:var(--text-muted); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.fs-fx .fs-clip-tools{ grid-area:tools; }
.fs-fx-mix{ grid-area:mix; display:grid; grid-template-columns:auto 1fr; align-items:center; gap:10px; font-size:12px; font-weight:600; color:var(--text-muted); font-variant-numeric:tabular-nums; }
.fs-fx-mix span{ min-width:64px; }
.fs-fx-mix input{ width:100%; min-height:32px; accent-color:var(--route-highlight); }
.fs-fx-empty{ padding:10px 2px; }
.fs-installed{ margin-top:12px; border-top:1px solid var(--border-strong); padding-top:10px; }
.fs-installed summary{ min-height:44px; display:flex; align-items:center; gap:6px; cursor:pointer; font-weight:700; font-size:14px; }
.fs-installed summary small{ color:var(--text-muted); font-weight:600; }
.fs-installed-list{ list-style:none; margin:4px 0 0; padding:0; display:flex; flex-direction:column; }
.fs-installed-list li{ display:flex; align-items:center; gap:6px; padding:6px 0; border-bottom:1px solid var(--border-strong); }
.fs-installed-list li > span{ flex:1; min-width:0; }
.fs-installed-list b{ display:block; font-size:14px; overflow-wrap:anywhere; }
.fs-installed-list small{ display:block; font-size:12px; color:var(--text-muted); }
.fs-iconbtn.is-armed{ background:var(--alert-red, #c0392b); color:#fff; }
.fs-iconbtn:disabled{ opacity:0.35; cursor:default; }

/* ---------- add-on store ---------- */
.fs-store{ width:min(1100px, 100vw); height:min(90dvh, 980px); }
.fs-store-tools{ display:flex; flex-wrap:wrap; gap:10px; align-items:center; padding:10px 12px; border-bottom:1px solid var(--border-strong); }
.fs-store-tools .fs-seg{ flex:1 1 360px; }
.fs-store-search{ flex:1 1 180px; display:flex; }
.fs-store-search[hidden]{ display:none; }
.fs-store-search input{
  flex:1; min-width:0; min-height:44px; padding:0 12px; border-radius:10px; border:1px solid var(--border-strong);
  background:var(--bg-panel-raised); color:var(--text-primary); font:inherit; font-size:15px;
}
.fs-store-search input:focus-visible, .fs-store-url input:focus-visible{ outline:2px solid var(--route-highlight); outline-offset:1px; }
.fs-store-url{ padding:12px; border-bottom:1px solid var(--border-strong); display:flex; flex-direction:column; gap:8px; }
.fs-store-url[hidden]{ display:none; }
.fs-store-url input{ min-height:44px; padding:0 12px; border-radius:10px; border:1px solid var(--border-strong); background:var(--bg-panel-raised); color:var(--text-primary); font:inherit; font-size:15px; }
.fs-store-status{ margin:0; padding:8px 14px; font-size:13px; color:var(--text-muted); border-bottom:1px solid var(--border-strong); }
.fs-store-status[hidden]{ display:none; }
.fs-store-status.is-error{ color:var(--alert-red, #b3261e); font-weight:600; }
.fs-store-body{ flex:1; min-height:0; display:grid; grid-template-columns:1fr; }
.fs-store-grid{
  list-style:none; margin:0; padding:12px; overflow-y:auto; display:grid; gap:10px; align-content:start;
  grid-template-columns:repeat(auto-fill, minmax(150px, 1fr)); scrollbar-width:thin;
}
.fs-card{
  position:relative; width:100%; display:flex; flex-direction:column; gap:6px; padding:6px; border-radius:12px; cursor:pointer; text-align:left;
  border:1px solid var(--border-strong); background:var(--bg-panel-raised); color:var(--text-primary); font-family:var(--font-body);
}
.fs-card:hover{ background:var(--bg-panel-hover); }
.fs-card:focus-visible{ outline:2px solid var(--route-highlight); outline-offset:2px; }
.fs-card.is-selected{ border-color:var(--route-highlight); box-shadow:inset 0 0 0 1px var(--route-highlight); }
.fs-card.is-broken .fs-card-thumb{ opacity:0.3; }
.fs-card-thumb{ width:100%; height:auto; border-radius:8px; background:var(--bg-panel); display:block; }
.fs-card-text{ padding:0 4px 4px; min-width:0; }
.fs-card-text b{ display:block; font-size:14px; line-height:1.25; overflow-wrap:anywhere; }
.fs-card-text small{ display:block; margin-top:2px; font-size:12px; color:var(--text-muted); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.fs-badge{
  position:absolute; top:12px; left:12px; padding:3px 8px; border-radius:6px; font-size:11px; font-weight:700;
  background:var(--text-primary); color:var(--bg-panel);
}
.fs-store-detail{ overflow-y:auto; padding:14px 16px 20px; border-top:1px solid var(--border-strong); }
.fs-store-detail[hidden]{ display:none; }
.fs-store-detail h3{ margin:12px 0 4px; font-family:var(--font-display); font-size:24px; font-weight:700; text-transform:uppercase; line-height:1.1; }
.fs-store-detail h3 small{ font-family:var(--font-body); font-size:13px; font-weight:600; text-transform:none; color:var(--text-muted); }
.fs-store-detail p{ margin:0 0 8px; font-size:14px; line-height:1.5; max-width:62ch; }
.fs-detail-preview{ width:100%; height:auto; border-radius:10px; background:#000; display:block; }
.fs-detail-actions{ display:flex; flex-wrap:wrap; gap:8px; margin-top:10px; }
.fs-detail-back{ display:inline-flex; align-items:center; gap:4px; margin-bottom:8px; }
.fs-credit{ font-size:13px !important; color:var(--text-muted); }
.fs-credit a{ color:var(--text-primary); font-weight:600; }
/* phone: the detail replaces the grid */
.fs-store.has-detail .fs-store-grid{ display:none; }
@media (min-width: 900px){
  .fs-store.has-detail .fs-store-body{ grid-template-columns:minmax(0, 1fr) 380px; }
  .fs-store.has-detail .fs-store-grid{ display:grid; }
  .fs-store-detail{ border-top:0; border-left:1px solid var(--border-strong); }
  .fs-store-detail:not([hidden]){ display:block; }
  .fs-detail-back{ display:none; }
}

/* ---------- add-on settings ---------- */
.fs-addon-dlg{ width:min(520px, 100vw); height:auto; max-height:min(86dvh, 860px); }
.fs-addon-body{ flex:1; overflow-y:auto; padding:14px 18px; display:flex; flex-direction:column; gap:14px; }
.fs-addon-body .fs-field span{ display:flex; justify-content:space-between; gap:8px; }
.fs-addon-body output{ font-family:var(--font-mono); color:var(--text-primary); font-variant-numeric:tabular-nums; }
.fs-addon-body input[type="color"]{ width:64px; height:40px; padding:2px; border-radius:8px; border:1px solid var(--border-strong); background:var(--bg-panel-raised); }
.fs-vec{ margin:0; padding:0; border:0; display:grid; grid-template-columns:repeat(auto-fit, minmax(80px, 1fr)); gap:8px; }
.fs-vec legend{ margin-bottom:6px; font-size:13px; font-weight:600; color:var(--text-muted); }
.fs-vec label{ display:flex; align-items:center; gap:6px; font-size:12px; font-weight:700; color:var(--text-muted); }
.fs-vec input{ flex:1; min-width:0; min-height:40px; padding:0 8px; border-radius:8px; border:1px solid var(--border-strong); background:var(--bg-panel-raised); color:var(--text-primary); font:inherit; font-size:14px; }
.fs-addon-foot{ display:flex; justify-content:space-between; gap:8px; padding:10px 14px; border-top:1px solid var(--border-strong); }

.fs-inspector{ display:flex; flex-direction:column; background:var(--bg-panel); }
.fs-tabs{
  position:sticky; top:61px; z-index:20; display:flex; overflow-x:auto; scrollbar-width:none;
  background:var(--bg-panel); border-bottom:1px solid var(--border-strong);
}
.fs-tabs::-webkit-scrollbar{ display:none; }
.fs-tabs button{
  flex:1 0 auto; min-height:48px; padding:0 14px; border:0; border-bottom:3px solid transparent; background:transparent;
  color:var(--text-muted); font-family:var(--font-body); font-size:14px; font-weight:600; cursor:pointer;
}
.fs-tabs button[aria-selected="true"]{ color:var(--text-primary); border-bottom-color:var(--route-highlight); }
.fs-tabs button:focus-visible{ outline:2px solid var(--route-highlight); outline-offset:-2px; }
.fs-panel{ padding:16px 12px 20px; display:flex; flex-direction:column; gap:14px; }
.fs-panel[hidden]{ display:none; }
.fs-h{
  margin:8px 0 -4px; display:flex; justify-content:space-between; gap:8px;
  font-family:var(--font-display); font-size:17px; font-weight:700; text-transform:uppercase; line-height:1.1;
}
.fs-h small{ font-family:var(--font-body); font-size:13px; font-weight:600; text-transform:none; color:var(--text-muted); font-variant-numeric:tabular-nums; }
.fs-inspector-foot{
  display:flex; justify-content:space-between; align-items:center; gap:8px; padding:8px 8px 8px 12px;
  padding-bottom:max(8px, env(safe-area-inset-bottom)); border-top:1px solid var(--border-strong); font-size:12px; color:var(--text-muted);
}

.fs-grid2{ display:grid; grid-template-columns:repeat(auto-fit, minmax(140px, 1fr)); gap:12px; }
.fs-field{ display:flex; flex-direction:column; gap:6px; font-size:13px; font-weight:600; color:var(--text-muted); }
.fs-field > label{ font:inherit; }
.fs-field select, .fs-field input[type="text"], .fs-field input[type="number"]{
  width:100%; min-height:46px; padding:0 12px; border-radius:10px; border:1px solid var(--border-strong);
  background:var(--bg-panel-raised); color:var(--text-primary); font-family:var(--font-body); font-size:16px; font-weight:500;
}
.fs-field input::placeholder{ color:var(--text-muted); opacity:0.8; }
.fs-field input[type="range"]{ width:100%; min-height:36px; accent-color:var(--route-highlight); }
.fs-field input:focus-visible, .fs-field select:focus-visible{ outline:2px solid var(--route-highlight); outline-offset:1px; }
.fs-inline{ display:flex; gap:8px; }
.fs-inline input{ flex:1; min-width:0; }

.fs-formats{ display:grid; grid-template-columns:repeat(2, 1fr); gap:8px; }
.fs-format{
  display:grid; grid-template-columns:40px 1fr; grid-template-rows:auto auto; align-items:center; column-gap:10px; text-align:left;
  min-height:66px; padding:8px 10px; border-radius:12px; border:1px solid var(--border-strong); background:var(--bg-panel-raised);
  color:var(--text-primary); cursor:pointer; font-family:var(--font-body);
}
.fs-format i{ grid-row:span 2; justify-self:center; width:var(--w); height:var(--h); border:2px solid currentColor; border-radius:4px; opacity:0.7; }
.fs-format b{ font-family:var(--font-display); font-size:23px; line-height:1; }
.fs-format small{ font-size:12px; color:var(--text-muted); line-height:1.2; }
.fs-format[aria-pressed="true"], .fs-look[aria-pressed="true"]{ border-color:var(--route-highlight); box-shadow:inset 0 0 0 1px var(--route-highlight); }
.fs-format[aria-pressed="true"] i{ border-color:var(--route-highlight); background:var(--route-highlight); opacity:1; }

/* map looks: CSS-drawn chips standing for each basemap, no image assets */
.fs-looks{ display:grid; grid-template-columns:repeat(5, minmax(0, 1fr)); gap:6px; }
.fs-look{
  display:flex; flex-direction:column; align-items:center; gap:6px; min-height:44px; padding:6px 4px 8px; border-radius:12px;
  border:1px solid var(--border-strong); background:var(--bg-panel-raised); color:var(--text-primary);
  font-family:var(--font-body); font-size:11px; font-weight:600; cursor:pointer;
}
.fs-look i{ width:100%; aspect-ratio:1; border-radius:8px; box-shadow:inset 0 0 0 1px rgba(0,0,0,0.12); }
.lk-sat{ background:radial-gradient(circle at 30% 35%, #6f7d4a 0 18%, transparent 19%), radial-gradient(circle at 70% 70%, #8a7a58 0 22%, transparent 23%), linear-gradient(135deg, #3d4f2c, #5d6b3d 45%, #7a6a4a); }
.lk-topo{ background:repeating-radial-gradient(circle at 40% 45%, #e8dfc8 0 5px, #c9b48a 5px 6px), #efe7d2; }
.lk-street{ background:linear-gradient(90deg, transparent 46%, #f2b44a 46% 54%, transparent 54%), linear-gradient(0deg, transparent 30%, #ffffff 30% 36%, transparent 36%), #ece8df; }
.lk-light{ background:linear-gradient(90deg, transparent 46%, #ffffff 46% 52%, transparent 52%), #d9dbde; }
.lk-dark{ background:linear-gradient(90deg, transparent 46%, #4a4e55 46% 52%, transparent 52%), #23262b; }

.fs-seg{ display:flex; border:1px solid var(--border-strong); border-radius:10px; overflow:hidden; }
.fs-seg button{ flex:1; min-height:46px; border:0; background:var(--bg-panel-raised); color:var(--text-primary); font-family:var(--font-body); font-size:14px; font-weight:600; cursor:pointer; }
.fs-seg button + button{ border-left:1px solid var(--border-strong); }
.fs-seg button[aria-pressed="true"]{ background:var(--text-primary); color:var(--bg-panel); }

.fs-toggle{ display:flex; align-items:flex-start; gap:12px; min-height:44px; padding:4px 0; cursor:pointer; font-size:15px; font-weight:600; }
.fs-toggle input{ flex:none; width:22px; height:22px; margin:1px 0 0; accent-color:var(--route-highlight); }
.fs-toggle small{ display:block; margin-top:2px; font-size:13px; font-weight:400; color:var(--text-muted); line-height:1.4; }
.fs-trim{ display:grid; gap:2px; }
.fs-trim input{ width:100%; accent-color:var(--route-highlight); min-height:36px; }
.fs-note{ margin:0; font-size:13px; line-height:1.45; color:var(--text-muted); max-width:62ch; }
.fs-warn{ color:var(--warn-amber, #b26a00); }

.fs-music{ display:flex; align-items:center; gap:10px; flex-wrap:wrap; padding:12px; border-radius:12px; background:var(--bg-panel-raised); border:1px solid var(--border-strong); }
.fs-music > div{ flex:1; min-width:150px; }
.fs-music strong{ display:block; font-size:15px; overflow-wrap:anywhere; }
.fs-music small{ display:block; margin-top:3px; font-size:13px; color:var(--text-muted); }
.fs-music label.rl-btn:focus-within{ outline:2px solid var(--route-highlight); outline-offset:2px; }
#fsMusicOpts{ display:flex; flex-direction:column; gap:12px; }
#fsMusicOpts[hidden]{ display:none; }

/* ---------- export dialog ---------- */
.fs-summary{ display:grid; grid-template-columns:repeat(auto-fit, minmax(130px, 1fr)); gap:10px 14px; margin:0; padding:12px; border-radius:12px; background:var(--bg-panel-raised); border:1px solid var(--border-strong); }
.fs-summary dt{ font-size:12px; font-weight:600; color:var(--text-muted); }
.fs-summary dd{ margin:2px 0 0; font-size:15px; font-weight:600; overflow-wrap:anywhere; }
.fs-exp-bar{ height:100%; width:0; background:var(--route-highlight); transition:width 0.25s ease; }
.fs-done-video{ max-height:52dvh; }

/* while exporting, the map renders at the export size behind the opaque dialog */
body.fs-exporting .fs-frame .fs-map,
body.fs-exporting .fs-frame .fs-map.maplibregl-map{ position:fixed; left:0; top:0; right:auto; bottom:auto; z-index:1; }

/* the studio's own browser surfaces */
.fs-studio ::selection{ background:var(--route-highlight); color:var(--route-highlight-ink); }
.fs-studio input{ caret-color:var(--route-highlight); }

/* ---------- wider screens ---------- */
@media (min-width: 640px){
  .fs-bar-poster{ display:inline-flex; }
  .fs-transport{ grid-template-columns:auto auto 1fr; grid-template-areas:"play time line"; }
  .fs-time{ flex-direction:column; gap:0; min-width:96px; }
  .fs-cams{ grid-auto-flow:row; grid-template-columns:repeat(auto-fill, minmax(84px, 1fr)); overflow:visible; }
}
@media (min-width: 1024px){
  body.fs-in-studio .rl-main{ padding:10px; }
  .fs-studio{ height:calc(100dvh - 20px); min-height:560px; gap:10px; }
  .fs-bar{ position:static; border:1px solid var(--border-strong); border-radius:12px; }
  .fs-body{ flex:1; min-height:0; display:grid; grid-template-columns:minmax(0, 1fr) 380px; gap:10px; }
  /* picture, transport and tabs stay put; only the open tab's panel scrolls, so the picture is always in view */
  .fs-stagecol{ min-height:0; display:grid; grid-template-rows:minmax(300px, 1fr) auto auto minmax(150px, 36%); grid-template-columns:minmax(0, 1fr); gap:10px; overflow:hidden; }
  .fs-stagecol > .fs-deck{ min-height:0; overflow-y:auto; scrollbar-width:thin; scrollbar-color:var(--border-strong) transparent; }
  .fs-stagecol > *{ min-width:0; }
  .fs-viewer{ height:auto; min-height:0; border-radius:12px; border:1px solid var(--border-strong); }
  .fs-transport, .fs-deck{ border:1px solid var(--border-strong); border-radius:12px; }
  .fs-worktabs{ border:1px solid var(--border-strong); border-radius:12px; margin-bottom:-10px; border-bottom-left-radius:0; border-bottom-right-radius:0; }
  .fs-worktabs + .fs-deck, .fs-worktabs ~ .fs-deck{ border-top-left-radius:0; border-top-right-radius:0; }
  .fs-viewer{ min-height:300px; }
  .fs-cams{ grid-auto-flow:column; grid-template-columns:none; grid-auto-columns:minmax(76px, 1fr); overflow-x:auto; }
  .fs-inspector{ min-height:0; overflow:hidden; border:1px solid var(--border-strong); border-radius:12px; }
  .fs-tabs{ position:static; }
  .fs-panel{ flex:1; min-height:0; overflow-y:auto; scrollbar-width:thin; scrollbar-color:var(--border-strong) transparent; }
}
@media (prefers-reduced-motion: reduce){
  .fs-cam, .fs-cam.is-cut{ transition:none; animation:none; }
}

/* studio dialogs and loader: plain elevation, no thick accent rule on a rounded card */
.fs-loader .rl-loader-card, #fsExport .cn-export-card{ border:0; box-shadow:0 12px 32px rgba(0,0,0,0.22); }

/* ---------- help ---------- */
.fs-helpbtn{
  position:relative; display:inline-grid; place-items:center; width:26px; height:26px; margin-left:6px; vertical-align:2px; border-radius:50%;
  border:1px solid var(--border-strong); background:var(--bg-panel-raised); color:var(--text-primary);
  font-family:var(--font-body); font-size:13px; font-weight:700; cursor:pointer;
}
.fs-helpbtn::before{ content:""; position:absolute; inset:-9px; } /* 44px touch target around a small mark */
.fs-linkbtn{ padding:0; border:0; background:none; color:var(--text-primary); font:inherit; font-weight:600; text-decoration:underline; text-underline-offset:2px; cursor:pointer; }
.fs-helpbtn:focus-visible, .fs-linkbtn:focus-visible{ outline:2px solid var(--route-highlight); outline-offset:2px; }
.fs-help{
  width:min(760px, 100vw); max-width:100vw; height:min(88dvh, 900px); max-height:100dvh; margin:auto; padding:0; border:0; border-radius:14px;
  background:var(--bg-panel); color:var(--text-primary); box-shadow:0 18px 48px rgba(0,0,0,0.35);
}
.fs-help[open]{ display:flex; flex-direction:column; }
.fs-help::backdrop{ background:rgba(10,12,16,0.55); }
.fs-help-head{ display:flex; align-items:center; gap:8px; padding:10px 10px 10px 18px; border-bottom:1px solid var(--border-strong); }
.fs-help-head h2{ flex:1; margin:0; font-family:var(--font-display); font-size:22px; font-weight:700; text-transform:uppercase; }
.fs-help-nav{ display:flex; gap:6px; overflow-x:auto; padding:10px 12px; border-bottom:1px solid var(--border-strong); scrollbar-width:thin; }
.fs-help-nav button{
  flex:none; min-height:40px; padding:0 12px; border-radius:20px; border:1px solid var(--border-strong); background:var(--bg-panel-raised);
  color:var(--text-primary); font-family:var(--font-body); font-size:13px; font-weight:600; cursor:pointer; white-space:nowrap;
}
.fs-help-nav button[aria-current="true"]{ background:var(--text-primary); color:var(--bg-panel); border-color:var(--text-primary); }
.fs-help-nav button:focus-visible{ outline:2px solid var(--route-highlight); outline-offset:2px; }
.fs-help-body{ flex:1; overflow-y:auto; padding:6px 20px 28px; font-size:15px; line-height:1.55; }
.fs-help-body section{ padding-top:14px; }
.fs-help-body h3{ margin:8px 0 6px; font-family:var(--font-display); font-size:21px; font-weight:700; text-transform:uppercase; outline:none; }
.fs-help-body h4{ margin:12px 0 4px; font-size:15px; }
.fs-help-body p, .fs-help-body li{ max-width:68ch; }
.fs-help-body p{ margin:0 0 10px; }
.fs-help-body ul, .fs-help-body ol{ margin:0 0 12px; padding-left:22px; }
.fs-help-body li{ margin:3px 0; }
.fs-help-body code{ font-family:var(--font-mono); font-size:13px; padding:1px 5px; border-radius:4px; background:var(--bg-panel-raised); }
.fs-help-body table{ width:100%; border-collapse:collapse; margin:4px 0 14px; font-size:14px; }
.fs-help-body th, .fs-help-body td{ text-align:left; vertical-align:top; padding:8px 10px; border-bottom:1px solid var(--border-strong); }
.fs-help-body thead th{ font-size:12px; color:var(--text-muted); }
.fs-help-body tbody th{ white-space:nowrap; }
@media (max-width: 640px){
  .fs-help{ width:100vw; height:100dvh; border-radius:0; }
}
.fs-help-body a{ color:var(--text-primary); font-weight:600; text-underline-offset:2px; }

/* ---------- leave the editor: save / leave without saving / stay ---------- */
.fs-help.fs-leave-dlg{ width:min(460px, calc(100vw - 32px)); height:auto; max-height:calc(100dvh - 32px); border-radius:14px; }
.fs-leave-body{ padding:22px 22px 8px; }
.fs-leave-body h2{ margin:0 0 8px; font-family:var(--font-display); font-size:22px; font-weight:700; text-transform:uppercase; }
.fs-leave-body p{ margin:0; color:var(--text-muted); font-size:15px; line-height:1.5; }
.fs-leave-foot{ display:flex; flex-wrap:wrap; justify-content:flex-end; gap:8px; padding:16px 22px 20px; }
.fs-leave-foot .rl-btn{ min-height:48px; }
.fs-leave-foot .rl-btn[hidden]{ display:none; }
@media (max-width: 520px){
  .fs-leave-foot{ flex-direction:column-reverse; }
  .fs-leave-foot .rl-btn{ width:100%; }
}
.fs-bar-save:disabled{ opacity:0.6; cursor:default; }
