/* ReelForge Studio: the editor workspace. Tokens first; dark mode follows the system unless the user picks. */
:root {
  --bg: #F2F1F7; --canvas: #E9E7F2; --dot: rgba(27, 20, 70, .11);
  --panel: #FFFFFF; --panel-2: #F7F6FB; --panel-3: #EFEDF6;
  --line: #E6E3EF; --line-2: #D6D2E4;
  --ink: #1B1446; --ink-2: #4D4770; --ink-3: #7E78A0;
  --sel: #2E3BFF; --sel-soft: rgba(46, 59, 255, .1); --sel-ink: #FFFFFF;
  --pink: #D4136F; --pink-soft: rgba(212, 19, 111, .12); --yellow: #FFC21A; --gold: #FFE14D;
  --ok: #00795B; --ok-bg: #E2F4ED; --warn: #8F5500; --warn-bg: #FFF1D2; --bad: #B3202A;
  --shadow: 0 1px 2px rgba(27, 20, 70, .06), 0 8px 24px -12px rgba(27, 20, 70, .22);
  --shadow-lg: 0 30px 80px -24px rgba(27, 20, 70, .45);
  --r: 8px; --r-lg: 14px; --glow: rgba(255, 255, 255, .85);
  --ui: Onest, Vazirmatn, system-ui, -apple-system, 'Segoe UI', sans-serif; --disp: Anybody, 'Arial Narrow', system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0E0D14; --canvas: #14131C; --dot: rgba(255, 255, 255, .07);
    --panel: #1A1824; --panel-2: #22202E; --panel-3: #2A2838;
    --line: #2B2939; --line-2: #3A374C;
    --ink: #F1EFFA; --ink-2: #BAB5D1; --ink-3: #8A84A6;
    --sel: #7D86FF; --sel-soft: rgba(125, 134, 255, .16); --sel-ink: #0E0D14;
    --pink: #FF5AA5; --pink-soft: rgba(255, 90, 165, .16);
    --ok: #4FD6A8; --ok-bg: rgba(79, 214, 168, .12); --warn: #FFC75A; --warn-bg: rgba(255, 199, 90, .12); --bad: #FF7A80;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px -12px rgba(0, 0, 0, .7); --shadow-lg: 0 30px 80px -24px rgba(0, 0, 0, .8);
    --glow: rgba(125, 134, 255, .1);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --glow: rgba(125, 134, 255, .1);
  --bg: #0E0D14; --canvas: #14131C; --dot: rgba(255, 255, 255, .07);
  --panel: #1A1824; --panel-2: #22202E; --panel-3: #2A2838;
  --line: #2B2939; --line-2: #3A374C;
  --ink: #F1EFFA; --ink-2: #BAB5D1; --ink-3: #8A84A6;
  --sel: #7D86FF; --sel-soft: rgba(125, 134, 255, .16); --sel-ink: #0E0D14;
  --pink: #FF5AA5; --pink-soft: rgba(255, 90, 165, .16);
  --ok: #4FD6A8; --ok-bg: rgba(79, 214, 168, .12); --warn: #FFC75A; --warn-bg: rgba(255, 199, 90, .12); --bad: #FF7A80;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px -12px rgba(0, 0, 0, .7); --shadow-lg: 0 30px 80px -24px rgba(0, 0, 0, .8);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body.rs { margin: 0; background: var(--bg); color: var(--ink); font: 400 13px/1.45 var(--ui); -webkit-font-smoothing: antialiased; overflow: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .45; }
:focus-visible { outline: 2px solid var(--sel); outline-offset: 2px; }
svg { display: block; }
a { color: inherit; }

/* ---------- shell ---------- */
.rs-app { display: grid; grid-template-rows: 48px minmax(0, 1fr); height: 100vh; height: 100dvh; }
.rs-top { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 0 10px 0 12px; background: var(--panel); border-bottom: 1px solid var(--line); position: relative; z-index: 5; }
.rs-logo { display: flex; align-items: center; gap: 9px; text-decoration: none; flex: none; }
.rs-logo svg { width: 28px; height: 28px; }
.rs-logo-t { display: flex; align-items: baseline; gap: 5px; }
.rs-logo-t b { font: 800 15px/1 var(--disp); font-stretch: 112%; letter-spacing: -.01em; }
.rs-logo-t i { font: italic 400 15px/1 'Instrument Serif', serif; color: var(--pink); }
.rs-crumb { display: flex; align-items: center; gap: 6px; min-width: 0; flex: 1 1 auto; margin-left: 6px; }
.rs-link { border: 0; background: none; padding: 4px 6px; border-radius: 6px; color: var(--ink-2); font-weight: 600; }
.rs-link:hover { background: var(--panel-2); color: var(--ink); }
.rs-slash { color: var(--line-2); }
.rs-name { min-width: 60px; max-width: 280px; width: 22ch; border: 1px solid transparent; background: none; border-radius: 6px; padding: 4px 6px; font-weight: 700; text-overflow: ellipsis; }
.rs-name:hover { border-color: var(--line); }
.rs-name:focus { border-color: var(--sel); background: var(--panel); outline: none; }
.rs-saved { color: var(--ink-3); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rs-app[data-view="home"] .rs-crumb .rs-slash, .rs-app[data-view="home"] .rs-name, .rs-app[data-view="home"] .rs-saved, .rs-app[data-view="home"] .rs-top-tools { display: none; }
.rs-app[data-view="home"] #homeBtn { pointer-events: none; color: var(--ink); }
.rs-app[data-view="home"] #exportBtn { display: none; }
.rs-top-tools { display: flex; align-items: center; gap: 4px; flex: none; }
.rs-top-right { display: flex; align-items: center; gap: 6px; flex: none; }
.rs-sep { width: 1px; height: 20px; background: var(--line); margin: 0 6px; }
.rs-ic { display: grid; place-items: center; width: 32px; height: 32px; border: 0; border-radius: 8px; background: none; color: var(--ink-2); }
.rs-ic svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.rs-ic:hover:not(:disabled) { background: var(--panel-2); color: var(--ink); }
.rs-score { display: flex; align-items: center; gap: 7px; height: 32px; padding: 0 10px 0 4px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); font-weight: 700; font-size: 12px; color: var(--ink-2); }
.rs-score:hover { border-color: var(--line-2); color: var(--ink); }
.rs-score svg { width: 24px; height: 24px; transform: rotate(-90deg); }
.rs-score b { font-variant-numeric: tabular-nums; color: var(--ink); }
.rs-ring-bg { fill: none; stroke: var(--line); stroke-width: 4; }
.rs-ring { fill: none; stroke: var(--ok); stroke-width: 4; stroke-linecap: round; stroke-dasharray: 94.25; stroke-dashoffset: 94.25; transition: stroke-dashoffset .5s cubic-bezier(.16, 1, .3, 1), stroke .3s; }
.rs-score.warn .rs-ring { stroke: var(--yellow); }
.rs-acct { display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 10px; border-radius: 8px; text-decoration: none; font-weight: 600; color: var(--ink-2); }
.rs-acct:hover { background: var(--panel-2); color: var(--ink); }
.rs-acct .av { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: linear-gradient(135deg, #2E3BFF, #D4136F); color: #fff; font-weight: 800; font-size: 12px; }

/* ---------- buttons and controls ---------- */
.rs-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 30px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); font-weight: 650; font-size: 12.5px; white-space: nowrap; text-decoration: none; }
.rs-btn:hover:not(:disabled) { border-color: var(--line-2); background: var(--panel-2); }
.rs-btn--ink { border-color: var(--ink); background: var(--ink); color: var(--panel); box-shadow: 2px 2px 0 var(--yellow); }
.rs-btn--ink:hover:not(:disabled) { background: var(--ink); border-color: var(--ink); filter: brightness(1.15); }
:root[data-theme="dark"] .rs-btn--ink { color: #0E0D14; }
.rs-btn--lg { height: 42px; padding: 0 18px; font-size: 14px; border-radius: 11px; box-shadow: 3px 3px 0 var(--yellow); }
.rs-btn--wide { width: 100%; }
.rs-btn.rs-btn--sel { border-color: var(--sel); background: var(--sel); color: var(--sel-ink); }
.rs-btn.rs-btn--sel:hover:not(:disabled) { background: var(--sel); filter: brightness(1.08); }
.rs-btn--ghost { border-color: transparent; background: none; color: var(--ink-2); }
.rs-btn--ghost:hover:not(:disabled) { background: var(--panel-2); color: var(--ink); }
.rs-btn--danger { color: var(--bad); }
.rs-chip { height: 26px; min-width: 26px; padding: 0 8px; border: 1px solid var(--line); border-radius: 7px; background: var(--panel); font-weight: 650; font-size: 12px; color: var(--ink-2); }
.rs-chip:hover { color: var(--ink); border-color: var(--line-2); }
.rs-chip--num { min-width: 52px; font-variant-numeric: tabular-nums; }
.rs-row-btns { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 12px; }

.rs-seg { display: inline-flex; padding: 2px; gap: 2px; border-radius: 8px; background: var(--panel-3); }
.rs-seg button { flex: 1 1 auto; height: 26px; padding: 0 9px; border: 0; border-radius: 6px; background: none; color: var(--ink-2); font-weight: 600; font-size: 12px; white-space: nowrap; }
.rs-seg button:hover { color: var(--ink); }
.rs-seg button.on { background: var(--panel); color: var(--ink); box-shadow: 0 1px 2px rgba(27, 20, 70, .14); }
.rs-seg--sm button { height: 24px; padding: 0 8px; font-size: 11.5px; }
.rs-seg--full { display: flex; width: 100%; }

.rs-field { display: flex; align-items: center; gap: 0; height: 28px; border: 1px solid transparent; border-radius: 7px; background: var(--panel-2); min-width: 0; }
.rs-field:hover { border-color: var(--line); }
.rs-field:focus-within { border-color: var(--sel); background: var(--panel); }
.rs-field > span { flex: none; padding: 0 4px 0 8px; color: var(--ink-3); font-size: 11.5px; font-weight: 600; cursor: ew-resize; user-select: none; min-width: 22px; }
.rs-field input { flex: 1 1 auto; width: 100%; min-width: 0; height: 26px; border: 0; background: none; padding: 0 8px 0 2px; font-variant-numeric: tabular-nums; font-size: 12.5px; outline: none; }
.rs-field i { flex: none; padding-right: 8px; color: var(--ink-3); font-style: normal; font-size: 11.5px; }
.rs-input { width: 100%; height: 30px; border: 1px solid var(--line); border-radius: 7px; background: var(--panel-2); padding: 0 9px; font-size: 12.5px; }
.rs-input:focus { border-color: var(--sel); background: var(--panel); outline: none; }
select.rs-input { padding-right: 4px; }
.rs-color { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.rs-sw { width: 22px; height: 22px; padding: 0; border: 0; border-radius: 6px; background: var(--c); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .14); }
.rs-sw.on { box-shadow: 0 0 0 2px var(--panel), 0 0 0 4px var(--sel); }
.rs-hex { width: 88px; }
.rs-hex input[type="color"] { width: 20px; height: 20px; margin-left: 4px; padding: 0; border: 0; border-radius: 5px; background: none; cursor: pointer; }
.rs-tog { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; }
.rs-tog input { appearance: none; flex: none; width: 30px; height: 18px; margin: 1px 0 0; border-radius: 999px; background: var(--line-2); position: relative; transition: background .2s; cursor: pointer; }
.rs-tog input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .3); transition: transform .2s cubic-bezier(.16, 1, .3, 1); }
.rs-tog input:checked { background: var(--sel); }
.rs-tog input:checked::after { transform: translateX(12px); }
.rs-tog b { display: block; font-weight: 650; font-size: 12.5px; }
.rs-tog small { display: block; color: var(--ink-3); font-size: 11.5px; line-height: 1.4; margin-top: 1px; }

/* ---------- side panels and tabs ---------- */
.rs-side, .rs-sheet { display: flex; flex-direction: column; min-height: 0; min-width: 0; background: var(--panel); }
.rs-side--l { border-right: 1px solid var(--line); }
.rs-side--r { border-left: 1px solid var(--line); }
.rs-tabs { display: flex; flex: none; gap: 2px; padding: 0 8px; height: 40px; align-items: stretch; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.rs-tabs::-webkit-scrollbar { display: none; }
.rs-tab { position: relative; border: 0; background: none; padding: 0 9px; color: var(--ink-3); font-weight: 650; font-size: 12.5px; white-space: nowrap; }
.rs-tab:hover { color: var(--ink); }
.rs-tab[aria-selected="true"] { color: var(--ink); }
.rs-tab[aria-selected="true"]::after { content: ""; position: absolute; left: 9px; right: 9px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--ink); }
.rs-tab .dot { display: inline-block; width: 6px; height: 6px; margin-left: 5px; border-radius: 50%; background: var(--yellow); vertical-align: 2px; }
.rs-panes-host { flex: 1 1 auto; min-height: 0; position: relative; }
.rs-pane { position: absolute; inset: 0; overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.rs-panes .rs-pane { position: static; }
.rs-sec { padding: 12px 14px 14px; border-bottom: 1px solid var(--line); }
.rs-sec:last-child { border-bottom: 0; }
.rs-sec-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 0 10px; font-weight: 700; font-size: 12px; }
.rs-sec-h small { font-weight: 500; color: var(--ink-3); font-size: 11.5px; }
.rs-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.rs-grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.rs-row { display: grid; grid-template-columns: 84px minmax(0, 1fr); align-items: center; gap: 8px; margin-top: 8px; }
.rs-row:first-child { margin-top: 0; }
.rs-row > label, .rs-row > .lbl { color: var(--ink-3); font-size: 11.5px; font-weight: 600; }
.rs-note { margin: 8px 0 0; color: var(--ink-3); font-size: 11.5px; line-height: 1.45; }
.rs-note b { color: var(--ink-2); }
.rs-say { margin: 8px 0 0; font-size: 12px; color: var(--ink-2); }
.rs-say.ok { color: var(--ok); }
.rs-say.warn { color: var(--warn); }

/* the selection header at the top of Design */
.rs-selh { display: flex; align-items: center; gap: 9px; padding: 11px 14px; border-bottom: 1px solid var(--line); }
.rs-selh .ico { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 7px; background: var(--sel-soft); color: var(--sel); }
.rs-selh .ico svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.rs-selh b { flex: 1; font-size: 13px; }
.rs-selh .rs-ic { width: 28px; height: 28px; }

/* style presets */
.rs-presets { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.rs-pre { padding: 0; border: 0; border-radius: 8px; background: none; transition: transform .15s cubic-bezier(.16, 1, .3, 1); }
.rs-pre img { display: block; width: 100%; aspect-ratio: 8 / 5; height: auto; border-radius: 8px; background: #1B1446; box-shadow: 0 0 0 1px rgba(27, 20, 70, .2); transition: box-shadow .15s; }
.rs-pre:hover { transform: translateY(-1px); }
.rs-pre:hover img { box-shadow: 0 0 0 1px var(--line-2), var(--shadow); }
.rs-pre[aria-pressed="true"] img { box-shadow: 0 0 0 2px var(--panel), 0 0 0 4px var(--sel); }
.rs-looks { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.rs-look { padding: 0; border: 0; background: none; color: var(--ink-2); font-size: 10.5px; font-weight: 650; text-align: center; }
.rs-look canvas { display: block; width: 100%; aspect-ratio: 3 / 4; height: auto; border-radius: 7px; background: #1B1446; box-shadow: 0 0 0 1px var(--line); }
.rs-look[aria-pressed="true"] canvas { box-shadow: 0 0 0 2px var(--panel), 0 0 0 4px var(--sel); }
.rs-look[aria-pressed="true"] { color: var(--ink); }
.rs-look span { display: block; margin-top: 4px; }
.rs-dl { display: grid; grid-template-columns: 70px 1fr; gap: 6px 10px; margin: 0; font-size: 11.5px; }
.rs-dl dt { color: var(--ink-3); font-weight: 600; }
.rs-dl dd { margin: 0; color: var(--ink-2); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.rs-music { display: flex; align-items: baseline; gap: 8px; padding: 8px 10px; border-radius: 9px; background: var(--panel-2); }
.rs-music b { flex: 1; font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rs-music small { color: var(--ink-3); font-variant-numeric: tabular-nums; }
.rs-tour-ring { position: fixed; z-index: 60; border-radius: 12px; box-shadow: 0 0 0 9999px rgba(14, 12, 30, .45), 0 0 0 3px var(--yellow); pointer-events: none; transition: all .35s cubic-bezier(.16, 1, .3, 1); }
.rs-tour { position: fixed; z-index: 61; width: 300px; padding: 16px 16px 12px; border-radius: 14px; background: var(--panel); color: var(--ink); box-shadow: var(--shadow-lg); animation: rsIn .3s cubic-bezier(.16, 1, .3, 1); }
.rs-tour small { color: var(--ink-3); font-weight: 700; font-size: 11px; letter-spacing: .04em; }
.rs-tour b { display: block; margin-top: 4px; font: 800 16px/1.2 var(--disp); font-stretch: 106%; }
.rs-tour p { margin: 6px 0 0; color: var(--ink-2); font-size: 12.5px; line-height: 1.5; }
@keyframes rsIn { from { opacity: 0; transform: translateY(6px); } }

/* hook ideas and my styles */
.rs-ideas { display: grid; gap: 6px; }
.rs-idea { display: flex; align-items: flex-start; gap: 8px; width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel); text-align: left; font-size: 12.5px; font-weight: 600; line-height: 1.35; }
.rs-idea span { flex: 1; }
.rs-idea small { flex: none; color: var(--ink-3); font-weight: 600; font-size: 11px; font-variant-numeric: tabular-nums; padding-top: 1px; }
.rs-idea:hover { border-color: var(--line-2); background: var(--panel-2); }
.rs-idea[aria-pressed="true"] { border-color: var(--sel); background: var(--sel-soft); }
.rs-mine { display: grid; gap: 4px; }
.rs-my-row { display: flex; align-items: center; gap: 2px; }
.rs-my { flex: 1; display: flex; align-items: center; gap: 8px; min-width: 0; height: 32px; padding: 0 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); text-align: left; font-size: 12px; font-weight: 600; }
.rs-my:hover { border-color: var(--line-2); background: var(--panel-2); }
.rs-my i { flex: none; width: 16px; height: 16px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .15); }
.rs-my span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rs-my-row .rs-ic { width: 28px; height: 28px; }

/* ---------- transcript ---------- */
.rs-wtools { position: sticky; top: 0; z-index: 2; display: flex; flex-wrap: wrap; gap: 4px; padding: 8px 10px; background: var(--panel); border-bottom: 1px solid var(--line); }
.rs-wtools .rs-chip[aria-pressed="true"] { background: var(--sel-soft); border-color: var(--sel); color: var(--sel); }
.rs-wtools .grow { flex: 1; }
.rs-chip-ic { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; vertical-align: -3px; }
.rs-find { display: grid; grid-template-columns: 1fr 1fr auto; gap: 6px; padding: 8px 10px; border-bottom: 1px solid var(--line); background: var(--panel-2); }
.rs-find .rs-input { height: 28px; }
.rs-find small { grid-column: 1 / -1; color: var(--ink-3); font-size: 11.5px; }
.rs-dis { display: flex; align-items: center; gap: 8px; margin: 10px 10px 0; padding: 8px 10px; border-radius: 9px; background: var(--warn-bg); color: var(--warn); font-size: 12px; font-weight: 600; }
.rs-dis span { flex: 1; }
.rs-words { padding: 4px 10px 40px; outline: none; }
.rs-wr { display: grid; grid-template-columns: 38px 1fr; gap: 6px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.rs-wt { color: var(--ink-3); font-size: 11px; font-variant-numeric: tabular-nums; padding-top: 3px; cursor: pointer; }
.rs-wt:hover { color: var(--sel); }
.rs-wr p { margin: 0; font-size: 14.5px; line-height: 1.75; }
.w { padding: 2px 1px; border-radius: 4px; cursor: pointer; transition: background .12s; }
.w:hover { background: var(--panel-3); }
.w.hi { color: var(--pink); font-weight: 700; }
.w.cut { color: var(--ink-3); text-decoration: line-through; text-decoration-color: var(--pink); text-decoration-thickness: 2px; opacity: .65; }
.w.df:not(.cut) { text-decoration: underline wavy; text-decoration-color: var(--yellow); text-underline-offset: 4px; }
/* where a caption starts: a hairline tick, blue where you forced the split */
.w.cs, .w.br { padding-left: 6px; background-image: linear-gradient(var(--line-2), var(--line-2)); background-size: 1.5px 1.05em; background-position: 0 55%; background-repeat: no-repeat; }
.w.br { background-image: linear-gradient(var(--sel), var(--sel)); background-size: 2px 1.15em; }
.w.cs.sel, .w.br.sel, .w.cs.now, .w.br.now { background-image: none; }
.w.now { background: var(--gold); color: #1B1446; }
.w.sel { background: var(--sel); color: var(--sel-ink); }
.w.fm { outline: 2px solid var(--yellow); }
.w.out { opacity: .32; }
.w[contenteditable="true"] { background: var(--panel); color: var(--ink); outline: 2px solid var(--sel); cursor: text; }
.w .emo { font-size: 12px; vertical-align: 6px; margin-left: 1px; }
.rs-whint { padding: 0 12px 16px; color: var(--ink-3); font-size: 11.5px; }
.rs-emopick { position: fixed; z-index: 30; width: 260px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); box-shadow: var(--shadow-lg); }
.rs-emopick p { margin: 0 0 8px; font-size: 11.5px; color: var(--ink-3); font-weight: 600; }
.rs-emogrid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; }
.rs-emogrid button { height: 28px; border: 0; border-radius: 6px; background: none; font-size: 17px; line-height: 1; }
.rs-emogrid button:hover, .rs-emogrid button.on { background: var(--panel-3); }

/* ---------- layers ---------- */
.rs-layers { list-style: none; margin: 0; padding: 6px; }
.rs-layer { display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 6px 0 8px; border-radius: 8px; cursor: pointer; }
.rs-layer:hover { background: var(--panel-2); }
.rs-layer.on { background: var(--sel-soft); }
.rs-layer .ico { width: 18px; height: 18px; color: var(--ink-3); fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.rs-layer.on .ico { color: var(--sel); }
.rs-layer b { flex: 1; font-weight: 600; font-size: 12.5px; }
.rs-layer small { color: var(--ink-3); font-size: 11px; }
.rs-layer .rs-ic { width: 26px; height: 26px; opacity: 0; }
.rs-layer:hover .rs-ic, .rs-layer .rs-ic.off { opacity: 1; }
.rs-layer.hid b, .rs-layer.hid small { opacity: .45; }

/* ---------- canvas ---------- */
.rs-center { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--canvas); }
.rs-cv { position: relative; flex: 1 1 auto; min-height: 0; overflow: hidden; background-color: var(--canvas); touch-action: none;
  background-image: radial-gradient(ellipse 60% 55% at 50% 46%, var(--glow), transparent 70%), radial-gradient(var(--dot) 1px, transparent 1.2px); background-size: 100% 100%, 16px 16px; }
.rs-cv.pan, .rs-cv.pan * { cursor: grab !important; }
.rs-cv.panning, .rs-cv.panning * { cursor: grabbing !important; }
.rs-world { position: absolute; left: 0; top: 0; transform-origin: 0 0; will-change: transform; }
.rs-flabel { position: absolute; left: 0; bottom: 100%; padding-bottom: 6px; white-space: nowrap; color: var(--ink-3); font-size: 11.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.rs-flabel b { color: var(--ink-2); }
.rs-frame { position: relative; background: #000; box-shadow: 0 0 0 1px rgba(27, 20, 70, .18), var(--shadow-lg); }
.rs-frame canvas { display: block; width: 100%; height: 100%; }
.rs-appview { position: absolute; inset: 0; pointer-events: none; }
.rs-appview svg { display: block; width: 100%; height: 100%; }
.rs-chip--app { display: inline-flex; align-items: center; gap: 6px; flex: none; }
.rs-chip--app svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.rs-chip--app[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--panel); }
.rs-chip--app:disabled { opacity: .45; }
.rs-zones { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.rs-ov { position: absolute; inset: 0; }
.rs-ov .hov { position: absolute; border: 1px solid var(--sel); pointer-events: none; }
.rs-ov .selb { position: absolute; border: 1.5px solid var(--sel); pointer-events: none; }
.rs-ov .hd { position: absolute; width: 9px; height: 9px; margin: -4.5px 0 0 -4.5px; border: 1.5px solid var(--sel); background: #fff; border-radius: 2px; pointer-events: auto; }
.rs-ov .hd[data-h="nw"], .rs-ov .hd[data-h="se"] { cursor: nwse-resize; }
.rs-ov .hd[data-h="ne"], .rs-ov .hd[data-h="sw"] { cursor: nesw-resize; }
.rs-ov .tag { position: absolute; transform: translate(-50%, 6px); padding: 2px 6px; border-radius: 4px; background: var(--sel); color: #fff; font-size: 10.5px; font-weight: 700; white-space: nowrap; pointer-events: none; font-variant-numeric: tabular-nums; }
.rs-ov .ghost { position: absolute; border: 1.5px dashed var(--sel); border-radius: 3px; pointer-events: none; opacity: .8; }
.rs-ov .gd { position: absolute; background: var(--pink); pointer-events: none; }
.rs-ov .gd.v { width: 1px; top: 0; bottom: 0; }
.rs-ov .gd.h { height: 1px; left: 0; right: 0; }
.rs-ov .gd i { position: absolute; padding: 1px 5px; border-radius: 3px; background: var(--pink); color: #fff; font-size: 10px; font-weight: 700; font-style: normal; white-space: nowrap; }
.rs-ov .gd.h i { left: 6px; top: -18px; }
.rs-ov .gd.v i { top: 6px; left: 4px; }
.rs-frame.grab { cursor: grab; }
.rs-frame.grabbing { cursor: grabbing; }
.rs-frame .movec { cursor: move; }
.rs-cvtools { position: absolute; right: 12px; bottom: 12px; display: flex; gap: 4px; padding: 3px; border-radius: 10px; background: var(--panel); box-shadow: var(--shadow); }
.rs-cvtools .rs-chip { border-color: transparent; }
.rs-busy, .rs-fail { position: absolute; inset: 0; display: grid; place-items: center; padding: 20px; background: color-mix(in srgb, var(--canvas) 70%, transparent); backdrop-filter: blur(6px); z-index: 4; }
.rs-busy-c { display: flex; flex-direction: column; align-items: center; gap: 6px; max-width: 360px; padding: 22px 26px; border-radius: 16px; background: var(--panel); box-shadow: var(--shadow-lg); text-align: center; }
.rs-busy-c b { font-size: 14px; }
.rs-busy-c span, .rs-busy-c p { color: var(--ink-3); font-size: 12px; margin: 0; }
.rs-spin { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--sel); animation: rsSpin .8s linear infinite; }
.rs-busy-bar { display: block; width: 220px; height: 4px; border-radius: 4px; background: var(--line); overflow: hidden; margin-top: 6px; }
.rs-busy-bar i { display: block; height: 100%; width: 0; background: var(--sel); transition: width .3s; }
@keyframes rsSpin { to { transform: rotate(360deg); } }

/* ---------- transport ---------- */
.rs-transport { flex: none; display: flex; align-items: center; gap: 10px; height: 46px; padding: 0 12px; background: var(--panel); border-top: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.rs-transport::-webkit-scrollbar { display: none; }
.rs-play { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: 50%; background: var(--ink); color: var(--panel); }
.rs-play svg { width: 16px; height: 16px; fill: currentColor; }
.rs-play .i-pause, .rs-play.on .i-play { display: none; }
.rs-play.on .i-pause { display: block; }
.rs-tc { flex: none; min-width: 112px; font-weight: 700; font-variant-numeric: tabular-nums; font-size: 12.5px; }
.rs-tc i { font-style: normal; font-weight: 500; color: var(--ink-3); }
.rs-transport .rs-seg { flex: none; }
#zoneSeg { margin-left: auto; }

/* ---------- timeline ---------- */
.rs-tl { position: relative; min-height: 0; background: var(--panel); border-top: 1px solid var(--line); }
.rs-tl canvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: default; }
.rs-tl-grip { position: absolute; left: 0; right: 0; top: -4px; height: 8px; cursor: ns-resize; z-index: 2; }

/* ---------- check ---------- */
.rs-chk-top { display: flex; align-items: center; gap: 14px; padding: 14px; border-bottom: 1px solid var(--line); }
.rs-chk-top svg { width: 54px; height: 54px; transform: rotate(-90deg); flex: none; }
.rs-chk-top .rs-ring-bg, .rs-chk-top .rs-ring { stroke-width: 3.4; }
.rs-chk-top b { display: block; font: 800 18px/1.1 var(--disp); font-stretch: 108%; }
.rs-chk-top span { color: var(--ink-3); font-size: 12px; }
.rs-chk-top .rs-btn { margin-left: auto; }
.rs-chks { list-style: none; margin: 0; padding: 4px 0; }
.rs-chk { padding: 10px 14px; border-bottom: 1px solid var(--line); }
.rs-chk:last-child { border-bottom: 0; }
.rs-chk-h { display: flex; align-items: center; gap: 9px; }
.rs-chk-h .st { flex: none; display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; font-size: 11px; font-weight: 900; }
.rs-chk.pass .st { background: var(--ok-bg); color: var(--ok); }
.rs-chk.warn .st { background: var(--warn-bg); color: var(--warn); }
.rs-chk-h b { flex: 1; font-size: 12.5px; }
.rs-chk-nt { display: grid; grid-template-columns: auto 1fr; gap: 2px 8px; margin: 6px 0 0 29px; font-size: 11.5px; }
.rs-chk-nt dt { color: var(--ink-3); font-weight: 600; }
.rs-chk-nt dd { margin: 0; color: var(--ink-2); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.rs-chk.warn .rs-chk-nt dd.now { color: var(--warn); font-weight: 700; }
.rs-chk p { margin: 6px 0 0 29px; color: var(--ink-3); font-size: 11.5px; line-height: 1.45; }
.rs-chk .rs-btn { margin: 8px 0 0 29px; height: 28px; }

/* ---------- home ---------- */
.rs-home { overflow: auto; outline: none; }
.rh-wrap { max-width: 1160px; margin: 0 auto; padding: 28px 24px 60px; }
.rh-new { display: grid; grid-template-columns: 1.1fr 1fr; gap: 28px; align-items: center; padding: 28px; border-radius: 22px; background: var(--panel); box-shadow: var(--shadow); }
.rh-copy h1 { margin: 0; font: 900 clamp(26px, 3.6vw, 40px)/1.02 var(--disp); font-stretch: 112%; letter-spacing: -.02em; }
.rh-copy p { margin: 12px 0 0; color: var(--ink-2); font-size: 15px; line-height: 1.55; max-width: 46ch; }
.rh-drop { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 230px; padding: 24px; border: 2px dashed var(--line-2); border-radius: 18px; background: var(--panel-2); text-align: center; transition: border-color .2s, background .2s; }
.rh-drop svg { width: 46px; height: 46px; fill: none; stroke: var(--ink-3); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; margin-bottom: 4px; }
.rh-drop b { font-size: 16px; }
.rh-drop span { color: var(--ink-3); font-size: 12.5px; margin-bottom: 10px; }
body.dropping .rh-drop { border-color: var(--sel); background: var(--sel-soft); }
.rh-sec { margin-top: 30px; }
.rh-sec h2 { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin: 0 0 12px; font: 800 18px/1.2 var(--disp); font-stretch: 108%; }
.rh-sec h2 small { font: 500 12.5px var(--ui); color: var(--ink-3); }
.rh-smps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.rh-smp { display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); text-align: left; transition: border-color .15s, transform .15s; }
.rh-smp:hover { border-color: var(--line-2); transform: translateY(-1px); }
.rh-smp img { width: 96px; height: 54px; object-fit: cover; border-radius: 9px; background: #1B1446; flex: none; }
.rh-smp b { display: block; font-size: 13.5px; }
.rh-smp small { color: var(--ink-3); font-size: 12px; }
.rh-smp.loading { opacity: .6; pointer-events: none; }
.rh-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: 16px; }
.rh-card { position: relative; border-radius: 14px; background: var(--panel); box-shadow: 0 0 0 1px var(--line); transition: box-shadow .15s, transform .15s; }
.rh-card:hover { box-shadow: 0 0 0 1px var(--line-2), var(--shadow); transform: translateY(-2px); }
.rh-open { display: block; width: 100%; padding: 0; border: 0; background: none; text-align: left; border-radius: 14px; }
.rh-thumb { display: grid; place-items: center; aspect-ratio: 4 / 5; margin: 8px 8px 0; border-radius: 9px; overflow: hidden; background: var(--canvas); }
.rh-thumb img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.rh-meta { display: block; padding: 9px 12px 12px; }
.rh-meta b { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rh-meta small { color: var(--ink-3); font-size: 11.5px; }
.rh-acts { position: absolute; top: 14px; right: 14px; display: flex; gap: 4px; opacity: 0; transition: opacity .15s; }
.rh-card:hover .rh-acts, .rh-card:focus-within .rh-acts { opacity: 1; }
.rh-acts .rs-ic { width: 28px; height: 28px; background: var(--panel); box-shadow: var(--shadow); }
.rh-empty { margin: 0; padding: 22px; border: 1px dashed var(--line-2); border-radius: 14px; color: var(--ink-3); text-align: center; }

/* ---------- dialogs ---------- */
.rs-dlg { width: min(560px, calc(100% - 24px)); max-height: calc(100dvh - 40px); padding: 0; border: 0; border-radius: 18px; background: var(--panel); color: var(--ink); box-shadow: var(--shadow-lg); }
.rs-dlg::backdrop { background: rgba(14, 12, 30, .45); backdrop-filter: blur(2px); }
.rs-dlg-h { display: flex; align-items: center; gap: 10px; padding: 16px 18px 12px; border-bottom: 1px solid var(--line); }
.rs-dlg-h h2 { flex: 1; margin: 0; font: 800 18px/1.2 var(--disp); font-stretch: 108%; }
.rs-dlg-b { padding: 14px 18px; overflow: auto; }
.rs-dlg-f { display: flex; align-items: center; gap: 8px; padding: 12px 18px 16px; border-top: 1px solid var(--line); }
.rs-dlg-f .grow { flex: 1; color: var(--ink-3); font-size: 12px; }
.rs-fmts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.rs-fmt { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 6px 10px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--panel); font-size: 12px; }
.rs-fmt i { display: block; width: calc(var(--w) * 2.4px); height: calc(var(--h) * 2.4px); border-radius: 4px; border: 2px solid currentColor; color: var(--ink-3); }
.rs-fmt b { font-size: 13px; }
.rs-fmt small { color: var(--ink-3); font-size: 11px; text-align: center; line-height: 1.3; }
.rs-fmt[aria-pressed="true"] { border-color: var(--sel); background: var(--sel-soft); }
.rs-fmt[aria-pressed="true"] i { color: var(--sel); background: color-mix(in srgb, var(--sel) 18%, transparent); }
.rs-xp-files { display: flex; flex-wrap: wrap; gap: 14px; }
.rs-check { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; font-size: 12.5px; cursor: pointer; }
.rs-check input { width: 16px; height: 16px; accent-color: var(--sel); }
.rs-xp-list { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; }
.rs-xp-it { display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; align-items: center; padding: 10px 12px; border-radius: 10px; background: var(--panel-2); font-size: 12.5px; }
.rs-xp-it b { font-weight: 650; }
.rs-xp-it small { color: var(--ink-3); }
.rs-xp-it .bar { grid-column: 1 / -1; height: 4px; border-radius: 4px; background: var(--line); overflow: hidden; }
.rs-xp-it .bar i { display: block; height: 100%; width: 0; background: var(--sel); transition: width .2s; }
.rs-xp-it.done .bar i { background: var(--ok); }
.rs-xp-it.bad { color: var(--bad); }
.rs-cmd-in { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.rs-cmd-in svg { width: 18px; height: 18px; fill: none; stroke: var(--ink-3); stroke-width: 2; stroke-linecap: round; }
.rs-cmd-in input { flex: 1; border: 0; background: none; font-size: 15px; outline: none; }
.rs-dlg--cmd { width: min(600px, calc(100% - 24px)); margin-top: 12vh; }
.rs-cmd-list { list-style: none; margin: 0; padding: 6px; max-height: min(420px, 60dvh); overflow: auto; }
.rs-cmd-list li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; cursor: pointer; font-size: 13px; }
.rs-cmd-list li small { color: var(--ink-3); font-size: 11.5px; }
.rs-cmd-list li kbd, .rs-keys kbd { margin-left: auto; padding: 1px 6px; border-radius: 5px; background: var(--panel-3); color: var(--ink-2); font: 600 11px var(--ui); white-space: nowrap; }
.rs-cmd-list li[aria-selected="true"] { background: var(--sel-soft); }
.rs-keys { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 20px; }
.rs-keys div { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 12.5px; }
.rs-keys kbd + kbd { margin-left: 0; }

.rs-dropveil { position: fixed; inset: 0; z-index: 40; display: none; place-items: center; background: color-mix(in srgb, var(--sel) 18%, transparent); border: 3px dashed var(--sel); pointer-events: none; }
.rs-dropveil p { padding: 14px 20px; border-radius: 14px; background: var(--panel); font-weight: 700; box-shadow: var(--shadow-lg); }
body.dropping .rs-dropveil { display: grid; }
.rs-toast { position: fixed; left: 50%; bottom: 22px; z-index: 50; transform: translate(-50%, 20px); max-width: calc(100% - 32px); padding: 10px 16px; border-radius: 12px; background: var(--ink); color: var(--panel); font-weight: 600; font-size: 13px; opacity: 0; pointer-events: none; transition: opacity .25s, transform .3s cubic-bezier(.16, 1, .3, 1); }
.rs-toast.on { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.rs-toast button { margin-left: 10px; border: 0; background: none; color: var(--gold); font-weight: 700; text-decoration: underline; }
:root[data-theme="dark"] .rs-toast { color: #0E0D14; }

/* ---------- layouts ---------- */
.rs-ed { display: grid; min-height: 0; grid-template-columns: var(--lw, 292px) minmax(0, 1fr) var(--rw, 304px); grid-template-rows: minmax(0, 1fr) var(--th, 198px);
  grid-template-areas: "l c r" "t t t"; }
.rs-side--l { grid-area: l; } .rs-center { grid-area: c; } .rs-side--r { grid-area: r; } .rs-tl { grid-area: t; } .rs-sheet { grid-area: s; display: none; }
.rs-ed[data-mode="mid"] { grid-template-columns: minmax(0, 1fr) var(--rw, 320px); grid-template-areas: "c r" "t t"; }
.rs-ed[data-mode="mid"] .rs-side--l { display: none; }
.rs-ed[data-mode="phone"] { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(260px, 46dvh) 64px minmax(0, 1fr); grid-template-areas: "c" "t" "s"; }
.rs-ed[data-mode="phone"] .rs-side { display: none; }
.rs-ed[data-mode="phone"] .rs-sheet { display: flex; border-top: 1px solid var(--line); }
.rs-ed[data-mode="phone"] .rs-tl-grip { display: none; }
.rs-ed[data-mode="phone"] .rs-transport { height: 42px; gap: 8px; padding: 0 8px; }
.rs-ed[data-mode="phone"] #zoneSeg, .rs-ed[data-mode="phone"] .rs-cvtools { display: none; }
.rs-ed[data-mode="phone"] .rs-tc { min-width: 0; font-size: 12px; }
.rs-ed[data-mode="phone"] #aspSeg { margin-left: auto; }

@media (max-width: 760px) {
  .rs-top { gap: 4px; padding: 0 6px 0 8px; }
  .rs-logo-t, .rs-saved, .rs-sep, #themeBtn, #cmdBtn, .rs-acct { display: none; }
  .rs-app[data-view="home"] .rs-logo-t, .rs-app[data-view="home"] .rs-acct { display: flex; }
  .rs-crumb { margin-left: 2px; gap: 2px; }
  .rs-link { padding: 4px; }
  .rs-name { width: 14ch; font-size: 12.5px; }
  .rs-score { padding: 0 8px 0 3px; } .rs-score span { display: none; }
  .rh-wrap { padding: 16px 16px 40px; }
  .rh-new { grid-template-columns: 1fr; padding: 18px; gap: 18px; }
  .rh-drop { min-height: 180px; }
  .rh-smps { grid-template-columns: 1fr; }
  .rh-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .rh-acts { opacity: 1; }
  .rs-fmts { grid-template-columns: repeat(2, 1fr); }
  .rs-keys { grid-template-columns: 1fr; }
  .rs-dlg { max-height: calc(100dvh - 16px); }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
