/* Tasvir Storyboard · the online slicer and editor. Built on site.css tokens (Inter, sunset colours). */
.sb-page { background: #000; }
.sb {
  --bg: #0b0b0d; --panel: #141416; --panel-2: #1c1c1f; --panel-3: #26262a;
  --line: rgba(255,255,255,.08); --line-2: rgba(255,255,255,.14);
  --tx: #f5f5f7; --dim: #a1a1a6; --dim-2: #6e6e73;
  --acc: #e48424; --acc-2: #f0a04b; --acc-soft: rgba(228,132,36,.16);
  --hot: linear-gradient(105deg, #9c240c, #c2410c 30%, #e48424 75%, #e4cc54);
  color: var(--tx); background: var(--bg);
  height: calc(100svh - 44px); min-height: 560px;
  display: flex; flex-direction: column; font-size: 13px; letter-spacing: -.01em;
  user-select: none; -webkit-user-select: none;
}
.sb input, .sb textarea, .sb select { user-select: text; -webkit-user-select: text; font: inherit; color: inherit; }
.sb [hidden] { display: none !important; }

/* ------------------------------------------------ app header */
.sb-bar { display: flex; align-items: center; gap: 18px; padding: 0 16px; height: 52px; border-bottom: 1px solid var(--line); background: #000; flex: none; }
.sb-name { display: flex; align-items: baseline; gap: 12px; margin-right: auto; min-width: 0; }
.sb-name b { font: 600 19px/1 var(--display); letter-spacing: .005em; white-space: nowrap; }
.sb-name b span { background: var(--hot); -webkit-background-clip: text; background-clip: text; color: transparent; }
.sb-name small { color: var(--dim-2); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-seg { display: flex; padding: 3px; gap: 3px; border-radius: 999px; background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--line); }
.sb-seg button { display: flex; align-items: center; gap: 8px; height: 32px; padding: 0 16px 0 6px; border-radius: 999px; color: var(--dim); font-weight: 500; font-size: 14px; transition: background .2s, color .2s; }
.sb-seg button i { font-style: normal; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--panel-3); font: 600 11px/1 var(--text); color: var(--dim); }
.sb-seg button[aria-selected="true"] { background: #fff; color: #1d1d1f; }
.sb-seg button[aria-selected="true"] i { background: var(--hot); color: #fff; }

/* ------------------------------------------------ buttons and fields */
.sb-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 30px; padding: 0 13px; border-radius: 999px;
  background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--line-2); color: var(--tx); font-size: 13px; font-weight: 500; white-space: nowrap;
  transition: background .15s, transform .1s, opacity .15s; }
.sb-btn:hover { background: var(--panel-3); }
.sb-btn:active { transform: scale(.97); }
.sb-btn:disabled { opacity: .35; pointer-events: none; }
.sb-btn.hot { background: var(--hot); box-shadow: 0 6px 22px rgba(228,132,36,.28); color: #fff; font-weight: 600; }
.sb-btn.hot:hover { filter: brightness(1.08); }
.sb-btn.ghost { background: transparent; }
.sb-btn.on { background: var(--acc-soft); box-shadow: inset 0 0 0 1px var(--acc); color: #fff; }
.sb-btn.big { height: 38px; padding: 0 18px; font-size: 14px; }
.sb-btn.icon { width: 30px; padding: 0; font-size: 15px; }
.sb-btn.danger { color: #ff9a8a; }
.sb-btn svg { width: 15px; height: 15px; }
.sb-sep { width: 1px; height: 20px; background: var(--line-2); flex: none; }
.sb-sp { flex: 1; }
.sb-hint { color: var(--dim-2); font-size: 12px; line-height: 1.45; }
.sb-num, .sb-text, .sb-sel { height: 30px; border-radius: 9px; border: 0; background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--line-2); padding: 0 9px; outline: none; min-width: 0; }
.sb-sel { padding: 0 6px; cursor: pointer; }
.sb-sel option { background: #1c1c1f; }
.sb-num:focus, .sb-text:focus, .sb-sel:focus, .sb textarea:focus { box-shadow: inset 0 0 0 1px var(--acc); }
.sb textarea { width: 100%; min-height: 64px; resize: vertical; border-radius: 10px; border: 0; background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--line-2); padding: 8px 10px; outline: none; line-height: 1.4; }
.sb input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 18px; background: none; cursor: pointer; }
.sb input[type="range"]::-webkit-slider-runnable-track { height: 3px; border-radius: 3px; background: var(--panel-3); }
.sb input[type="range"]::-moz-range-track { height: 3px; border-radius: 3px; background: var(--panel-3); }
.sb input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 13px; height: 13px; margin-top: -5px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.5); }
.sb input[type="range"]::-moz-range-thumb { width: 13px; height: 13px; border: 0; border-radius: 50%; background: #fff; }
.sb input[type="checkbox"] { accent-color: var(--acc); width: 15px; height: 15px; cursor: pointer; }

/* ------------------------------------------------ drop zone */
.sb-drop { width: min(620px, 100%); margin: auto; border-radius: 28px; padding: 64px 32px; text-align: center; cursor: pointer;
  background: radial-gradient(120% 90% at 50% 0%, rgba(228,132,36,.10), transparent 60%), var(--panel);
  box-shadow: inset 0 0 0 1.5px var(--line-2); transition: box-shadow .2s, transform .2s, background .2s; }
.sb-drop:hover, .sb-drop.drag { box-shadow: inset 0 0 0 1.5px var(--acc); transform: translateY(-2px); }
.sb-drop .ic { width: 56px; height: 56px; margin: 0 auto 18px; border-radius: 16px; display: grid; place-items: center; background: var(--hot); color: #fff; font-size: 26px; box-shadow: 0 10px 30px rgba(228,132,36,.3); }
.sb-drop h2 { font: 600 24px/1.15 var(--display); letter-spacing: 0; }
.sb-drop p { color: var(--dim); font-size: 15px; margin-top: 8px; }
.sb-drop small { display: inline-block; margin-top: 22px; color: var(--dim-2); font-size: 12px; }

/* ------------------------------------------------ slicer */
.sb-view { flex: 1; min-height: 0; display: flex; }
.sl-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.sl-tabs { display: flex; gap: 6px; padding: 10px 16px 0; overflow-x: auto; flex: none; }
.sl-tab { display: flex; align-items: center; gap: 8px; height: 28px; padding: 0 6px 0 12px; border-radius: 999px; background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--line); white-space: nowrap; cursor: pointer; color: var(--dim); }
.sl-tab.on { color: #fff; box-shadow: inset 0 0 0 1px var(--acc); background: var(--acc-soft); }
.sl-tab .x { width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; color: var(--dim-2); }
.sl-tab .x:hover { color: #fff; background: rgba(255,255,255,.1); }
.sl-tools { display: flex; align-items: center; gap: 10px; padding: 10px 16px; flex-wrap: wrap; flex: none; }
.sl-chip { display: flex; align-items: center; gap: 8px; height: 30px; padding: 0 10px; border-radius: 999px; background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--line); color: var(--dim); }
.sl-chip button { width: 20px; font-size: 16px; color: var(--tx); }
.sl-chip input[type="range"] { width: 100px; }
.sl-chip b { font-weight: 500; color: var(--tx); min-width: 38px; text-align: center; }
.sl-stage { flex: 1; min-height: 0; overflow: auto; display: flex; padding: 0 16px 16px; }
.sl-scroll { margin: auto; padding: 8px; border-radius: 20px; background: #050506; box-shadow: inset 0 0 0 1px var(--line); }
.sl-wrap { position: relative; line-height: 0; border-radius: 12px; overflow: hidden; cursor: pointer; touch-action: none; }
.sl-wrap canvas { display: block; }
.sl-off { position: absolute; background: rgba(0,0,0,.62); pointer-events: none; }
.sl-badge { position: absolute; margin: 6px; padding: 3px 7px; border-radius: 7px; background: rgba(0,0,0,.72); color: #fff; font: 600 11px/1.2 var(--text); pointer-events: none; }
.sl-ln { position: absolute; z-index: 5; background: var(--acc); opacity: .9; }
.sl-ln::after { content: ""; position: absolute; inset: -6px; }
.sl-ln.v { top: 0; bottom: 0; width: 2px; margin-left: -1px; cursor: col-resize; }
.sl-ln.h { left: 0; right: 0; height: 2px; margin-top: -1px; cursor: row-resize; }
.sl-ln:hover, .sl-ln.drag { background: var(--sun); opacity: 1; }
.sl-cam { position: absolute; z-index: 7; pointer-events: none; }
.sl-cam canvas { width: 100%; height: 100%; }
.sl-wrap.cam .sl-cam { pointer-events: auto; cursor: grab; }
.sl-foot { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 12px 16px; border-top: 1px solid var(--line); flex: none; }
.sl-foot .sb-hint { margin-right: auto; }
.sl-side { width: 300px; flex: none; border-left: 1px solid var(--line); background: var(--panel); display: flex; flex-direction: column; min-height: 0; }
.sb-sec { padding: 14px 14px; border-bottom: 1px solid var(--line); }
.sb-sec h4 { font: 600 11px/1 var(--text); letter-spacing: .08em; text-transform: uppercase; color: var(--dim-2); margin-bottom: 10px; }
.sb-row { display: flex; gap: 8px; align-items: center; }
.sb-row + .sb-row { margin-top: 8px; }
.sb-row > .sb-btn { flex: 1; }
.sb-fld { flex: 1; min-width: 0; }
.sb-fld label { display: block; color: var(--dim-2); font-size: 11px; margin-bottom: 4px; }
.sb-fld .sb-num, .sb-fld .sb-text, .sb-fld .sb-sel { width: 100%; }
.sb-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.sb-chips span { font-size: 11px; padding: 3px 8px; border-radius: 999px; background: var(--panel-3); color: var(--dim); cursor: pointer; }
.sb-chips span:hover { color: var(--acc-2); }
.sl-count { display: flex; justify-content: space-between; padding: 9px 14px; border-bottom: 1px solid var(--line); color: var(--dim-2); font-size: 12px; }
.sl-count a { color: var(--acc-2); cursor: pointer; }
.sl-list { flex: 1; overflow-y: auto; min-height: 80px; }
.sl-cell { display: flex; align-items: center; gap: 8px; padding: 6px 14px; border-bottom: 1px solid rgba(255,255,255,.035); }
.sl-cell.off { opacity: .4; }
.sl-cell canvas { width: 48px; height: 32px; border-radius: 6px; flex: none; background: #000; cursor: pointer; object-fit: cover; }
.sl-cell input[type="text"] { flex: 1; width: 0; height: 26px; font-size: 12px; }
.sl-cell .cam { width: 18px; text-align: center; color: #ff3b3b; font-size: 14px; flex: none; }
.sl-cell .dl { color: var(--dim-2); font-size: 15px; flex: none; padding: 0 2px; }
.sl-cell .dl:hover { color: var(--acc-2); }
.sl-empty { padding: 40px 18px; text-align: center; color: var(--dim-2); }
.sl-opts { padding: 12px 14px; border-top: 1px solid var(--line); display: grid; gap: 8px; color: var(--dim); font-size: 12px; }
.sl-opts label { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.sl-opts .sb-sel { height: 26px; margin-left: auto; }

/* direction picker (slicer and editor) */
.sb-pick { position: fixed; z-index: 300; display: grid; grid-template-columns: repeat(3, 40px); gap: 5px; padding: 9px; border-radius: 16px;
  background: rgba(22,22,24,.96); box-shadow: 0 18px 48px rgba(0,0,0,.6), inset 0 0 0 1px var(--line-2); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); }
.sb-pick button, .ed-dirs button { height: 40px; border-radius: 10px; background: var(--panel-3); font-size: 19px; color: #fff; }
.sb-pick button:hover, .ed-dirs button:hover { background: var(--acc-soft); }
.sb-pick button.on, .ed-dirs button.on { background: rgba(255,59,59,.22); box-shadow: inset 0 0 0 1px #ff3b3b; color: #ff5b5b; }
.sb-pick .clr { grid-column: 1 / -1; height: 28px; font-size: 12px; color: #ff9a8a; background: none; box-shadow: inset 0 0 0 1px rgba(255,138,138,.3); }

/* ------------------------------------------------ editor */
.ed { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ed-top { display: flex; align-items: center; gap: 8px; padding: 9px 14px; border-bottom: 1px solid var(--line); flex: none; flex-wrap: wrap; }
.ed-tool { display: flex; padding: 2px; gap: 2px; border-radius: 999px; background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--line); }
.ed-tool button { height: 26px; padding: 0 12px; border-radius: 999px; color: var(--dim); display: flex; align-items: center; gap: 6px; }
.ed-tool button.on { background: #fff; color: #1d1d1f; }
.ed-tool svg { width: 14px; height: 14px; }
.ed-mid { flex: 1; min-height: 0; display: flex; }
.ed-view { flex: 1; min-width: 0; display: flex; flex-direction: column; background: #050506; }
.ed-box { flex: 1; min-height: 0; position: relative; display: grid; place-items: center; padding: 18px; }
.ed-box canvas { display: block; max-width: 100%; max-height: 100%; border-radius: 4px; box-shadow: 0 0 0 1px var(--line), 0 18px 60px rgba(0,0,0,.6); background: #000; touch-action: none; }
.ed-box.arrow canvas { cursor: crosshair; }
.ed-box .sb-drop { position: absolute; inset: 0; margin: auto; height: fit-content; }
.ed-trans { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 14px 10px; flex: none; }
.ed-trans .tc { font: 500 13px/1 ui-monospace, "SF Mono", Menlo, Consolas, monospace; color: var(--dim); min-width: 170px; text-align: center; letter-spacing: 0; }
.ed-trans .tc b { color: #fff; font-weight: 500; }
.ed-trans .play { width: 40px; height: 40px; border-radius: 50%; background: #fff; color: #000; font-size: 15px; }
.ed-insp { width: 300px; flex: none; border-left: 1px solid var(--line); background: var(--panel); overflow-y: auto; }
.ed-insp .sb-sec h4 { display: flex; justify-content: space-between; align-items: center; }
.ed-sl { display: grid; grid-template-columns: 86px 1fr 40px; align-items: center; gap: 8px; color: var(--dim); font-size: 12px; }
.ed-sl + .ed-sl { margin-top: 6px; }
.ed-sl output { text-align: right; color: var(--tx); font-variant-numeric: tabular-nums; cursor: pointer; }
.ed-seg2 { display: flex; padding: 2px; gap: 2px; border-radius: 9px; background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--line); flex: 1; }
.ed-seg2 button { flex: 1; height: 26px; border-radius: 7px; color: var(--dim); font-size: 12px; white-space: nowrap; }
.ed-seg2 button.on { background: var(--panel-3); color: #fff; box-shadow: inset 0 0 0 1px var(--line-2); }
.ed-dirs { display: grid; grid-template-columns: repeat(3, 1fr) 1fr; gap: 5px; }
.ed-dirs button { height: 32px; font-size: 16px; }
.ed-dirs .clr { grid-column: 4; grid-row: 1 / 4; height: auto; font-size: 12px; color: #ff9a8a; background: none; box-shadow: inset 0 0 0 1px rgba(255,138,138,.25); }
.ed-colors { display: flex; gap: 6px; }
.ed-colors button { width: 24px; height: 24px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(255,255,255,.25); }
.ed-colors button.on { box-shadow: 0 0 0 2px #000, 0 0 0 3.5px #fff; }
.ed-thumbs { display: flex; gap: 4px; flex-wrap: wrap; }
.ed-thumbs img { width: 40px; height: 26px; object-fit: cover; border-radius: 4px; }

/* timeline */
.ed-tl { flex: none; height: 228px; border-top: 1px solid var(--line); background: var(--panel); display: flex; flex-direction: column; }
.ed-tl-bar { display: flex; align-items: center; gap: 6px; padding: 6px 12px; border-bottom: 1px solid var(--line); flex: none; }
.ed-tl-bar .sb-btn { height: 26px; padding: 0 10px; font-size: 12px; }
.ed-tl-bar .sb-hint { margin: 0 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ed-zoom { display: flex; align-items: center; gap: 6px; width: 140px; color: var(--dim-2); }
.ed-tl-body { flex: 1; min-height: 0; display: flex; }
.ed-heads { width: 44px; flex: none; border-right: 1px solid var(--line); padding-top: 24px; }
.ed-heads div { height: 64px; display: grid; place-items: center; color: var(--dim-2); font: 600 11px/1 var(--text); letter-spacing: .06em; border-bottom: 1px solid var(--line); }
.ed-heads div.t, .ed-heads div.a { height: 40px; }
.ed-scroll { flex: 1; min-width: 0; overflow-x: auto; overflow-y: hidden; position: relative; }
.ed-inner { position: relative; height: 100%; min-width: 100%; }
.ed-ruler { height: 24px; position: relative; border-bottom: 1px solid var(--line); cursor: text; }
.ed-ruler span { position: absolute; top: 0; bottom: 0; border-left: 1px solid rgba(255,255,255,.12); padding: 6px 0 0 4px; font: 10px/1 ui-monospace, Consolas, monospace; color: var(--dim-2); letter-spacing: 0; }
.ed-trk { position: relative; border-bottom: 1px solid var(--line); }
.ed-trk.v { height: 64px; }
.ed-trk.t, .ed-trk.a { height: 40px; }
.ed-clip { position: absolute; top: 4px; bottom: 4px; border-radius: 7px; overflow: hidden; background: #2a2a2e center / auto 100% repeat-x; box-shadow: inset 0 0 0 1px rgba(255,255,255,.18); cursor: grab; }
.ed-clip .n { position: absolute; left: 5px; top: 4px; padding: 2px 5px; border-radius: 5px; background: rgba(0,0,0,.65); font: 600 10px/1.2 var(--text); color: #fff; pointer-events: none; white-space: nowrap; }
.ed-clip .d { position: absolute; right: 9px; bottom: 4px; padding: 2px 5px; border-radius: 5px; background: rgba(0,0,0,.65); font: 500 10px/1.2 var(--text); color: #ddd; pointer-events: none; }
.ed-clip .r { position: absolute; right: 0; top: 0; bottom: 0; width: 8px; cursor: ew-resize; }
.ed-clip .r::after { content: ""; position: absolute; right: 2px; top: 30%; bottom: 30%; width: 2px; border-radius: 2px; background: rgba(255,255,255,.5); }
.ed-clip.sel { box-shadow: inset 0 0 0 2px var(--acc), 0 0 0 1px var(--acc); }
.ed-clip.ghost { opacity: .35; }
.ed-cap { position: absolute; top: 5px; bottom: 5px; border-radius: 6px; background: rgba(108,204,228,.16); box-shadow: inset 0 0 0 1px rgba(108,204,228,.4); color: #bfe9f4; font-size: 11px; padding: 0 7px; display: flex; align-items: center; overflow: hidden; white-space: nowrap; cursor: pointer; }
.ed-mus { position: absolute; top: 4px; bottom: 4px; border-radius: 7px; background: rgba(228,204,84,.13); box-shadow: inset 0 0 0 1px rgba(228,204,84,.45); overflow: hidden; cursor: grab; }
.ed-mus.sel { box-shadow: inset 0 0 0 2px var(--sun); }
.ed-mus canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.ed-mus b { position: absolute; left: 6px; top: 3px; font: 500 10px/1.2 var(--text); color: #f3e7a7; white-space: nowrap; }
.ed-ins { position: absolute; top: 24px; bottom: 0; width: 2px; margin-left: -1px; background: var(--sun); box-shadow: 0 0 8px var(--sun); pointer-events: none; z-index: 6; }
.ed-ph { position: absolute; top: 0; bottom: 0; width: 1px; background: #ff453a; z-index: 8; pointer-events: none; }
.ed-ph::before { content: ""; position: absolute; top: 0; left: -6px; border: 6px solid transparent; border-top: 8px solid #ff453a; }
.ed-tl-empty { position: absolute; left: 14px; top: 38px; color: var(--dim-2); pointer-events: none; }

/* export menu */
.ed-menu { position: absolute; z-index: 120; right: 14px; top: 100%; margin-top: 6px; width: 300px; padding: 6px; border-radius: 16px;
  background: rgba(22,22,24,.98); box-shadow: 0 18px 50px rgba(0,0,0,.6), inset 0 0 0 1px var(--line-2); }
.ed-menu button { display: grid; grid-template-columns: 34px 1fr; gap: 2px 10px; width: 100%; text-align: left; padding: 9px 10px; border-radius: 11px; }
.ed-menu button:hover { background: rgba(255,255,255,.06); }
.ed-menu i { grid-row: 1 / 3; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font: 700 10px/1 var(--text); font-style: normal; background: var(--panel-3); color: var(--acc-2); letter-spacing: .02em; }
.ed-menu b { font-weight: 600; font-size: 14px; }
.ed-menu small { color: var(--dim-2); font-size: 12px; line-height: 1.3; }

/* dialog, toast, progress */
.sb-dlg { position: fixed; inset: 0; z-index: 400; display: grid; place-items: center; background: rgba(0,0,0,.55); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); padding: 16px; }
.sb-dlg-box { width: min(420px, 100%); padding: 22px; border-radius: 22px; background: #161618; color: #f5f5f7; box-shadow: 0 30px 80px rgba(0,0,0,.6), inset 0 0 0 1px rgba(255,255,255,.1); display: grid; gap: 14px; font-size: 13px; }
.sb-dlg-box h3 { font: 600 20px/1.2 var(--display); }
.sb-dlg-box label { display: grid; gap: 6px; color: #a1a1a6; font-size: 12px; }
.sb-dlg-box .sb-text, .sb-dlg-box .sb-sel { height: 36px; width: 100%; border-radius: 10px; border: 0; background: #1c1c1f; box-shadow: inset 0 0 0 1px rgba(255,255,255,.14); color: #fff; padding: 0 10px; font: inherit; }
.sb-dlg-box p { color: #8e8e93; font-size: 12px; line-height: 1.45; }
.sb-dlg-row { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }
.sb-dlg .sb-btn { display: inline-flex; align-items: center; height: 36px; padding: 0 18px; border-radius: 999px; font: 500 14px var(--text); color: #fff; background: #26262a; }
.sb-dlg .sb-btn.hot { background: linear-gradient(105deg, #9c240c, #c2410c 30%, #e48424 75%, #e4cc54); font-weight: 600; }
.sb-toast { position: fixed; left: 50%; bottom: 28px; z-index: 500; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; max-width: min(560px, calc(100% - 32px));
  padding: 12px 18px; border-radius: 14px; background: rgba(28,28,30,.97); color: #f5f5f7; font: 500 14px/1.4 var(--text); box-shadow: 0 16px 40px rgba(0,0,0,.5), inset 0 0 0 1px rgba(255,255,255,.1); transition: opacity .25s, transform .25s; text-align: center; }
.sb-toast.on { opacity: 1; transform: translate(-50%, 0); }
.sb-prog { position: fixed; inset: 0; z-index: 450; display: grid; place-items: center; background: rgba(0,0,0,.6); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.sb-prog div { width: min(360px, calc(100% - 32px)); padding: 22px; border-radius: 20px; background: #161618; color: #fff; text-align: center; font: 500 15px var(--text); box-shadow: inset 0 0 0 1px rgba(255,255,255,.1); }
.sb-prog i { display: block; height: 4px; margin-top: 14px; border-radius: 4px; background: #26262a; overflow: hidden; }
.sb-prog i b { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #c2410c, #e48424, #e4cc54); transition: width .15s; }

/* ================================================ v2: icons first, fewer words */
.sb .ic { width: 18px; height: 18px; flex: none; display: block; }
.sb-name { align-items: center; }
.sb-name img { width: 34px; height: 34px; object-fit: contain; filter: drop-shadow(0 2px 8px rgba(228,132,36,.35)); }
.sb-ib { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; color: var(--dim); transition: background .15s, color .15s; flex: none; }
.sb-ib:hover { background: rgba(255,255,255,.08); color: #fff; }
.sb-ib.boxed { background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--line); color: var(--tx); }
.sb-ib.boxed:hover { background: var(--panel-3); }
.sb-ib.on { background: var(--acc-soft); box-shadow: inset 0 0 0 1px var(--acc); color: #fff; }
.sb-ib.danger { color: #ff8f80; }
.sb-ib:disabled { opacity: .3; pointer-events: none; }
span.sb-ib { pointer-events: none; width: 24px; }
.sb-btn .ic { width: 16px; height: 16px; }
.sb-group { display: flex; align-items: center; gap: 4px; height: 34px; padding: 0 6px; border-radius: 12px; background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--line); }
.sb-group input[type="range"] { width: 96px; }
.sb-val { font: 500 12px/1 var(--text); color: var(--tx); min-width: 40px; text-align: center; font-variant-numeric: tabular-nums; }
.sb-drop .logo { width: 150px; height: auto; margin: -10px auto 8px; filter: drop-shadow(0 18px 40px rgba(228,132,36,.25)); }
.sb-x { color: var(--dim-2); }
.ic-fld { display: flex; align-items: center; gap: 4px; flex: 1; min-width: 0; height: 34px; padding: 0 4px 0 8px; border-radius: 10px; background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--line); color: var(--dim); }
.ic-fld .sb-num, .ic-fld .sb-text { background: none; box-shadow: none; height: 30px; padding: 0 4px; width: 100%; }
.ic-fld .ic { width: 16px; height: 16px; }
.sl-count .sb-ib { width: 26px; height: 26px; }
.sl-count .sb-ib .ic { width: 16px; height: 16px; }
.sl-count { align-items: center; padding: 5px 10px 5px 14px; }
.ed-top { gap: 6px; }
.ed-tool button { width: 34px; padding: 0; justify-content: center; height: 30px; }
.ed-tool button .ic { width: 17px; height: 17px; }
.ed-dot { width: 20px; height: 20px; border-radius: 50%; box-shadow: 0 0 0 2px #000, 0 0 0 3.5px rgba(255,255,255,.55); margin: 0 6px; flex: none; }
.ed-trans .play { display: grid; place-items: center; }
.ed-trans .play .ic { width: 18px; height: 18px; color: #000; }
.ed-heads div .ic { width: 16px; height: 16px; }
.ed-zoom { width: 150px; }
.ed-zoom .ic { width: 16px; height: 16px; }
.ed-tl-bar { gap: 2px; padding: 4px 10px; }
.ed-tl-bar .sb-ib { width: 30px; height: 30px; }

/* inspector: icon rows and folding sections */
.ed-insp .sb-sec { padding: 12px 14px; }
.ed-head { display: flex; align-items: center; gap: 8px; }
.ed-head b { font: 600 14px/1.2 var(--display); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ed-num { display: flex; align-items: center; gap: 4px; height: 32px; padding: 0 8px; border-radius: 10px; background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--line); color: var(--dim); }
.ed-num .ic { width: 16px; height: 16px; }
.ed-num input { width: 48px; height: 28px; border: 0; background: none; color: #fff; outline: none; text-align: right; font-variant-numeric: tabular-nums; }
.ed-icons { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.ed-icons .sb-ib { background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--line); color: var(--tx); width: 36px; height: 34px; }
.ed-icons .sb-ib.on { background: var(--acc-soft); box-shadow: inset 0 0 0 1px var(--acc); }
.ed-icons .gap { width: 6px; }
.ed-sl { grid-template-columns: 22px 1fr 44px; }
.ed-sl > span { display: grid; place-items: center; color: var(--dim); }
.ed-sl > span .ic { width: 17px; height: 17px; }
.ed-sl > span.txt { font: 600 13px/1 var(--text); }
.ed-fold > summary { list-style: none; display: flex; align-items: center; gap: 8px; cursor: pointer; color: var(--dim); font-weight: 500; }
.ed-fold > summary::-webkit-details-marker { display: none; }
.ed-fold > summary .ch { margin-left: auto; transition: transform .2s; }
.ed-fold[open] > summary .ch { transform: rotate(180deg); }
.ed-fold > summary:hover { color: #fff; }
.ed-fold > div { margin-top: 10px; }
.ed-fold .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--acc); }
.ed-insp textarea { min-height: 76px; font-size: 14px; }

/* subtitles on T1 */
.ed-trk.t { cursor: text; }
.ed-trk.t:hover { background: rgba(108,204,228,.04); }
.ed-cap { cursor: grab; }
.ed-cap.sel { box-shadow: inset 0 0 0 2px #6ccce4; background: rgba(108,204,228,.26); color: #fff; }
.ed-cap .r { position: absolute; right: 0; top: 0; bottom: 0; width: 7px; cursor: ew-resize; }
.ed-cap.empty { color: rgba(191,233,244,.5); font-style: italic; }

/* the dragged clips ride on the mouse; the others make room */
.ed-box.texttool canvas { cursor: text; }
.ed-x { position: absolute; z-index: 5; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: rgba(22,22,24,.92); color: #fff; box-shadow: 0 0 0 1px rgba(255,255,255,.22), 0 6px 18px rgba(0,0,0,.5); cursor: pointer; }
.ed-x[hidden] { display: none; }
.ed-x .ic { width: 16px; height: 16px; }
.ed-x:hover { background: #ff3b30; }
.ed-inline { position: absolute; z-index: 20; height: 30px; min-height: 30px; resize: none; border: 0; border-radius: 6px; padding: 6px 8px; background: #0f2a31; color: #fff; font: 500 12px/1.4 var(--text); box-shadow: 0 0 0 2px #6ccce4, 0 10px 26px rgba(0,0,0,.6); outline: none; overflow: hidden; }
.ed-inline::placeholder { color: rgba(191,233,244,.55); }
.pdf-f { display: grid; gap: 6px; color: #a1a1a6; font-size: 12px; }
.pdf-set .seg button:disabled { opacity: .3; }
.pdf-set .amt[hidden] { display: none; }
.ed-clip { transition: left .14s ease; }
.ed-clip.mv { opacity: .12; }
.ed-float { position: fixed; z-index: 300; display: flex; gap: 2px; pointer-events: none; transform: rotate(-1.5deg) translateY(-6px); filter: drop-shadow(0 14px 26px rgba(0,0,0,.7)); }
.ed-float div { height: 56px; border-radius: 7px; background: #2a2a2e center / auto 100% repeat-x; box-shadow: inset 0 0 0 2px var(--acc); position: relative; }
.ed-float span { position: absolute; left: 5px; top: 4px; padding: 2px 5px; border-radius: 5px; background: rgba(0,0,0,.7); font: 600 10px/1.2 var(--text); color: #fff; }

/* popups */
.sb-pick { display: block; }
.sb-dirs { display: grid; grid-template-columns: repeat(3, 40px); gap: 5px; }
.sb-dirs button { height: 40px; border-radius: 10px; background: #26262a; font-size: 19px; color: #fff; }
.sb-dirs button:hover { background: rgba(228,132,36,.16); }
.sb-dirs button.on { background: rgba(255,59,59,.22); box-shadow: inset 0 0 0 1px #ff3b3b; color: #ff5b5b; }
.sb-pick .clr { display: grid; place-items: center; width: 100%; height: 30px; margin-top: 6px; border-radius: 9px; color: #ff9a8a; box-shadow: inset 0 0 0 1px rgba(255,138,138,.3); }
.sb-pick .clr .ic { width: 16px; height: 16px; }
.sb-cols { display: flex; gap: 8px; }
.sb-cols button { width: 28px; height: 28px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(255,255,255,.3); }
.sb-cols button.on { box-shadow: 0 0 0 2px #161618, 0 0 0 3.5px #fff; }
.ed-insp .sb-row { flex-wrap: wrap; }
.ed-insp .sb-cols { gap: 7px; }
.ed-insp .sb-cols button { width: 22px; height: 22px; flex: none; }
.ed-icons .sb-ib { width: 32px; height: 32px; }
.ed-icons .gap { width: 2px; }

/* storyboard sheets dialog: settings left, live pages right */
.sb-dlg.wide .sb-dlg-box { width: min(1060px, 100%); height: min(760px, calc(100svh - 32px)); grid-template-columns: 300px 1fr; grid-template-rows: auto 1fr auto; overflow: hidden; }
.sb-dlg.wide h3 { grid-column: 1 / -1; }
.sb-dlg.wide .sb-dlg-row { grid-column: 1 / -1; align-items: center; }
.pdf-set { display: grid; gap: 12px; align-content: start; overflow-y: auto; padding-right: 4px; min-height: 0; }
.pdf-set .seg { display: flex; gap: 3px; padding: 3px; border-radius: 11px; background: #1c1c1f; box-shadow: inset 0 0 0 1px rgba(255,255,255,.1); }
.pdf-set .seg button { flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; height: 32px; border-radius: 8px; color: #a1a1a6; font: 500 12px var(--text); white-space: nowrap; padding: 0 6px; }
.pdf-set .seg button.on { background: #2c2c30; color: #fff; box-shadow: inset 0 0 0 1px rgba(255,255,255,.14); }
.pdf-set .seg .ic { width: 16px; height: 16px; }
.pdf-set .chk { display: flex; align-items: center; gap: 8px; color: #a1a1a6; font-size: 12px; grid-auto-flow: column; justify-content: start; }
.pdf-set input[type="range"] { width: 100%; accent-color: #e48424; }
.pdf-set input[type="checkbox"] { accent-color: #e48424; width: 15px; height: 15px; }
.pdf-prev { overflow-y: auto; min-height: 0; background: #0b0b0d; border-radius: 14px; padding: 16px; display: grid; gap: 16px; justify-items: center; align-content: start; box-shadow: inset 0 0 0 1px rgba(255,255,255,.06); }
.pdf-prev canvas { width: 100%; max-width: 640px; height: auto; border-radius: 3px; box-shadow: 0 6px 24px rgba(0,0,0,.5); background: #fff; }
.pdf-info { margin-right: auto; color: #8e8e93; font-size: 12px; }

/* ------------------------------------------------ narrow screens */
@media (max-width: 760px) {
  .sb-dlg.wide .sb-dlg-box { grid-template-columns: 1fr; grid-template-rows: auto auto auto auto; height: auto; overflow-y: auto; }
  .pdf-prev { max-height: 46vh; }
}
@media (max-width: 1000px) {
  .sb-drop .logo { width: 90px; margin-top: 0; }
  .sb { height: auto; min-height: calc(100svh - 44px); }
  .sb-view { flex-direction: column; }
  .sl-side, .ed-insp { width: auto; border-left: 0; border-top: 1px solid var(--line); max-height: none; }
  .sl-list { max-height: 320px; }
  .sl-stage { min-height: 50vh; }
  .ed-mid { flex-direction: column; }
  .ed-box { height: 56vw; min-height: 240px; flex: none; }
  .ed-tl { height: 236px; }
  .ed-box .sb-drop { padding: 22px 18px; border-radius: 20px; width: calc(100% - 24px); }
  .ed-box .sb-drop .ic { width: 40px; height: 40px; margin-bottom: 10px; font-size: 18px; }
  .ed-box .sb-drop h2 { font-size: 17px; }
  .ed-box .sb-drop small { margin-top: 8px; }
  .sb-name small { display: none; }
}
@media (max-width: 560px) {
  .sb-bar { gap: 10px; padding: 0 12px; }
  .sb-name b { font-size: 16px; }
  .sb-seg button { padding: 0 12px 0 5px; font-size: 13px; }
  .ed-tl-bar .sb-hint { display: none; }
}
