/* ================================================================
   NOVA FX STUDIO — Black & pastel aurora
   검정 캔버스 위에 흑연색 표면, 흰색 원형 주요 동작,
   파스텔 오로라 그라데이션은 "지금 작업 중인 것"에만 사용합니다.
   ================================================================ */
:root {
  --black: #000;
  --surface: #161618;
  --surface-2: #1f1f22;
  --surface-3: #2a2a2e;
  --hair: rgba(255, 255, 255, 0.08);
  --hair-2: rgba(255, 255, 255, 0.14);
  --text: #fff;
  --text-2: rgba(255, 255, 255, 0.72);
  --dim: rgba(255, 255, 255, 0.5);
  --faint: rgba(255, 255, 255, 0.28);

  --lilac: #b9a3e6;
  --orchid: #d99bcb;
  --peach: #f1b89c;
  --amber: #f4c46a;
  --aurora-line: linear-gradient(90deg, var(--lilac), var(--orchid) 45%, var(--peach) 75%, var(--amber));
  --aurora:
    radial-gradient(120% 90% at 0% 0%, #bba6ea 0%, rgba(187, 166, 234, 0) 55%),
    radial-gradient(90% 80% at 100% 100%, #f5c26a 0%, rgba(245, 194, 106, 0) 60%),
    radial-gradient(70% 60% at 75% 25%, #f2c4c6 0%, rgba(242, 196, 198, 0) 65%),
    linear-gradient(140deg, #c9a3dc 0%, #dfa8c4 45%, #eab89e 100%);

  --ok: #8fe3b6;
  --warn: #f4c46a;
  --danger: #ff8a8a;

  --r-panel: 28px;
  --r-card: 18px;
  --r-item: 16px;
  --r-field: 14px;

  --font: 'Outfit', 'Pretendard Variable', Pretendard, system-ui, -apple-system, 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
  --mono: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;

  --left-w: 320px;
  --right-w: 352px;
  --top-h: 68px;
  --status-h: 30px;
  --gap: 10px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--black);
  color: var(--text);
  font: 300 13.5px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
strong { font-weight: 500; }
.num, .mono { font-variant-numeric: tabular-nums; }
.dim { color: var(--dim); }
.strong { font-weight: 500; }
.grow { flex: 1; }
.row-gap { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 16px; }

.ic { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.12); border: 2px solid transparent; background-clip: padding-box; border-radius: 10px; }
::-webkit-scrollbar-track { background: transparent; }
:focus-visible { outline: 2px solid var(--orchid); outline-offset: 2px; }

/* ── Boot: 레퍼런스 첫 화면처럼 오로라 환영 화면 */
.boot {
  position: fixed; inset: 0; z-index: 100; overflow: hidden;
  background: var(--aurora);
  display: flex; flex-direction: column; justify-content: space-between;
  padding: max(28px, env(safe-area-inset-top)) 32px 40px;
}
.boot::before {
  content: ''; position: absolute; left: 20%; top: 38%; width: 46vmin; height: 46vmin; border-radius: 50%;
  background: radial-gradient(circle, rgba(222, 128, 96, 0.55), rgba(222, 128, 96, 0) 70%); filter: blur(30px);
}
.boot > * { position: relative; }
.boot-brand { display: flex; align-items: center; gap: 8px; font-weight: 500; font-size: 17px; letter-spacing: 0.01em; }
.boot-brand .ic { width: 22px; height: 22px; }
.boot-kicker { font-size: 14px; color: rgba(255, 255, 255, 0.85); margin-bottom: 6px; }
.boot-title { font-size: clamp(30px, 4.2vw, 46px); line-height: 1.18; font-weight: 200; letter-spacing: -0.01em; }
.boot-title strong { font-weight: 500; }
.boot-dashes { display: flex; gap: 6px; margin: 26px 0 12px; }
.boot-dashes i { width: 14px; height: 2px; border-radius: 2px; background: rgba(255, 255, 255, 0.5); animation: dash 1.6s ease-in-out infinite; }
.boot-dashes i:nth-child(2) { animation-delay: .2s; }
.boot-dashes i:nth-child(3) { animation-delay: .4s; }
.boot-dashes i:nth-child(4) { animation-delay: .6s; }
@keyframes dash { 50% { width: 34px; background: #fff; } }
.boot-status { font-size: 13px; color: rgba(255, 255, 255, 0.8); }
.boot-error { max-width: 420px; padding: 24px; border-radius: 24px; background: rgba(0, 0, 0, 0.35); backdrop-filter: blur(20px); }
.boot-error p { color: var(--text-2); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Layout: 검정 위에 떠 있는 둥근 패널 */
.app {
  display: grid; height: 100dvh; gap: var(--gap); padding: 0 var(--gap) 0;
  grid-template-columns: var(--left-w) minmax(0, 1fr) var(--right-w);
  grid-template-rows: var(--top-h) minmax(0, 1fr) var(--status-h);
  grid-template-areas: "top top top" "left stage right" "status status status";
}
.topbar { grid-area: top; }
.panel-left { grid-area: left; }
.stage { grid-area: stage; }
.panel-right { grid-area: right; }
.statusbar { grid-area: status; }
.mobile-nav { display: none; }

/* ── Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 18px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.06); border: 1px solid var(--hair-2); color: var(--text);
  font-weight: 400; white-space: nowrap; text-decoration: none;
  transition: background .15s, border-color .15s, transform .1s;
}
.btn:hover { background: rgba(255, 255, 255, 0.11); }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: .4; cursor: default; transform: none; }
.btn.primary, .btn.accent { background: #fff; border-color: #fff; color: #000; font-weight: 500; }
.btn.primary:hover, .btn.accent:hover { background: #ececec; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn.ghost:hover { background: rgba(255, 255, 255, 0.07); color: var(--text); }
.btn.danger { background: transparent; border-color: rgba(255, 138, 138, 0.4); color: var(--danger); }
.btn.danger:hover { background: rgba(255, 138, 138, 0.1); }
.btn.sm { height: 32px; padding: 0 12px; font-size: 12.5px; gap: 6px; }
.btn.sm .ic { width: 15px; height: 15px; }
.btn.block { width: 100%; }

.icon-btn {
  display: inline-grid; place-items: center; width: 44px; height: 44px; flex: none;
  border-radius: 50%; border: 1px solid var(--hair); background: var(--surface-2); color: var(--text);
  text-decoration: none; transition: background .15s, transform .1s;
}
.icon-btn:hover { background: var(--surface-3); }
.icon-btn:active { transform: scale(0.94); }
.icon-btn:disabled { opacity: .35; cursor: default; transform: none; background: var(--surface-2); }
.icon-btn.sm { width: 30px; height: 30px; background: transparent; border-color: transparent; color: var(--text-2); }
.icon-btn.sm:hover { background: rgba(255, 255, 255, 0.08); color: var(--text); }
.icon-btn.sm .ic { width: 16px; height: 16px; }
.icon-btn.danger:hover { color: var(--danger); background: rgba(255, 138, 138, 0.1); }

.tool-btn {
  display: inline-flex; align-items: center; gap: 7px; height: 40px; padding: 0 16px;
  border-radius: 999px; border: 1px solid var(--hair-2); background: transparent;
  color: var(--text-2); text-decoration: none; white-space: nowrap; transition: background .15s, color .15s;
}
.tool-btn .ic { width: 16px; height: 16px; }
.tool-btn:hover { color: var(--text); background: rgba(255, 255, 255, 0.06); }
.tool-btn.active { background: #fff; color: #000; border-color: #fff; }
.tool-btn.signed .ic { color: var(--ok); }
.tool-btn:disabled { opacity: .35; cursor: default; background: transparent; color: var(--text-2); }
.reset-btn:not(:disabled):hover { color: var(--danger); border-color: rgba(255, 138, 138, 0.4); }
.layer-reset { display: inline-flex; align-items: center; gap: 5px; height: 30px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--hair-2); background: transparent; color: var(--text-2); font-size: 12px; }
.layer-reset .ic { width: 14px; height: 14px; }
.layer-reset:not(:disabled):hover { color: var(--danger); border-color: rgba(255, 138, 138, 0.4); }
.layer-reset:disabled { opacity: .35; cursor: default; }

.link-btn { background: none; border: 0; padding: 0; color: var(--orchid); font-size: 12.5px; }
.link-btn:hover { text-decoration: underline; }
.link-btn.active { color: var(--amber); }

/* 레퍼런스의 Start 슬라이더: 흰 원형 노브 + 라벨 */
.btn-start {
  display: inline-flex; align-items: center; gap: 10px; height: 44px; padding: 3px 18px 3px 3px;
  border-radius: 999px; border: 1px solid var(--hair); background: var(--surface-2); color: var(--text); white-space: nowrap;
}
.btn-start:hover { background: var(--surface-3); }
.start-knob { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: #fff; color: #000; flex: none; transition: transform .2s; }
.start-knob .ic { width: 17px; height: 17px; stroke-width: 1.7; }
.btn-start:hover .start-knob, .start-slider:hover .start-knob { transform: translateX(3px); }

/* ── Topbar */
.topbar { display: flex; align-items: center; gap: 18px; padding: 0 6px; min-width: 0; }
.brand { display: flex; align-items: center; gap: 8px; width: calc(var(--left-w) - 18px); flex: none; }
.brand-mark { width: 22px; height: 22px; }
.brand-name { font-weight: 500; font-size: 17px; letter-spacing: 0.01em; }
.toolbar { display: flex; align-items: center; gap: 14px; min-width: 0; }
.circle-group, .pill-group { display: flex; align-items: center; gap: 6px; flex: none; }
.toolbar > *, .topbar-right > * { flex-shrink: 0; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.sync-badge {
  display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 12px; border-radius: 999px;
  font-size: 12px; color: var(--dim); border: 1px solid var(--hair); white-space: nowrap;
}
.sync-badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--faint); }
.sync-badge.online { color: var(--text-2); }
.sync-badge.online::before { background: var(--ok); }
.export-btn { height: 44px; padding: 0 20px; }

/* ── Panels */
.panel { background: var(--surface); border-radius: var(--r-panel); min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.panel-head { display: flex; align-items: center; justify-content: space-between; min-height: 58px; padding: 10px 12px 4px 20px; flex: none; }
.panel-title { display: flex; align-items: center; gap: 8px; font-size: 17px; font-weight: 300; color: var(--text); }
.panel-title .ic { width: 17px; height: 17px; color: var(--dim); }
.panel-tools { display: flex; gap: 2px; }
.count-label { font-size: 12px; color: var(--dim); font-weight: 300; font-variant-numeric: tabular-nums; }
.panel-title .count-label { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: rgba(255, 255, 255, 0.08); font-size: 11.5px; color: var(--text-2); }
.panel-title .count-label:empty { display: none; }

/* ── Browser */
.browser-controls { padding: 4px 14px 10px; display: flex; flex-direction: column; gap: 10px; flex: none; }
.search-wrap { position: relative; }
.search-wrap .ic { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--dim); width: 17px; height: 17px; pointer-events: none; }
.search-input {
  width: 100%; height: 44px; padding: 0 16px 0 42px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid transparent; outline: none; font-weight: 300;
}
.search-input::placeholder { color: var(--faint); }
.search-input:focus { border-color: var(--hair-2); }

.tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: 1 0 auto; height: 36px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--hair-2);
  background: transparent; color: var(--text-2); font-size: 12.5px; white-space: nowrap;
}
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] { background: #fff; border-color: #fff; color: #000; font-weight: 400; }

.chips { display: flex; gap: 5px; overflow-x: auto; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; height: 28px; padding: 0 12px; border-radius: 999px; font-size: 12px;
  border: 0; background: rgba(255, 255, 255, 0.06); color: var(--text-2);
}
.chip:hover { background: rgba(255, 255, 255, 0.1); color: var(--text); }
.chip.active { background: rgba(255, 255, 255, 0.16); color: var(--text); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35); }
.chip.sm { height: 26px; font-size: 11.5px; padding: 0 10px; }
.chip-count { margin-left: 5px; opacity: .5; font-size: 10.5px; }
.tag-chips { flex-wrap: wrap; max-height: 0; overflow: hidden; transition: max-height .25s; }
.tag-chips.open { max-height: 150px; overflow-y: auto; }
.browser-meta { display: flex; align-items: center; justify-content: space-between; min-height: 28px; }
.mini-select { height: 28px; border-radius: 999px; background: rgba(255, 255, 255, 0.06); border: 0; font-size: 12px; padding: 0 10px; color: var(--text-2); }

.effect-scroll { overflow-y: auto; flex: 1; min-height: 0; padding: 2px 14px 14px; }
.effect-list[data-view="grid"] { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.effect-list[data-view="list"] { display: flex; flex-direction: column; gap: 6px; }
.effect-list.loading::after { content: ''; grid-column: 1 / -1; height: 2px; border-radius: 2px; background: var(--aurora-line); background-size: 200% 100%; animation: bar 1.2s linear infinite; }
@keyframes bar { from { background-position: 200% 0; } to { background-position: 0 0; } }
.list-sentinel { height: 1px; }
.list-empty { color: var(--dim); text-align: center; padding: 36px 16px; font-size: 13px; }

.effect-card {
  position: relative; border-radius: var(--r-card); background: var(--surface-2);
  overflow: hidden; cursor: pointer; content-visibility: auto; contain-intrinsic-size: 140px;
  transition: transform .12s;
}
.effect-card:active { transform: scale(0.97); }
.effect-card::after { content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; box-shadow: inset 0 0 0 1px var(--hair); transition: box-shadow .15s; }
.effect-card:hover::after { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.28); }
.effect-card.in-stack::after { box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.9); }
.card-thumb { position: relative; aspect-ratio: 1; background: linear-gradient(140deg, #232327, #1b1b1e); }
.card-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: 0; transition: opacity .3s; }
.effect-card.thumb-ready .card-thumb img { opacity: 1; }
.card-badges { position: absolute; left: 8px; top: 8px; display: flex; gap: 4px; }
.badge { font-size: 9.5px; font-weight: 500; line-height: 1; padding: 4px 7px; border-radius: 999px; letter-spacing: .02em; }
.badge.new { background: rgba(255, 255, 255, 0.92); color: #000; }
.badge.cpu { background: rgba(0, 0, 0, 0.45); color: #fff; backdrop-filter: blur(8px); }
.fav-btn {
  position: absolute; right: 7px; top: 7px; width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center; border: 0; background: rgba(0, 0, 0, 0.35); color: #fff; backdrop-filter: blur(8px);
  opacity: 0; transition: opacity .15s;
}
.fav-btn .ic { width: 14px; height: 14px; }
.effect-card:hover .fav-btn, .fav-btn.on, .fav-btn:focus-visible { opacity: 1; }
.fav-btn.on { background: #fff; color: #000; }
.fav-btn.on .ic { fill: currentColor; }
.card-body { position: absolute; left: 0; right: 0; bottom: 0; padding: 26px 10px 9px; background: linear-gradient(to top, rgba(0, 0, 0, 0.72), rgba(0, 0, 0, 0)); pointer-events: none; }
.card-name { font-weight: 400; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-sub { font-size: 11px; color: rgba(255, 255, 255, 0.62); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 5px; }
.cat-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--faint); flex: none; }
[data-cat="adjust"] .cat-dot { background: var(--lilac); }
[data-cat="digital"] .cat-dot { background: var(--orchid); }
[data-cat="art"] .cat-dot { background: var(--amber); }

.effect-list[data-view="list"] .effect-card { display: flex; align-items: center; gap: 10px; padding: 5px; contain-intrinsic-size: 56px; }
.effect-list[data-view="list"] .card-thumb { width: 46px; flex: none; border-radius: 12px; overflow: hidden; }
.effect-list[data-view="list"] .card-badges { display: none; }
.effect-list[data-view="list"] .card-body { position: static; padding: 0; background: none; }
.effect-list[data-view="list"] .fav-btn { top: 50%; transform: translateY(-50%); background: transparent; }
.effect-list[data-view="list"] .fav-btn.on { background: #fff; }

/* ── Stage */
.stage {
  position: relative; overflow: hidden; border-radius: var(--r-panel); touch-action: none;
  background: radial-gradient(90% 70% at 50% 110%, rgba(217, 155, 203, 0.09), rgba(0, 0, 0, 0) 60%), #0b0b0c;
  box-shadow: inset 0 0 0 1px var(--hair);
}
.stage.pannable { cursor: grab; }
.stage.pannable:active { cursor: grabbing; }
.stage-inner {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  border-radius: 22px; overflow: hidden;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.06);
  background: repeating-conic-gradient(#18181a 0% 25%, #1f1f22 0% 50%) 50% / 16px 16px;
}
.stage:not(.has-media) .stage-inner { display: none; }
.stage-inner canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

.divider { position: absolute; top: 0; bottom: 0; width: 30px; margin-left: -15px; cursor: ew-resize; z-index: 3; touch-action: none; }
.divider::before { content: ''; position: absolute; left: 50%; top: 0; bottom: 0; width: 1.5px; margin-left: -0.75px; background: #fff; }
.divider-handle { position: absolute; left: 50%; top: 50%; width: 38px; height: 38px; margin: -19px 0 0 -19px; border-radius: 50%; background: #fff; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35); }
.divider-handle::before, .divider-handle::after { content: ''; position: absolute; top: 50%; width: 6px; height: 6px; margin-top: -3px; border: solid #000; border-width: 0 0 1.5px 1.5px; }
.divider-handle::before { left: 11px; transform: rotate(45deg); }
.divider-handle::after { right: 11px; transform: rotate(-135deg); }
.divider-tag { position: absolute; top: 14px; font-size: 11.5px; padding: 5px 11px; border-radius: 999px; background: rgba(0, 0, 0, 0.35); backdrop-filter: blur(12px); color: #fff; white-space: nowrap; }
.divider-tag.left { right: 22px; }
.divider-tag.right { left: 22px; }

/* 빈 상태: 레퍼런스 첫 화면의 오로라 카드 */
.empty-state { position: absolute; inset: 0; display: grid; place-items: center; padding: 24px; }
.welcome-card {
  position: relative; overflow: hidden; width: min(400px, 100%); height: min(560px, 100%);
  border-radius: 36px; background: var(--aurora); padding: 26px 26px 24px;
  display: flex; flex-direction: column; justify-content: space-between;
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.6);
}
.welcome-glow { position: absolute; left: 12%; top: 34%; width: 62%; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle, rgba(214, 120, 92, 0.55), rgba(214, 120, 92, 0) 70%); filter: blur(24px); pointer-events: none; }
.welcome-card > :not(.welcome-glow) { position: relative; }
.welcome-top { display: flex; align-items: center; gap: 7px; font-size: 13.5px; color: rgba(255, 255, 255, 0.9); }
.welcome-top .ic { width: 17px; height: 17px; }
.welcome-kicker { font-size: 13px; color: rgba(255, 255, 255, 0.85); margin-bottom: 4px; }
.welcome-title { font-size: 30px; line-height: 1.2; font-weight: 200; letter-spacing: -0.01em; text-shadow: 0 1px 20px rgba(90, 40, 80, 0.18); }
.welcome-title strong { font-weight: 500; }
.welcome-sub { margin: 12px 0 22px; font-size: 12.5px; color: rgba(255, 255, 255, 0.85); max-width: 30ch; }
.start-slider {
  display: flex; align-items: center; width: 100%; height: 58px; padding: 5px 18px 5px 5px; border: 0;
  border-radius: 999px; background: rgba(255, 255, 255, 0.24); backdrop-filter: blur(16px); color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.3);
}
.start-slider .start-knob { width: 48px; height: 48px; }
.start-slider .start-knob .ic { width: 19px; height: 19px; }
.start-label { flex: 1; text-align: center; font-size: 14px; font-weight: 400; margin-left: -24px; }
.start-chevrons { width: 26px; height: 18px; stroke-width: 1.6; }
.welcome-hint { margin-top: 12px; text-align: center; font-size: 11.5px; color: rgba(255, 255, 255, 0.72); }

.drop-overlay { position: absolute; inset: 12px; border-radius: 22px; display: none; place-items: center; z-index: 5; pointer-events: none; background: rgba(0, 0, 0, 0.35); backdrop-filter: blur(6px); box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.6); }
.drop-overlay span { padding: 12px 22px; border-radius: 999px; background: #fff; color: #000; font-weight: 500; }
.stage.dragover .drop-overlay { display: grid; }

.stage-hud, .video-bar {
  position: absolute; bottom: 14px; z-index: 4; display: flex; align-items: center;
  border-radius: 999px; background: rgba(22, 22, 24, 0.72); backdrop-filter: blur(18px) saturate(1.2);
  box-shadow: inset 0 0 0 1px var(--hair);
}
.stage-hud { right: 14px; gap: 2px; padding: 4px; }
.stage:not(.has-media) .stage-hud { display: none; }
.hud-zoom { min-width: 56px; height: 30px; border: 0; background: transparent; font-size: 12px; color: var(--text-2); border-radius: 999px; font-variant-numeric: tabular-nums; }
.hud-zoom:hover { background: rgba(255, 255, 255, 0.08); color: var(--text); }
.video-bar { left: 50%; transform: translateX(-50%); width: min(560px, calc(100% - 220px)); gap: 12px; padding: 5px 18px 5px 5px; }
.play-btn { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; border: 0; background: #fff; color: #000; flex: none; }
.play-btn .ic { width: 17px; height: 17px; }
.video-bar .ctl-slider { flex: 1; }
.video-time { font-size: 12px; color: var(--text-2); white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ── Right panel */
.panel-right { background: transparent; border-radius: 0; gap: var(--gap); overflow: visible; }
.layers-section, .params-section { background: var(--surface); border-radius: var(--r-panel); display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.layers-section { flex: 0 0 auto; max-height: 40%; }
.params-section { flex: 1; }
.layer-scroll { overflow-y: auto; padding: 2px 14px 14px; min-height: 0; }
.pipe-node { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--dim); padding: 4px 6px; }
.pipe-dot { width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid var(--faint); background: var(--surface); position: relative; z-index: 1; }
.pipe-node.result .pipe-dot { border: 0; background: var(--aurora-line); }
.layer-list { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 6px 0; }
.layer-list::before { content: ''; position: absolute; left: 10px; top: -8px; bottom: -8px; width: 1px; background: linear-gradient(var(--faint), rgba(255, 255, 255, 0.1)); }
.layer-empty { font-size: 12.5px; color: var(--dim); padding: 12px 6px 12px 26px; }
.layer-item {
  position: relative; display: flex; align-items: center; gap: 2px; margin-left: 24px; min-height: 54px; padding: 4px 6px 4px 0;
  border-radius: var(--r-item); background: var(--surface-2); border: 1px solid transparent; cursor: pointer;
  transition: transform .18s ease, background .15s;
}
.layer-item::before { content: ''; position: absolute; left: -14px; top: 50%; width: 12px; height: 1px; background: rgba(255, 255, 255, 0.16); }
.layer-item:hover { background: var(--surface-3); }
.layer-item.selected {
  border-color: transparent;
  background: linear-gradient(var(--surface-2), var(--surface-2)) padding-box, var(--aurora-line) border-box;
}
.layer-item.selected::after { content: ''; position: absolute; inset: 0; border-radius: inherit; background: linear-gradient(100deg, rgba(185, 163, 230, 0.12), rgba(244, 196, 106, 0.08)); pointer-events: none; }
.layer-item.off .layer-info { opacity: .4; }
.layer-item.error { border-color: rgba(255, 138, 138, 0.55); }
.layer-item.dragging { z-index: 5; transition: none; box-shadow: 0 16px 36px rgba(0, 0, 0, 0.6); background: var(--surface-3); }
.layer-grip { width: 24px; align-self: stretch; display: grid; place-items: center; border: 0; background: none; color: var(--faint); cursor: grab; touch-action: none; }
.layer-grip:active { cursor: grabbing; }
.layer-grip .ic { width: 15px; height: 15px; }
.layer-item .eye { position: relative; z-index: 1; }
.layer-info { flex: 1; min-width: 0; padding-left: 4px; position: relative; z-index: 1; }
.layer-name { font-weight: 400; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; gap: 8px; align-items: baseline; }
.layer-index { font-size: 11px; color: var(--dim); font-variant-numeric: tabular-nums; }
.layer-sub { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--dim); margin-top: 1px; }
.layer-tag { font-size: 10px; padding: 1px 7px; border-radius: 999px; background: rgba(255, 255, 255, 0.07); color: var(--text-2); }
.layer-mix { font-variant-numeric: tabular-nums; }
.layer-err { color: var(--danger); }
.layer-loading { color: var(--warn); }
.layer-actions { display: flex; opacity: 0; transition: opacity .15s; position: relative; z-index: 1; }
.layer-item:hover .layer-actions, .layer-item.selected .layer-actions { opacity: 1; }

/* ── Params */
.param-scroll { overflow-y: auto; flex: 1; min-height: 0; padding: 0 12px 20px; }
.param-empty { padding: 34px 20px; text-align: center; color: var(--dim); display: grid; justify-items: center; gap: 8px; }
.param-empty-title { color: var(--text); font-size: 15px; font-weight: 300; }
.param-empty p { margin: 0; font-size: 12.5px; max-width: 26ch; }

/* 선택된 효과 카드 = 레퍼런스의 AI Assistant 글래스 카드 */
.param-header {
  position: relative; overflow: hidden; border-radius: 24px; padding: 18px 16px 14px 18px; margin-bottom: 10px;
  background: var(--aurora); color: #fff;
}
.param-header::before { content: ''; position: absolute; right: -20%; bottom: -40%; width: 70%; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle, rgba(214, 120, 92, 0.35), rgba(214, 120, 92, 0) 70%); filter: blur(18px); }
.param-header > * { position: relative; }
.param-title-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.param-effect-name { font-size: 22px; font-weight: 300; line-height: 1.2; text-shadow: 0 1px 14px rgba(90, 40, 80, 0.2); }
.param-effect-sub { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.param-effect-sub span { font-size: 11px; padding: 3px 9px; border-radius: 999px; background: rgba(255, 255, 255, 0.24); backdrop-filter: blur(10px); }
.param-desc { margin: 10px 0 0; color: rgba(255, 255, 255, 0.92); font-size: 12.5px; line-height: 1.55; }
.param-actions { display: flex; gap: 6px; margin-top: 14px; flex-wrap: wrap; }
.param-header .btn.ghost { height: 32px; padding: 0 12px; background: rgba(255, 255, 255, 0.22); color: #fff; border: 0; backdrop-filter: blur(10px); }
.param-header .btn.ghost:hover { background: rgba(255, 255, 255, 0.34); }
.param-header .switch-track { background: rgba(255, 255, 255, 0.35); }
.param-header .switch-input:checked + .switch-track { background: #fff; }
.param-header .switch-input:checked + .switch-track::after { background: #000; }

.param-group { padding: 6px 8px 6px; margin-top: 6px; border-radius: 20px; background: var(--surface-2); }
.mix-group { background: var(--surface-2); }
.group-title { font-size: 12px; color: var(--dim); padding: 8px 0 0; }
.param-foot { padding: 14px 8px 0; font-size: 11.5px; color: var(--faint); }

/* ── Controls: 라벨+수치 윗줄 / 트랙은 패널 폭 전체 */
.ctl { padding: 9px 6px; }
.ctl + .ctl { border-top: 1px solid rgba(255, 255, 255, 0.05); }
.ctl-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 24px; margin-bottom: 8px; }
.ctl-label { font-size: 13px; color: var(--text-2); user-select: none; cursor: default; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ctl-value { display: flex; align-items: center; gap: 4px; flex: none; }
.ctl-num {
  width: 58px; height: 26px; padding: 0 8px; text-align: right; border-radius: 999px;
  border: 1px solid transparent; background: transparent; font-size: 13px; font-weight: 400; color: var(--text); outline: none;
  font-variant-numeric: tabular-nums; -moz-appearance: textfield; appearance: textfield;
}
.ctl-num::-webkit-inner-spin-button, .ctl-num::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.ctl-num:hover { background: rgba(255, 255, 255, 0.05); }
.ctl-num:focus { border-color: var(--hair-2); background: var(--black); }
.ctl-unit { font-size: 11.5px; color: var(--dim); min-width: 12px; }

.ctl-slider {
  --fill: 50%;
  -webkit-appearance: none; appearance: none; display: block; width: 100%; height: 20px; margin: 0; background: transparent; cursor: pointer; touch-action: pan-y;
}
.ctl-slider::-webkit-slider-runnable-track {
  height: 4px; border-radius: 4px;
  background:
    linear-gradient(90deg, var(--lilac), var(--orchid) 50%, var(--amber)) 0 0 / var(--fill) 100% no-repeat,
    rgba(255, 255, 255, 0.12);
}
.ctl-slider::-moz-range-track { height: 4px; border-radius: 4px; background: rgba(255, 255, 255, 0.12); }
.ctl-slider::-moz-range-progress { height: 4px; border-radius: 4px; background: linear-gradient(90deg, var(--lilac), var(--orchid), var(--amber)); }
.ctl-slider::-webkit-slider-thumb {
  -webkit-appearance: none; width: 18px; height: 18px; margin-top: -7px; border-radius: 50%;
  background: #fff; border: 0; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45); transition: transform .12s;
}
.ctl-slider::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 0; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45); }
.ctl-slider:hover::-webkit-slider-thumb { transform: scale(1.1); }
.ctl-slider:active::-webkit-slider-thumb { transform: scale(1.2); }
.ctl-slider:focus-visible { outline: none; }
.ctl-slider:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px rgba(217, 155, 203, 0.55); }
.video-bar .ctl-slider { --fill: 0%; }

.ctl-toggle-row { display: flex; justify-content: space-between; align-items: center; cursor: pointer; min-height: 26px; }
.switch { position: relative; display: inline-block; width: 40px; height: 24px; flex: none; }
.switch-input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch-track { position: absolute; inset: 0; border-radius: 24px; background: rgba(255, 255, 255, 0.14); transition: background .2s; }
.switch-track::after { content: ''; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .2s; }
.switch-input:checked + .switch-track { background: linear-gradient(90deg, var(--lilac), var(--orchid) 60%, var(--peach)); }
.switch-input:checked + .switch-track::after { transform: translateX(16px); }
.switch-input:focus-visible + .switch-track { outline: 2px solid var(--orchid); outline-offset: 2px; }

/* 옵션: 레퍼런스의 9:16 / 1080p 칩 */
.seg { display: flex; gap: 6px; flex-wrap: wrap; }
.seg-btn {
  flex: 1 1 auto; min-height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--hair-2);
  background: rgba(255, 255, 255, 0.04); color: var(--text-2); font-size: 12.5px;
}
.seg-btn:hover { color: var(--text); background: rgba(255, 255, 255, 0.08); }
.seg-btn[aria-pressed="true"] { background: #fff; color: #000; border-color: #fff; font-weight: 400; }
.seg.wide { margin-bottom: 2px; }

.ctl-select, .input, .ctl-text {
  width: 100%; height: 42px; padding: 0 14px; border-radius: var(--r-field);
  background: rgba(255, 255, 255, 0.05); border: 1px solid var(--hair); outline: none; font-weight: 300;
}
select.ctl-select, select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--dim) 50%), linear-gradient(135deg, var(--dim) 50%, transparent 50%); background-position: calc(100% - 18px) 55%, calc(100% - 13px) 55%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 32px; }
select option { background: var(--surface-2); }
.ctl-select:focus, .input:focus, .ctl-text:focus { border-color: rgba(255, 255, 255, 0.35); }
.input::placeholder, .ctl-text::placeholder { color: var(--faint); }
textarea.input { height: auto; padding: 12px 14px; resize: vertical; font-size: 12.5px; line-height: 1.6; }
.ctl-text { letter-spacing: .08em; }
.ctl-hex { width: 82px; height: 28px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--hair); background: rgba(255, 255, 255, 0.04); font-size: 12px; outline: none; text-transform: uppercase; font-variant-numeric: tabular-nums; }
.ctl-hex:focus { border-color: rgba(255, 255, 255, 0.35); }
.swatch { position: relative; width: 28px; height: 28px; border-radius: 50%; overflow: hidden; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25); }
.ctl-color { position: absolute; inset: -8px; width: calc(100% + 16px); height: calc(100% + 16px); border: 0; padding: 0; cursor: pointer; background: none; }
.ctl-color-wrap .ctl-head { margin-bottom: 0; }

/* ── Statusbar */
.statusbar { display: flex; align-items: center; gap: 16px; padding: 0 12px; font-size: 11.5px; color: var(--dim); white-space: nowrap; overflow: hidden; }
.status-select { display: flex; align-items: center; gap: 6px; }
.status-select select { height: 22px; font-size: 11.5px; background: rgba(255, 255, 255, 0.06); border: 0; border-radius: 999px; padding: 0 8px; color: var(--text-2); }
.status-btn { height: 22px; padding: 0 10px; font-size: 11.5px; border-radius: 999px; background: transparent; border: 1px solid var(--hair); color: var(--dim); }
.status-btn:hover { color: var(--text); }
.status-btn.active { background: #fff; color: #000; border-color: #fff; }
.save-state[data-state="pending"] { color: var(--warn); }
.save-state[data-state="saved"] { color: var(--text-2); }
.save-state[data-state="error"] { color: var(--danger); }

/* ── Modal: 흰 원형 닫기 버튼 */
#modalRoot { position: relative; z-index: 50; }
.modal-backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.55); backdrop-filter: blur(6px); display: grid; place-items: center; padding: 16px; animation: fade .18s; }
.modal {
  width: 100%; max-height: calc(100dvh - 32px); display: flex; flex-direction: column;
  background: var(--surface); border-radius: 32px; box-shadow: 0 40px 120px rgba(0, 0, 0, 0.7), inset 0 0 0 1px var(--hair);
  animation: pop .22s cubic-bezier(.2, .8, .2, 1);
}
.modal-sm { max-width: 400px; }
.modal-md { max-width: 540px; }
.modal-lg { max-width: 940px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 18px 8px 26px; }
.modal-head h2 { margin: 0; font-size: 21px; font-weight: 300; }
.modal-head .icon-btn { background: #fff; color: #000; border: 0; }
.modal-head .icon-btn:hover { background: #e9e9e9; }
.modal-body { padding: 12px 26px 22px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 22px 20px; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(12px) scale(.98); } }

.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.field-label { font-size: 12.5px; color: var(--text-2); }
.field-hint, .hint { font-size: 12px; color: var(--dim); margin: 0; line-height: 1.55; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }
.field.wide { grid-column: 1 / -1; }
.check { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--text-2); }
.check input { accent-color: var(--orchid); width: 16px; height: 16px; }
hr { border: 0; border-top: 1px solid var(--hair); margin: 6px 0; width: 100%; }

.progress { position: relative; height: 34px; border-radius: 999px; background: rgba(255, 255, 255, 0.06); overflow: hidden; margin-top: 14px; }
.progress-bar { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--aurora); transition: width .2s; }
.progress-text { position: relative; display: grid; place-items: center; height: 100%; font-size: 12.5px; font-weight: 500; font-variant-numeric: tabular-nums; }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.12); border-top-color: #fff; animation: spin .8s linear infinite; margin: 12px auto; }

/* presets */
.preset-layout { display: grid; grid-template-columns: minmax(0, 1fr) 270px; gap: 20px; }
.preset-side { display: flex; flex-direction: column; gap: 12px; padding: 18px; border-radius: 24px; background: var(--surface-2); align-self: start; }
.preset-side h3, .preset-section h3, .section-title { margin: 0; font-size: 14px; font-weight: 400; color: var(--text); display: flex; gap: 8px; align-items: baseline; }
.preset-sections { display: flex; flex-direction: column; gap: 22px; min-width: 0; }
.preset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; margin-top: 10px; }
.preset-card { position: relative; display: flex; border-radius: 22px; overflow: hidden; background: var(--surface-2); }
.preset-section:first-child .preset-card { background: var(--aurora); }
.preset-card:hover { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35); }
.preset-main { flex: 1; text-align: left; border: 0; background: none; padding: 14px 4px 14px 16px; min-width: 0; color: inherit; }
.preset-name { font-weight: 500; font-size: 14px; }
.preset-desc { font-size: 12px; color: rgba(255, 255, 255, 0.85); margin-top: 3px; line-height: 1.45; }
.preset-chain { font-size: 11px; color: rgba(255, 255, 255, 0.62); margin-top: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.preset-section:first-child .preset-chain { color: rgba(255, 255, 255, 0.82); }
.preset-actions { display: flex; flex-direction: column; padding: 8px 8px 8px 0; gap: 4px; }
.preset-section:first-child .preset-actions .icon-btn { color: #fff; background: rgba(255, 255, 255, 0.2); }

/* projects */
.section-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; margin-top: 10px; }
.project-card { position: relative; border-radius: 20px; background: var(--surface-2); overflow: hidden; }
.project-card.current { box-shadow: inset 0 0 0 1.5px #fff; }
.project-thumb { display: grid; place-items: center; width: 100%; aspect-ratio: 4/3; border: 0; padding: 0; background: #0c0c0d; color: var(--faint); }
.project-thumb img { width: 100%; height: 100%; object-fit: cover; }
.project-thumb .ic { width: 30px; height: 30px; }
.project-meta { padding: 9px 40px 11px 12px; }
.project-name { font-size: 13px; font-weight: 400; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.project-sub { font-size: 11.5px; color: var(--dim); }
.project-card .icon-btn { position: absolute; right: 6px; bottom: 8px; }
.account-row { display: flex; gap: 12px; align-items: center; padding: 14px; border-radius: 20px; background: var(--surface-2); }
.account-row .ic { width: 30px; height: 30px; color: var(--dim); }
.kbd-table { display: grid; gap: 8px; }
.kbd-row { display: flex; justify-content: space-between; gap: 12px; align-items: center; font-size: 13px; color: var(--text-2); }
kbd { font: 11.5px var(--font); font-weight: 400; padding: 4px 10px; border-radius: 999px; background: var(--surface-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--hair); }

/* ── Toast */
.toast-root { position: fixed; left: 50%; bottom: 44px; transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast {
  pointer-events: auto; display: flex; align-items: center; gap: 14px; max-width: min(540px, calc(100vw - 24px));
  padding: 11px 20px; border-radius: 999px; background: rgba(34, 34, 37, 0.9); backdrop-filter: blur(18px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5), inset 0 0 0 1px var(--hair); font-size: 13px;
  animation: pop .2s ease-out; transition: opacity .2s, transform .2s;
}
.toast::before { content: ''; width: 7px; height: 7px; border-radius: 50%; flex: none; background: rgba(255, 255, 255, 0.6); }
.toast.out { opacity: 0; transform: translateY(6px); }
.toast-success::before { background: var(--ok); }
.toast-error::before { background: var(--danger); }
.toast-warn::before { background: var(--warn); }
.toast-action { border: 0; background: #fff; color: #000; font-weight: 500; padding: 4px 12px; border-radius: 999px; font-size: 12px; }

/* ================================================================
   Responsive
   ================================================================ */
@media (max-width: 1320px) {
  :root { --left-w: 276px; --right-w: 318px; }
  .pill-group .tool-btn .label { display: none; }
  .pill-group .tool-btn { width: 40px; padding: 0; justify-content: center; }
  .pill-group .reset-btn { width: auto; padding: 0 14px; }
  .pill-group .reset-btn .label { display: inline; }
  .sync-badge { display: none; }
}

@media (max-width: 900px) {
  :root { --gap: 8px; }
  body { font-size: 14px; }
  .app {
    padding: 0; gap: 0;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: 60px minmax(220px, 44dvh) minmax(0, 1fr) 72px;
    grid-template-areas: "top" "stage" "sheet" "nav";
  }
  .statusbar { display: none; }
  .topbar { gap: 6px; padding: 0 8px; overflow-x: auto; scrollbar-width: none; }
  .brand-name { display: none; }
  .circle-group, .pill-group, .topbar-right { gap: 4px; }
  .pill-group .tool-btn { width: 38px; height: 38px; }
  .topbar::-webkit-scrollbar { display: none; }
  .brand { width: auto; }
  .brand-name { font-size: 15px; }
  .toolbar { gap: 6px; }
  .toolbar .label, .topbar-right .label, [data-action="shortcuts"], .pill-group [data-action="hold"] { display: none; }
  .btn-start { padding-right: 3px; }
  .icon-btn { width: 38px; height: 38px; }
  .btn-start { height: 40px; }
  .btn-start .start-knob { width: 34px; height: 34px; }
  .pill-group .reset-btn { display: none; }
  .tool-btn.account-btn, .export-btn { width: 38px; height: 38px; padding: 0; justify-content: center; }

  .stage { border-radius: 0 0 28px 28px; margin: 0 8px; }
  .panel-left, .panel-right { grid-area: sheet; margin: 8px 8px 0; }
  .panel-left, .panel-right, .layers-section, .params-section { display: none; }
  body[data-mpanel="effects"] .panel-left { display: flex; }
  body[data-mpanel="layers"] .panel-right, body[data-mpanel="params"] .panel-right { display: flex; }
  body[data-mpanel="layers"] .layers-section { display: flex; max-height: none; flex: 1; }
  body[data-mpanel="params"] .params-section { display: flex; }

  .panel-head { min-height: 50px; }
  .browser-controls { padding: 2px 12px 8px; gap: 8px; }
  .effect-list[data-view="grid"] { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); }
  .fav-btn { opacity: 1; }
  .layer-actions { opacity: 1; }

  /* 터치 조작용 크게 */
  .ctl { padding: 11px 6px; }
  .ctl-slider { height: 32px; }
  .ctl-slider::-webkit-slider-runnable-track { height: 6px; }
  .ctl-slider::-webkit-slider-thumb { width: 26px; height: 26px; margin-top: -10px; }
  .ctl-slider::-moz-range-thumb { width: 26px; height: 26px; }
  .ctl-num { font-size: 14px; width: 62px; height: 30px; }
  .seg-btn { min-height: 40px; }
  .icon-btn.sm { width: 36px; height: 36px; }

  /* 레퍼런스 스토리보드 하단 원형 버튼 줄 */
  .mobile-nav { grid-area: nav; display: flex; justify-content: center; gap: 22px; padding: 8px 0 max(8px, env(safe-area-inset-bottom)); }
  .mobile-nav button { border: 0; background: none; color: var(--text-2); display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 11px; }
  .nav-circle { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--hair); transition: background .15s, color .15s; }
  .nav-circle .ic { width: 20px; height: 20px; }
  .mobile-nav button[aria-pressed="true"] { color: var(--text); }
  .mobile-nav button[aria-pressed="true"] .nav-circle { background: #fff; color: #000; }
  .nav-label { line-height: 1; }

  .stage-hud { right: 10px; bottom: 10px; }
  .video-bar { left: 10px; right: 10px; width: auto; transform: none; bottom: 10px; }
  .video-bar:not([hidden]) ~ .stage-hud { bottom: 64px; }
  .empty-state { padding: 12px; }
  .welcome-card { height: auto; max-height: 100%; justify-content: flex-end; border-radius: 28px; padding: 18px; }
  .welcome-top, .welcome-sub, .welcome-hint { display: none; }
  .welcome-title { font-size: 22px; margin-bottom: 16px; }
  .start-slider { height: 52px; }
  .start-slider .start-knob { width: 42px; height: 42px; }
  .toast-root { bottom: 92px; width: calc(100vw - 24px); }
  .toast { border-radius: 22px; }
  .preset-layout { grid-template-columns: 1fr; }
  .modal-backdrop { place-items: end center; padding: 0; }
  .modal { border-radius: 30px 30px 0 0; max-height: 92dvh; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
