/* Brotherly Record — tokens follow brotherly-unified-site/BRAND.md */
:root {
  --orange: #FF7A2F;
  --violet: #6A37D9;
  --blue: #1959FF;
  --blue-dark: #1246D8;
  --grad: linear-gradient(105deg, #FF7A2F 0%, #6A37D9 48%, #1959FF 100%);
  --rec: #F0443A;
  --rec-dark: #D42F26;
  --success: #12805C;
  --warning: #B35A00;

  --bg: #F6F8FC;
  --panel: #FFFFFF;
  --panel-2: #F2F5FB;
  --hover: #EAEEF6;
  --ink: #20212A;
  --ink-soft: #343640;
  --muted: #5D6370;
  --line: #DFE4EE;
  --line-strong: #C9D0DD;
  --link: #1959FF;
  --stage: #0B0C12;
  --shadow: 0 1px 2px rgba(20, 22, 30, .05), 0 10px 28px rgba(20, 22, 30, .08);
  --focus: 0 0 0 3px rgba(25, 89, 255, .35);
  --radius: 14px;
  --radius-sm: 9px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0E0F15;
    --panel: #171922;
    --panel-2: #1E212C;
    --hover: #252937;
    --ink: #ECEEF4;
    --ink-soft: #D4D7E0;
    --muted: #9AA1B0;
    --line: #272B37;
    --line-strong: #383D4C;
    --link: #6D95FF;
    --stage: #07080C;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 28px rgba(0, 0, 0, .35);
    --focus: 0 0 0 3px rgba(109, 149, 255, .45);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0E0F15;
  --panel: #171922;
  --panel-2: #1E212C;
  --hover: #252937;
  --ink: #ECEEF4;
  --ink-soft: #D4D7E0;
  --muted: #9AA1B0;
  --line: #272B37;
  --line-strong: #383D4C;
  --link: #6D95FF;
  --stage: #07080C;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 28px rgba(0, 0, 0, .35);
  --focus: 0 0 0 3px rgba(109, 149, 255, .45);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 "Open Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { margin: 0; line-height: 1.2; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .5; }
:focus-visible { outline: none; box-shadow: var(--focus); }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.icon { width: 18px; height: 18px; flex: none; }
kbd {
  display: inline-block;
  min-width: 20px;
  padding: 1px 5px;
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: var(--panel);
  font: 600 11px/1.5 "Open Sans", system-ui, sans-serif;
  text-align: center;
  color: var(--ink-soft);
}

/* ---------- top bar ---------- */
.topbar {
  display: flex;
  align-items: center;
  gap: 28px;
  height: 60px;
  padding: 0 20px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  flex: none;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; }
.brand img { display: block; }
.brand-name { font-size: 17px; font-weight: 600; letter-spacing: -.01em; white-space: nowrap; }
.brand-name strong { font-weight: 800; }
.tabs { display: flex; gap: 4px; }
.tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 14px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  font-weight: 600;
}
.tab:hover:not(:disabled) { background: var(--hover); color: var(--ink); }
.tab[aria-current="page"] { background: var(--panel-2); color: var(--ink); box-shadow: inset 0 -2px 0 var(--blue); }
.tab-count {
  min-width: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--hover);
  font-size: 12px;
  line-height: 20px;
  text-align: center;
  color: var(--ink-soft);
}
.tab-count:empty { display: none; }
.topbar-end { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
}
.pill .icon { width: 14px; height: 14px; color: var(--success); }
.brand-rule { height: 3px; background: var(--grad); flex: none; }
main { flex: 1; display: flex; flex-direction: column; min-height: 0; }

/* ---------- buttons & controls ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--panel);
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
  transition: background .12s, border-color .12s, color .12s;
}
.btn:hover:not(:disabled) { background: var(--hover); }
.btn .icon { width: 16px; height: 16px; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn-block { width: 100%; }
.btn-primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--blue-dark); border-color: var(--blue-dark); }
.btn-danger { background: var(--rec); border-color: var(--rec); color: #fff; }
.btn-danger:hover:not(:disabled) { background: var(--rec-dark); border-color: var(--rec-dark); }
.btn-quiet { border-color: transparent; background: transparent; color: var(--muted); padding-left: 8px; }
.btn-quiet:hover:not(:disabled) { color: var(--ink); }
.btn-danger-quiet { border-color: transparent; background: transparent; color: var(--rec); }
.btn-danger-quiet:hover:not(:disabled) { background: rgba(240, 68, 58, .1); }
.btn-glass { background: rgba(255, 255, 255, .12); border-color: rgba(255, 255, 255, .25); color: #fff; backdrop-filter: blur(6px); }
.btn-glass:hover:not(:disabled) { background: rgba(255, 255, 255, .22); }
.btn-glass kbd { background: transparent; color: rgba(255, 255, 255, .8); border-color: rgba(255, 255, 255, .35); }
.btn-stop { background: var(--rec); border-color: var(--rec); color: #fff; padding: 0 18px 0 14px; }
.btn-stop:hover:not(:disabled) { background: var(--rec-dark); border-color: var(--rec-dark); }
.link-btn { border: 0; background: none; padding: 0; color: var(--link); font-size: 13px; font-weight: 600; text-align: left; }
.link-btn:hover { text-decoration: underline; }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ink-soft);
}
.icon-btn:hover:not(:disabled) { background: var(--hover); color: var(--ink); }
.icon-btn[aria-pressed="true"] { background: rgba(240, 68, 58, .12); color: var(--rec); }
.icon-btn.sm { width: 32px; height: 32px; }
.icon-btn.sm .icon { width: 16px; height: 16px; }

.select {
  width: 100%;
  height: 38px;
  padding: 0 32px 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--panel) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%235D6370' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 11px center;
  font-size: 13.5px;
  appearance: none;
  text-overflow: ellipsis;
}
.select:disabled { opacity: .55; }

.switch { position: relative; display: inline-block; width: 38px; height: 22px; flex: none; }
.switch input { position: absolute; inset: 0; z-index: 1; margin: 0; opacity: 0; cursor: pointer; }
.switch input:disabled { cursor: not-allowed; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--line-strong); transition: background .15s; }
.switch span::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .25);
  transition: transform .15s;
}
.switch input:checked + span { background: var(--blue); }
.switch input:checked + span::after { transform: translateX(16px); }
.switch input:focus-visible + span { box-shadow: var(--focus); }
.switch input:disabled + span { opacity: .5; }

.check { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-soft); cursor: pointer; }
.check input { width: 16px; height: 16px; margin: 0; accent-color: var(--blue); }

.seg { display: flex; padding: 3px; gap: 3px; border-radius: var(--radius-sm); background: var(--panel-2); border: 1px solid var(--line); }
.seg button { flex: 1; height: 30px; border: 0; border-radius: 6px; background: transparent; font-size: 13px; font-weight: 600; color: var(--muted); }
.seg button:hover:not(:disabled) { color: var(--ink); }
.seg button[aria-pressed="true"] { background: var(--panel); color: var(--ink); box-shadow: 0 1px 3px rgba(20, 22, 30, .14); }

input[type="range"] { width: 100%; accent-color: var(--blue); margin: 4px 0 0; }

/* ---------- panels ---------- */
.panel {
  min-height: 0;
  overflow: auto;
  padding: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.panel-title {
  margin: 4px 0 12px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}
.prop-group + .prop-group { margin-top: 24px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field-label { display: flex; justify-content: space-between; font-size: 13px; font-weight: 600; color: var(--ink-soft); }
.field-label output { color: var(--muted); font-weight: 500; }
.hint { margin: 2px 0 0; font-size: 12.5px; color: var(--muted); }
.warn { margin: 10px 0 0; padding: 10px 12px; border-radius: var(--radius-sm); background: rgba(179, 90, 0, .1); color: var(--warning); font-size: 13px; font-weight: 600; }
.row-toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 36px; font-size: 13.5px; font-weight: 600; color: var(--ink-soft); cursor: pointer; }
.panel-note { margin: 12px 0 0; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--panel-2); font-size: 12.5px; color: var(--muted); }

.corners { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; width: 112px; padding: 6px; border-radius: var(--radius-sm); background: var(--panel-2); border: 1px solid var(--line); aspect-ratio: 16 / 10; }
.corners button { position: relative; border: 0; border-radius: 4px; background: transparent; }
.corners button::after { content: ""; position: absolute; width: 14px; height: 14px; border-radius: 50%; background: var(--line-strong); transition: background .12s, transform .12s; }
.corners button[data-corner="tl"]::after { top: 2px; left: 2px; }
.corners button[data-corner="tr"]::after { top: 2px; right: 2px; }
.corners button[data-corner="bl"]::after { bottom: 2px; left: 2px; }
.corners button[data-corner="br"]::after { bottom: 2px; right: 2px; }
.corners button:hover::after { background: var(--blue); transform: scale(1.15); }

.shortcuts { margin: 0; display: grid; gap: 8px; }
.shortcuts div { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.shortcuts dt { display: flex; gap: 3px; align-items: center; font-size: 12px; color: var(--muted); }
.shortcuts dd { margin: 0; font-size: 12.5px; color: var(--muted); }

/* ---------- studio ---------- */
.studio {
  flex: 1;
  display: grid;
  grid-template-columns: 276px minmax(0, 1fr) 288px;
  gap: 16px;
  padding: 16px;
  height: calc(100vh - 63px);
  min-height: 560px;
}
.source {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  transition: border-color .15s, background .15s;
}
.source.on { border-color: rgba(25, 89, 255, .45); background: rgba(25, 89, 255, .04); }
.source-head { display: flex; align-items: center; gap: 10px; }
.source-icon { display: grid; place-items: center; width: 36px; height: 36px; flex: none; border-radius: 10px; background: var(--panel-2); color: var(--muted); }
.source.on .source-icon { background: rgba(25, 89, 255, .12); color: var(--blue); }
.source-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.source-name { font-weight: 700; font-size: 14px; }
.source-status { overflow: hidden; font-size: 12.5px; color: var(--muted); white-space: nowrap; text-overflow: ellipsis; }
.source.on .source-status { color: var(--success); }
.meter { height: 6px; overflow: hidden; border-radius: 3px; background: var(--panel-2); border: 1px solid var(--line); }
.meter span { display: block; height: 100%; background: linear-gradient(90deg, #12805C, #52b26b 60%, #FF7A2F); transform: scaleX(0); transform-origin: left; }
.meter.muted span { background: var(--line-strong); }

.stage-col { display: flex; flex-direction: column; gap: 12px; min-width: 0; min-height: 0; }
.stage {
  position: relative;
  flex: 1;
  min-height: 220px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: var(--radius);
  background: radial-gradient(120% 90% at 50% 0%, #161927 0%, var(--stage) 60%);
  container-type: size;
  transition: box-shadow .2s;
}
body[data-phase="recording"] .stage { box-shadow: inset 0 0 0 2px var(--rec); }
body[data-phase="paused"] .stage { box-shadow: inset 0 0 0 2px #8a90a0; }
.frame { position: relative; width: min(calc(100cqw - 32px), calc((100cqh - 32px) * 16 / 9)); aspect-ratio: 16 / 9; }
.frame canvas { display: block; width: 100%; height: 100%; border-radius: 6px; background: #0d0e14; box-shadow: 0 0 0 1px rgba(255, 255, 255, .07), 0 20px 50px rgba(0, 0, 0, .45); touch-action: none; }
.frame canvas.grab { cursor: grab; }
.frame canvas.dragging { cursor: grabbing; }

.stage-empty { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.stage-empty-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  max-width: 320px;
  padding: 20px 24px;
  border-radius: var(--radius);
  background: rgba(23, 25, 34, .82);
  border: 1px solid rgba(255, 255, 255, .08);
  backdrop-filter: blur(8px);
  text-align: center;
  pointer-events: auto;
}
.stage-empty-card p { margin: 0; color: #D4D7E0; font-size: 14px; font-weight: 600; }

.countdown {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  border-radius: 6px;
  background: rgba(7, 8, 12, .62);
  backdrop-filter: blur(3px);
}
.countdown-num {
  display: grid;
  place-items: center;
  width: 148px;
  height: 148px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .06);
  font-size: 84px;
  font-weight: 800;
  color: #fff;
  position: relative;
}
.countdown-num::before {
  content: "";
  position: absolute;
  inset: 0;
  padding: 5px;
  border-radius: 50%;
  background: var(--grad);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
}
.countdown-num.tick { animation: tick .9s ease-out; }
@keyframes tick { from { transform: scale(1.18); opacity: .4; } 30% { opacity: 1; } to { transform: scale(1); } }

.live-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  display: none;
  align-items: center;
  gap: 7px;
  padding: 4px 10px 4px 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, .6);
  color: #fff;
  font-size: 12.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.live-badge i { width: 9px; height: 9px; border-radius: 50%; background: var(--rec); animation: pulse 1.4s ease-in-out infinite; }
body[data-phase="recording"] .live-badge, body[data-phase="paused"] .live-badge { display: inline-flex; }
body[data-phase="paused"] .live-badge i, body[data-phase="paused"] .timer-dot { background: #8a90a0; animation: none; }
@keyframes pulse { 50% { opacity: .35; } }

/* scenes */
.scenes { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; flex: none; }
.scene {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 7px 7px 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  text-align: left;
  transition: border-color .12s, box-shadow .12s;
}
.scene:hover { border-color: var(--line-strong); }
.scene[aria-pressed="true"] { border-color: var(--blue); box-shadow: 0 0 0 1px var(--blue); }
.scene-art { position: relative; display: block; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 7px; background: #12141c; }
.scene-art i { position: absolute; display: block; }
.scene-art .s { background: linear-gradient(160deg, #3a5bd1, #1c2b6b); }
.scene-art .c { background: linear-gradient(135deg, #FF7A2F, #6A37D9); }
.scene-art .full { inset: 0; }
.scene-art .c.bubble { left: 6%; bottom: 9%; width: 27%; aspect-ratio: 1; border-radius: 50%; box-shadow: 0 0 0 2px #12141c; }
.scene-art .s.side { left: 6%; top: 17%; width: 60%; height: 66%; border-radius: 3px; }
.scene-art .c.side { right: 6%; top: 17%; width: 24%; height: 66%; border-radius: 3px; }
.scene-art .s.inset { right: 6%; top: 9%; width: 40%; height: 40%; border-radius: 3px; box-shadow: 0 2px 6px rgba(0, 0, 0, .55); }
.scene-label { display: flex; justify-content: space-between; align-items: center; gap: 6px; padding: 0 2px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.scene-label kbd { font-size: 10px; min-width: 17px; padding: 0 4px; }

/* transport */
.transport {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  min-height: 66px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}
.transport-idle, .transport-live { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: center; }
.transport-live { display: none; }
body[data-phase="recording"] .transport-idle, body[data-phase="paused"] .transport-idle { display: none; }
body[data-phase="recording"] .transport-live, body[data-phase="paused"] .transport-live { display: flex; }
.rec-btn {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  height: 46px;
  padding: 0 26px 0 18px;
  border: 0;
  border-radius: 999px;
  background: var(--rec);
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  box-shadow: 0 6px 18px rgba(240, 68, 58, .32);
  transition: background .12s, transform .12s;
}
.rec-btn:hover:not(:disabled) { background: var(--rec-dark); transform: translateY(-1px); }
.rec-dot { width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 3px rgba(255, 255, 255, .35); }
.kbd-hint { display: inline-flex; gap: 3px; }
.timer { display: inline-flex; align-items: center; gap: 8px; min-width: 76px; font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; }
.timer-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--rec); animation: pulse 1.4s ease-in-out infinite; }
.sep { width: 1px; height: 26px; background: var(--line); margin: 0 2px; }

/* ---------- library ---------- */
.library { width: 100%; max-width: 1400px; margin: 0 auto; padding: 28px clamp(16px, 4vw, 48px) 40px; }
.lib-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.lib-head h1 { font-size: 28px; font-weight: 800; letter-spacing: -.02em; }
.lib-head p { margin: 4px 0 0; }
.lib-tools { display: flex; gap: 10px; flex-wrap: wrap; }
.search { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--panel); color: var(--muted); }
.search:focus-within { border-color: var(--blue); box-shadow: var(--focus); }
.search input { width: 200px; border: 0; outline: none; background: transparent; color: var(--ink); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.card { display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); transition: box-shadow .15s, transform .15s; }
.card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.card-thumb { position: relative; display: block; width: 100%; aspect-ratio: 16 / 9; padding: 0; border: 0; background: #0d0e14; }
.card-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.thumb-fallback { display: grid; place-items: center; height: 100%; color: #5D6370; }
.thumb-fallback .icon { width: 32px; height: 32px; }
.dur { position: absolute; right: 8px; bottom: 8px; padding: 2px 7px; border-radius: 6px; background: rgba(0, 0, 0, .72); color: #fff; font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.badge-warn { position: absolute; left: 8px; top: 8px; padding: 2px 8px; border-radius: 6px; background: var(--warning); color: #fff; font-size: 11.5px; font-weight: 700; }
.card-body { display: flex; align-items: flex-start; gap: 6px; padding: 12px 10px 12px 14px; }
.card-text { flex: 1; min-width: 0; }
.card-title { overflow: hidden; font-size: 14.5px; font-weight: 700; white-space: nowrap; text-overflow: ellipsis; }
.card-meta { margin: 3px 0 0; font-size: 12.5px; color: var(--muted); }
.card-actions { display: flex; flex: none; }
.empty { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 72px 20px; border: 1px dashed var(--line-strong); border-radius: var(--radius); text-align: center; }
.empty h2 { font-size: 20px; font-weight: 800; }
.empty p { margin: 0 0 8px; }
.lib-foot { display: flex; align-items: center; gap: 12px; margin-top: 28px; font-size: 12.5px; }
.storage-bar { width: 140px; height: 6px; overflow: hidden; border-radius: 3px; background: var(--line); }
.storage-bar span { display: block; height: 100%; width: 0; background: var(--grad); }

/* ---------- review ---------- */
.review { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; width: 100%; max-width: 1440px; margin: 0 auto; padding: 20px clamp(16px, 3vw, 32px) 40px; align-items: start; }
.review-head { margin-bottom: 14px; }
.title-input { display: block; width: calc(100% + 16px); margin: 6px 0 0 -8px; padding: 4px 8px; border: 1px solid transparent; border-radius: var(--radius-sm); background: transparent; font-size: 24px; font-weight: 800; letter-spacing: -.015em; }
.title-input:hover { border-color: var(--line); }
.title-input:focus { outline: none; border-color: var(--blue); box-shadow: var(--focus); }
.review-meta { margin: 2px 0 0; font-size: 13.5px; }
.player-wrap { overflow: hidden; border-radius: var(--radius); background: #000; aspect-ratio: 16 / 9; }
.player-wrap video { display: block; width: 100%; height: 100%; }
.trim { margin-top: 16px; padding: 14px 16px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.trim-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.trim-head h2 { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 700; }
.trim-head span { font-size: 13px; font-variant-numeric: tabular-nums; }
.trim-track { position: relative; height: 64px; margin: 14px 7px 16px; border-radius: 8px; background: #12141c; cursor: pointer; user-select: none; touch-action: none; }
.filmstrip { position: absolute; inset: 0; display: flex; overflow: hidden; border-radius: 8px; }
.filmstrip canvas { flex: 1; min-width: 0; height: 100%; object-fit: cover; }
.trim-shade { position: absolute; top: 0; bottom: 0; background: rgba(8, 9, 14, .7); }
.trim-shade.left { left: 0; border-radius: 8px 0 0 8px; }
.trim-shade.right { right: 0; border-radius: 0 8px 8px 0; }
.trim-window { position: absolute; top: -3px; bottom: -3px; border-top: 3px solid var(--orange); border-bottom: 3px solid var(--orange); pointer-events: none; }
.handle { position: absolute; top: -3px; bottom: -3px; z-index: 2; width: 14px; margin-left: -7px; padding: 0; border: 0; border-radius: 5px; background: var(--orange); cursor: ew-resize; touch-action: none; }
.handle::after { content: ""; position: absolute; left: 5px; right: 5px; top: 35%; bottom: 35%; border-left: 2px solid rgba(255, 255, 255, .85); }
.handle:focus-visible { box-shadow: 0 0 0 3px rgba(255, 122, 47, .45); }
.playhead { position: absolute; top: -7px; bottom: -7px; z-index: 3; width: 2px; margin-left: -1px; background: #fff; box-shadow: 0 0 0 1px rgba(0, 0, 0, .45); pointer-events: none; }
.trim-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.review-side { position: sticky; top: 16px; }
.review-side .panel-title:not(:first-child) { margin-top: 24px; }
.details { margin: 0; display: grid; gap: 8px; font-size: 13.5px; }
.details div { display: flex; justify-content: space-between; gap: 10px; }
.details dt { color: var(--muted); }
.details dd { margin: 0; font-weight: 600; text-align: right; }
.side-actions { display: grid; gap: 8px; margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--line); }

/* ---------- dialogs & toasts ---------- */
.dialog { width: min(440px, calc(100vw - 32px)); padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); color: var(--ink); box-shadow: 0 24px 60px rgba(0, 0, 0, .3); }
.dialog::backdrop { background: rgba(8, 9, 14, .55); backdrop-filter: blur(2px); }
.dialog h2 { font-size: 18px; font-weight: 800; }
.dialog p { margin: 8px 0 0; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }
.progress { height: 8px; margin-top: 18px; overflow: hidden; border-radius: 4px; background: var(--panel-2); }
.progress span { display: block; height: 100%; width: 0; background: var(--grad); transition: width .2s linear; }
.export-text { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.toasts { position: fixed; left: 50%; bottom: 20px; z-index: 50; display: flex; flex-direction: column; align-items: center; gap: 8px; transform: translateX(-50%); pointer-events: none; width: max-content; max-width: calc(100vw - 32px); }
.toast { padding: 10px 16px; border-radius: 10px; background: #20212A; color: #fff; font-size: 13.5px; font-weight: 600; box-shadow: 0 10px 30px rgba(0, 0, 0, .25); animation: toast-in .2s ease-out; pointer-events: auto; }
.toast.error { background: #8E1D17; }
.toast.out { opacity: 0; transform: translateY(6px); transition: opacity .2s, transform .2s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .studio { grid-template-columns: 260px minmax(0, 1fr); height: auto; min-height: 0; }
  .stage { flex: none; height: min(64vh, 50vw); }
  .props { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 8px 28px; overflow: visible; }
  .prop-group + .prop-group { margin-top: 0; }
}
@media (max-width: 820px) {
  .topbar { gap: 12px; padding: 0 16px; }
  .brand-name { display: none; }
  .pill { display: none; }
  .tab { padding: 0 10px; }
  .studio { grid-template-columns: minmax(0, 1fr); gap: 12px; padding: 12px 16px; }
  .sources { order: 2; }
  .stage-col { order: 1; }
  .props { order: 3; }
  .stage { height: auto; aspect-ratio: 16 / 10; min-height: 0; }
  .scenes { grid-template-columns: repeat(5, minmax(104px, 1fr)); overflow-x: auto; padding-bottom: 4px; }
  .transport { padding: 10px; }
  .transport-live .sep { display: none; }
  .kbd-hint { display: none; }
  .review { grid-template-columns: minmax(0, 1fr); padding: 16px; }
  .review-side { position: static; }
  .search input { width: 100%; }
  .lib-tools, .search { flex: 1 1 100%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
