/* FramebotAI · by Deepu Explains AI
   Look: graphite editing-suite · neutral greys, one SAFFRON accent (#ff9933, v5.1.0 FramebotAI brand) for
   action + timecode, white Export, warm amber for keyframes / markers. Type: Inter (UI) + JetBrains Mono (timecode, section labels).
   Old class names are kept so every existing feature keeps working; only the skin + layout changed. */
:root {
  --accent: #ff9933; --on-accent: #fff; --saffron-deep: #f07f12; --accent2: color-mix(in oklch, var(--accent) 78%, white); --tcol: color-mix(in oklch, var(--accent) 70%, white);
  --bg: #1c1c1e; --bg2: #232324; --card: #2d2d2f; --card2: #353537; --line: #3a3a3c; --deep: #161617; --black: #000;
  --text: #f2f2f3; --muted: #a1a1a6; --dim: #6e6e73;
  --amber: #ffb340; --rose: #ff6b7d; --green: #32d07a; --violet: #a78bfa; --pink: #f472b6; --orange: #c98a35;
  /* legacy aliases (old code / inline styles use these) */
  --teal: var(--accent); --teal2: var(--accent2); --gold: var(--amber); --gold2: #ffd18a; --lapis: #5b7cfa; --mauve: var(--pink); --leaf: var(--green); --wine: #d43c5a; --red: #d43c5a; --saffron: var(--amber);
  --k-play: var(--accent); --k-edit: var(--amber); --k-view: var(--pink); --k-file: var(--lapis);
  --r: 12px; --tlh: 300px; --vh: 42dvh;
  --font: 'Inter', 'Hind', 'Noto Sans Devanagari', system-ui, sans-serif; --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace; --display: 'Inter', sans-serif;
}
[data-theme=midnight] { --bg: #0f1420; --bg2: #151b2a; --card: #1d2537; --card2: #252e43; --line: #2c3650; --deep: #0b0f19; }
[data-theme=oled] { --bg: #000; --bg2: #0b0b0c; --card: #161618; --card2: #1e1e20; --line: #2a2a2c; --deep: #000; }
[data-theme=light] { --bg: #ececef; --bg2: #f7f7f9; --card: #ffffff; --card2: #f0f0f3; --line: #d6d6dc; --deep: #e4e4e8; --text: #18181b; --muted: #5f5f66; --dim: #8b8b92; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font: 15px/1.45 var(--font); -webkit-tap-highlight-color: transparent; overscroll-behavior: none; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
button:disabled { opacity: .4; cursor: default; }
a { color: var(--accent2); }
kbd { font: 500 12px/1 var(--mono); background: var(--deep); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; padding: 2px 6px; color: var(--text); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
svg.i { width: 22px; height: 22px; flex: none; display: block; }
.app { display: grid; grid-template-rows: auto minmax(0, 1fr) var(--tlh) auto auto; grid-template-columns: minmax(0, 1fr); height: 100dvh; overflow: hidden; }

/* ---------- buttons ---------- */
.tb { width: 40px; height: 40px; border-radius: 10px; display: inline-grid; place-items: center; color: var(--text); flex: none; position: relative; }
.tb:hover { background: var(--card); }
.tb.sm { width: 32px; height: 32px; } .tb.sm svg.i { width: 18px; height: 18px; }
.tb.on { background: color-mix(in oklch, var(--accent) 26%, transparent); color: #fff; }
.tb.boxed { border: 1px solid var(--line); background: var(--card); width: 44px; }
.tb.export { background: #ececec; color: #111; width: auto; min-width: 46px; padding: 0 12px; display: inline-flex; gap: 8px; font-weight: 600; }
.tb.export:hover { background: #fff; }
.pill { height: 40px; border: 1px solid var(--line); border-radius: 12px; display: inline-flex; align-items: center; gap: 6px; padding: 0 12px; color: var(--text); white-space: nowrap; }
.pill svg.i { width: 18px; height: 18px; } .pill:hover { background: var(--card); }
.pill.branch b { font-weight: 500; font-size: 14px; max-width: 120px; overflow: hidden; text-overflow: ellipsis; }
.primary { background: var(--accent); color: var(--on-accent, #fff); font-weight: 600; padding: 9px 16px; border-radius: 10px; min-height: 40px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; border: 0; }
.primary:hover { filter: brightness(1.1); } .primary svg.i { width: 18px; height: 18px; }
.primary.white { background: #ececec; color: #111; }
.ghost { white-space: nowrap; border: 1px solid var(--line); padding: 8px 12px; border-radius: 10px; min-height: 40px; font-weight: 500; color: var(--text); display: inline-flex; align-items: center; justify-content: center; gap: 6px; text-decoration: none; background: transparent; }
.ghost:hover { background: var(--card); } .ghost.sm { min-height: 34px; padding: 5px 10px; font-size: 14px; }
.ic { width: 38px; height: 38px; border-radius: 9px; font-size: 18px; display: inline-grid; place-items: center; text-decoration: none; color: var(--text); }
.ic:hover { background: var(--card); } .ic.sm { width: 30px; height: 30px; font-size: 15px; }
.ic.on { background: color-mix(in oklch, var(--accent) 30%, transparent); }
.file { cursor: pointer; }

/* ---------- top bar ---------- */
.topbar > *, .tbg > * { flex-shrink: 0; }
.tbg { display: contents; } /* desktop: groups are invisible, items flow exactly as before */
.topbar #exportBtn { order: 2; } .topbar #insTgl { order: 3; }
.topbar { display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: var(--bg2); border-bottom: 1px solid var(--line); position: relative; min-width: 0; }
.brand { display: flex; align-items: center; gap: 9px; white-space: nowrap; margin-right: 4px; }
.brand .word { font: 600 17px/1 var(--font); letter-spacing: -.01em; } .brand .word b { font-weight: 400; color: var(--muted); margin-left: 3px; }
.brand small { font-size: 12px; color: var(--dim); }
.mark { width: 24px; height: 24px; border-radius: 7px; background: conic-gradient(from 200deg, var(--accent), #ffc27a, var(--accent)); position: relative; flex: none; }
.mark i { position: absolute; inset: 7px 6px 7px 9px; background: #fff; clip-path: polygon(0 0, 100% 50%, 0 100%); }
.wsbtn { display: none; align-items: center; gap: 6px; font: 700 20px/1 var(--font); padding: 6px 8px; border-radius: 10px; } .wsbtn svg.i { width: 18px; height: 18px; color: var(--muted); }
.wstabs { display: flex; gap: 2px; margin: 0 auto; }
.wstabs button { padding: 6px 12px; border-radius: 8px; font-size: 14px; color: var(--muted); font-weight: 500; }
.wstabs button.on { color: var(--text); box-shadow: inset 0 -2px 0 var(--text); border-radius: 0; }
.wstabs button:hover { color: var(--text); }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: inline-grid; place-items: center; flex: none; position: relative; }
.avatar .face { width: 26px; height: 26px; }
.avatar.white { background: transparent; } .avatar.white .face { background: #f2f2f2; }
.avatar.gold .face { background: var(--orange); }
.avatar em { position: absolute; right: 1px; bottom: 1px; width: 9px; height: 9px; border-radius: 50%; background: var(--dim); border: 2px solid var(--bg2); }
.avatar em.on { background: var(--green); box-shadow: 0 0 8px var(--green); }
.avatar em.busy { background: var(--accent); animation: twinkle 1s infinite; }
.face { position: relative; border-radius: 50%; display: inline-block; }
.face i { position: absolute; width: 22%; height: 22%; border-radius: 50%; background: #1b1b1b; top: 46%; }
.face i:first-child { left: 24%; } .face i:last-child { left: 48%; top: 50%; }
.projname { flex: 1; min-width: 60px; max-width: 240px; background: transparent; border: 1px solid transparent; border-radius: 8px; padding: 6px 10px; font-weight: 500; }
.projname:hover, .projname:focus { border-color: var(--line); outline: none; background: var(--bg); }
.savedot { font-size: 12px; color: var(--muted); opacity: 0; transition: opacity .4s; white-space: nowrap; }
.savedot.ok { opacity: 1; color: var(--green); }
.top-actions { display: flex; align-items: center; gap: 6px; }
#backBtn { display: none; }
select, input[type=text], input[type=number], input[type=password], input[type=url], input[type=search], textarea { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; min-height: 38px; width: 100%; color: var(--text); }
select { width: auto; }
textarea { resize: vertical; min-height: 84px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }

/* ---------- workspace ---------- */
.workspace { display: grid; grid-template-columns: 340px minmax(0, 1fr) 320px; min-height: 0; min-width: 0; }
body.noleft .workspace { grid-template-columns: 0 minmax(0, 1fr) 320px; } body.noleft .panel.left { display: none; }
body.noright .workspace { grid-template-columns: 340px minmax(0, 1fr) 0; } body.noright .panel.right { display: none; }
body.noleft.noright .workspace { grid-template-columns: 0 minmax(0, 1fr) 0; }
body.ws-preview .workspace { grid-template-columns: 0 minmax(0, 1fr) 0; } body.ws-preview .panel.left, body.ws-preview .panel.right { display: none; }
body.ws-preview { --tlh: 170px; }
.panel { background: var(--bg2); min-height: 0; display: flex; flex-direction: column; position: relative; }
.panel.left { border-right: 1px solid var(--line); }
.panel.right { border-left: 1px solid var(--line); overflow: auto; padding: 0 14px 14px; }
.phead { display: none; align-items: center; justify-content: space-between; padding: 10px 12px 4px 16px; }
.crumb { font: 500 15px/1 var(--mono); letter-spacing: .06em; color: var(--muted); text-transform: uppercase; text-align: left; }
.tabs { display: flex; gap: 2px; padding: 6px 8px 0; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; flex: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { padding: 8px 10px; font-weight: 500; font-size: 14px; color: var(--muted); white-space: nowrap; border-bottom: 2px solid transparent; }
.tabs button.on { color: var(--text); border-bottom-color: var(--text); }
.tabs button:not(.on):hover { color: var(--text); }
.panel-body { overflow: auto; padding: 14px; flex: 1; min-height: 0; }
h3 { font: 600 20px/1.15 var(--font); letter-spacing: -.01em; margin: 2px 0 10px; }
h4 { font: 500 13px/1 var(--mono); letter-spacing: .08em; margin: 20px 0 10px; color: var(--muted); text-transform: uppercase; }
.hint { color: var(--muted); font-size: 14px; margin: 4px 0 10px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row > * { flex: 1; }
.row > .ic, .row > .tb, .row > button.ghost, .row > button.primary, .row > .chip { flex: 0 0 auto; }
.field { display: grid; gap: 5px; margin-bottom: 10px; font-size: 14px; color: var(--muted); min-width: 0; }
.field > span { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.field > span b { color: var(--text); font: 500 13px var(--mono); margin-left: auto; }
.field select { width: 100%; }
input[type=range] { width: 100%; accent-color: var(--accent); }
input[type=color] { width: 44px; height: 38px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); padding: 3px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; align-items: center; }
.chip { border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; font-size: 14px; text-decoration: none; color: var(--text); display: inline-flex; align-items: center; gap: 6px; background: transparent; }
.chip:hover, .chip.on { border-color: var(--accent); background: color-mix(in oklch, var(--accent) 16%, transparent); }
.chip svg.i { width: 16px; height: 16px; }
.card { background: var(--card); border-radius: var(--r); padding: 12px; margin-bottom: 10px; text-align: left; border: 1px solid transparent; }
.out { white-space: pre-wrap; background: var(--bg); border-radius: 10px; padding: 10px; font-size: 14px; max-height: 260px; overflow: auto; border-left: 3px solid var(--accent); }
.out.err { border-left-color: var(--rose); }
.out.code { font: 13px/1.5 var(--mono); max-height: 220px; }
.badge { display: inline-block; font-size: 12px; padding: 1px 8px; border-radius: 999px; background: var(--bg); color: var(--muted); }
.badge.ok { background: color-mix(in oklch, var(--green) 22%, transparent); color: #8ff0b8; }
.badge.blue { background: color-mix(in oklch, var(--accent) 25%, transparent); color: #ffe2c2; }

/* list rows (settings / timelines / markers, like the reference) */
.lrow { display: flex; align-items: center; gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--line); width: 100%; text-align: left; }
.lrow:last-child { border-bottom: 0; }
.lrow .lic { width: 56px; height: 56px; border-radius: 12px; background: var(--card); display: grid; place-items: center; flex: none; color: var(--text); }
.lrow .lic svg.i { width: 26px; height: 26px; }
.lrow .lt { flex: 1; min-width: 0; } .lrow .lt b { display: block; font-weight: 500; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lrow .lt small { display: block; font: 13px/1.5 var(--mono); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lrow .go { width: 40px; height: 34px; border-radius: 8px; background: var(--black); display: grid; place-items: center; flex: none; color: var(--text); }
.lrow .go svg.i { width: 18px; height: 18px; }
.lrow.on .lt b { color: var(--accent2); }
.slabel { font: 500 13px/1 var(--mono); letter-spacing: .08em; color: var(--muted); text-transform: uppercase; margin: 18px 0 4px; }
.seghead { display: flex; background: var(--card); border-radius: 12px; padding: 4px; gap: 4px; margin: 4px 0 10px; }
.seghead button { flex: 1; padding: 8px; border-radius: 9px; font-weight: 500; color: var(--text); }
.seghead button.on { color: var(--accent2); background: color-mix(in oklch, var(--accent) 12%, transparent); }
.emptyst { display: grid; justify-items: center; gap: 8px; text-align: center; padding: 34px 10px; color: var(--muted); }
.emptyst > svg.i { width: 46px; height: 46px; color: var(--muted); } .emptyst b { color: var(--text); font-size: 18px; font-weight: 600; }
.switch { appearance: none; width: 64px; height: 36px; border-radius: 999px; background: var(--card2); position: relative; cursor: pointer; flex: none; transition: .2s; border: 0; outline-offset: 2px; }
.switch::after { content: ''; position: absolute; top: 4px; left: 4px; width: 28px; height: 28px; border-radius: 8px; background: #e8e8ea; transition: .2s; }
.switch:checked { background: var(--accent); } .switch:checked::after { left: 32px; }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; } .swatches button { width: 34px; height: 34px; border-radius: 50%; border: 2px solid transparent; }
.swatches button.on { border-color: var(--text); box-shadow: 0 0 0 2px var(--bg2) inset; }

/* docked website */
.dock { position: absolute; inset: 0; background: var(--bg2); z-index: 5; display: flex; flex-direction: column; }
.dock-head { display: flex; align-items: center; gap: 6px; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.dock-head b { white-space: nowrap; } .dock-head small { flex: 1; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dock iframe { flex: 1; border: 0; background: var(--bg); width: 100%; color-scheme: dark; }
.dock-note { font-size: 12px; color: var(--muted); padding: 6px 10px; }

/* media bin */
.drop { border: 1.5px dashed var(--line); border-radius: var(--r); padding: 22px; text-align: center; color: var(--muted); cursor: pointer; display: grid; gap: 4px; justify-items: center; }
.drop:hover { border-color: var(--accent); color: var(--text); }
.rec { margin-top: 10px; } .rec .ghost { flex: 1 1 0; padding: 7px 6px; font-size: 14px; }
.bin { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-top: 12px; }
.bin.list { grid-template-columns: 1fr; } .bin.list .mitem { display: grid; grid-template-columns: 96px 1fr; } .bin.list .mitem .th { aspect-ratio: 16/10; }
.mitem { background: var(--card); border-radius: 10px; overflow: hidden; position: relative; }
.mitem.off { outline: 1px dashed var(--rose); }
.mitem .th { aspect-ratio: 16/10; background: var(--deep) center/cover; display: grid; place-items: center; font-size: 26px; }
.mitem .nm { font-size: 13px; padding: 6px 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mitem .meta { display: block; color: var(--muted); font: 11px var(--mono); overflow: hidden; text-overflow: ellipsis; }
.mitem .ac { position: absolute; inset: 0 0 auto 0; display: flex; justify-content: flex-end; gap: 4px; padding: 5px; opacity: 0; transition: .15s; }
.mitem:hover .ac, .mitem:focus-within .ac { opacity: 1; }
.mitem .ac button { background: rgba(10,10,12,.82); border-radius: 7px; padding: 4px 8px; font-size: 13px; font-weight: 600; }
@media (hover: none) { .mitem .ac { opacity: 1; } }
.tp { display: grid; gap: 8px; }
.tp .card { margin: 0; font-size: 22px; line-height: 1.15; display: grid; gap: 4px; }
.tp .card small { font-family: var(--font); font-size: 12px; font-style: normal; font-weight: 500; }
.gridfx { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.fxcard { background: var(--card); border-radius: 12px; padding: 10px 8px; display: grid; gap: 8px; justify-items: center; text-align: center; font-size: 13px; border: 1px solid transparent; min-height: 92px; align-content: center; }
.fxcard:hover, .fxcard.on { border-color: var(--accent); }
.fxcard .sw { width: 100%; aspect-ratio: 16/10; border-radius: 8px; background: linear-gradient(135deg, #4b6cb7, #182848 60%, #f7b267); }
.fxcard svg.i { width: 26px; height: 26px; }

/* ---------- stage ---------- */
.stage { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--bg); position: relative; }
.mon-head { display: flex; gap: 14px; padding: 8px 14px 0; font-size: 14px; } .mtab { color: var(--muted); padding-bottom: 6px; } .mtab.on { color: var(--text); box-shadow: inset 0 -2px 0 var(--text); }
.viewer { flex: 1; min-height: 0; min-width: 0; display: flex; align-items: center; justify-content: center; padding: 10px; position: relative; overflow: hidden; background: var(--black); margin: 8px 10px 0; border-radius: 4px; }
.agent-strip { position: absolute; z-index: 12; top: 54px; left: 50%; transform: translateX(-50%); max-width: min(92%, 520px); padding: 8px 13px; border: 1px solid var(--accent); border-radius: 999px; background: color-mix(in oklch, var(--bg2) 88%, transparent); backdrop-filter: blur(12px); box-shadow: 0 8px 24px rgba(0,0,0,.35); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.agent-strip[data-phase=done], .agent-strip[data-phase=check] { border-color: var(--green); }
.agent-strip[data-phase=error] { border-color: var(--rose); color: #ffb7c0; }
.viewer:fullscreen { background: #000; margin: 0; }
.viewer.picking #cv { cursor: crosshair; outline: 2px dashed var(--amber); }
#cv { display: block; background: #000; touch-action: none; }
.guides { position: absolute; pointer-events: none; }
.guides .gl { position: absolute; background: rgba(255,255,255,.35); } .guides .gl.v { top: 0; bottom: 0; width: 1px; } .guides .gl.h { left: 0; right: 0; height: 1px; }
.guides .gc { position: absolute; left: 50%; top: 50%; width: 18px; height: 18px; margin: -9px; border: 1px solid rgba(255,255,255,.5); border-radius: 50%; }
.guides .safe { position: absolute; border: 1px dashed rgba(255,179,64,.6); } .guides .safe.t { border-color: rgba(255,153,51,.7); }
.guides .soc { position: absolute; background: rgba(244,114,182,.18); border: 1px dashed rgba(244,114,182,.8); }
.guides em { position: absolute; left: 4px; top: 2px; font: 600 11px/1 var(--font); font-style: normal; color: #fff; text-shadow: 0 1px 2px #000; }
.scopes { position: absolute; left: 12px; bottom: 12px; border-radius: 8px; border: 1px solid var(--line); cursor: pointer; }
.vtools { position: absolute; top: 8px; right: 8px; display: flex; gap: 2px; background: rgba(20,20,22,.7); border-radius: 10px; padding: 3px; opacity: .6; transition: .2s; backdrop-filter: blur(6px); }
.vtools:hover, .vtools:focus-within { opacity: 1; }
.vtools select { min-height: 30px; padding: 2px 6px; font-size: 13px; border-radius: 8px; }
.empty { position: absolute; display: grid; gap: 8px; justify-items: center; text-align: center; color: var(--text); }
.empty b { font: 600 22px/1.1 var(--font); }
.empty span, .empty small { color: var(--muted); }
.recbar { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 12px; background: var(--bg2); border: 1px solid var(--rose); padding: 6px 8px 6px 14px; border-radius: 999px; z-index: 6; box-shadow: 0 8px 24px rgba(0,0,0,.5); }
.recbar .dot { width: 12px; height: 12px; border-radius: 50%; background: #ff3b3b; animation: twinkle 1s infinite; }
.recbar .cd { font: 600 30px/1 var(--mono); color: var(--amber); padding: 0 6px; }
@keyframes twinkle { 50% { opacity: .45; } }
.scrub { height: 22px; margin: 6px 20px 0; position: relative; cursor: pointer; touch-action: none; }
.scrub::before { content: ''; position: absolute; left: 0; right: 0; top: 10px; height: 3px; border-radius: 3px; background: var(--card2); }
.scrub i { position: absolute; left: 0; top: 10px; height: 3px; border-radius: 3px; background: var(--accent); width: 0; }
.scrub b { position: absolute; top: 5px; width: 13px; height: 13px; margin-left: -6px; border-radius: 50%; background: #fff; left: 0; opacity: 0; transition: opacity .15s; }
.scrub:hover b, .scrub.drag b, body.has-media .scrub b { opacity: 1; }
.transport { display: flex; align-items: center; gap: 8px; padding: 6px 20px 8px; }
.tc, .tcd { flex: 1; font: 400 17px/1 var(--mono); color: var(--tcol); font-variant-numeric: tabular-nums; white-space: nowrap; min-width: 0; }
.tcd { text-align: right; color: var(--text); }
.tbtns { display: flex; gap: 6px; align-items: center; justify-content: center; }
.play { width: 58px; height: 58px; border-radius: 14px; background: var(--card); color: var(--text); display: grid; place-items: center; }
.play svg.i { width: 26px; height: 26px; } .play:hover { background: var(--card2); }
.play.on { background: var(--accent); color: #fff; }
.tool { padding: 7px 10px; border-radius: 9px; font-weight: 500; font-size: 13px; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; color: var(--text); }
.tool svg.i { width: 18px; height: 18px; } .tool:hover { background: var(--card); }
.tool.danger { color: #ff8b9b; } .tool.danger:hover { background: color-mix(in oklch, var(--rose) 22%, transparent); }
#loopBtn.on { color: var(--accent2); background: color-mix(in oklch, var(--accent) 20%, transparent); }
.vu { width: 90px; height: 10px; border-radius: 3px; background: var(--deep); }
.grabber { display: flex; justify-content: center; padding: 2px 0 6px; cursor: ns-resize; touch-action: none; }
.grabber i { width: 66px; height: 5px; border-radius: 9px; background: var(--card2); }

/* ---------- timeline ---------- */
.timeline { background: var(--bg2); border-top: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; position: relative; }
.tl-head { display: flex; align-items: center; padding: 8px 12px; gap: 6px; min-width: 0; }
.tlsel { display: inline-flex; align-items: center; gap: 8px; height: 46px; padding: 0 12px 0 16px; border-radius: 12px; background: var(--card); font-size: 16px; max-width: 170px; flex: none; }
.tlsel span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .tlsel svg.i { width: 18px; height: 18px; }
.tool-pick, .zoom-pick { width: auto; padding: 0 6px; display: inline-flex; gap: 0; } .tool-pick svg.i:last-child, .zoom-pick svg.i:last-child { width: 14px; height: 14px; }
.cliptools em { font-style: normal; }
.cliptools { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; min-width: 0; } .cliptools::-webkit-scrollbar { display: none; }
.sp { flex: 1; }
#snapTgl { opacity: .55; } #snapTgl.on { opacity: 1; }
.zoom { display: flex; align-items: center; gap: 4px; width: 230px; }
.zoom-pick { display: none; }
.tl-body { flex: 1; display: flex; min-height: 0; }
.tl-labels { width: 56px; flex: none; border-right: 1px solid var(--line); }
.lab { height: 40px; display: flex; align-items: center; padding-left: 10px; font: 500 12px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.lab.ruler-lab { height: 26px; }
.lab.v { color: #ffb066; } .lab.o { color: #a3b4ff; } .lab.x { color: var(--amber); } .lab.c { color: var(--pink); } .lab.a { color: var(--green); }
.tl-scroll { flex: 1; overflow-x: auto; overflow-y: hidden; position: relative; touch-action: pan-x; scrollbar-color: var(--line) transparent; }
.tl-inner { position: relative; min-width: 100%; height: 100%; }
.ruler { height: 26px; position: relative; cursor: pointer; border-bottom: 1px solid var(--line); touch-action: none; background: var(--bg); }
.ruler .tk { position: absolute; top: 0; height: 100%; border-left: 1px solid var(--line); font: 11px/1 var(--mono); color: var(--muted); padding: 5px 0 0 4px; white-space: nowrap; pointer-events: none; font-variant-numeric: tabular-nums; }
.ruler .tk.s { height: 6px; top: auto; bottom: 0; padding: 0; }
.ruler .mk { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--mc); z-index: 3; cursor: pointer; }
.ruler .mk span { position: absolute; left: 3px; top: 1px; font-size: 11px; font-weight: 600; color: #1a1300; background: var(--mc); padding: 1px 5px; border-radius: 0 4px 4px 0; white-space: nowrap; max-width: 120px; overflow: hidden; text-overflow: ellipsis; }
.track { height: 40px; position: relative; border-bottom: 1px solid color-mix(in oklch, var(--line) 55%, transparent); }
.clip { position: absolute; top: 4px; height: 32px; border-radius: 6px; overflow: hidden; font-size: 12px; font-weight: 500; padding: 0 10px; display: flex; align-items: center; white-space: nowrap; cursor: grab; touch-action: none; user-select: none; color: #fff; }
.clip::before { content: ''; position: absolute; inset: 0; background: var(--th) left center / auto 100% repeat-x; opacity: .5; }
.clip span { overflow: hidden; text-overflow: ellipsis; text-shadow: 0 1px 2px rgba(0,0,0,.85); position: relative; z-index: 1; }
.k-video { background-color: #a8530f; }
.k-overlay { background-color: #4a4fb8; }
.k-text { background: #b7791f; } .k-text.shape { background: #2f855a; } .k-text.adj { background: repeating-linear-gradient(135deg, #6b46c1 0 8px, #553c9a 8px 16px); }
.k-caption { background: #a23c78; }
.k-audio { background: #1d7a4b; }
.clip.offline { background: repeating-linear-gradient(45deg, #5a1424 0 8px, #2a0711 8px 16px); }
.clip.sel { outline: 2px solid #fff; outline-offset: -2px; z-index: 2; }
.clip.tsel { outline: 2px dashed var(--amber); outline-offset: -2px; }
.clip .h { position: absolute; top: 0; bottom: 0; width: 12px; cursor: ew-resize; z-index: 3; }
.clip .h.l { left: 0; } .clip .h.r { right: 0; }
.clip.sel .h { background: rgba(255,255,255,.55); }
.clip canvas.wf { position: absolute; top: 0; height: 100%; pointer-events: none; }
.clip .kfd { position: absolute; bottom: 2px; width: 8px; height: 8px; margin-left: -4px; background: var(--amber); transform: rotate(45deg); z-index: 2; box-shadow: 0 0 0 1px #000; }
.clip .trb { position: absolute; left: 0; top: 0; bottom: 0; background: linear-gradient(90deg, rgba(255,255,255,.45), transparent); z-index: 1; }
.clip .fd { position: absolute; top: 0; bottom: 0; pointer-events: none; z-index: 1; }
.clip .fd.l { left: 0; background: linear-gradient(to bottom right, rgba(0,0,0,.55) 50%, transparent 50%); }
.clip .fd.r { right: 0; background: linear-gradient(to bottom left, rgba(0,0,0,.55) 50%, transparent 50%); }
.playhead { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--accent); pointer-events: none; z-index: 6; will-change: transform; }
.playhead i { position: absolute; top: 0; left: -6px; width: 14px; height: 14px; background: var(--accent); clip-path: polygon(0 0, 100% 0, 100% 55%, 50% 100%, 0 55%); }
.snapline { position: absolute; top: 0; bottom: 0; width: 1px; background: #fff; z-index: 7; pointer-events: none; display: none; box-shadow: 0 0 6px #fff; }
.inout { position: absolute; top: 0; height: 26px; background: color-mix(in oklch, var(--accent) 28%, transparent); border-left: 2px solid var(--accent); border-right: 2px solid var(--accent); pointer-events: none; z-index: 2; display: none; }
body.tool-blade .tl-inner .clip { cursor: crosshair; } body.tool-slip .tl-inner .clip { cursor: ew-resize; } body.tool-track .tl-inner .track { cursor: e-resize; }
body.ws-audio .track:not(.a) { opacity: .45; } body.ws-color .track.a, body.ws-color .track.c { opacity: .45; }
.meter { width: 54px; border-left: 1px solid var(--line); position: relative; display: flex; gap: 6px; justify-content: center; padding: 6px 0 20px; }
.meter i { width: 8px; background: var(--deep); border-radius: 2px; position: relative; overflow: hidden; }
.meter i::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: var(--lv, 0%); background: linear-gradient(to top, var(--green), var(--amber) 80%, var(--rose)); }
.meter small { position: absolute; bottom: 4px; font: 10px var(--mono); color: var(--dim); } .meter small:nth-of-type(1) { left: 14px; } .meter small:nth-of-type(2) { right: 14px; }
.tl-empty { position: absolute; left: 0; right: 0; top: 64px; bottom: 0; display: grid; place-content: center; justify-items: center; gap: 14px; color: var(--muted); font-size: 16px; background: var(--bg2); z-index: 8; }
.tl-empty .primary { min-width: 240px; }
body.has-media .tl-empty { display: none; }

/* ---------- inspector ---------- */
.itabs { display: flex; gap: 14px; padding: 10px 0 0; border-bottom: 1px solid var(--line); margin: 0 -14px 10px; padding-left: 14px; position: sticky; top: 0; background: var(--bg2); z-index: 2; }
.itabs button { padding: 4px 0 8px; font-size: 14px; color: var(--muted); } .itabs button.on { color: var(--text); box-shadow: inset 0 -2px 0 var(--text); }
.insp-empty { color: var(--muted); text-align: center; margin: 18px 0 8px; }
.insp-empty b { display: block; font: 600 18px/1.2 var(--font); color: var(--text); margin-bottom: 6px; }
.ihead { display: flex; align-items: center; gap: 2px; margin: 6px 0 4px; } .ihead h3 { flex: 1; margin: 0; }
.sec { border-top: 1px solid var(--line); padding: 4px 0; }
.sec summary { cursor: pointer; font: 500 13px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 12px 0 10px; list-style: none; display: flex; align-items: center; gap: 6px; }
.sec summary::before { content: '›'; font-size: 16px; transition: transform .15s; } .sec[open] summary::before { transform: rotate(90deg); }
.sec summary small { font: 500 12px var(--font); letter-spacing: 0; text-transform: none; margin-left: auto; }
.sec summary::-webkit-details-marker { display: none; }
.kfb { font-size: 13px; color: var(--dim); width: 24px; height: 22px; border-radius: 5px; } .kfb:hover { color: var(--amber); background: var(--card); }
.kfb.has { color: color-mix(in oklch, var(--amber) 55%, var(--muted)); } .kfb.on { color: var(--amber); text-shadow: 0 0 6px var(--amber); }
.presets { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 10px; }
.presets button { font-size: 12px; padding: 8px 2px; border-radius: 8px; background: var(--card); }
.presets button:hover { outline: 1px solid var(--accent); }
.seg { display: flex; background: var(--bg); border-radius: 10px; padding: 3px; gap: 3px; margin-bottom: 10px; }
.seg button { flex: 1; padding: 6px; border-radius: 8px; font-size: 13px; font-weight: 500; color: var(--muted); }
.seg button.on { background: var(--card2); color: var(--text); }
.mrow { display: grid; grid-template-columns: auto 1fr 28px; gap: 6px; align-items: center; margin-bottom: 6px; } .mrow input { min-height: 30px; padding: 4px 8px; }
.kfrow { display: grid; grid-template-columns: 80px 1fr auto auto; gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.kfrow code { font: 12px var(--mono); color: var(--tcol); }

/* captions list */
.caplist { display: grid; gap: 6px; margin-top: 8px; }
.capi { display: grid; grid-template-columns: 58px 1fr 28px; gap: 6px; align-items: center; background: var(--card); padding: 6px; border-radius: 10px; }
.capi.on { outline: 1px solid var(--accent); }
.capi small { font: 500 12px/1 var(--mono); color: var(--pink); cursor: pointer; }
.capi input { min-height: 30px; padding: 4px 8px; font-size: 14px; }

/* ---------- AI agent chat ---------- */
.chat { display: grid; gap: 10px; margin-bottom: 12px; }
.msg { padding: 10px 12px; border-radius: 14px; font-size: 14px; white-space: pre-wrap; max-width: 92%; }
.msg.me { background: var(--accent); color: #fff; justify-self: end; border-bottom-right-radius: 4px; }
.msg.ai { background: var(--card); justify-self: start; border-bottom-left-radius: 4px; }
.msg.ai small { display: block; color: var(--muted); font: 11px var(--mono); margin-bottom: 4px; }
.msg.ai .log { color: #8ff0b8; font-size: 13px; margin-top: 6px; }
.composer { background: var(--card2); border-radius: 22px; padding: 14px 14px 12px; display: grid; gap: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.25); }
.composer textarea { background: transparent; border: 0; min-height: 70px; padding: 2px; font-size: 16px; resize: none; } .composer textarea:focus { outline: none; }
.composer .crow { display: flex; align-items: center; gap: 6px; min-width: 0; }
.cbtn { width: 44px; height: 44px; border-radius: 14px; border: 1px solid #4a4a4d; display: grid; place-items: center; flex: none; color: var(--text); }
.cbtn.send { background: #f2f2f2; color: #111; border: 0; } .cbtn.send svg.i { stroke-width: 2.4; }
.cbtn.rec { background: var(--rose); border-color: var(--rose); color: #fff; animation: twinkle 1s infinite; }
.modeseg { flex: none; display: flex; background: var(--bg); border-radius: 14px; padding: 3px; } .modeseg button { padding: 8px 10px; border-radius: 11px; color: var(--muted); font-size: 15px; }
.modeseg button.on { background: var(--card2); color: var(--text); border: 1px solid #4a4a4d; }
.modelsel { margin-left: auto; background: transparent; border: 0; font-size: 15px; min-height: 40px; padding: 0 2px; flex: 1 1 auto; min-width: 0; width: 0; color: var(--text); }
.projbar { display: flex; align-items: center; gap: 10px; padding: 12px 14px; margin-top: -14px; padding-top: 24px; border: 1px solid var(--line); border-top: 0; border-radius: 0 0 20px 20px; background: var(--bg); color: var(--muted); font-size: 14px; }
.quick { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin: 14px 0; }
.quick button { display: inline-flex; gap: 8px; align-items: center; background: var(--card); padding: 10px 14px; border-radius: 12px; font-size: 14px; }
.aisites { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.aisite { background: var(--card); border-radius: 12px; padding: 10px; display: grid; gap: 6px; } .aisite b { font-weight: 600; font-size: 14px; }
.aisite .row button, .aisite .row a { min-height: 32px; padding: 4px 8px; font-size: 13px; }
.mcpurl { display: flex; gap: 6px; align-items: center; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 6px 6px 6px 12px; font: 13px var(--mono); overflow: hidden; }
.agent-feed { display: grid; gap: 5px; max-height: 220px; overflow: auto; background: var(--bg); border-radius: 10px; padding: 8px; }
.agent-feed-row { display: grid; grid-template-columns: 18px 1fr auto; gap: 6px; align-items: center; font-size: 13px; padding: 5px 4px; border-bottom: 1px solid color-mix(in oklch, var(--line) 60%, transparent); }
.agent-feed-row b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agent-feed-row small { color: var(--dim); font: 11px var(--mono); }
.agent-feed-row.start span { color: var(--amber); }
.agent-feed-row.done span { color: var(--green); }
.agent-feed-row.error span { color: var(--rose); }
.mcpurl span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.steps { margin: 6px 0 0; padding-left: 20px; color: var(--muted); font-size: 14px; } .steps li { margin: 4px 0; } .steps b { color: var(--text); }

/* context + dropdown menus */
.ctx, .menu, .dd { position: fixed; z-index: 80; background: #2c2c2e; border: 1px solid #444446; border-radius: 16px; padding: 6px; min-width: 230px; box-shadow: 0 18px 44px rgba(0,0,0,.55); display: grid; max-height: 80dvh; overflow: auto; }
.ctx button, .menu button, .dd button { display: flex; align-items: center; gap: 14px; text-align: left; padding: 11px 14px; border-radius: 10px; font-size: 16px; color: var(--text); }
.ctx button { justify-content: space-between; font-size: 14px; padding: 8px 12px; }
.ctx button:hover, .ctx button:focus, .menu button:hover, .dd button:hover, .dd button:focus { background: rgba(255,255,255,.07); outline: none; }
.ctx button.danger, .dd button.danger { color: #ff8b9b; }
.dd button .ck { margin-left: auto; color: var(--accent); } .dd button svg.i { width: 22px; height: 22px; color: var(--muted); }
.dd .ddh { font: 500 12px var(--mono); letter-spacing: .08em; color: var(--muted); padding: 8px 14px 4px; text-transform: uppercase; }
.ctx hr, .menu hr, .dd hr { border: 0; border-top: 1px solid #444446; margin: 4px 2px; }
.menu { position: absolute; right: 120px; top: 56px; min-width: 260px; }
.menu button { font-size: 15px; padding: 9px 12px; justify-content: space-between; }

/* keyboard map */
.kbmap { display: grid; gap: 4px; margin: 8px 0 4px; overflow-x: auto; padding-bottom: 4px; }
.kbrow { display: flex; gap: 4px; }
.kc { min-width: 38px; height: 38px; border-radius: 7px; background: var(--deep); border: 1px solid var(--line); border-bottom-width: 3px; font: 500 12px/1 var(--mono); color: var(--muted); flex: 1; }
.kc.wide { flex: 1.6; } .kc.space { flex: 5; }
.kc.g-play { border-color: var(--k-play); color: var(--text); } .kc.g-edit { border-color: var(--k-edit); color: var(--text); } .kc.g-view { border-color: var(--k-view); color: var(--text); } .kc.g-file { border-color: var(--k-file); color: var(--text); }
.kgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 0 18px; }
.kgroup h4.g-play { color: var(--accent2); } .kgroup h4.g-edit { color: var(--amber); } .kgroup h4.g-view { color: var(--pink); } .kgroup h4.g-file { color: #a3b4ff; }
.krow { display: flex; gap: 10px; align-items: baseline; padding: 3px 0; font-size: 14px; } .krow kbd { flex: none; min-width: 74px; text-align: center; }

/* ---------- support footer + ads ---------- */
.support { display: flex; align-items: center; gap: 16px; padding: 6px 14px; background: var(--deep); border-top: 1px solid var(--line); font-size: 14px; flex-wrap: wrap; }
.support .lbl { font: 500 12px/1 var(--mono); letter-spacing: .12em; color: var(--muted); }
.support a { text-decoration: none; font-weight: 500; color: var(--text); display: inline-flex; align-items: center; gap: 6px; }
.support a:hover { color: var(--accent2); }
.support small { font-size: 12px; color: var(--muted); }
.support .qr-btn { margin-left: auto; display: flex; align-items: center; gap: 10px; background: var(--card); padding: 4px 12px 4px 4px; border-radius: 10px; text-align: left; }
.support .qr-btn .qrmini { width: 38px; height: 38px; background: #fff; border-radius: 6px; padding: 2px; }
.support .qr-btn .qrmini svg, .support .qr-btn .qrmini img { width: 100%; height: 100%; display: block; }
.yt { color: #ff8a80 !important; }
.adbar { min-height: 56px; display: flex; align-items: center; justify-content: center; gap: 10px; padding: 3px 40px 3px 14px; background: var(--deep); border-top: 1px solid var(--line); position: relative; font-size: 14px; color: var(--muted); overflow: hidden; }
.adbar[hidden] { display: none !important; }
.adl { font: 500 10px/1.4 var(--mono); letter-spacing: .1em; border: 1px solid var(--line); border-radius: 4px; padding: 0 4px; color: var(--muted); flex: none; }
.adt { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); }
.adbar a.cta, .adslot a.cta { background: var(--accent); color: #fff; font-weight: 600; padding: 6px 14px; border-radius: 999px; text-decoration: none; white-space: nowrap; flex: none; }
.adbar .x { position: absolute; right: 8px; width: 28px; height: 28px; border-radius: 50%; color: var(--muted); }
.adbar .x:hover { background: var(--card); }
.adbar ins { display: block; width: 100%; max-width: 728px; min-height: 50px; }
.adslot { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; display: flex; align-items: center; gap: 10px; margin: 12px 0; min-height: 64px; overflow: hidden; }
.adslot ins { display: block; width: 100%; min-height: 90px; } .adslot.big { flex-direction: column; align-items: stretch; } .adslot.big ins { min-height: 250px; }
.adslot .adt { white-space: normal; flex: 1; font-size: 14px; }
.ad-fade { animation: adin .5s ease; }
@keyframes adin { from { opacity: 0; transform: translateY(6px); } }

/* ---------- modal / export sheet / toast / drop ---------- */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.62); display: grid; place-items: center; z-index: 50; padding: 16px; }
.modal-card { background: #2a2a2c; border: 1px solid #3c3c3e; border-radius: 22px; padding: 20px; width: min(520px, 100%); max-height: 92dvh; overflow: auto; }
.modal-card.wide { width: min(980px, 100%); }
.modal-card .qrbig { background: #fff; border-radius: 12px; padding: 14px; width: 240px; margin: 10px auto; }
.modal-card .qrbig svg, .modal-card .qrbig img { width: 100%; display: block; }
.mhead { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; } .mhead h3 { flex: 1; margin: 0; font-size: 24px; }
.fmtlist { display: grid; gap: 4px; margin: 10px 0; }
.fmt { display: grid; grid-template-columns: 28px 1fr; gap: 2px 12px; padding: 12px 14px; border-radius: 14px; text-align: left; align-items: center; }
.fmt svg.i { grid-row: span 2; color: var(--muted); } .fmt b { font-weight: 600; font-size: 17px; } .fmt small { grid-column: 2; color: var(--muted); font-size: 14px; }
.fmt.on, .fmt:hover { background: #38383a; }
.exset { background: #333335; border-radius: 16px; padding: 4px 16px; }
.exset .er { display: grid; grid-template-columns: minmax(110px, 1fr) minmax(0, 1.8fr); align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid #444446; font-size: 16px; }
.exset .er:last-child { border-bottom: 0; }
.exset select, .exset input { width: 100%; background: #444446; border: 0; min-height: 44px; border-radius: 10px; }
.exset .lufs { display: flex; gap: 8px; align-items: center; justify-content: flex-end; } .exset .lufs input { width: 80px; text-align: center; } .exset .lufs span { color: var(--muted); }
.exfoot { display: flex; align-items: center; gap: 12px; margin-top: 14px; } .exfoot small { flex: 1; color: var(--muted); font: 13px var(--mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.exfoot .primary.white { min-width: 120px; }
.prog { height: 8px; background: var(--bg); border-radius: 999px; overflow: hidden; margin: 12px 0; }
.prog i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }
.exstat { font-size: 14px; color: var(--text); min-height: 22px; } .exstat small { color: var(--muted); }
.dropbig { border: 1.5px dashed #555558; border-radius: 16px; padding: 46px 16px; display: grid; justify-items: center; gap: 10px; text-align: center; cursor: pointer; margin: 14px 0 12px; }
.dropbig:hover { border-color: var(--accent); } .dropbig b { font-size: 20px; } .dropbig svg.i { width: 32px; height: 32px; color: var(--muted); }
.fchips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; max-width: 340px; } .fchips span { background: #444446; padding: 4px 10px; border-radius: 8px; font-size: 14px; }
.toasts { position: fixed; top: 64px; left: 50%; transform: translateX(-50%); display: grid; gap: 6px; z-index: 90; pointer-events: none; justify-items: center; }
.toast { background: #2c2c2e; border: 1px solid #444446; padding: 9px 14px; border-radius: 12px; box-shadow: 0 8px 24px rgba(0,0,0,.45); font-weight: 500; font-size: 14px; animation: tin .25s ease; max-width: 88vw; }
.toast.err { border-color: var(--rose); } .toast.ok { border-color: var(--accent); }
.toast.out { opacity: 0; transition: .4s; }
@keyframes tin { from { opacity: 0; transform: translateY(-8px); } }
.dropzone { position: fixed; inset: 0; display: none; place-items: center; font: 600 44px/1 var(--font); background: color-mix(in oklch, var(--accent) 30%, rgba(0,0,0,.6)); z-index: 70; pointer-events: none; }
.dropzone.on { display: grid; }
.spin { display: inline-block; width: 14px; height: 14px; border: 2px solid var(--muted); border-top-color: var(--accent); border-radius: 50%; animation: sp .8s linear infinite; vertical-align: -2px; }
@keyframes sp { to { transform: rotate(360deg); } }
.mtabs, .mctx, .sheet-backdrop { display: none; }

@media (max-width: 1600px) { #kbBtn, #aspectSel, .brand small { display: none; } .projname { max-width: 150px; } }
@media (max-width: 1360px) { .projname, .savedot, #menuBtn { display: none; } }
@media (max-width: 1240px) { .workspace { grid-template-columns: 300px minmax(0, 1fr) 290px; } .brand small { display: none; } .cliptools em { display: none; } }
@media (max-width: 1040px) and (min-width: 861px) { .vu, .wstabs button { padding: 6px 8px; } .brand { display: none; } }

/* =================== PHONE (matches the reference screens) =================== */
@media (max-width: 860px) {
  /* v4.2: Export is centred by the layout itself (3-column grid), not by absolute positioning, so it can never overlap */
  .topbar { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); column-gap: 6px; }
  .topbar .tbg { display: flex; align-items: center; gap: 2px; min-width: 0; }
  .topbar .tbl { justify-content: flex-start; } .topbar .tbr { justify-content: flex-end; }
  .topbar #exportBtn, .topbar #insTgl { order: 0; }
  .topbar .tb.export { grid-column: 2; justify-self: center; }
  .agent-strip { top: 8px; font-size: 12px; max-width: 78%; }
  :root { --tlh: auto; }
  .app { grid-template-rows: auto auto minmax(0, 1fr) auto auto; }
  .hide-sm { display: none !important; }
  .topbar { padding: 8px 6px; }
  #backBtn { display: inline-grid; } .topbar .tb { width: 30px; } .topbar .tb svg.i { width: 20px; height: 20px; }
  .wsbtn { font-size: 18px; padding: 6px 2px; gap: 2px; } .avatar { width: 30px; height: 30px; } .avatar .face { width: 24px; height: 24px; }
  .topbar .pill { height: 38px; padding: 0 6px; gap: 2px; border-radius: 11px; }
  .wsbtn { display: inline-flex; } .wstabs { display: none; }
  .topbar .tb.boxed { width: 40px; height: 40px; border-radius: 11px; } .topbar .tb.export { width: 46px; min-width: 46px; height: 42px; padding: 0; border-radius: 12px; justify-content: center; } .tb.export .lbl { display: none; }
  .workspace { display: block; }
  .stage { height: var(--vh); }
  body.ws-preview .stage { height: auto; } body.ws-preview .timeline, body.ws-preview .mtabs { display: none !important; } body.ws-preview .app { grid-template-rows: auto minmax(0,1fr) 0 auto auto; } body.ws-preview .workspace { display: flex; flex-direction: column; } body.ws-preview .stage { flex: 1; }
  .viewer { margin: 8px 10px 0; padding: 0; }
  .empty { display: none !important; }
  .vtools { opacity: .85; }
  .scrub { margin: 8px 20px 0; }
  .transport { padding: 2px 20px 2px; }
  .tc, .tcd { font-size: 14px; flex: 1 1 0; }
  .transport { padding: 2px 12px; gap: 2px; } .transport .tb { width: 34px; }
  .play { width: 50px; height: 50px; }
  .tbtns { gap: 0; }
  .timeline { border-top: 1px solid var(--line); }
  .tl-head { padding: 10px 10px; gap: 2px; } .tlsel { max-width: 130px; height: 44px; font-size: 15px; padding: 0 8px 0 12px; } .tl-head .tb { width: 38px; }
  .cliptools { display: none; } body.has-sel .cliptools { display: flex; } body.has-sel .tlsel { max-width: 46px; padding: 0 10px; } body.has-sel .tlsel span:first-child { display: none; }
  .cliptools em { display: none; } .cliptools .tool { padding: 7px; }
  .zoom-pick { display: inline-flex; }
  .tl-labels { width: 40px; } .lab { font-size: 11px; padding-left: 6px; }
  .lab, .track { height: 44px; } .clip { height: 36px; }
  .tl-empty { top: 66px; }
  .support { display: none; }
  .adbar { min-height: 54px; padding: 2px 36px 2px 10px; font-size: 13px; }
  /* panels open into the lower area (in place of the timeline), like the reference */
  .panel.left, .panel.right { position: fixed; left: 0; right: 0; top: var(--lowTop, 50dvh); bottom: var(--botH, 64px); z-index: 30; border: 0; border-top: 1px solid var(--line); display: none; padding-bottom: 0; }
  .panel.right { padding: 0 16px 16px; }
  .panel.open { display: flex; }
  .panel.right.open { display: block; }
  .panel.left .tabs { display: none; }
  .phead { display: flex; }
  .panel-body { padding: 4px 16px 16px; }
  .panel-body > h3:first-child { display: none; }
  .itabs { margin: 0 -16px 10px; padding-left: 16px; }
  .sheet-backdrop.on { display: none; }
  .mtabs { display: flex; background: var(--bg2); border-top: 1px solid var(--line); padding: 8px 4px calc(8px + env(safe-area-inset-bottom)); overflow-x: auto; scrollbar-width: none; gap: 2px; }
  .mtabs::-webkit-scrollbar { display: none; }
  .mtabs button { flex: none; min-width: 72px; display: grid; justify-items: center; gap: 6px; padding: 4px 6px; font-size: 13px; color: var(--text); }
  .mtabs button svg.i { width: 30px; height: 30px; stroke-width: 1.4; }
  .mtabs button.on { color: var(--accent2); }
  .mtabs .div { width: 1px; background: var(--line); margin: 10px 4px; flex: none; }
  .mctx { display: flex; background: var(--bg2); border-top: 1px solid var(--line); padding: 8px 10px calc(8px + env(safe-area-inset-bottom)); gap: 4px; align-items: center; }
  .mctx[hidden] { display: none !important; }
  .mctx button { display: grid; justify-items: center; gap: 6px; min-width: 64px; padding: 4px 6px; font-size: 13px; color: var(--text); }
  .mctx button svg.i { width: 30px; height: 30px; stroke-width: 1.4; }
  .mctx { overflow-x: auto; scrollbar-width: none; } .mctx > * { flex: none; }
  .mctx .back { width: 68px; height: 68px; border-radius: 16px; background: var(--card); place-content: center; min-width: 0; }
  .mctx .back svg.i { width: 24px; height: 24px; }
  .mctx .div { width: 1px; height: 40px; background: var(--line); margin: 0 6px; }
  .mctx .push { margin-left: auto; }
  .mctx .danger { color: var(--rose); }
  .menu { right: 8px; left: 8px; top: 60px; }
  .cbtn { width: 40px; height: 40px; border-radius: 12px; } .modeseg button { padding: 7px 8px; font-size: 14px; }
  .modal { padding: 10px; align-items: end; }
  .modal-card { border-radius: 22px; max-height: 88dvh; }
  body.has-kb .hide-sm { display: inline-grid !important; }
  body.has-mouse .clip .h { width: 9px; }
}

/* =================== v4 · quick bar, on-canvas handles, elements, tour, premium finish =================== */
:root { --glass: color-mix(in oklch, var(--bg2) 72%, transparent); --ease: cubic-bezier(.2,.8,.2,1); --shadow-lg: 0 24px 60px rgba(0,0,0,.5), 0 2px 0 rgba(255,255,255,.04) inset; }
button, .chip, .ghost, .primary, .lrow, .tb { transition: background-color .18s var(--ease), color .18s var(--ease), transform .12s var(--ease), border-color .18s var(--ease), opacity .18s; }
button:active:not(:disabled), .chip:active, .primary:active, .ghost:active { transform: scale(.96); }
.primary { box-shadow: 0 6px 18px color-mix(in oklch, var(--accent) 35%, transparent); }
.modal-card { box-shadow: var(--shadow-lg); animation: rise .28s var(--ease); }
.ctx, .menu, .dd { animation: pop .16s var(--ease); transform-origin: top; backdrop-filter: blur(14px); background: color-mix(in oklch, #2c2c2e 92%, transparent); }
.toast { backdrop-filter: blur(12px); background: color-mix(in oklch, #2c2c2e 90%, transparent); }
@keyframes rise { from { opacity: 0; transform: translateY(14px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes pop { from { opacity: 0; transform: scale(.97) translateY(-4px); } to { opacity: 1; transform: none; } }
@keyframes sheet { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
.panel-body > * { animation: fadein .22s var(--ease) both; }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
#cv { box-shadow: 0 10px 40px rgba(0,0,0,.45); border-radius: 2px; }

/* floating quick bar on the preview */
.quickbar { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); display: flex; align-items: center; gap: 2px; padding: 4px; border-radius: 16px; background: var(--glass); backdrop-filter: blur(16px) saturate(1.4); border: 1px solid color-mix(in oklch, var(--line) 70%, transparent); box-shadow: 0 10px 30px rgba(0,0,0,.4); z-index: 6; max-width: calc(100% - 16px); overflow-x: auto; scrollbar-width: none; }
.quickbar::-webkit-scrollbar { display: none; }
.quickbar .qb { display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 10px; border-radius: 12px; color: var(--text); font-size: 13px; font-weight: 500; white-space: nowrap; flex: none; }
.quickbar .qb svg.i { width: 19px; height: 19px; }
.quickbar .qb:hover { background: rgba(255,255,255,.08); }
.quickbar .qb.danger { color: #ff8b9b; } .quickbar .qb.vol { color: var(--accent2); }
.quickbar .qb span { display: none; } .quickbar.sel .qb span { display: inline; } .quickbar .qb.ghosty span, .quickbar .qb[data-q=undo] span, .quickbar .qb[data-q=redo] span { display: none; }
.quickbar .qsep { width: 1px; height: 22px; background: var(--line); margin: 0 4px; flex: none; }
body.ws-preview .quickbar { display: none; }
.volpop { position: fixed; z-index: 85; width: 290px; padding: 14px; border-radius: 16px; background: color-mix(in oklch, #2c2c2e 94%, transparent); backdrop-filter: blur(14px); border: 1px solid #444446; box-shadow: var(--shadow-lg); animation: pop .16s var(--ease); }
.volpop .vprow { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; } .volpop output { font: 600 15px var(--mono); color: var(--accent2); }
.volpop input[type=range] { width: 100%; } .volpop .chips { margin-top: 10px; }

/* on-canvas selection box with resize + rotate handles */
.selbox { position: absolute; left: 0; top: 0; border: 1.5px solid var(--accent); border-radius: 3px; pointer-events: none; z-index: 5; transform-origin: center; box-shadow: 0 0 0 1px rgba(0,0,0,.35); }
.selbox .hd { position: absolute; width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 2px solid var(--accent); pointer-events: auto; touch-action: none; box-shadow: 0 2px 8px rgba(0,0,0,.4); }
.selbox .hd::after { content: ''; position: absolute; inset: -12px; }
.selbox .tl { left: -9px; top: -9px; cursor: nwse-resize; } .selbox .br { right: -9px; bottom: -9px; cursor: nwse-resize; }
.selbox .tr { right: -9px; top: -9px; cursor: nesw-resize; } .selbox .bl { left: -9px; bottom: -9px; cursor: nesw-resize; }
.selbox .rot { left: 50%; top: -34px; margin-left: -9px; cursor: grab; background: var(--accent); border-color: #fff; }
.selbox .rot::before { content: ''; position: absolute; left: 50%; top: 16px; width: 1.5px; height: 16px; background: var(--accent); margin-left: -1px; }
.viewer.resizing #cv { cursor: grabbing; }
body.ws-preview .selbox { display: none; }

/* elements panel */
.bulk { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
.bulk .bk { display: flex; align-items: center; gap: 8px; padding: 12px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); text-align: left; font-size: 14px; font-weight: 500; }
.bulk .bk:hover { border-color: var(--accent); }
.eltiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.elt { display: grid; gap: 6px; font-size: 13px; color: var(--muted); text-align: left; }
.elt i, .elt .sw { display: block; aspect-ratio: 16 / 10; border-radius: 10px; border: 1px solid var(--line); background-size: cover; transition: transform .18s var(--ease), border-color .18s; }
.elt:hover i, .elt .sw:hover { transform: translateY(-2px); border-color: var(--accent); }
.elt[data-ov=border] i { border: 3px solid #fff; background: #333 !important; }
.eltiles.bgs .elt { grid-template-columns: 1fr auto; align-items: center; } .eltiles.bgs .elt .sw { grid-column: 1 / -1; }
.stickers { display: grid; grid-template-columns: repeat(auto-fill, minmax(48px, 1fr)); gap: 6px; }
.stickers button { font-size: 28px; height: 52px; border-radius: 12px; background: var(--card); }
.stickers button:hover { background: var(--card2); transform: scale(1.06); }
.slabel small { font: 500 12px var(--font); text-transform: none; letter-spacing: 0; color: var(--dim); margin-left: 6px; }
.bgpick { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 8px; }
.bgpick button { aspect-ratio: 16 / 10; border-radius: 10px; background-size: cover; background-position: center; border: 2px solid transparent; }
.bgpick button.on { border-color: var(--accent); }

/* keys */
.keyrow { display: flex; gap: 6px; margin-top: 6px; align-items: center; } .keyrow input { flex: 1; min-width: 0; }
.keysaved { display: block; color: var(--green); font-size: 13px; margin-top: 4px; }

/* tour */
.tour { position: fixed; inset: 0; z-index: 120; }
.tour-spot { position: fixed; border-radius: 14px; box-shadow: 0 0 0 9999px rgba(6,8,12,.72), 0 0 0 2px var(--accent), 0 0 28px color-mix(in oklch, var(--accent) 60%, transparent); transition: all .35s var(--ease); pointer-events: none; }
.tour-card { position: fixed; background: color-mix(in oklch, #2a2a2c 96%, transparent); border: 1px solid #48484a; border-radius: 18px; padding: 16px 18px; box-shadow: var(--shadow-lg); transition: top .35s var(--ease), left .35s var(--ease); }
.tour-card.in { animation: rise .3s var(--ease); }
.tour-card h3 { margin: 6px 0 6px; font-size: 19px; letter-spacing: -.01em; } .tour-card p { margin: 0 0 12px; color: var(--muted); font-size: 15px; line-height: 1.5; }
.tour-top { display: flex; justify-content: space-between; align-items: center; } .tour-n { font: 500 12px var(--mono); color: var(--accent2); letter-spacing: .08em; }
.tour-x { width: 30px; height: 30px; border-radius: 50%; color: var(--muted); } .tour-x:hover { background: var(--card); }
.tour-dots { display: flex; gap: 4px; margin-bottom: 12px; } .tour-dots i { height: 4px; flex: 1; border-radius: 4px; background: var(--line); transition: background .3s; } .tour-dots i.past { background: color-mix(in oklch, var(--accent) 45%, var(--line)); } .tour-dots i.on { background: var(--accent); }
.tour-btns { display: flex; justify-content: space-between; gap: 8px; }
.tourcard { display: grid; gap: 8px; padding: 16px; border-radius: 16px; margin: 6px 0 12px; background: linear-gradient(135deg, color-mix(in oklch, var(--accent) 22%, var(--card)), var(--card)); border: 1px solid color-mix(in oklch, var(--accent) 35%, var(--line)); }
.tourcard b { font-size: 17px; } .tourcard span { color: var(--muted); }

@media (max-width: 860px) {
  .quickbar { bottom: 6px; } .quickbar .qb { height: 40px; padding: 0 9px; }
  .quickbar.sel .qb span { display: none; } .quickbar.sel .qb.vol span { display: inline; }
  /* phone: context actions sit above the main toolbar, so tapping the same item again closes the panel */
  .mctx { padding: 6px 10px; border-top: 1px solid var(--line); } .mctx .back { width: 52px; height: 52px; border-radius: 14px; }
  .mctx button svg.i { width: 24px; height: 24px; } .mctx button { font-size: 12px; gap: 4px; }
  .mtabs button svg.i { width: 26px; height: 26px; } .mtabs { padding-top: 6px; }
  .panel.open { animation: sheet .24s var(--ease); }
  .selbox .hd { width: 22px; height: 22px; } .selbox .tl, .selbox .bl { left: -11px; } .selbox .tr, .selbox .br { right: -11px; } .selbox .tl, .selbox .tr { top: -11px; } .selbox .bl, .selbox .br { bottom: -11px; }
}

@media (pointer: coarse) { .clip .h { width: 18px; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---------- v4.2 ---------- */
@media (max-width: 380px) { .topbar .tb { width: 28px; } .topbar .tb.boxed { width: 34px; height: 36px; } .avatar { width: 28px; height: 28px; } .wsbtn { font-size: 16px; } .topbar .pill { padding: 0 4px; } .topbar .tb.export { width: 42px; min-width: 42px; } }
.agent-feed-row.verified span { color: var(--green); } .agent-feed-row.warn span { color: var(--amber); } .agent-feed-row.progress span, .agent-feed-row.tool span { color: var(--accent); } .agent-feed-row.batch span { color: var(--muted); }
.agent-strip[data-phase=verified] { border-color: var(--green); } .agent-strip[data-phase=warn] { border-color: var(--amber); } .agent-strip[data-phase=progress], .agent-strip[data-phase=tool] { border-color: var(--accent); }
.warnbox { border: 1px solid var(--amber); background: color-mix(in oklch, var(--amber) 12%, transparent); border-radius: 10px; padding: 10px 12px; font-size: 13px; } .warnbox ol { margin: 6px 0 4px 18px; padding: 0; }
.okbox { border: 1px solid var(--green); background: color-mix(in oklch, var(--green) 12%, transparent); border-radius: 10px; padding: 8px 12px; font-size: 13px; }
.ms-ask { position: fixed; z-index: 90; left: 50%; bottom: max(18px, env(safe-area-inset-bottom)); transform: translateX(-50%); width: min(92vw, 420px); background: var(--bg2); border: 1px solid var(--accent); border-radius: 16px; padding: 14px 16px; box-shadow: 0 16px 40px rgba(0,0,0,.5); animation: msAsk .25s ease-out; }
.ms-ask p { margin: 6px 0 10px; color: var(--muted); font-size: 14px; } .ms-ask .row { display: flex; gap: 8px; } .ms-ask .primary { flex: 1; }
@keyframes msAsk { from { transform: translate(-50%, 30px); opacity: 0; } }

/* ---- v4.3.1: confirmation card, undo toast, phone awake banner, live agent feed, cut preview, transcript ---- */
.ms-confirm { position: fixed; z-index: 95; left: 50%; bottom: max(18px, env(safe-area-inset-bottom)); transform: translateX(-50%); width: min(94vw, 440px); background: var(--bg2); border: 2px solid #ff5a5a; border-radius: 16px; padding: 14px 16px; box-shadow: 0 18px 44px rgba(0,0,0,.55); animation: msAsk .25s ease-out; }
.ms-confirm ul { margin: 8px 0 10px; padding-left: 18px; color: var(--muted); font-size: 14px; max-height: 30vh; overflow: auto; }
.ms-confirm .row { display: flex; gap: 8px; } .ms-confirm .danger { flex: 1; background: #ff5a5a; color: #fff; border: 0; border-radius: 10px; padding: 10px; font-weight: 700; }
.ms-confirm small { display: block; margin-top: 8px; }
.ms-confirm.ask { border-color: var(--accent); } .ms-confirm.ask .danger { background: var(--accent); color: var(--on-accent, #fff); }
.ms-undo { position: fixed; z-index: 94; left: 50%; top: max(14px, env(safe-area-inset-top)); transform: translateX(-50%); display: flex; gap: 10px; align-items: center; background: var(--bg2); border: 1px solid var(--accent); border-radius: 12px; padding: 8px 12px; box-shadow: 0 10px 30px rgba(0,0,0,.45); }
.ms-awake-banner { position: fixed; z-index: 93; left: 8px; right: 8px; top: max(8px, env(safe-area-inset-top)); display: flex; gap: 8px; align-items: center; background: #3a2c00; color: #ffe08a; border: 1px solid var(--amber, #ffcd12); border-radius: 12px; padding: 8px 10px; font-size: 13px; }
.ms-awake-banner span { flex: 1; }
.clip.agent-hl { box-shadow: 0 0 0 2px var(--accent), 0 0 14px var(--accent); z-index: 3; transition: box-shadow .3s; }
.clip.agent-born { animation: agentBorn .8s ease-out; }
@keyframes agentBorn { from { opacity: 0; transform: translateY(6px) scale(.96); } to { opacity: 1; transform: none; } }
.cut-preview-layer { position: absolute; inset: 0; pointer-events: none; z-index: 4; }
.cut-preview { position: absolute; top: 0; bottom: 0; background: repeating-linear-gradient(45deg, rgba(255,70,70,.32) 0 6px, rgba(255,70,70,.16) 6px 12px); border-left: 1px solid #ff5a5a; border-right: 1px solid #ff5a5a; }
.tr-words { margin-top: 10px; line-height: 1.9; font-size: 15px; max-height: 55vh; overflow: auto; user-select: none; }
.tr-words span { padding: 1px 2px; border-radius: 4px; cursor: pointer; } .tr-words span:hover { background: rgba(255,255,255,.08); }
.tr-words span.on { background: rgba(255,70,70,.35); } .tr-words span.approx { opacity: .75; text-decoration: underline dotted; }
.msg .plan { margin-top: 6px; font-size: 13px; } .msg .plan .pl { padding: 1px 0; color: var(--muted); } .msg .plan .pl.verified { color: #5fd38d; } .msg .plan .pl.error { color: #ff7a7a; } .msg .plan .pl.warn { color: #ffcd12; } .msg .plan .pl.say { color: inherit; }

/* =================== v4.4 =================== */
/* top bar: same sequence on every screen, like the reference  ‹ ‹ Edit⌄ ●  [···⌄] ● [▣] [⇧] [◨] */
.topbar #exportBtn { order: 2; } .topbar #insTgl { order: 3; }
.tb.export { width: 46px; min-width: 46px; height: 42px; padding: 0; border-radius: 12px; justify-content: center; background: #ececec; color: #141414; box-shadow: 0 1px 0 rgba(255,255,255,.4) inset; }
.tb.export svg.i { width: 22px; height: 22px; }
.tb.boxed.lt { background: var(--card2); border-color: color-mix(in oklch, var(--line) 70%, white); }
.tb.boxed#insTgl { background: var(--bg2); }
.topbar #moreBtn { border-radius: 12px; padding: 0 12px; gap: 8px; }
@media (max-width: 860px) {
  .topbar { display: flex; align-items: center; gap: 6px; padding: 8px 10px; }
  .topbar .tbg { display: contents; }
  .topbar #moreBtn { margin-left: auto; height: 42px; padding: 0 10px; gap: 6px; }
  .topbar .tb.boxed { width: 42px; height: 42px; border-radius: 12px; }
  .topbar .tb.export { width: 46px; height: 42px; }
  .topbar #exportBtn { order: 2; } .topbar #insTgl { order: 3; }
}
@media (max-width: 400px) { .topbar { gap: 3px; padding: 8px 6px; } .topbar #moreBtn { padding: 0 6px; gap: 2px; } .topbar .tb.boxed { width: 36px; height: 38px; } .topbar .tb.export { width: 40px; min-width: 40px; height: 38px; } }
/* selection toolbar */
.selbar { display: flex; align-items: center; gap: 2px; padding: 5px 8px; margin: 6px 10px 0; background: var(--bg2); border: 1px solid var(--line); border-radius: 14px; overflow-x: auto; scrollbar-width: none; flex: none; animation: sbIn .22s var(--ease, ease-out); }
.selbar::-webkit-scrollbar { display: none; }
@keyframes sbIn { from { opacity: 0; transform: translateY(-6px); } }
.selbar .sb { height: 36px; padding: 0 11px; border-radius: 10px; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; font-size: 14px; font-weight: 500; color: var(--text); flex: none; transition: background .15s; }
.selbar .sb:hover, .selbar .sb.on { background: color-mix(in oklch, var(--accent) 22%, transparent); }
.selbar .sb.ic { padding: 0 8px; } .selbar .sb svg.i { width: 20px; height: 20px; }
.selbar .sb.hl { background: color-mix(in oklch, var(--accent) 18%, transparent); color: var(--accent2); }
.selbar .sbsep { width: 1px; height: 20px; background: var(--line); flex: none; margin: 0 2px; }
.selbar .sbsw { display: inline-flex; gap: 2px; } .selbar .sb.sw { padding: 0 3px; } .selbar .sb.sw i { width: 26px; height: 26px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 1px rgba(255,255,255,.15) inset; }
.sbpop { position: fixed; z-index: 80; min-width: 240px; max-width: 92vw; background: var(--bg2); border: 1px solid var(--line); border-radius: 14px; padding: 12px; box-shadow: 0 14px 36px rgba(0,0,0,.5); display: grid; gap: 8px; animation: sbIn .18s ease-out; }
.sbrow { display: grid; grid-template-columns: 70px 1fr 48px; gap: 8px; align-items: center; font-size: 14px; } .sbrow output { text-align: right; color: var(--muted); font: 500 13px var(--mono); }
.sbgrid { display: grid; grid-template-columns: repeat(3, 44px); gap: 6px; justify-content: center; } .sbgrid button { height: 40px; padding: 0; }
body.anrec #viewer { box-shadow: 0 0 0 2px #ff4d6d inset; } body.anrec #viewer::after { content: '● REC  drag the item'; position: absolute; top: 10px; left: 12px; color: #ff4d6d; font: 700 13px var(--mono); z-index: 9; animation: twinkle 1s infinite; }
/* Animate + Transitions panels: live tiles in the app theme */
.anseg { display: flex; gap: 4px; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 4px; margin: 6px 0 10px; }
.anseg button { flex: 1; height: 36px; border-radius: 9px; font-weight: 600; color: var(--muted); position: relative; } .anseg button.on { background: var(--card2); color: var(--text); }
.andot { position: absolute; top: 7px; right: 10px; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.angrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; } .angrid.ease { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.antile { background: var(--card); border: 1.5px solid var(--line); border-radius: 14px; padding: 6px 6px 8px; display: grid; gap: 6px; justify-items: center; font-size: 13px; color: var(--text); transition: border-color .15s, transform .15s; }
.antile:hover { border-color: color-mix(in oklch, var(--accent) 60%, var(--line)); transform: translateY(-1px); } .antile.on { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in oklch, var(--accent) 30%, transparent); }
.antile canvas { width: 100%; aspect-ratio: 1 / .8; border-radius: 10px; background: var(--bg); display: block; } .angrid.tr .antile canvas { aspect-ratio: 16 / 10; } .antile.ez canvas { aspect-ratio: 1 / .75; }
.antile span { line-height: 1.2; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.ancreate { display: flex; gap: 12px; align-items: center; width: 100%; text-align: left; background: var(--card); border: 1.5px solid var(--line); border-radius: 14px; padding: 10px; margin-bottom: 12px; }
.ancreate b { display: block; font-size: 15px; } .ancreate small { color: var(--muted); font-size: 13px; }
.anbee { width: 64px; height: 64px; flex: none; border-radius: 12px; background: linear-gradient(135deg, var(--accent), color-mix(in oklch, var(--accent) 45%, #000)); position: relative; overflow: hidden; }
.anbee i { position: absolute; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 3px rgba(255,255,255,.25); animation: beePath 2.4s ease-in-out infinite; }
@keyframes beePath { 0% { left: 6px; top: 38px; } 30% { left: 24px; top: 8px; } 60% { left: 40px; top: 30px; } 100% { left: 6px; top: 38px; } }
@media (max-width: 440px) { .topbar { gap: 2px; padding: 8px 6px; } .topbar .tb { width: 26px; } .wsbtn { font-size: 17px; padding: 6px 2px; } .avatar { width: 30px; height: 30px; } .avatar .face { width: 24px; height: 24px; } .topbar #moreBtn { padding: 0 6px; gap: 2px; height: 38px; } .topbar .tb.boxed { width: 36px; height: 38px; border-radius: 11px; } .topbar .tb.export { width: 42px; min-width: 42px; height: 38px; } }
@media (max-width: 360px) { .topbar #moreBtn span:last-child { display: none; } .topbar .tb.boxed { width: 32px; } }

/* ===================== v4.5 polish ===================== */
/* panels: smooth, never trapped scrolling (Transitions / Animate) */
.panel-body, .panel.right { overscroll-behavior: contain; -webkit-overflow-scrolling: touch; touch-action: pan-y; scroll-behavior: auto; }
.antile, .antile canvas { touch-action: pan-y; }
/* media bin: sharp thumbnails, portrait screenshots are shown whole (no blurry crop) */
.mitem .th { position: relative; overflow: hidden; background: var(--deep); }
.mitem .th::before { content: ''; position: absolute; inset: -12px; background: var(--tb) center/cover; filter: blur(14px) brightness(.55); opacity: .9; }
.mitem .th img { position: relative; width: 100%; height: 100%; object-fit: contain; display: block; image-rendering: auto; }
.mitem .th.aud { color: var(--green); } .mitem .th.aud svg.i { width: 34px; height: 34px; }
.mitem .ac button svg.i { width: 16px; height: 16px; vertical-align: -3px; }
/* quick bar: only clip actions, fixed-size mute toggle with a clean micro animation */
.quickbar[hidden] { display: none !important; }
.quickbar .qb.mute { width: 42px; justify-content: center; padding: 0; position: relative; }
.quickbar .qb.mute .mi { position: relative; width: 20px; height: 20px; display: block; }
.quickbar .qb.mute .mi svg.i { position: absolute; inset: 0; width: 20px; height: 20px; transition: opacity .18s ease, transform .22s cubic-bezier(.2,.9,.3,1.3); }
.quickbar .qb.mute .mi svg.off { opacity: 0; transform: scale(.6) rotate(-12deg); }
.quickbar .qb.mute.is-muted { color: #ff8b9b; background: color-mix(in oklch, var(--rose) 16%, transparent); }
.quickbar .qb.mute.is-muted .mi svg.on { opacity: 0; transform: scale(.6) rotate(12deg); }
.quickbar .qb.mute.is-muted .mi svg.off { opacity: 1; transform: none; }
.quickbar .qb.mute.pop { animation: mutepop .28s ease; }
@keyframes mutepop { 40% { transform: scale(.88); } 100% { transform: none; } }
.quickbar .qb.vol span { display: inline !important; min-width: 3.2em; text-align: left; font-variant-numeric: tabular-nums; }
.quickbar .qb.flipy svg.i { transform: scaleY(-1); }
.mute-tg { display: inline-flex; align-items: center; gap: 5px; } .mute-tg svg.i { width: 16px; height: 16px; } .mute-tg.is-muted { color: #ff8b9b; border-color: color-mix(in oklch, var(--rose) 50%, var(--line)); }
/* timeline: clearer waveforms, muted clips, no white blobs on tiny clips */
.clip canvas.wf { z-index: 0; }
.clip.muted::after { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(135deg, rgba(0,0,0,.28) 0 6px, transparent 6px 12px); pointer-events: none; }
.clip em.mut { position: relative; z-index: 2; flex: none; width: 16px; height: 16px; margin-right: 4px; border-radius: 4px; background: rgba(255,69,58,.9) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 9.5h3.5L12 6v12l-4.5-3.5H4z'/%3E%3Cpath d='m16 9.5 5 5M21 9.5l-5 5'/%3E%3C/svg%3E") center/12px no-repeat; }
.clip.sel .h { background: transparent; } .clip.sel .h::after { content: ''; position: absolute; top: 25%; bottom: 25%; left: 50%; width: 3px; margin-left: -1.5px; border-radius: 2px; background: #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.35); }
.clip.narrow { padding: 0; } .clip.narrow span, .clip.narrow em.mut { display: none; } .clip.narrow .h { width: 6px; } .clip.narrow.sel .h::after { display: none; }
.clip.masked span::before { content: '◎ '; opacity: .85; }
.k-audio { background: #12432c; } .k-audio.sel { background: #175a3a; }
@media (max-width: 860px) { .track.a, .lab.a { height: 56px; } .track.a .clip { height: 48px; } }
.track.a { height: 52px; } .lab.a { height: 52px; } .track.a .clip { height: 44px; }
.cut-preview { background: repeating-linear-gradient(135deg, rgba(255,69,58,.45) 0 5px, rgba(255,69,58,.2) 5px 10px) !important; border-left: 1px solid #ff453a; border-right: 1px solid #ff453a; }
/* silence meter */
.sil-meter { width: 100%; height: 86px; display: block; border-radius: 12px; background: var(--bg); margin: 6px 0 4px; }
.pro-rng { flex: 1; } .pro-rng span { display: flex; justify-content: space-between; gap: 6px; align-items: baseline; } .pro-rng b { color: var(--text); font-variant-numeric: tabular-nums; }
.primary.danger-fill { background: #e5484d; border-color: #e5484d; color: #fff; }
h3 svg.i { width: 20px; height: 20px; vertical-align: -3px; margin-right: 4px; }
.chip.on { border-color: var(--accent); background: color-mix(in oklch, var(--accent) 22%, transparent); }
/* "All tools" grid + tool cards */
.toolgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; margin: 6px 0 12px; }
.toolcard { display: grid; justify-items: center; gap: 6px; padding: 12px 6px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); color: var(--text); font-size: 13px; text-align: center; transition: border-color .15s, transform .12s; }
.toolcard:active { transform: scale(.97); } .toolcard:hover { border-color: color-mix(in oklch, var(--accent) 55%, var(--line)); }
.toolcard svg.i { width: 26px; height: 26px; color: var(--accent2, var(--accent)); }

/* ===== v4.6 ===== */
/* resize handles: corners win over the rotate knob (knob sits higher, smaller hit area) so pulling a corner RESIZES */
.selbox .hd.tl, .selbox .hd.tr, .selbox .hd.bl, .selbox .hd.br { z-index: 2; }
.selbox .hd.rot { top: -48px; z-index: 1; }
.selbox .hd.rot::after { inset: -8px; }
.selbox .hd.rot::before { top: 18px; height: 28px; }
@media (pointer: coarse) { .selbox .hd::after { inset: -14px; } .selbox .hd.rot::after { inset: -6px; } }
.selbar .sb.bgon { background: color-mix(in oklch, var(--accent) 30%, transparent); color: #fff; box-shadow: 0 0 0 1px var(--accent) inset; }
.viewbar { display: flex; align-items: center; gap: 6px; margin: 6px 10px 0; min-height: 0; flex: none; overflow-x: auto; scrollbar-width: none; }
.viewbar:empty { display: none; }
.viewbar .quickbar { position: static; transform: none; left: auto; bottom: auto; max-width: none; flex: 1 1 auto; box-shadow: none; }
.viewbar .vtools { position: static; opacity: 1; flex: none; margin-left: auto; }
body.ws-preview .viewbar { display: none; }
/* Projects home page */
.home { position: fixed; inset: 0; z-index: 900; background: var(--bg, #1c1c1e); overflow-y: auto; }
.home[hidden] { display: none; }
.home-in { max-width: 1180px; margin: 0 auto; padding: 16px 16px 40px; display: flex; flex-direction: column; gap: 16px; }
.home-top, .home-bar, .binrow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; } .home .sp { flex: 1; }
.home-new { display: grid; grid-template-columns: minmax(200px, 1fr) 2fr; gap: 12px; }
.newbig { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 22px; border-radius: 18px; border: 2px dashed var(--accent, #ff9933); background: color-mix(in oklch, var(--accent, #ff9933) 10%, transparent); min-height: 150px; }
.newbig .plus { width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; background: var(--accent, #ff9933); color: #fff; } .newbig .plus svg { width: 30px; height: 30px; }
.newpre { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
.pre { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; padding: 12px; border-radius: 14px; background: var(--card, #2c2c2e); text-align: left; border: 1px solid transparent; }
.pre.on { border-color: var(--accent, #ff9933); } .pre i { display: block; height: 34px; aspect-ratio: var(--ar); border: 2px solid currentColor; border-radius: 5px; opacity: .7; } .pre i.fold { border: 0; aspect-ratio: auto; }
.pre small, .pmeta small, .home small { opacity: .65; font-size: 12px; }
.home-cont { display: flex; align-items: center; gap: 14px; padding: 12px; border-radius: 16px; background: var(--card, #2c2c2e); cursor: pointer; } .home-cont > div:nth-child(2) { flex: 1; display: flex; flex-direction: column; } .home-cont .pthumb { width: 120px; flex: none; }
.home-bar h2 { margin: 0; font-size: 18px; } .home-bar input { min-width: 160px; }
.plist.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; } .plist.list { display: flex; flex-direction: column; gap: 6px; }
.pcard { position: relative; border-radius: 14px; background: var(--card, #2c2c2e); overflow: hidden; cursor: pointer; } .pcard.cur { box-shadow: 0 0 0 2px var(--accent, #ff9933); }
.plist.list .pcard { display: flex; align-items: center; gap: 10px; } .plist.list .pthumb { width: 96px; flex: none; }
.pthumb { position: relative; aspect-ratio: 16/9; background: #111; display: grid; place-items: center; overflow: hidden; } .pthumb img { width: 100%; height: 100%; object-fit: contain; }
.pthumb em { position: absolute; right: 6px; bottom: 6px; font: 600 11px var(--mono, monospace); background: rgba(0,0,0,.65); padding: 2px 6px; border-radius: 6px; font-style: normal; }
.pmeta { padding: 8px 40px 10px 10px; display: flex; flex-direction: column; min-width: 0; } .pmeta b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pmore { position: absolute; right: 4px; bottom: 6px; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; }
.pmenu { position: fixed; z-index: 950; background: var(--bg2, #2c2c2e); border: 1px solid var(--line, #444); border-radius: 12px; padding: 4px; display: flex; flex-direction: column; min-width: 170px; box-shadow: 0 12px 30px rgba(0,0,0,.5); }
.pmenu button { display: flex; gap: 8px; align-items: center; padding: 10px 12px; border-radius: 8px; text-align: left; } .pmenu .danger, .binrow .danger { color: #ff8b9b; }
.hsheet { position: fixed; inset: 0; z-index: 960; background: rgba(0,0,0,.55); display: grid; place-items: center; padding: 16px; }
.hcard { width: min(520px, 100%); background: var(--bg2, #2c2c2e); border-radius: 18px; padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.home-bin summary { cursor: pointer; opacity: .8; } .binrow { padding: 8px 0; border-bottom: 1px solid var(--line, #333); }
@media (max-width: 700px) { .home-new { grid-template-columns: 1fr; } .plist.grid { grid-template-columns: repeat(2, 1fr); } }
/* v4.7: the "AI is editing" banner shrinks to a small pill after 6 s so it never covers the item bar; stand-by bar sits at the bottom */
.ms-awake-banner.mini { left: auto; right: 8px; padding: 4px 6px; gap: 4px; opacity: .92; }
.ms-awake-banner.mini span { display: none; }
.ms-awake-banner.mini::before { content: '🔌 AI'; font-size: 12px; font-weight: 600; padding: 0 4px; }
.ms-awake-banner.ms-standby { top: auto; bottom: calc(env(safe-area-inset-bottom) + 84px); background: #3a1d00; color: #ffe2c2; border-color: #ff9933; }
.ms-awake-banner.ms-standby .primary { white-space: nowrap; }

/* ===================================================================== v5.2.0 · login page, account menu, Admin panel */
.fb-boot { display: grid; place-items: center; }
.fb-login { position: fixed; inset: 0; z-index: 1200; display: grid; place-items: center; padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom)); background: radial-gradient(120% 80% at 50% 0%, color-mix(in srgb, var(--accent, #ff9933) 22%, transparent), transparent 60%), var(--bg, #1c1c1e); color: var(--text, #f2f2f3); font-family: var(--font, Inter, system-ui, sans-serif); overflow: auto; }
.fb-card { width: min(420px, 100%); background: var(--card, #2a2a2d); border: 1px solid var(--line, #3a3a3e); border-radius: 22px; padding: 26px 20px 20px; box-shadow: 0 24px 60px rgba(0,0,0,.35); }
.fb-hero { text-align: center; margin-bottom: 18px; } .fb-hero h1 { margin: 8px 0 2px; font: 700 28px/1.1 var(--font, Inter); letter-spacing: -.02em; } .fb-hero h1 b { color: var(--accent, #ff9933); font-weight: 700; } .fb-hero p { margin: 0; color: var(--muted, #a1a1a8); font-size: 14px; }
.fb-btns { display: grid; gap: 10px; }
.fb-btn { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 50px; width: 100%; border-radius: 14px; border: 1px solid var(--line, #3a3a3e); background: #fff; color: #1f1f1f; font: 600 16px var(--font, Inter); cursor: pointer; }
.fb-btn.dark { background: #24292f; color: #fff; border-color: #24292f; } .fb-btn.primary { background: var(--accent, #ff9933); color: #1a1006; border: 0; }
.fb-btn:disabled { opacity: .55; } .fb-btn:active { transform: scale(.985); }
.fb-email { margin-top: 14px; border-top: 1px solid var(--line, #3a3a3e); padding-top: 12px; } .fb-email summary { cursor: pointer; color: var(--muted, #a1a1a8); font-size: 14px; text-align: center; list-style: none; } .fb-email summary::-webkit-details-marker { display: none; }
.fb-email form { display: grid; gap: 10px; margin-top: 12px; } .fb-email input { min-height: 48px; border-radius: 12px; border: 1px solid var(--line, #3a3a3e); background: var(--bg2, #232326); color: inherit; padding: 0 14px; font-size: 16px; }
.fb-link { background: none; border: 0; color: var(--accent, #ff9933); font-size: 14px; padding: 6px; cursor: pointer; }
/* v5.6 sign-up: tabs, Gmail check, password meter, verify screen (44 px+ touch targets, 16 px inputs = no iOS zoom) */
.fb-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; margin: 0 0 14px; border-radius: 14px; background: var(--bg2, #232326); border: 1px solid var(--line, #3a3a3e); }
.fb-tabs button { min-height: 42px; border: 0; border-radius: 10px; background: none; color: var(--muted, #a1a1a8); font: 600 15px var(--font, Inter); cursor: pointer; transition: background .2s, color .2s; }
.fb-tabs button.on { background: var(--card2, #3a3a3e); color: var(--text, #f2f2f3); box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.fb-or { display: flex; align-items: center; gap: 10px; margin: 16px 0 10px; color: var(--dim, #8b8b92); font-size: 13px; } .fb-or::before, .fb-or::after { content: ''; flex: 1; height: 1px; background: var(--line, #3a3a3e); }
.fb-up { display: grid; gap: 10px; } .fb-up input[type=text], .fb-up input[type=email], .fb-up input[type=password], .fb-pass input { width: 100%; box-sizing: border-box; min-height: 48px; border-radius: 12px; border: 1px solid var(--line, #3a3a3e); background: var(--bg2, #232326); color: inherit; padding: 0 14px; font-size: 16px; }
.fb-up input:focus, .fb-email input:focus { outline: 2px solid color-mix(in srgb, var(--accent, #ff9933) 70%, transparent); outline-offset: 1px; }
.fb-up input[aria-invalid=true] { border-color: #ff6b6b; }
.fb-field { display: grid; gap: 5px; } .fb-hint { min-height: 0; font-size: 12.5px; line-height: 1.4; color: var(--dim, #8b8b92); padding: 0 4px; } .fb-hint:empty { display: none; } .fb-hint.err { color: #ff6b6b; } .fb-hint.ok { color: #4cd38a; }
.fb-pass { position: relative; } .fb-pass input { padding-right: 50px; }
.fb-eye { position: absolute; right: 3px; top: 3px; transform: none !important; width: 42px; height: 42px; min-height: 0; padding: 0; display: grid; place-items: center; border: 0; background: none; color: var(--muted, #a1a1a8); border-radius: 10px; cursor: pointer; } .fb-eye.on { color: var(--accent, #ff9933); }
.fb-meter { height: 4px; border-radius: 4px; background: var(--line, #3a3a3e); overflow: hidden; } .fb-meter i { display: block; height: 100%; width: 0; background: #ff6b6b; transition: width .25s, background .25s; }
.fb-meter i[data-s="2"] { background: #f5b942; } .fb-meter i[data-s="3"] { background: #8fd16a; } .fb-meter i[data-s="4"] { background: #4cd38a; }
.fb-check { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; line-height: 1.4; color: var(--muted, #a1a1a8); cursor: pointer; padding: 4px 2px; } .fb-check input { width: 20px; height: 20px; margin: 0; flex: none; accent-color: var(--accent, #ff9933); }
.fb-switch { margin: 10px 0 0; text-align: center; font-size: 14px; color: var(--muted, #a1a1a8); } .fb-switch:empty { display: none; }
a.fb-btn { text-decoration: none; box-sizing: border-box; }
.fb-switch .fb-link, .fb-email .fb-link { min-height: 40px; }
.fb-login[data-mode=up] .fb-hero svg { width: 44px; height: 44px; } .fb-login[data-mode=up] .fb-hero { margin-bottom: 4px; }
.fb-card h1 { overflow-wrap: anywhere; }
.fb-msg { min-height: 20px; margin: 12px 2px 0; font-size: 14px; color: var(--muted, #a1a1a8); text-align: center; } .fb-msg.err { color: #ff6b6b; } .fb-msg.ok { color: #4cd38a; }
.fb-small { margin: 14px 0 0; font-size: 12.5px; line-height: 1.5; color: var(--dim, #8b8b92); text-align: center; }
.fb-note { border-radius: 12px; padding: 10px 12px; margin: 0 0 12px; background: var(--card2, #323236); font-size: 14px; line-height: 1.45; } .fb-note.warn { background: color-mix(in srgb, #ff9933 18%, var(--card2, #323236)); }
.fb-user { width: 34px; height: 34px; border-radius: 50%; padding: 0; overflow: hidden; border: 2px solid var(--accent, #ff9933); background: var(--card2, #323236); color: var(--text, #fff); display: grid; place-items: center; font: 700 14px var(--font, Inter); flex: none; cursor: pointer; }
.fb-user img { width: 100%; height: 100%; object-fit: cover; }
.fb-admin-tab { height: 30px; padding: 0 10px; border-radius: 9px; border: 1px solid var(--accent, #ff9933); background: color-mix(in srgb, var(--accent, #ff9933) 16%, transparent); color: var(--accent, #ff9933); font: 700 12.5px var(--font, Inter); cursor: pointer; flex: none; }
.fb-menu { position: fixed; z-index: 1300; min-width: 250px; max-width: calc(100vw - 16px); background: var(--card, #2a2a2d); border: 1px solid var(--line, #3a3a3e); border-radius: 16px; padding: 8px; box-shadow: 0 16px 40px rgba(0,0,0,.4); display: grid; gap: 2px; }
.fb-menu button { text-align: left; min-height: 44px; border: 0; background: none; color: var(--text, #fff); border-radius: 10px; padding: 0 12px; font: 500 15px var(--font, Inter); cursor: pointer; } .fb-menu button:hover { background: var(--card2, #323236); } .fb-menu .danger { color: #ff6b6b; }
.fb-me { display: flex; gap: 10px; align-items: center; padding: 8px 8px 10px; border-bottom: 1px solid var(--line, #3a3a3e); margin-bottom: 4px; } .fb-me img { width: 40px; height: 40px; border-radius: 50%; } .fb-me small { display: block; color: var(--muted, #a1a1a8); font-size: 12.5px; word-break: break-all; } .fb-me em { color: var(--accent, #ff9933); font-style: normal; font-weight: 700; }
.fb-ann { position: fixed; left: 50%; transform: translateX(-50%); top: calc(env(safe-area-inset-top) + 58px); z-index: 900; max-width: min(640px, calc(100vw - 20px)); display: flex; gap: 10px; align-items: center; background: var(--card, #2a2a2d); border: 1px solid var(--accent, #ff9933); border-radius: 14px; padding: 8px 8px 8px 14px; font-size: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.35); } .fb-ann button { border: 0; background: none; color: inherit; font-size: 16px; min-width: 36px; min-height: 36px; }

.adm { position: fixed; inset: 0; z-index: 1100; display: flex; flex-direction: column; background: var(--bg, #1c1c1e); color: var(--text, #f2f2f3); font: 15px/1.45 var(--font, Inter, system-ui); padding-top: env(safe-area-inset-top); }
.adm[hidden] { display: none; }
.adm-top { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--line, #3a3a3e); } .adm-top b { font-size: 17px; } .adm-repo { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted, #a1a1a8); font-size: 12.5px; } .adm-repo a { color: inherit; }
.adm-x { min-width: 44px; min-height: 44px; border: 0; border-radius: 12px; background: var(--card2, #323236); color: inherit; font-size: 18px; }
.adm-tabs { display: flex; gap: 6px; overflow-x: auto; padding: 8px 10px; border-bottom: 1px solid var(--line, #3a3a3e); scrollbar-width: none; } .adm-tabs button { flex: none; min-height: 38px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line, #3a3a3e); background: none; color: var(--muted, #a1a1a8); font: 600 14px var(--font, Inter); } .adm-tabs button.on { background: var(--accent, #ff9933); border-color: transparent; color: #1a1006; }
.adm-body { flex: 1; overflow: auto; padding: 12px 12px calc(24px + env(safe-area-inset-bottom)); max-width: 820px; width: 100%; margin: 0 auto; box-sizing: border-box; }
.adm-body h3 { margin: 18px 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--dim, #8b8b92); }
.adm-drop { display: grid; justify-items: center; gap: 4px; text-align: center; border: 2px dashed color-mix(in srgb, var(--accent, #ff9933) 60%, var(--line, #3a3a3e)); border-radius: 18px; padding: 26px 14px; cursor: pointer; background: color-mix(in srgb, var(--accent, #ff9933) 6%, transparent); } .adm-drop.on { background: color-mix(in srgb, var(--accent, #ff9933) 20%, transparent); } .adm-drop-ic { font-size: 34px; } .adm-drop small { color: var(--muted, #a1a1a8); }
.adm-row { display: flex; gap: 8px; align-items: center; margin: 10px 0; } .adm-row.wrap { flex-wrap: wrap; } .adm-row .grow { flex: 1; min-width: 0; } .adm-row.sticky { position: sticky; bottom: 0; background: var(--bg, #1c1c1e); padding: 10px 0; margin-bottom: 0; z-index: 2; }
.adm-row input, .adm-field input, .adm-body textarea { min-height: 44px; border-radius: 12px; border: 1px solid var(--line, #3a3a3e); background: var(--bg2, #232326); color: inherit; padding: 0 12px; font-size: 16px; box-sizing: border-box; }
.adm-btn { min-height: 44px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line, #3a3a3e); background: var(--card2, #323236); color: inherit; font: 600 15px var(--font, Inter); cursor: pointer; } .adm-btn.sm { min-height: 36px; font-size: 13px; padding: 0 10px; } .adm-btn.primary { background: var(--accent, #ff9933); color: #1a1006; border: 0; flex: 1; } .adm-btn.danger { background: #b3261e; color: #fff; border: 0; } .adm-btn:disabled { opacity: .45; }
.adm-prog { margin: 14px 0; display: grid; gap: 6px; font-size: 14px; color: var(--muted, #a1a1a8); } .adm-bar { height: 10px; border-radius: 6px; background: var(--card2, #323236); overflow: hidden; } .adm-bar i { display: block; height: 100%; background: var(--accent, #ff9933); transition: width .3s; } .adm-bar i.ind { width: 40% !important; animation: admInd 1.1s ease-in-out infinite; } @keyframes admInd { 0% { transform: translateX(-100%); } 100% { transform: translateX(250%); } }
.adm-note { border-radius: 12px; padding: 10px 12px; margin: 10px 0; background: var(--card2, #323236); font-size: 14px; } .adm-note.ok { background: color-mix(in srgb, #2fbf71 18%, var(--card2, #323236)); } .adm-note.warn { background: color-mix(in srgb, #ff9933 18%, var(--card2, #323236)); } .adm-note.err { background: color-mix(in srgb, #ff4d4d 20%, var(--card2, #323236)); } .adm-note.big { font-size: 17px; } .adm-note ul { margin: 6px 0 0; padding-left: 18px; } .adm-note a { color: inherit; font-weight: 700; }
.adm-kpis { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin: 12px 0 6px; } .adm-kpis div { background: var(--card, #2a2a2d); border-radius: 12px; padding: 8px 4px; text-align: center; } .adm-kpis b { display: block; font-size: 19px; } .adm-kpis small { color: var(--muted, #a1a1a8); font-size: 11.5px; } .adm-kpis .add b { color: #2fbf71; } .adm-kpis .chg b { color: var(--accent, #ff9933); } .adm-kpis .del b { color: #ff6b6b; }
.adm-meta { color: var(--muted, #a1a1a8); font-size: 13px; margin: 8px 0; word-break: break-word; } .adm-meta code, .adm-list code { font-family: var(--mono, monospace); font-size: 12.5px; }
.adm-sw { display: flex; gap: 12px; align-items: flex-start; padding: 10px 2px; border-bottom: 1px solid var(--line, #3a3a3e); cursor: pointer; } .adm-sw input { width: 22px; height: 22px; margin-top: 2px; accent-color: var(--accent, #ff9933); flex: none; } .adm-sw small { display: block; color: var(--muted, #a1a1a8); font-size: 12.5px; }
.adm-field { display: grid; gap: 4px; margin: 10px 0; } .adm-field span { font-size: 12.5px; color: var(--muted, #a1a1a8); }
.adm-list { background: var(--card, #2a2a2d); border-radius: 12px; margin: 8px 0; } .adm-list summary { padding: 10px 12px; cursor: pointer; font-weight: 600; } .adm-list summary em { font-style: normal; color: var(--muted, #a1a1a8); } .adm-list ul { margin: 0; padding: 0 12px 10px 28px; max-height: 300px; overflow: auto; font-size: 13px; } .adm-list.add summary { color: #2fbf71; } .adm-list.chg summary { color: var(--accent, #ff9933); } .adm-list.del summary { color: #ff6b6b; }
.adm-pin { position: absolute; inset: 0; z-index: 5; display: grid; place-items: center; background: rgba(0,0,0,.55); padding: 16px; } .adm-card { width: min(400px, 100%); background: var(--card, #2a2a2d); border-radius: 18px; padding: 18px; border: 1px solid var(--line, #3a3a3e); } .adm-card input { width: 100%; min-height: 48px; border-radius: 12px; border: 1px solid var(--line, #3a3a3e); background: var(--bg2, #232326); color: inherit; padding: 0 12px; font-size: 18px; box-sizing: border-box; } .adm-card .red { color: #ff6b6b; } .adm-mini { font-size: 12.5px; max-height: 140px; overflow: auto; }
.adm-pill { display: inline-block; padding: 3px 10px; border-radius: 99px; font-size: 12.5px; font-weight: 700; font-style: normal; background: var(--card2, #323236); } .adm-pill.success { background: #1f7a4a; color: #fff; } .adm-pill.failure { background: #b3261e; color: #fff; } .adm-pill.pending { background: color-mix(in srgb, #ff9933 35%, var(--card2, #323236)); }
.adm-deploy, .adm-st { display: block; margin: 8px 0; font-size: 13.5px; } .adm-deploy a, .adm-st a { color: var(--accent, #ff9933); }
.adm-hist, .adm-users, .adm-log { list-style: none; margin: 0; padding: 0; } .adm-hist li, .adm-users li, .adm-log li { display: flex; gap: 10px; align-items: center; padding: 10px 2px; border-bottom: 1px solid var(--line, #3a3a3e); } .adm-hist li > div, .adm-users li > div { flex: 1; min-width: 0; } .adm-hist small, .adm-users small, .adm-log small { display: block; color: var(--muted, #a1a1a8); font-size: 12.5px; word-break: break-all; } .adm-hist a { color: inherit; } .adm-log li { display: block; }
.adm-users img, .adm-users i { width: 38px; height: 38px; border-radius: 50%; background: var(--card2, #323236); flex: none; } .adm-users li.banned { opacity: .6; }
.adm-body textarea { width: 100%; min-height: 55vh; padding: 10px; font: 13px/1.5 var(--mono, monospace); white-space: pre; tab-size: 2; }
.adm-help { margin-top: 18px; background: var(--card, #2a2a2d); border-radius: 12px; padding: 10px 12px; font-size: 14px; } .adm-help summary { cursor: pointer; font-weight: 600; } .adm-help ol { padding-left: 18px; margin: 8px 0 0; display: grid; gap: 6px; }
.adm-health { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; } .adm-health li { padding: 4px 10px; border-radius: 99px; font-size: 12.5px; background: var(--card2, #323236); } .adm-health li.ok { color: #2fbf71; } .adm-health li.no { color: #ff6b6b; }
@media (max-width: 420px) { .adm-kpis { grid-template-columns: repeat(3, 1fr); } }

/* ===================================================================== v5.3.0 · login, Projects page, caret, smooth motion */
body { caret-color: transparent; } input, textarea, select, [contenteditable] { caret-color: auto; }
.app, .home, .fb-login { -webkit-user-select: none; user-select: none; } .app input, .app textarea, .home input, .fb-login input, .app [contenteditable] { -webkit-user-select: text; user-select: text; }
input:not([type]), input[type=email] { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; min-height: 42px; width: 100%; color: var(--text); font-size: 16px; }
body.booting .app { visibility: hidden; }
.fb-login { display: flex; flex-direction: column; place-items: initial; padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom); }
.fb-top { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; } .fb-mini { display: flex; align-items: center; gap: 8px; font-weight: 700; } .fb-mini em { color: var(--accent); font-style: normal; }
.fb-lang { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 6px 0 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); font-size: 13px; }
.fb-lang select { border: 0; background: transparent; min-height: 0; padding: 0 4px; font-size: 13px; color: var(--text); }
.fb-wrap { flex: 1; display: grid; place-items: center; padding: 8px 16px 16px; gap: 40px; }
.fb-side { display: none; } .fb-card { width: min(420px, 100%); animation: fbIn .35s cubic-bezier(.22,1,.36,1) both; }
.fb-foot { display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; padding: 10px 16px 14px; font-size: 12.5px; color: var(--muted); }
@keyframes fbIn { from { opacity: 0; transform: translate3d(0, 14px, 0); } to { opacity: 1; transform: none; } }
@media (min-width: 900px) { .fb-wrap { grid-template-columns: 1fr minmax(360px, 440px); max-width: 1080px; margin: 0 auto; width: 100%; } .fb-side { display: block; } .fb-side h2 { font: 700 44px/1.05 var(--font); margin: 18px 0 8px; } .fb-side h2 b { color: var(--accent); } .fb-side p { color: var(--muted); font-size: 18px; } .fb-side ul { padding-left: 18px; color: var(--muted); line-height: 1.9; } .fb-card .fb-hero svg { display: none; } }
@media (max-height: 640px) { .fb-hero svg { width: 44px; height: 44px; } .fb-card { padding: 18px 16px 14px; } }
.fb-acc { background: var(--card); border-radius: 14px; padding: 6px 10px 10px; margin-bottom: 8px; } .fb-acc-btns { display: grid; gap: 6px; } .fb-acc .danger { color: #ff6b6b; } .fb-av { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--card2); font-weight: 700; }
.fb-menu { left: 8px; right: auto; min-width: min(260px, calc(100vw - 16px)); }
.home-top .fb-user { margin-left: 6px; } .home-acc { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 12px; border-radius: 16px; background: var(--card); margin-top: 4px; } .home-acc .ha-me { display: flex; flex-direction: column; min-width: 0; } .home-acc .ha-me small { word-break: break-all; } .home-acc .danger { color: #ff6b6b; } .home-acc.flash { box-shadow: 0 0 0 2px var(--accent); }
.home-in { padding: max(12px, env(safe-area-inset-top)) clamp(12px, 3vw, 28px) calc(28px + env(safe-area-inset-bottom)); }
@media (max-width: 520px) { .home-bar input { min-width: 0; flex: 1 1 100%; order: 9; } .newpre { grid-template-columns: repeat(2, 1fr); } .hcard { padding: 14px; } .hsheet { align-items: end; padding: 0; } .hcard { border-radius: 18px 18px 0 0; width: 100%; padding-bottom: calc(16px + env(safe-area-inset-bottom)); } }
.hsheet .hcard, .modal-card, .sheet, .menu, .dd, .fb-menu { animation-timing-function: cubic-bezier(.22,1,.36,1) !important; will-change: transform, opacity; }
.viewbar { margin: 4px 8px 0; min-height: 40px; }

/* v5.4 render animation */
.rfx{position:fixed;inset:0;z-index:9999;display:grid;place-items:center;background:rgba(6,8,18,.82);backdrop-filter:blur(14px);animation:rfxIn .35s ease}
.rfx-aur{position:absolute;inset:-20%;background:conic-gradient(from calc(var(--p,0)*360deg),#7c5cff33,#00c2ff2a,#34f5a522,#7c5cff33);filter:blur(80px);animation:rfxSpin 14s linear infinite}
.rfx-pt{position:absolute;inset:0;pointer-events:none}
.rfx-card{position:relative;width:min(420px,92vw);padding:26px 22px 18px;border-radius:24px;background:linear-gradient(160deg,#171a2bcc,#0d0f1bcc);border:1px solid #ffffff1f;box-shadow:0 30px 80px #000a,inset 0 1px #ffffff14;text-align:center;color:#fff}
.rfx-ring{position:relative;width:210px;height:210px;margin:0 auto 6px}.rfx-ring svg{width:100%;height:100%;transform:rotate(0)}
.rfx-trk{fill:none;stroke:#ffffff12;stroke-width:10}.rfx-arc,.rfx-glow{fill:none;stroke:url(#rfxg);stroke-width:10;stroke-linecap:round;transform:rotate(-90deg);transform-origin:100px 100px}.rfx-glow{stroke-width:16;opacity:.55}
.rfx-head{fill:#fff;filter:drop-shadow(0 0 8px #00c2ff) drop-shadow(0 0 16px #7c5cff)}
.rfx-mid{position:absolute;inset:34px;display:grid;place-items:center;border-radius:50%;overflow:hidden;background:radial-gradient(#11152a,#06070f)}
.rfx-prev{position:absolute;width:100%;height:100%;object-fit:cover;opacity:0;transition:opacity .6s;filter:saturate(1.1) brightness(.75)}.rfx-prev.on{opacity:.9}
.rfx-pc{position:relative;font:800 38px/1 Inter,system-ui;letter-spacing:-1px;text-shadow:0 2px 18px #000}
.rfx-card h3{margin:8px 0 10px;font-size:18px}
.rfx-st{display:flex;gap:6px;justify-content:center;flex-wrap:wrap;margin-bottom:10px}.rfx-st span{font-size:11.5px;padding:5px 9px;border-radius:99px;background:#ffffff0d;color:#ffffff80;display:flex;align-items:center;gap:6px;transition:.3s}
.rfx-st i{width:7px;height:7px;border-radius:50%;background:#ffffff40}.rfx-st .on{color:#fff;background:#7c5cff33}.rfx-st .on i{background:#00c2ff;box-shadow:0 0 0 0 #00c2ff;animation:rfxPulse 1.2s infinite}.rfx-st .ok{color:#34f5a5}.rfx-st .ok i{background:#34f5a5}
.rfx-info{font-size:13px;color:#ffffffc0;min-height:36px}.rfx-bar{height:4px;border-radius:4px;background:#ffffff14;overflow:hidden;margin:10px 0 14px}.rfx-bar i{display:block;height:100%;background:linear-gradient(90deg,#7c5cff,#00c2ff,#34f5a5);background-size:200% 100%;animation:rfxShim 1.6s linear infinite}
.rfx-btns{display:flex;gap:8px;justify-content:center}
.rfx.mini{inset:auto 12px 12px auto;background:none;backdrop-filter:none}.rfx.mini .rfx-aur,.rfx.mini .rfx-pt,.rfx.mini .rfx-st,.rfx.mini .rfx-info,.rfx.mini .rfx-btns,.rfx.mini h3{display:none}.rfx.mini .rfx-card{width:auto;padding:8px;border-radius:50%}.rfx.mini .rfx-ring{width:86px;height:86px;margin:0}.rfx.mini .rfx-mid{inset:14px}.rfx.mini .rfx-pc{font-size:16px}.rfx.mini .rfx-bar{display:none}
.rfx.done .rfx-head{opacity:0}.rfx.done .rfx-pc{color:#34f5a5;animation:rfxPop .5s cubic-bezier(.2,1.6,.4,1)}.rfx.err .rfx-arc{stroke:#ff4d6d}
.rfx-cf{position:absolute;left:50%;top:50%;width:7px;height:7px;border-radius:2px;animation:rfxBurst .9s cubic-bezier(.1,.8,.3,1) forwards}
@keyframes rfxIn{from{opacity:0;transform:scale(1.03)}}@keyframes rfxSpin{to{transform:rotate(360deg)}}@keyframes rfxShim{to{background-position:-200% 0}}
@keyframes rfxPulse{70%{box-shadow:0 0 0 7px #00c2ff00}}@keyframes rfxPop{from{transform:scale(.6)}}
@keyframes rfxBurst{to{transform:rotate(var(--a)) translateX(var(--d)) rotate(200deg);opacity:0}}
@media (prefers-reduced-motion:reduce){.rfx-aur,.rfx-bar i,.rfx-cf{animation:none}}
/* ===== v5.5 rig: camera layer, nulls, groups, Layers panel, element editing ===== */
.selbox.sub { border-color: #21d4fd; border-style: dashed; } .selbox.sub .hd { border-color: #21d4fd; } .selbox.sub .rot, .selbox.sub .rot::before { background: #21d4fd; }
.selbox.cam { border-color: #ff4d6d; border-style: dashed; } .selbox.cam .hd { border-color: #ff4d6d; } .selbox.cam .rot, .selbox.cam .rot::before { background: #ff4d6d; }
.selbox.grp { border-color: #a78bfa; } .selbox.grp .hd { border-color: #a78bfa; } .selbox.grp .rot, .selbox.grp .rot::before { background: #a78bfa; }
.rigbar { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); z-index: 8; display: flex; align-items: center; gap: 6px; padding: 6px 8px 6px 12px; border-radius: 999px; background: rgba(20,20,24,.86); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border: 1px solid rgba(255,255,255,.12); box-shadow: 0 8px 24px rgba(0,0,0,.45); font-size: 13px; white-space: nowrap; animation: rigIn .18s ease-out; }
.rigbar[hidden] { display: none; }
.rigbar button { min-height: 32px; padding: 0 12px; border-radius: 999px; border: 0; background: rgba(255,255,255,.1); color: inherit; font: inherit; cursor: pointer; }
.rigbar button[data-rb=group] { background: var(--accent); color: var(--on-accent); font-weight: 600; } .rigbar button:disabled { opacity: .45; }
@keyframes rigIn { from { opacity: 0; transform: translate(-50%, 6px); } }
.rigtools { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 2px; } .rigtools button { flex: 1 1 auto; min-height: 38px; } .rigtools button:disabled { opacity: .45; }
.riglist { display: flex; flex-direction: column; gap: 2px; margin-top: 4px; }
.rigrow { display: flex; align-items: center; gap: 6px; min-height: 46px; padding-right: 4px; border-radius: 10px; border: 1px solid transparent; }
.rigrow.on { background: color-mix(in oklch, var(--accent) 16%, transparent); border-color: color-mix(in oklch, var(--accent) 45%, transparent); }
.rigrow.dim { opacity: .5; }
.rigck { width: 30px; display: grid; place-items: center; flex: none; } .rigck input { width: 18px; height: 18px; accent-color: var(--accent); }
.rigname { flex: 1; min-width: 0; text-align: left; background: none; border: 0; color: inherit; padding: 6px 2px; cursor: pointer; font: inherit; }
.rigname b { display: block; font-weight: 600; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rigname small { display: block; color: var(--mute, #9a9aa3); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rigic { width: 38px; height: 38px; flex: none; border-radius: 10px; border: 0; background: rgba(255,255,255,.06); color: inherit; cursor: pointer; font-size: 15px; }
.rigsub { margin: 8px 0 10px; padding: 10px; border-radius: 12px; border: 1px dashed #21d4fd; background: rgba(33,212,253,.07); }
.rigsub-h { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; } .rigsub-h b { font-size: 14px; } .rigsub-h small { flex: 1; color: var(--mute, #9a9aa3); } 
.rigtip { margin: 6px 0 8px; }
.clip.cam { background: linear-gradient(90deg, #6b1a2a, #8a2238) !important; } .clip.nul { background: linear-gradient(90deg, #3b2a63, #4b3680) !important; }
@media (pointer: coarse) { .rigrow { min-height: 52px; } .rigic { width: 44px; height: 44px; } .rigbar button { min-height: 38px; } }
@media (prefers-reduced-motion: reduce) { .rigbar { animation: none; } }

/* v5.6 crash guard: recovery card (boot watchdog / editor failed to load) */
.fb-recover { position: fixed; inset: 0; z-index: 2000; display: grid; place-items: center; padding: 20px; background: rgba(0,0,0,.55); backdrop-filter: blur(6px); }
.fb-recover-card { width: min(420px, 100%); background: var(--card, #2a2a2d); color: var(--text, #f2f2f3); border: 1px solid var(--line, #3a3a3e); border-radius: 18px; padding: 20px; font: 15px/1.5 var(--font, Inter, system-ui, sans-serif); box-shadow: 0 24px 60px rgba(0,0,0,.4); }
.fb-recover-card p { color: var(--muted, #a1a1a8); margin: 8px 0 12px; } .fb-recover-card small { display: block; color: #ff8a8a; margin-bottom: 12px; overflow-wrap: anywhere; }
.fb-recover-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; } .fb-recover-btns button { min-height: 46px; border-radius: 12px; border: 1px solid var(--line, #3a3a3e); background: var(--bg2, #232326); color: inherit; font: 600 15px var(--font, Inter); cursor: pointer; } .fb-recover-btns button:last-child { background: var(--accent, #ff9933); color: #1a1006; border: 0; }

/* v5.7 */
.ctx { overscroll-behavior: contain; touch-action: pan-y; -webkit-overflow-scrolling: touch; }
.rfx.lite .rfx-aur, .rfx.lite .rfx-pt, .rfx.lite .rfx-glow { display: none !important; animation: none !important; }
.home-safe { margin: 12px 0; padding: 12px; border: 1px solid var(--line, #333); border-radius: 14px; display: grid; gap: 6px; }
.home-safe .row { display: flex; gap: 8px; flex-wrap: wrap; }
.fb-repair { position: fixed; inset: 0; z-index: 999; display: grid; place-items: center; background: rgba(0,0,0,.6); }
.fb-repair-c { background: #1c1c1e; border-radius: 16px; padding: 18px; max-width: 360px; display: grid; gap: 8px; }
@media (max-width: 860px) {
  #quickbar, #noteBtn, #pqSel { display: none !important; }
  #selbar:not([hidden]) { order: 99; }
}

/* v5.8 */
.rfx2 { position: fixed; inset: 0; z-index: 1500; display: grid; place-items: center; background: rgba(0,0,0,.6); }
.rfx2-c { width: min(360px, 92vw); background: var(--bg2, #232326); border: 1px solid var(--line, #3a3a3e); border-radius: 16px; padding: 18px; display: grid; gap: 10px; text-align: center; }
.rfx2-pc { font: 700 34px var(--font, Inter, sans-serif); }
.rfx2-bar { height: 8px; border-radius: 8px; background: rgba(255,255,255,.08); overflow: hidden; } .rfx2-bar i { display: block; height: 100%; width: 0; background: var(--accent, #ff9933); }
.rfx2-i { font-size: 13px; color: var(--muted, #a1a1a8); min-height: 18px; }
.rfx2-b { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.rfx2.mini { inset: auto 10px 90px auto; background: none; } .rfx2.mini .rfx2-c { width: 170px; padding: 10px; } .rfx2.mini .rfx2-pc { font-size: 18px; } .rfx2.mini .rfx2-t, .rfx2.mini .rfx2-i, .rfx2.mini .rfx2-b { display: none; }
.mlhub { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0 0 12px; }
.mlhub button { min-height: 46px; border-radius: 12px; border: 1px solid var(--line, #3a3a3e); background: linear-gradient(135deg, color-mix(in oklch, var(--accent) 18%, var(--bg2)), var(--bg2)); color: inherit; font: 600 14px var(--font, Inter); cursor: pointer; }
@media (max-width: 860px) {
  #viewbar, #aiMic { display: none !important; }
  #panelBody > p.hint:not([id]) { display: none; }
  .mdock { display: flex; align-items: center; gap: 6px; padding: 4px 8px; background: var(--bg2); border-top: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
  .mdock::-webkit-scrollbar { display: none; }
  .mdock .selbar { margin: 0; border: 0; flex: 1 1 auto; padding: 2px 0; }
  .mdock .vtools { position: static; opacity: 1; flex: none; margin-left: auto; background: none; }
  .mtabs { display: grid !important; grid-template-columns: repeat(7, 1fr); gap: 2px; overflow: visible; padding: 4px 2px calc(4px + env(safe-area-inset-bottom)); }
  .mtabs .div { display: none; }
  .mtabs button { min-width: 0; gap: 2px; padding: 3px 0; font-size: 10px; }
  .mtabs button svg.i { width: 20px; height: 20px; }
  .mtabs button span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
}

/* v5.9: overlapping items stack in extra rows; the timeline scrolls up / down when a lane grows */
.tl-body.multirow { overflow-y: auto; align-items: flex-start; overscroll-behavior: contain; }
.tl-body.multirow .tl-labels, .tl-body.multirow .tl-scroll { min-height: 100%; }
.tl-body.multirow .tl-scroll { touch-action: pan-x pan-y; }
.track.multirow { background-image: repeating-linear-gradient(to bottom, transparent 0 calc(var(--rh, 36px) - 1px), color-mix(in oklch, var(--line) 35%, transparent) calc(var(--rh, 36px) - 1px) var(--rh, 36px)); background-position: 0 4px; }
.lab { transition: height .15s; }
/* v5.9 delete buttons */
.mhead { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; } .mhead h3 { margin: 0; } .mhead .sp, .mselbar .sp { flex: 1; }
.mselbar { display: flex; align-items: center; gap: 6px; padding: 8px; margin-bottom: 8px; border-radius: 10px; background: color-mix(in oklch, var(--rose) 14%, var(--card)); position: sticky; top: 0; z-index: 3; }
button.danger, .ghost.danger { color: #ff8b9b; } .primary.danger { background: #e5484d; color: #fff; } .primary.danger:disabled { opacity: .45; }
.mitem .ac .mdel { color: #ff8b9b; } .mitem .ac { flex-wrap: wrap; }
.mitem.picking { cursor: pointer; } .mitem.picking .ac { display: none; }
.mitem.picked { outline: 2px solid #e5484d; outline-offset: -2px; }
.mcheck { position: absolute; top: 6px; left: 6px; width: 24px; height: 24px; border-radius: 50%; border: 2px solid #fff; background: rgba(0,0,0,.45); display: grid; place-items: center; font-weight: 800; color: #fff; z-index: 2; }
.mitem.picked .mcheck { background: #e5484d; border-color: #e5484d; }
.dm-row .danger:disabled { opacity: .35; }
.lrow .lrdel { color: #ff8b9b; }
.home-top .hmcp { margin-right: 6px; }
body.at-home .modal { z-index: 1000; } /* v5.9: AI link sheet shows above the Home page */
/* v5.9.1: Home logo no longer overlaps the name / buttons; announcement moves to the bottom on Home */
.home-top .brand { flex: 0 1 auto; min-width: 0; gap: 10px; margin-right: 8px; }
.home-top .mark.fbm, .fb-mini .fb-logo { display: inline-grid; place-items: center; width: 32px; height: 32px; flex: none; overflow: visible; }
.home-top .mark.fbm svg { width: 30px; height: 30px; display: block; }
.home-top .brand .word { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 32px; }
.home-main { display: contents; }
body.at-home .fb-ann { top: auto; bottom: calc(env(safe-area-inset-bottom) + 16px); }
/* v5.9.1: delete button on timeline items (selected item always, any item on mouse hover) */

/* ===== v6.0 ===== */
/* A1 / lane labels never leak over the panels or the bottom bar any more: the timeline clips its own content, the
   labels scroll together with the lanes, and the phone bars sit above the timeline layer. */
.timeline { overflow: hidden; }
.tl-body { overflow-y: auto; overflow-x: hidden; align-items: flex-start; overscroll-behavior: contain; position: relative; }
.tl-body .tl-labels, .tl-body .tl-scroll { min-height: 100%; }
.tl-labels { position: relative; z-index: 2; background: var(--bg2); padding-bottom: 72px; box-sizing: content-box; }
.tl-inner { padding-bottom: 72px; box-sizing: content-box; height: auto; min-height: calc(100% - 72px); }
.mtabs, .mctx { position: relative; z-index: 12; }
@media (max-width: 860px) {
  body:has(#leftPanel.open) .timeline .tl-body, body:has(#inspector.open) .timeline .tl-body { visibility: hidden; }
  .timeline { min-height: 190px; }
}
/* lane labels: drag up / down to reorder */
.tl-labels .lab:not(.ruler-lab) { cursor: grab; touch-action: none; user-select: none; position: relative; }
.tl-labels .lab.dragging { z-index: 5; background: var(--card); box-shadow: 0 6px 18px rgba(0,0,0,.45); border-radius: 8px; opacity: .95; cursor: grabbing; }
.tl-labels .lab.drop-before { box-shadow: 0 -2px 0 var(--accent) inset, 0 -2px 0 var(--accent); }
.track.drop-target { background: color-mix(in oklch, var(--accent) 16%, transparent); outline: 2px dashed var(--accent); outline-offset: -2px; }
/* long-press menu = bottom sheet on phones (never runs off screen), sub-menus instead of one endless list */
.ctx-scrim { position: fixed; inset: 0; z-index: 79; background: rgba(0,0,0,.35); }
.ctx.sheet { left: 8px !important; right: 8px; top: auto !important; bottom: calc(8px + env(safe-area-inset-bottom)); min-width: 0; max-height: 58dvh; border-radius: 18px; padding: 4px 6px 8px; display: flex; flex-direction: column; transform-origin: bottom; }
.ctx .ctx-list { display: grid; overflow: auto; overscroll-behavior: contain; min-height: 0; }
.ctx.sheet .ctx-list { grid-template-columns: 1fr 1fr; gap: 2px; }
.ctx.sheet .ctx-list hr { grid-column: 1 / -1; }
.ctx.sheet button { font-size: 14px; padding: 11px 10px; min-height: 44px; }
.ctx-head { display: flex; align-items: center; gap: 8px; padding: 4px 6px 6px; min-height: 26px; }
.ctx-head b { font-size: 13px; color: var(--muted); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ctx-grip { width: 38px; height: 4px; border-radius: 4px; background: #555; margin: 2px auto 0; position: absolute; left: 50%; transform: translateX(-50%); top: 5px; }
.ctx.sheet .ctx-head { padding-top: 14px; }
.ctx-back { width: 34px; height: 34px; border-radius: 10px; background: rgba(255,255,255,.08); font-size: 20px; display: grid; place-items: center; padding: 0 !important; justify-content: center !important; }
.ctx button.has-sub kbd { font-size: 16px; opacity: .7; }
/* item bar: Delete is always the first button */
.selbar .sb.del { color: #ff8b9b; }
.selbar .sb.del:hover { background: color-mix(in oklch, var(--rose, #ff4d6d) 18%, transparent); }
@media (max-width: 860px) { .cliptools #delBtn { order: -1; } }
