/* Replotre / Cutroom direction
   A quiet instrument panel for stories in motion.
   Design redline based on Unslop by Damir Sokolovsky (CC BY 4.0)
   https://github.com/heydamir/unslop
*/
:root {
  --bg: #101113;
  --panel: #171819;
  --panel2: #1c1e20;
  --panel3: #242628;
  --line: #303235;
  --line2: #292b2d;
  --text: #f0eee9;
  --muted: #a5a39d;
  --muted2: #777975;
  --primary: #e2ab77;
  --primary-bright: #efbd8e;
  --accent: #e2ab77;
  --green: #7bb59a;
  --orange: #e2ab77;
  --shadow: 0 20px 60px #0009;
  --focus: #e2ab77;
  --easing: cubic-bezier(.22,1,.36,1);
}
html,body { background:var(--bg); color:var(--text); font-family: 'Avenir Next', 'Segoe UI', 'Helvetica Neue', system-ui, sans-serif; font-size:13px; }
* { scrollbar-color:#393b3e transparent; }
button, input, textarea, select { font-family:inherit; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, [tabindex]:focus-visible {outline:2px solid var(--focus);outline-offset:2px;}
button, .rail-item, .icon-button, .button, .suggestion-pill, .template-card, .text-item, .asset-card { transition: background-color .16s var(--easing),color .16s var(--easing),border-color .16s var(--easing),opacity .16s var(--easing); }
h2 {font-size:17px;font-weight:500;letter-spacing:-.25px;line-height:1.3;}
h3 {font-size:13px;font-weight:500;letter-spacing:0;}
svg {stroke-width:1.65;}
.app { min-height:0; background:var(--bg); }
.app-header { height:60px; min-height:60px; gap:20px; padding:0 20px; background:#121314; border-bottom:1px solid var(--line2); }
.header-brand { width:300px;gap:9px; }
.brand-mark {width:auto;height:32px; border-radius:0; background:none; box-shadow:none; color:#DDB07F;}
.brand-mark svg {width:auto;height:14px;}/* official lockup: mark height = wordmark ascender height */
.brand-name {font-family:ui-sans-serif,-apple-system,BlinkMacSystemFont,'SF Pro Display','Segoe UI',Inter,Roboto,sans-serif;font-size:19px;font-weight:700;letter-spacing:-.034em;}
.brand-dot {color:var(--primary);}
.beta-tag {font-size:10px;font-weight:500;letter-spacing:0;color:#a6a39d;border:0;border-left:1px solid #3a3c3f;background:none;border-radius:0;padding:2px 0 2px 11px;margin-left:8px;}
.header-middle {gap:20px;}
.header-divider {background:#3b3b3c;height:24px;}
.minor-label {font-size:11px;color:#8a8b88; margin-bottom:2px;}
.project-name {font-size:13px;font-weight:500;letter-spacing:0;width:175px;color:#ebe8e1;}
.saved-label {font-size:11px;color:#777b74;}
.project-chevron {display:none;}
.header-actions {gap:8px;}
.online-chip {font-size:11px;color:#9b9f99;margin-right:12px;gap:9px;}
.online-dot {width:6px;height:6px;background:#81b79c;box-shadow:none;}
.icon-button {border-radius:8px;color:#a2a3a0;width:32px;height:32px;}
.icon-button:hover,.small-toolbar-btn:hover,.timeline-tool:hover,.transport-button:hover {color:#efece6;background:#27292b;}
.action-divider {background:#3a3c3e;}
.button {height:34px;padding:0 14px;border-radius:8px;font-size:12px;font-weight:500;gap:8px;box-shadow:none;}
.button-ghost {background:#1d1f21;border-color:#36383b;color:#ddd9d2;}
.button-ghost:hover {background:#292a2b;}
.button-primary {background:#eeeae3;color:#171819;box-shadow:inset 0 1px 0 #fff6;}
.button-primary:hover {background:#fffaf3;filter:none;}
.button-soft {background:#32302d;color:#e5c4a4;}
.button-outline {border-color:#464748;color:#ddd9d0;}
.nav-rail {width:68px;background:#131415;border-right-color:var(--line2);}
.nav-main {padding:16px 8px;gap:4px;}
.nav-bottom {padding:12px 8px;}
.rail-item {width:52px;height:58px;gap:6px;color:#90918d;border-radius:8px;font-size:10px;font-weight:500;}
.rail-item svg {width:19px;height:19px;}
.rail-item:hover {color:#e8e5de;background:#242628;}
.rail-item.active {color:#eae4da;background:#292a29;}
.rail-item.active:before {top:15px;left:-8px;height:28px;width:2px;background:var(--primary);border-radius:0 2px 2px 0;}
.asset-panel {width:264px;background:#171819;border-right-color:var(--line2);}
.asset-header {padding:25px 20px 22px;}
.panel-kicker {font-size:11px;letter-spacing:0;font-weight:400;color:#91928e;margin-bottom:7px;text-transform:none;}
.asset-content {padding:0 16px 22px;scrollbar-color:#434444 transparent;}
.panel-intro {font-size:12px;line-height:1.55;color:#a6a39d;margin-bottom:18px;}
.upload-zone {background:#1c1e1e;border:1px dashed #464643;border-radius:12px;min-height:142px;padding:16px;margin:0 0 22px;gap:9px;}
.upload-zone:hover,.upload-zone.drag-over {border-color:var(--primary);background:#252422;}
.upload-icon {background:#2e302f;color:#d7c4af;border-radius:8px;width:36px;height:36px;}
.upload-icon svg {width:17px;height:17px;}
.upload-zone strong {font-size:12px;font-weight:500;}
.upload-zone small {font-size:11px;color:#91918c;line-height:1.55;}
.upload-zone em {color:#e7bf96;font-style:normal;}
.section-heading {margin:22px 0 12px;}
.section-heading span {font-size:11px;font-weight:500;color:#d5d2cc;letter-spacing:0;}
.section-heading button {font-size:11px;color:#d8b38b;}
.search-input,.field-input,.property-input,.property-select,.field-area {background:#242628;border:1px solid #3a3c3d;border-radius:8px;color:#f0eee9;}
.search-input {height:36px;}
.search-input::placeholder,.chat-textarea::placeholder {color:#858780;}
.media-grid {gap:12px 8px;}
.asset-thumb {height:78px;border-radius:7px;border:1px solid #ffffff1a;}
.asset-thumb:after {background:linear-gradient(transparent 52%,#0009);}
.asset-thumb svg {width:18px;height:18px;filter:drop-shadow(0 1px 6px #0007);}
.asset-name {font-size:11px;font-weight:500;color:#e1dfd9;margin-top:7px;}
.asset-sub {font-size:10px;color:#96958f;}
.asset-placeholder {background:#1c1e20;border:1px solid #303235;border-radius:10px;padding:14px;color:#92938f;font-size:11px;}
.asset-placeholder svg {color:#b1aba3;}
.template-card {background:#202122;border-color:#393a39;border-radius:10px;margin-bottom:12px;}
.template-card:hover,.variant-card:hover {border-color:#b09a82;transform:none;}
.template-visual {height:100px;}
.template-visual:after {display:none;}
.template-visual span {font-size:23px;font-weight:600;letter-spacing:-.7px;}
.template-info {padding:12px;}
.template-info strong {font-weight:500;font-size:12px;}
.template-info small {font-size:11px;color:#a09e99;}
.text-item {background:#202122;border-color:#383a3b;border-radius:10px;padding:11px;gap:12px;}
.text-item:hover {border-color:#967e66;}
.text-preview {background:#30302d;color:#d3bfa9;border-radius:7px;font-weight:500;}
.text-item strong {font-weight:500;}
.text-item small {color:#9d9b96;}
.field-label {color:#c0beb9;font-weight:500;font-size:11px;margin:16px 0 8px;}
.variant-card {background:#202122;border-color:#3c3c3a;border-radius:10px;padding:14px;}
.variant-number {color:#d6b99a;letter-spacing:0;font-weight:500;}
.variant-text {font-weight:500;font-size:14px;}
.variant-info {color:#a29e97;}
.brand-card {background:#202223;border-color:#3b3d3e;}
.editor-main {background:#111213;}
.editor-toolbar {height:52px;padding:0 20px;border-bottom-color:#2c2e2f;background:#171819;}
.toolbar-left,.toolbar-right {gap:11px;}
.editor-section-icon {color:#9b9d9a;}
.editor-title {font-size:12px;font-weight:500;}
.toolbar-sep {background:#37393a;}
.preview-badge {font-size:10px;letter-spacing:0;color:#aaa9a4;font-weight:400;}
.preview-dot {background:var(--primary);width:5px;height:5px;}
.small-toolbar-btn {color:#b0afaa;}
.preview-section {background:#131415;}
.preview-section:before {background-image:none;}
.preview-workspace {padding:18px 22px 8px;}
.preview-stage {background:transparent;}
.preview-frame {border-radius:2px;background:#111316;box-shadow:0 15px 45px #000a,0 0 0 1px #ffffff1c;}
.preview-frame:after {content:'';position:absolute;pointer-events:none;inset:0;box-shadow:inset 0 0 0 1px #ffffff10;}
.preview-bottom {height:38px;padding:0 22px 8px;color:#8d8e89;font-size:11px;}
.preview-helper svg {display:none;}
.preview-helper {gap:0;color:#a8a59d;}
.preview-bottom-controls {font-family:ui-monospace,'SFMono-Regular',Consolas,monospace;letter-spacing:.12px;font-size:10px;color:#939591;}
.timeline-section {height:288px;background:#141516;border-top-color:#333436;}
.timeline-section.expanded {height:440px;}
.timeline-toolbar {height:44px;padding:0 17px;border-bottom-color:#2b2d2f;}
.timeline-left,.timeline-right {gap:7px;}
.timeline-heading {font-size:12px;font-weight:500;margin-right:4px;}
.timeline-clip-count {background:none;border:0;font-family:ui-monospace,monospace;font-size:10px;padding:0;margin-right:9px;color:#878b86;}
.timeline-tool {width:30px;height:30px;border-radius:6px;color:#949793;}
.timeline-tool.active {background:#2d2b29;color:#e8bb8f;}
.timeline-tool svg {width:16px;height:16px;}
.transport-bar {height:42px;padding:0 20px;border-bottom-color:#292b2e;}
.transport-left,.transport-right {gap:8px;}
.time-value {color:#e8b587;font-size:11px;letter-spacing:.1px;font-weight:500;font-variant-numeric:tabular-nums;}
.time-total {color:#9e9e9b;font-variant-numeric:tabular-nums;}
.transport-button {color:#a3a39e;border-radius:6px;}
.transport-play {background:#eeeae3;color:#1a1a1a;border-radius:7px;width:32px;height:30px;}
.transport-play:hover {background:#fffaf3;color:#111;}
.keyboard-hint {color:#848680;font-size:10px;letter-spacing:0;}
.timeline-scroll {scrollbar-color:#3d3e3f #161718;}
.timeline-body {min-height:170px;}
.timeline-ruler {background:#171819;border-bottom-color:#333435;color:#969793;font:10px/1.2 ui-monospace,'SFMono-Regular',monospace;}
.track-row {border-bottom-color:#292b2c;}
.track-label {background:#1b1d1e;color:#969894;border-right-color:#303232;font-weight:400;font-size:10px;letter-spacing:0;}
.track-area {background:repeating-linear-gradient(90deg,transparent 0,transparent 83px,#ffffff06 84px);}
.clip-block {color:#f2eee7;border-color:#696963;border-radius:5px;font-weight:500;font-size:11px;box-shadow:none;}
.clip-block:hover {filter:brightness(1.06);}
.clip-block.selected {border:1.5px solid #f0b981;box-shadow:inset 0 0 0 1px #f0b981,0 0 0 1px #e2ab7755;}
.clip-block.demo0 {background:linear-gradient(110deg,#71594a,#4a3a36);border-color:#a08a77;}
.clip-block.demo1 {background:linear-gradient(110deg,#85624d,#69463a);border-color:#9f806a;}
.clip-block.demo2 {background:linear-gradient(110deg,#3e5756,#293d43);border-color:#68878c;}
.clip-block.video {background:linear-gradient(110deg,#394d52,#293a41);border-color:#68818a;}
.clip-block.image {background:linear-gradient(110deg,#556455,#333f36);border-color:#778b79;}
.clip-waveform {opacity:.21;}
.clip-duration {opacity:.7;}
.playhead-line {background:#e7b584;box-shadow:none;width:1px;}
.playhead-handle {background:#e7b584;width:11px;}
.timeline-footer {background:#171819;border-top-color:#2b2d2d;color:#858783;font-size:10px;height:26px;}
.status-indicator {background:#85b39c;box-shadow:none;}
.right-panel {width:334px;background:#191a1b;border-left-color:#303132;}
.right-header {height:52px;padding:0 16px;border-bottom-color:#303132;}
.right-tabs {gap:19px;}
.right-tab {font-size:12px;font-weight:500;color:#9b9c99;gap:8px;}
.right-tab.active {color:#eeeae4;}
.right-tab.active:after {background:#e2ab77;height:2px;border-radius:0;}
.right-tab svg {width:16px;height:16px;}
.ai-intro {padding:22px 20px 18px;border-bottom-color:#303131;}
.ai-intro-top {gap:12px;}
.agent-avatar {width:36px;height:36px;border-radius:9px;color:#f3e7d9;background:#38332d;box-shadow:none;border:1px solid #61503c;}
.agent-avatar svg {width:18px;height:18px;}
.ai-intro h3 {font-size:13px;font-weight:500;}
.ai-intro p {font-size:11px;color:#9f9e98;margin-top:4px;}
.agent-mode {background:none;border:1px solid #41403c;color:#b4b1a8;font-size:10px;letter-spacing:0;font-weight:400;border-radius:6px;margin-top:14px;padding:6px 9px;}
.agent-mode svg {color:#cfad88;}
.ai-message-list {padding:20px 18px;gap:16px;}
.message-agent {gap:11px;}
.message-icon {width:24px;height:24px;border-radius:6px;background:#30302e;color:#d8b38b;}
.message-bubble {font-size:12px;color:#c9c8c3;line-height:1.6;}
.message-bubble strong {font-weight:500;color:#f0ebe3;}
.message-user {background:#30302e;color:#eae6df;border-radius:10px 10px 3px 10px;font-size:12px;}
.suggestion-heading {color:#a8a59e;font-size:11px;font-weight:500;letter-spacing:0;margin:16px 0 11px 35px;}
.suggestion-pill {margin-left:35px;padding:12px;border:1px solid #3c3d3d;background:#222425;color:#c8c6c0;border-radius:8px;font-size:11px;line-height:1.5;}
.suggestion-pill:hover {background:#292b2b;border-color:#80715f;}
.suggestion-pill svg {color:#bcb3a8;width:15px;height:15px;}
.ai-compose {padding:14px 16px 16px;background:#191a1b;border-top-color:#323332;}
.composer-box {background:#222425;border:1px solid #494b49;border-radius:11px;}
.composer-box:focus-within {border-color:#aa8968;}
.chat-textarea {height:91px;font-size:12px;line-height:1.6;padding:12px 13px 5px;}
.composer-footer {padding:4px 8px 8px;}
.composer-model {font-size:11px;color:#a9a79f;}
.composer-model svg {color:#a9a79f;}
.send-button {background:#e9e3d9;color:#1b1c1c;border-radius:7px;width:30px;height:30px;}
.send-button:hover {background:#fff9ed;}
.composer-hint {font-size:10px;color:#898c85;line-height:1.4;margin-top:10px;}
.property-scroll {padding:18px;}
.property-card {background:#222324;border-color:#373939;border-radius:11px;padding:15px;}
.property-card-title {font-weight:500;color:#e8e4dc;font-size:12px;}
.property-card-title svg {color:#d1a476;}
.property-label {color:#b1b0a8;}
.property-input,.property-select {background:#2b2c2c;border-color:#474747;color:#ede9e3;}
.range {accent-color:#d4a572;}
.property-color {border-color:#57534d;background:#292928;}
.tiny-ghost {color:#d7b58f;}
.properties-empty {color:#a7a59e;}
.properties-empty svg {color:#b49d84;}
.properties-empty h3 {color:#e3ded5;}
.subtle-divider {border-top-color:#3c3d3c;}
.toast {background:#242625;border-color:#4a4c4a;color:#efebe4;border-radius:9px;box-shadow:0 8px 32px #0008;}
.toast svg {color:#e3b283;}
.modal-backdrop {background:#080909b7;backdrop-filter:blur(4px);}
.modal {background:#202122;border-color:#474847;border-radius:14px;box-shadow:0 24px 70px #000a;}
.modal-header,.export-footer {border-color:#363737;}
.modal-header h2 {font-size:17px;font-weight:500;}
.modal-description {color:#b3b0a7;}
.export-option {background:#292a2a;border-color:#464746;border-radius:8px;color:#dedbd5;}
.export-option.active {background:#39332d;border-color:#dfab7b;box-shadow:inset 0 0 0 1px #b8895c;}
.export-option strong {font-weight:500;}
.export-option small {color:#aeadab;}
.export-note {color:#9d9c96;}
.export-progress {background:#383937;}
.export-progress span {background:#e2ab77;}
.shortcut {color:#d3d0c9;border-color:#393a39;}
.shortcut kbd {background:#383a3b;color:#dbd5cd;}
.orange-badge {background:#40362c;color:#e7bd95;}
.mini-action {background:#31302e;border-color:#514a42;color:#ead8c2;border-radius:8px;font-weight:500;}
.mini-action:hover {background:#3a3833;}
.file-select {color:#c1bdb6;}
.file-select input {accent-color:#e2ab77;}
/* Readable field sizes, without compromising editor density */
.asset-content,.right-content {font-variant-numeric:tabular-nums;}
@media(max-width:1450px) {
  .header-brand {width:290px;}
  .asset-panel {width:240px;}
  .right-panel {width:316px;}
}
@media(max-width:1180px) {
  .header-brand {width:210px;}
  .nav-rail {width:60px;}
  .rail-item {width:44px;}
  .asset-panel {width:216px;}
  .right-panel {width:282px;}
}
@media(max-width:980px) {
  .asset-panel {top:60px;left:60px;width:260px;}
  .right-panel {width:280px;}
  .editor-toolbar {padding:0 14px;}
  .timeline-section {height:265px;}
}
@media(max-width:700px) {
  .app-header {height:56px;min-height:56px;padding:0 14px;gap:12px;}
  .brand-mark {width:auto;height:28px;}
  .brand-mark svg {width:auto;height:13px;}
  .brand-name {font-size:18px;}
  .header-actions .button-primary {height:32px;padding:0 12px;font-size:11px;}
  .header-actions .button-primary svg {width:14px;height:14px;}
  .asset-panel,.right-panel {inset:56px 0 60px 0;width:100%;}
  .asset-header {padding:20px 20px 14px;}
  .asset-content {padding:0 20px 24px;}
  .media-grid {grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;}
  .asset-thumb {height:105px;}
  .right-header {height:52px;}
  .editor-main {padding-bottom:60px;}
  .editor-toolbar {height:44px;padding:0 13px;}
  .preview-workspace {padding:14px 12px 5px;}
  .preview-bottom {padding:0 14px 5px;height:32px;font-size:10px;}
  .timeline-section {height:300px;}
  .timeline-toolbar {padding:0 9px;height:42px;}
  .timeline-left,.timeline-right {gap:1px;}
  .timeline-tool {width:28px;height:29px;}
  .timeline-clip-count {margin-right:3px;}
  .transport-bar {padding:0 12px;height:42px;}
  .transport-center {gap:3px;}
  .transport-button {width:23px;}
  .transport-play {width:30px;}
  .time-value,.time-total {font-size:10px;}
  .timeline-footer {padding:0 12px;}
  .mobile-bottom-nav {height:60px;background:#1a1b1b;border-top-color:#383938;}
  .mobile-bottom-nav button {font-size:11px;color:#a7a6a0;gap:7px;}
  .mobile-bottom-nav button.mobile-nav-active {color:#ebc09b;}
  .mobile-bottom-nav svg {width:17px;height:17px;}
}
@media(max-width:390px) {
  .timeline-left .timeline-clip-count {display:none;}
  .timeline-left,.timeline-right {gap:0;}
  .preview-bottom-controls {font-size:9px;}
  .toolbar-right {gap:4px;}
  .brand-name {font-size:17px;}
}
@media(max-height:690px) and (min-width:701px) {
  .timeline-section {height:246px;}
  .preview-workspace {padding:8px;}
  .right-header {height:48px;}
  .ai-intro {padding:14px 17px;}
}
@media(prefers-reduced-motion:reduce) {
  *,*::before,*::after {animation-duration:.01ms!important;transition-duration:.01ms!important;scroll-behavior:auto!important;}
}
/* Film-contact thumbnails are generated from the same sample renderer as the canvas. */
.demo-thumb {background:#4b4e4b;}
.demo-thumb img {width:100%;height:100%;object-fit:cover;object-position:50% 56%;filter:saturate(.88);}
.demo-thumb svg {position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);background:#1012136b;border-radius:50%;padding:5px;width:28px;height:28px;stroke-width:2;}

/* Responsive, scrollable timeline */
.timeline-scroll {overscroll-behavior-x:contain;-webkit-overflow-scrolling:touch;touch-action:pan-x pan-y;scroll-behavior:auto;}
.timeline-ruler {cursor:ew-resize;}
.ruler-corner {position:sticky;left:0;z-index:1;flex:0 0 78px;width:78px;height:100%;background:#171819;border-right:1px solid #303232;}
.track-label {z-index:5;}
.track-area {cursor:text;background:repeating-linear-gradient(90deg,transparent 0,transparent calc(var(--grid,84px) - 1px),#ffffff06 calc(var(--grid,84px) - 1px),#ffffff06 var(--grid,84px));}
.track-area .clip-block {cursor:grab;}
.playhead-line.behind-labels {visibility:hidden;}
.zoom-value {min-width:44px;text-align:center;cursor:zoom-in;user-select:none;}
.timeline-body {overflow-x:clip;}
/* Pinned clip names: overflow:clip (unlike hidden) isn't a scroll container, so the label can stick to the timeline viewport */
.clip-block {overflow:clip;}
.clip-label {position:sticky;left:86px;z-index:1;display:inline-flex;align-items:center;gap:8px;min-width:0;max-width:100%;overflow:hidden;pointer-events:none;}
.clip-name {overflow:hidden;text-overflow:ellipsis;min-width:0;}
.clip-label .clip-duration {flex-shrink:0;}

/* ---------- Media library cards (v2) ---------- */
.section-count {display:inline-grid;place-items:center;min-width:18px;height:16px;padding:0 5px;margin-left:5px;border-radius:8px;background:#ffffff0f;color:#a8a69f !important;font:500 10px/1 ui-monospace,'SFMono-Regular',monospace !important;vertical-align:1px;}
.section-add {display:inline-flex;align-items:center;gap:4px;height:24px;padding:0 9px 0 7px;border-radius:7px;border:1px solid #e2ab7733;background:#e2ab770d;}
.section-add:hover {background:#e2ab771f;border-color:#e2ab7766;color:#f0c79c;}
.section-add svg {width:12px;height:12px;}
.media-grid .asset-card {position:relative;border-radius:9px;padding:0 0 4px;outline-offset:3px;}
.media-grid .asset-thumb {height:auto;aspect-ratio:16/10;border-radius:8px;border:1px solid #ffffff14;background:linear-gradient(140deg,#2b2d33,#1d1f23);transition:border-color .16s,box-shadow .16s,transform .2s cubic-bezier(.2,.8,.2,1);isolation:isolate;}
.media-grid .asset-thumb:after {z-index:2;background:linear-gradient(180deg,#0006 0,transparent 30%,transparent 58%,#000a 100%);pointer-events:none;}
.media-grid .asset-card:hover .asset-thumb {border-color:#e2ab7799;box-shadow:0 6px 18px #0007;transform:translateY(-1px);}
.media-grid .asset-card:active .asset-thumb {transform:scale(.985);}
.asset-card.dragging {opacity:.45;}
.asset-thumb img.poster,.asset-thumb .hover-preview {position:absolute;inset:0;width:100%;height:100%;object-fit:cover;z-index:0;}
.asset-thumb .hover-preview {opacity:0;transition:opacity .12s;pointer-events:none;background:#000;}
.asset-card.scrubbing .hover-preview.ready {opacity:1;}
/* Placeholder until the poster frame is ready */
.asset-card.kind-video .asset-thumb:not(.has-poster) {background:#25272c;}
.asset-card.kind-video .asset-thumb:not(.has-poster):before {content:'';position:absolute;inset:0;background:linear-gradient(110deg,transparent 30%,#30333a 50%,transparent 70%);transform:translateX(-100%);animation:thumb-sweep 1.4s linear infinite;pointer-events:none;}
@keyframes thumb-sweep {to{transform:translateX(100%)}}
.asset-card.kind-audio .asset-thumb {background:linear-gradient(140deg,#24332e,#1b2427);}
.thumb-wave {position:absolute;inset:22% 12% 30%;display:flex;align-items:center;gap:2px;z-index:1;}
.thumb-wave i {flex:1;border-radius:2px;background:#8fc0a8;opacity:.75;}
.media-grid .asset-thumb .thumb-kind {position:absolute;top:6px;left:6px;z-index:3;display:grid;place-items:center;width:20px;height:20px;border-radius:6px;background:#0009;backdrop-filter:blur(6px);-webkit-backdrop-filter:blur(6px);color:#ece8e1;}
.media-grid .asset-thumb .thumb-kind svg {width:11px;height:11px;filter:none;}
.thumb-used {position:absolute;top:6px;right:6px;z-index:3;display:inline-flex;align-items:center;gap:2px;height:20px;padding:0 6px;border-radius:10px;background:#e2ab77;color:#1a1612;font:600 10px/1 ui-monospace,monospace;}
.media-grid .asset-thumb .thumb-used svg {width:11px;height:11px;stroke-width:3;filter:none;}
.thumb-add {position:absolute;left:50%;top:50%;z-index:3;display:grid;place-items:center;width:30px;height:30px;margin:-15px 0 0 -15px;border-radius:50%;background:#f3ede4;color:#141414;box-shadow:0 4px 14px #0009;opacity:0;transform:scale(.8);transition:opacity .15s,transform .18s cubic-bezier(.2,.8,.2,1);}
.media-grid .asset-thumb .thumb-add svg {width:15px;height:15px;stroke-width:2.4;filter:none;}
.media-grid .asset-card:hover .thumb-add,.media-grid .asset-card:focus-visible .thumb-add {opacity:1;transform:scale(1);}
.media-grid .asset-card.scrubbing .thumb-add {opacity:0;}
.media-grid .thumb-time {z-index:3;right:6px;bottom:6px;padding:3px 5px;border-radius:5px;background:#000b;color:#f4f1ec;font:500 10px/1 ui-monospace,'SFMono-Regular',monospace;letter-spacing:.2px;}
.scrub-bar {position:absolute;left:0;right:0;bottom:0;height:2px;z-index:4;background:#ffffff26;opacity:0;transition:opacity .12s;}
.scrub-bar i {display:block;height:100%;width:var(--scrub,0%);background:#e2ab77;}
.asset-card.scrubbing .scrub-bar {opacity:1;}
.asset-card.scrubbing .thumb-time {opacity:0;}
.media-grid .asset-name {display:flex;min-width:0;margin-top:8px;font-size:12px;font-weight:500;color:#ece9e3;}
.asset-base {overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0;}
.asset-ext {flex-shrink:0;color:#8d8b85;font-weight:400;}
.media-grid .asset-sub {margin-top:3px;font-size:10.5px;color:#8d8b85;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.asset-card.in-use .asset-thumb {border-color:#e2ab7755;}
/* Timeline glows while a library card is being dragged over it */
.timeline-section.media-drop-ready .track-area[data-drop-track] {box-shadow:inset 0 0 0 1px #e2ab7766;background-color:#e2ab770a;}
@media (prefers-reduced-motion:reduce) {.media-grid .asset-thumb,.thumb-add{transition:none}.asset-card.kind-video .asset-thumb:not(.has-poster):before{animation:none;transform:none;opacity:0}}

/* ---------- Sample footage cards ---------- */
.section-tag {height:18px;display:inline-flex;align-items:center;padding:0 7px;border-radius:9px;border:1px solid #ffffff17;color:#8d8b85 !important;font-size:10px !important;font-weight:500 !important;}
.asset-card.kind-sample .asset-thumb img.poster {transition:transform 2.4s cubic-bezier(.2,.7,.2,1);transform-origin:62% 45%;}
.asset-card.kind-sample:hover .asset-thumb img.poster {transform:scale(1.12);}
@media (prefers-reduced-motion:reduce) {.asset-card.kind-sample .asset-thumb img.poster{transition:none}.asset-card.kind-sample:hover .asset-thumb img.poster{transform:none}}

/* ---------- Timeline clip blocks (v2) ---------- */
.track-row:not(.text-row):not(.audio-row) {height:56px;}
.track-area .clip-block {padding:0;align-items:flex-start;border-radius:6px;border:1px solid #ffffff1f;transition:box-shadow .14s,border-color .14s,filter .14s;}
.track-area .clip-block:hover {filter:none;border-color:#ffffff4d;}
/* Filmstrip */
.clip-strip {position:absolute;inset:0;display:flex;overflow:hidden;pointer-events:none;}
.clip-strip i {flex:none;height:100%;background-size:var(--thumb-w) 100%;background-repeat:repeat-x;background-position:left center;box-shadow:inset -1px 0 0 #0000004d;}
.clip-strip.pending:before {content:'';position:absolute;inset:0;background:linear-gradient(110deg,transparent 30%,#ffffff0d 50%,transparent 70%);transform:translateX(-100%);animation:thumb-sweep 1.4s linear infinite;pointer-events:none;}
.track-area .clip-block:not(.text-clip):not(.caption-clip):not(.audio-clip):after {content:'';position:absolute;inset:0;pointer-events:none;background:linear-gradient(180deg,#000a 0,#0000 46%,#0000 70%,#0006 100%);}
/* Name chip pinned to the visible part of the clip */
.track-area .clip-label {z-index:2;margin:5px 6px 0;max-width:calc(100% - 12px);height:18px;padding:0 6px;gap:5px;border-radius:4px;background:#121314e6;font-size:10.5px;font-weight:500;color:#f3efe8;}
.track-area .clip-label svg {width:11px;height:11px;opacity:.75;}
.track-area .clip-duration {font:500 9.5px/1 ui-monospace,'SFMono-Regular',monospace;opacity:.65;}
.clip-speed {flex-shrink:0;padding:1px 4px;border-radius:3px;background:#e2ab77;color:#1a1612;font:600 9px/1.2 ui-monospace,monospace;}
.track-area .clip-block .real-waveform {z-index:1;color:#f1e3d2;opacity:.55;}
/* Text, caption and audio blocks */
.track-area .text-clip,.track-area .caption-clip {align-items:center;background:linear-gradient(180deg,#4a3b63,#3a2f50);border-color:#8e76b866;}
.track-area .caption-clip {background:linear-gradient(180deg,#3d4a63,#2f3a50);border-color:#7690b866;}
.track-area .text-clip .clip-label,.track-area .caption-clip .clip-label {margin:0 6px;background:none;backdrop-filter:none;-webkit-backdrop-filter:none;padding:0 4px;}
.track-area .audio-clip {align-items:center;background:linear-gradient(180deg,#24453b,#1c352e);border-color:#4f9a8066;}
.track-area .audio-clip .clip-label {margin:0 6px;background:#0f1a17cc;}
/* Selection */
.track-area .clip-block.selected {border-color:#f0b981;box-shadow:0 0 0 1px #f0b981,0 4px 14px #0008;z-index:2;}
/* Trim handles */
.trim-handle {position:absolute;top:0;bottom:0;width:9px;z-index:3;cursor:ew-resize;display:flex;align-items:center;justify-content:center;opacity:0;transition:opacity .12s,background-color .12s;touch-action:none;}
.trim-handle.l {left:0;border-radius:5px 0 0 5px;}
.trim-handle.r {right:0;border-radius:0 5px 5px 0;}
.trim-handle:before {content:'';width:2px;height:40%;max-height:16px;border-radius:1px;background:#1a1612;opacity:.75;}
.track-area .clip-block:hover .trim-handle {opacity:1;background:#ffffff40;}
.track-area .clip-block.selected .trim-handle {opacity:1;background:#f0b981;}
.track-area .clip-block .trim-handle:hover,body.is-trimming .clip-block.selected .trim-handle {background:#f6cb9c;}
body.is-trimming,body.is-trimming * {cursor:ew-resize !important;user-select:none;}
@media (hover:none) {.track-area .clip-block.selected .trim-handle{width:14px}}
@media (prefers-reduced-motion:reduce) {.clip-strip.pending:before{animation:none;transform:none;opacity:0}}

/* ---------- Properties panel (v2) ---------- */
.pp {padding:16px 16px 22px;display:flex;flex-direction:column;gap:12px;}
.pp-head {display:flex;gap:12px;align-items:center;}
.pp-thumb {position:relative;flex:none;width:84px;height:54px;border-radius:8px;border:1px solid #ffffff1a;background:#2a2c2f center/cover no-repeat;display:grid;place-items:center;color:#c9c5bd;overflow:hidden;}
.pp-thumb-text {font:700 18px/1 Manrope,sans-serif;color:#f1e6d8;background:linear-gradient(140deg,#4a3b63,#2f2740);}
.pp-thumb-time {position:absolute;right:4px;bottom:4px;padding:2px 4px;border-radius:4px;background:#000b;color:#f4f1ec;font:500 9px/1 ui-monospace,'SFMono-Regular',monospace;}
.pp-head-text {display:flex;flex-direction:column;gap:3px;min-width:0;flex:1;}
.pp-kicker {font-size:10px;letter-spacing:.6px;text-transform:uppercase;color:#d1a476;}
.pp-head-name {font-size:14px;font-weight:600;color:#f1ede6;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.pp-name {width:100%;min-width:0;height:28px;margin-left:-6px;padding:0 6px;border:1px solid transparent;border-radius:6px;background:transparent;color:#f1ede6;font-size:14px;font-weight:600;text-overflow:ellipsis;}
.pp-name:hover {border-color:#3a3c3d;}
.pp-name:focus {border-color:#d1a476;background:#1b1c1d;outline:none;}
.pp-meta {font-size:11px;color:#8d8b85;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.pp-stats {display:grid;grid-template-columns:repeat(3,1fr);gap:1px;border-radius:9px;overflow:hidden;border:1px solid #333536;background:#333536;}
.pp-stats > div {display:flex;flex-direction:column;gap:3px;padding:8px 10px;background:#1d1e1f;}
.pp-stats span {font-size:10px;color:#8d8b85;}
.pp-stats strong {font:500 12px/1.1 ui-monospace,'SFMono-Regular',monospace;color:#ece9e3;}
.pp-section {background:#1f2021;border:1px solid #313334;border-radius:11px;padding:13px 13px 14px;}
.pp-section-title {display:flex;align-items:center;gap:7px;margin-bottom:12px;font-size:12px;font-weight:500;color:#e8e4dc;}
.pp-section-title svg {width:14px;height:14px;color:#d1a476;}
.pp-section-title > span {flex:1;}
.pp-link {font-size:11px;color:#d8b38b;padding:2px 4px;border-radius:4px;}
.pp-link:hover {background:#e2ab771a;}
.pp-label {font-size:11px;color:#b1b0a8;}
.pp-label-row {margin:12px 0 7px;}
.pp-label-row:first-child {margin-top:0;}
.pp-help {margin:10px 0 0;font-size:10.5px;line-height:1.55;color:#8d8b85;}
.pp-textarea {min-height:70px;font-size:13px;line-height:1.45;}
/* Segmented control (radio based, so data-change keeps working) */
.pp-seg {display:flex;padding:2px;gap:2px;border-radius:8px;background:#151617;border:1px solid #303233;}
.pp-seg-opt {flex:1;position:relative;min-width:0;}
.pp-seg-opt input {position:absolute;opacity:0;inset:0;margin:0;cursor:pointer;}
.pp-seg-opt span {display:grid;place-items:center;height:28px;padding:0 4px;border-radius:6px;font-size:11px;color:#a9a7a0;white-space:nowrap;transition:background-color .14s,color .14s;}
.pp-seg-opt:hover span {color:#ece9e3;background:#ffffff0a;}
.pp-seg-opt input:checked + span {background:#e2ab77;color:#1a1612;font-weight:600;}
.pp-seg-opt input:focus-visible + span {outline:2px solid #e2ab77;outline-offset:1px;}
/* Sliders with live value */
.pp-slider {margin-top:12px;}
.pp-slider:first-child {margin-top:0;}
.pp-slider-top {display:flex;justify-content:space-between;align-items:baseline;margin-bottom:6px;}
.pp-value {font:500 11px/1 ui-monospace,'SFMono-Regular',monospace;color:#ece9e3;}
.pp-range {-webkit-appearance:none;appearance:none;width:100%;height:18px;margin:0;background:transparent;cursor:pointer;}
.pp-range::-webkit-slider-runnable-track {height:4px;border-radius:2px;background:linear-gradient(90deg,#e2ab77 var(--fill,50%),#3a3c3d var(--fill,50%));}
.pp-range::-moz-range-track {height:4px;border-radius:2px;background:linear-gradient(90deg,#e2ab77 var(--fill,50%),#3a3c3d var(--fill,50%));}
.pp-range::-webkit-slider-thumb {-webkit-appearance:none;width:14px;height:14px;margin-top:-5px;border-radius:50%;background:#f6efe6;border:0;box-shadow:0 1px 4px #000a,0 0 0 3px #e2ab7733;transition:transform .12s;}
.pp-range::-moz-range-thumb {width:14px;height:14px;border-radius:50%;background:#f6efe6;border:0;box-shadow:0 1px 4px #000a;}
.pp-range:hover::-webkit-slider-thumb {transform:scale(1.15);}
.pp-range:focus-visible {outline:none;}
.pp-range:focus-visible::-webkit-slider-thumb {box-shadow:0 0 0 3px #e2ab7799;}
.pp-audio {display:flex;align-items:flex-end;gap:10px;}
.pp-audio .pp-slider {flex:1;}
.pp-icon-btn {flex:none;display:grid;place-items:center;width:30px;height:30px;border-radius:7px;border:1px solid #3a3c3d;color:#d6d3cc;}
.pp-icon-btn:hover {background:#ffffff0d;}
.pp-icon-btn.is-on {background:#e2ab77;border-color:#e2ab77;color:#1a1612;}
.pp-icon-btn svg {width:14px;height:14px;}
/* Number fields */
.pp-grid2 {display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:10px;}
.pp-grid2:first-child {margin-top:0;}
.pp-num {position:relative;display:flex;flex-direction:column;gap:5px;}
.pp-num > span {font-size:10.5px;color:#8d8b85;}
.pp .pp-num .property-input {width:100%;height:32px;padding:0 22px 0 9px;font:500 12px ui-monospace,'SFMono-Regular',monospace;}
.pp-num em {position:absolute;right:9px;bottom:9px;font-style:normal;font-size:11px;color:#6f6d68;pointer-events:none;}
.pp .property-input:focus {border-color:#d1a476;outline:none;}
/* Trim visual */
.pp-trimviz {position:relative;height:38px;border-radius:7px;overflow:hidden;background:#151617;border:1px solid #303233;}
.pp-trimviz-strip {position:absolute;inset:0;display:flex;}
.pp-trimviz-strip i {flex:1;background:center/cover no-repeat;}
.pp-trimviz-mask {position:absolute;top:0;bottom:0;background:#0f1011d9;}
.pp-trimviz-range {position:absolute;top:0;bottom:0;border:2px solid #e2ab77;border-radius:5px;box-shadow:0 0 0 1px #0007;}
.pp-trimviz-scale {display:flex;justify-content:space-between;margin:5px 0 2px;font:500 9.5px/1 ui-monospace,monospace;color:#6f6d68;}
/* Color swatches */
.pp-swatches {display:flex;flex-wrap:wrap;gap:7px;}
.pp-swatch {position:relative;width:26px;height:26px;border-radius:50%;background:var(--sw);box-shadow:inset 0 0 0 1px #ffffff26;cursor:pointer;}
.pp-swatch input[type=radio] {position:absolute;inset:0;margin:0;opacity:0;cursor:pointer;}
.pp-swatch:has(input:checked) {box-shadow:0 0 0 2px #1f2021,0 0 0 4px #e2ab77;}
.pp-swatch:has(input:focus-visible) {outline:2px solid #e2ab77;outline-offset:3px;}
.pp-swatch-custom {background:conic-gradient(#f87171,#fbbf24,#a3e635,#22d3ee,#818cf8,#f472b6,#f87171);overflow:hidden;}
.pp-swatch-custom input {position:absolute;inset:-6px;width:40px;height:40px;opacity:0;cursor:pointer;border:0;padding:0;}
/* Buttons */
.pp-btn {display:inline-flex;align-items:center;justify-content:center;gap:6px;height:32px;padding:0 10px;border-radius:8px;border:1px solid #3d3f40;background:#2a2b2c;color:#e6e2da;font-size:11px;font-weight:500;white-space:nowrap;}
.pp-btn:hover {background:#333536;border-color:#4a4c4d;}
.pp-btn svg {width:13px;height:13px;}
.pp-btn.ghost {background:transparent;}
.pp-btn.ghost:hover {background:#ffffff0a;}
.pp-btn.full {width:100%;margin-top:10px;}
.pp-btn.danger {color:#f0a294;border-color:#5a3a35;background:#2c1f1d;}
.pp-btn.danger:hover {background:#3a2523;border-color:#7a4a43;}
.pp-actions {display:grid;grid-template-columns:1fr 1fr;gap:8px;}
.pp-actions.three {grid-template-columns:repeat(3,1fr);}
.pp-grid2 .pp-btn {min-width:0;overflow:hidden;text-overflow:ellipsis;}
/* Empty state */
.pp-empty-hero {display:flex;flex-direction:column;align-items:center;text-align:center;gap:8px;padding:22px 10px 8px;}
.pp-empty-hero svg {width:26px;height:26px;padding:12px;box-sizing:content-box;border-radius:14px;background:#e2ab7714;color:#d1a476;}
.pp-empty-hero h3 {font-size:14px;color:#ece8e1;}
.pp-empty-hero p {font-size:11.5px;line-height:1.55;color:#8d8b85;max-width:230px;}
.pp-keys {list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:8px;}
.pp-keys li {display:flex;justify-content:space-between;align-items:center;font-size:11.5px;color:#b1b0a8;}
.pp-keys li > span:last-child {display:flex;gap:4px;}
.pp kbd {display:inline-grid;place-items:center;min-width:22px;height:20px;padding:0 6px;border-radius:5px;border:1px solid #3d3f40;border-bottom-width:2px;background:#262728;color:#e6e2da;font:500 10px/1 ui-monospace,'SFMono-Regular',monospace;}

/* ---------- AI Director (v2) ---------- */
.dr-header {display:flex;align-items:center;justify-content:space-between;gap:10px;padding:16px 16px 14px;border-bottom:1px solid #303131;flex-shrink:0;}
.dr-id {display:flex;align-items:center;gap:11px;min-width:0;}
.dr-id h3 {font-size:13px;font-weight:600;color:#f1ede6;}
.dr-mode {display:inline-flex;align-items:center;gap:6px;margin-top:3px;font-size:10.5px;color:#9f9e98;}
.dr-mode i {width:6px;height:6px;border-radius:50%;background:#8d8b85;}
.dr-mode.is-live i {background:#7fc4a0;box-shadow:0 0 0 3px #7fc4a022;}
.dr-new {display:inline-flex;align-items:center;gap:5px;height:28px;padding:0 10px 0 8px;border-radius:7px;border:1px solid #3d3f40;color:#d6d3cc;font-size:11px;}
.dr-new:hover {background:#ffffff0a;border-color:#4a4c4d;}
.dr-new svg {width:12px;height:12px;}
.dr-thread {gap:14px;padding:18px 16px 12px;}
/* Welcome */
.dr-welcome {display:flex;flex-direction:column;align-items:center;text-align:center;gap:8px;padding:18px 6px 6px;}
.dr-hero {display:grid;place-items:center;width:46px;height:46px;border-radius:14px;background:radial-gradient(circle at 30% 25%,#e2ab7740,#e2ab770d 70%);border:1px solid #e2ab7733;color:#e8bd8f;}
.dr-hero svg {width:22px;height:22px;}
.dr-welcome h3 {font-size:15px;font-weight:600;color:#f1ede6;margin-top:4px;}
.dr-welcome p {font-size:11.5px;line-height:1.55;color:#8d8b85;max-width:250px;}
.dr-suggest-grid {display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:8px;}
.dr-suggest {display:flex;flex-direction:column;align-items:flex-start;gap:4px;min-width:0;padding:11px 11px 12px;border-radius:10px;border:1px solid #333536;background:#1f2021;text-align:left;transition:border-color .15s,background-color .15s,transform .15s;}
.dr-suggest:hover {border-color:#e2ab7780;background:#252321;transform:translateY(-1px);}
.dr-suggest svg {width:15px;height:15px;color:#d1a476;margin-bottom:3px;}
.dr-suggest strong {font-size:11.5px;font-weight:600;color:#ece9e3;}
.dr-suggest span {font-size:10.5px;line-height:1.4;color:#8d8b85;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;}
/* Messages */
.dr-msg {display:flex;gap:9px;align-items:flex-start;animation:dr-in .22s ease-out;}
@keyframes dr-in {from{opacity:0;transform:translateY(4px)}}
.dr-user {justify-content:flex-end;}
.dr-user .dr-bubble {max-width:88%;padding:9px 12px;border-radius:12px 12px 3px 12px;background:#3a332b;border:1px solid #4d4237;color:#f3ece2;font-size:12px;line-height:1.5;overflow-wrap:anywhere;white-space:pre-wrap;}
.dr-avatar {flex:none;display:grid;place-items:center;width:24px;height:24px;border-radius:7px;background:#2c2a27;border:1px solid #4a4036;color:#e2b386;}
.dr-avatar svg {width:13px;height:13px;}
.dr-avatar.is-thinking {animation:dr-pulse 1.2s ease-in-out infinite;}
@keyframes dr-pulse {50%{box-shadow:0 0 0 4px #e2ab7726}}
.dr-body {flex:1;min-width:0;display:flex;flex-direction:column;gap:8px;}
.dr-text {font-size:12px;line-height:1.6;color:#d0cec8;padding-top:2px;overflow-wrap:anywhere;}
.dr-agent.is-error .dr-avatar {background:#2c1f1d;border-color:#5a3a35;color:#f0a294;}
.dr-agent.is-error .dr-text {color:#e8b4aa;}
.dr-result {border:1px solid #333536;border-radius:9px;background:#1b1c1d;overflow:hidden;}
.dr-result-head {display:flex;align-items:center;gap:7px;padding:8px 10px;border-bottom:1px solid #2c2e2f;font-size:11px;font-weight:500;color:#9fd2b5;}
.dr-result-head svg {width:13px;height:13px;}
.dr-result-head > span {flex:1;}
.dr-result.is-undone .dr-result-head {color:#8d8b85;}
.dr-result.is-undone ul {opacity:.5;text-decoration:line-through;}
.dr-result ul {list-style:none;margin:0;padding:6px 10px 8px;display:flex;flex-direction:column;gap:5px;}
.dr-result li {display:flex;align-items:center;gap:7px;font-size:11px;color:#c6c3bc;min-width:0;}
.dr-result li span {overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.dr-result li svg {flex:none;width:12px;height:12px;color:#d1a476;}
.dr-undo {display:inline-flex;align-items:center;gap:4px;height:22px;padding:0 8px;border-radius:6px;border:1px solid #3d3f40;color:#e6e2da;font-size:10.5px;font-weight:500;}
.dr-undo:hover {background:#ffffff0d;}
.dr-undo svg {width:11px;height:11px;}
.dr-thinking {display:flex;align-items:center;gap:4px;height:24px;font-size:11.5px;color:#9f9e98;}
.dr-thinking i {width:5px;height:5px;border-radius:50%;background:#e2ab77;animation:dr-dot 1s ease-in-out infinite;}
.dr-thinking i:nth-child(2) {animation-delay:.15s;}
.dr-thinking i:nth-child(3) {animation-delay:.3s;margin-right:6px;}
@keyframes dr-dot {0%,80%,100%{opacity:.25;transform:translateY(0)}40%{opacity:1;transform:translateY(-3px)}}
.dr-followups {display:flex;flex-wrap:wrap;gap:6px;padding-left:33px;}
.dr-chip {display:inline-flex;align-items:center;gap:5px;height:26px;padding:0 10px;border-radius:13px;border:1px solid #3d3f40;color:#cfccc5;font-size:11px;}
.dr-chip:hover {border-color:#e2ab7780;color:#f0c79c;}
.dr-chip svg {width:12px;height:12px;color:#d1a476;}
/* Composer */
.dr-compose {padding:10px 14px 14px;}
.dr-context {display:flex;align-items:center;gap:6px;min-width:0;margin:0 2px 8px;font-size:10.5px;color:#8d8b85;}
.dr-context svg {flex:none;width:12px;height:12px;color:#d1a476;}
.dr-context-label {color:#d6d3cc;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0;}
.dr-context-detail {flex:none;font-family:ui-monospace,'SFMono-Regular',monospace;}
.dr-box .dr-input {height:44px;min-height:44px;max-height:160px;padding:11px 12px 4px;overflow-y:auto;}
.dr-keys {display:inline-flex;align-items:center;gap:4px;font-size:10px;color:#6f6d68;}
.dr-keys kbd {display:inline-grid;place-items:center;min-width:18px;height:16px;padding:0 4px;border-radius:4px;border:1px solid #3d3f40;background:#262728;color:#a9a7a0;font:500 9.5px/1 ui-monospace,monospace;}
.dr-keys kbd + kbd, .dr-keys kbd:nth-of-type(2) {margin-left:6px;}
.dr-box .send-button:disabled {background:#3a3c3d;color:#77756f;opacity:1;}
@media (prefers-reduced-motion:reduce) {.dr-msg,.dr-thinking i,.dr-avatar.is-thinking{animation:none}}

/* ---------- Preview panel (v2) ---------- */
.preview-badge {display:inline-flex !important;align-items:center;gap:6px;height:22px;padding:0 9px;border-radius:11px;background:#ffffff0a;border:1px solid #ffffff12;}
.preview-badge .preview-dot {background:#8d8b85;}
.preview-badge[data-state="playing"] {color:#a8dcc0;border-color:#7fc4a033;background:#7fc4a012;}
.preview-badge[data-state="playing"] .preview-dot {background:#7fc4a0;animation:pv-pulse 1.4s ease-in-out infinite;}
.preview-badge[data-state="buffering"] {color:#efc597;border-color:#e2ab7733;background:#e2ab7712;}
.preview-badge[data-state="buffering"] .preview-dot {background:#e2ab77;animation:pv-pulse .7s ease-in-out infinite;}
@keyframes pv-pulse {50%{opacity:.35}}
.small-toolbar-btn {height:30px;border:1px solid transparent;}
.small-toolbar-btn.is-on {color:#f0c79c;background:#e2ab7714;border-color:#e2ab7740;}
/* Aspect menu */
.ratio-wrap {position:relative;}
.ratio-glyph {display:inline-grid;place-items:center;width:16px;height:16px;}
.ratio-glyph i {display:block;border:1.5px solid currentColor;border-radius:2px;}
#ratioBtn[aria-expanded="true"] {background:#27292b;color:#efece6;}
.ratio-menu {position:absolute;top:calc(100% + 6px);right:0;z-index:30;width:236px;padding:5px;border-radius:11px;background:#1f2021;border:1px solid #3a3c3d;box-shadow:0 16px 40px #000c;animation:pv-menu .14s ease-out;}
.ratio-menu[hidden] {display:none;}
@keyframes pv-menu {from{opacity:0;transform:translateY(-4px)}}
.ratio-opt {display:flex;align-items:center;gap:10px;width:100%;padding:8px 9px;border-radius:7px;text-align:left;color:#d6d3cc;}
.ratio-opt:hover {background:#ffffff0d;}
.ratio-opt.is-current {background:#e2ab7714;}
.ratio-opt .ratio-glyph {width:24px;height:24px;border-radius:6px;background:#151617;color:#d1a476;}
.ratio-text {flex:1;display:flex;flex-direction:column;gap:2px;min-width:0;}
.ratio-text strong {font-size:12px;font-weight:500;color:#ece9e3;}
.ratio-text em {font-style:normal;font:500 10.5px ui-monospace,'SFMono-Regular',monospace;color:#8d8b85;margin-left:3px;}
.ratio-text small {font-size:10.5px;color:#8d8b85;}
.ratio-opt > svg {width:14px;height:14px;color:#e2ab77;}
/* Stage */
.preview-section {background:radial-gradient(ellipse 70% 60% at 50% 45%,#1b1c1e 0,#131415 70%);}
.preview-stage.is-fullscreen {background:#000;padding:0;}
.preview-stage.is-fullscreen .preview-frame {box-shadow:none;}
.preview-frame {border-radius:4px;}
/* Safe-area guides */
.canvas-guide {border:0;}
.canvas-guide .guide-action {position:absolute;inset:5%;border:1px solid #ffffff40;border-radius:2px;}
.canvas-guide .guide-inner {inset:10%;border:1px dashed #e2ab77aa;border-radius:2px;}
.canvas-guide .guide-inner:after {display:none;}
.canvas-guide span {position:absolute;top:3px;left:5px;font:500 9px/1 ui-monospace,monospace;letter-spacing:.3px;text-transform:uppercase;color:#ffffffb0;text-shadow:0 1px 2px #000;}
.canvas-guide .guide-inner span {color:#f0c79c;}
.canvas-guide .guide-cross {position:absolute;left:50%;top:50%;width:18px;height:18px;margin:-9px 0 0 -9px;background:linear-gradient(#ffffff80,#ffffff80) center/1px 100% no-repeat,linear-gradient(#ffffff80,#ffffff80) center/100% 1px no-repeat;}
.canvas-guide .guide-ui {position:absolute;display:none;background:repeating-linear-gradient(135deg,#ff6b6b1f 0 6px,transparent 6px 12px);border:1px dashed #ff8a8a66;}
.preview-frame[data-aspect="9:16"] .guide-ui-side {display:block;right:2%;top:38%;bottom:20%;width:14%;border-radius:8px;}
.preview-frame[data-aspect="9:16"] .guide-ui-bottom {display:block;left:2%;right:18%;bottom:6%;height:13%;border-radius:8px;}
.preview-frame[data-aspect="4:5"] .guide-ui-bottom {display:block;left:3%;right:3%;bottom:3%;height:9%;border-radius:6px;}
/* Player overlay */
.preview-overlay {position:absolute;inset:0;z-index:3;display:flex;align-items:center;justify-content:center;cursor:pointer;}
.preview-overlay.hidden {display:none;}
.po-play {display:grid;place-items:center;width:54px;height:54px;border-radius:50%;background:#0b0b0cb3;color:#fff;backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px);box-shadow:0 8px 24px #0008,inset 0 0 0 1px #ffffff26;opacity:0;transform:scale(.9);transition:opacity .18s,transform .18s;}
.po-play svg {width:22px;height:22px;}
.preview-overlay:not(.is-playing) .po-play {opacity:.92;transform:scale(1);}
.preview-overlay:hover .po-play {opacity:1;transform:scale(1);}
.preview-overlay.is-playing:not(.is-awake) .po-play {opacity:0;}
.po-play:hover {background:#000d;transform:scale(1.06) !important;}
.po-bar {position:absolute;left:0;right:0;bottom:0;display:flex;align-items:center;gap:8px;padding:22px 10px 8px;background:linear-gradient(transparent,#000c);cursor:default;opacity:0;transition:opacity .2s;}
.preview-overlay:hover .po-bar,.preview-overlay.is-awake .po-bar,.preview-overlay.is-seeking .po-bar,.preview-overlay:not(.is-playing) .po-bar {opacity:1;}
.preview-overlay.is-playing:not(.is-awake):not(.is-seeking) .po-bar {opacity:0;}
.po-time {flex:none;font:500 10px/1 ui-monospace,'SFMono-Regular',monospace;color:#f2efe9;text-shadow:0 1px 2px #000;}
.po-track {position:relative;flex:1;height:14px;cursor:pointer;touch-action:none;}
.po-track:before {content:'';position:absolute;left:0;right:0;top:5px;height:4px;border-radius:2px;background:#ffffff38;transition:height .12s,top .12s;}
.po-fill {position:absolute;left:0;top:5px;height:4px;border-radius:2px;background:#e2ab77;pointer-events:none;transition:height .12s,top .12s;}
.po-fill:after {content:'';position:absolute;right:-6px;top:50%;width:12px;height:12px;margin-top:-6px;border-radius:50%;background:#fff;box-shadow:0 1px 4px #0009;transform:scale(0);transition:transform .12s;}
.po-track:hover:before,.preview-overlay.is-seeking .po-track:before,.po-track:hover .po-fill,.preview-overlay.is-seeking .po-fill {top:4px;height:6px;}
.po-track:hover .po-fill:after,.preview-overlay.is-seeking .po-fill:after {transform:scale(1);}
.po-icon {flex:none;display:grid;place-items:center;width:24px;height:24px;border-radius:6px;color:#f2efe9;}
.po-icon:hover {background:#ffffff1f;}
.po-icon svg {width:13px;height:13px;}
/* Empty state */
.preview-empty {position:absolute;inset:0;z-index:4;display:none;flex-direction:column;align-items:center;justify-content:center;gap:7px;padding:18px;text-align:center;background:radial-gradient(circle at 50% 40%,#262728,#18191a);}
.preview-empty.visible {display:flex;}
.pe-icon {display:grid;place-items:center;width:44px;height:44px;border-radius:13px;background:#e2ab7714;border:1px solid #e2ab7733;color:#e2b386;margin-bottom:4px;}
.pe-icon svg {width:20px;height:20px;}
.preview-empty strong {font-size:13px;font-weight:600;color:#f1ede6;}
.preview-empty > span:not(.pe-icon) {font-size:11px;line-height:1.5;color:#8d8b85;max-width:200px;}
.pe-actions {display:flex;flex-wrap:wrap;justify-content:center;gap:6px;margin-top:8px;}
.pe-btn {display:inline-flex;align-items:center;gap:6px;height:30px;padding:0 11px;border-radius:8px;border:1px solid #3d3f40;color:#e6e2da;font-size:11px;font-weight:500;}
.pe-btn:hover {background:#ffffff0d;}
.pe-btn svg {width:13px;height:13px;}
.pe-btn.primary {background:#e9e3d9;border-color:#e9e3d9;color:#1b1c1c;}
.pe-btn.primary:hover {background:#fff9ed;}
/* Bottom bar */
.preview-helper {display:flex !important;align-items:center;gap:7px !important;min-width:0;}
.pcl-dot {flex:none;width:6px;height:6px;border-radius:50%;background:#55534f;}
.preview-helper.has-clip .pcl-dot {background:#e2ab77;}
.pcl-name {overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#c6c3bc;}
.preview-bottom {gap:12px;}
.preview-bottom-controls {gap:5px !important;flex:none;}
.pb-chip {height:20px;display:inline-flex;align-items:center;padding:0 7px;border-radius:5px;background:#ffffff08;border:1px solid #ffffff0f;color:#a9a7a0;}
#previewTimecode {color:#efc597;}
@media (max-width:700px) {.pb-chip:last-child,#resolutionLabel{display:none}.po-play{width:46px;height:46px}}
@media (hover:none) {.po-bar{opacity:1 !important}}
@media (prefers-reduced-motion:reduce) {.preview-badge .preview-dot{animation:none}.po-play,.po-bar,.ratio-menu{transition:none;animation:none}}

/* ---------- Header (v2) ---------- */
.app-header {background:linear-gradient(180deg,#151617,#121314);}
.brand-mark {color:#DDB07F;}
.brand-dot {color:#DDB07F;}
.beta-tag {color:#8d8b85;}
.project-block {display:flex;flex-direction:column;justify-content:center;gap:2px;min-width:0;}
.project-title-wrap {position:relative;display:inline-flex;align-items:center;gap:4px;max-width:100%;margin-left:-7px;padding:2px 6px;border-radius:7px;border:1px solid transparent;cursor:text;transition:background-color .14s,border-color .14s;}
.project-title-wrap:hover {background:#ffffff08;border-color:#ffffff12;}
.project-title-wrap:focus-within {background:#0e0f10;border-color:#d1a476;}
.app-header .project-name {width:auto;min-width:60px;max-width:280px;font-size:14px;font-weight:600;color:#f1ede6;letter-spacing:-.1px;}
.project-edit {display:grid;place-items:center;color:#6f6d68;opacity:0;transition:opacity .14s;}
.project-edit svg {width:12px;height:12px;}
.project-title-wrap:hover .project-edit {opacity:1;}
.project-title-wrap:focus-within .project-edit {opacity:0;}
.project-meta {display:flex;align-items:center;gap:7px;min-width:0;padding-left:0;font-size:11px;color:#8d8b85;white-space:nowrap;}
.save-state {display:inline-flex;align-items:center;gap:5px;min-width:0;}
.save-icon {display:inline-grid;place-items:center;width:12px;height:12px;}
.save-icon svg {width:12px;height:12px;}
.save-state[data-state="saved"] .save-icon {color:#7fc4a0;}
.save-state[data-state="saving"] .save-icon {color:#e2ab77;}
.save-state[data-state="saving"] .save-icon svg {animation:hd-spin .9s linear infinite;}
.save-state[data-state="dirty"] .save-icon:before {content:'';width:6px;height:6px;border-radius:50%;background:#e2ab77;}
.save-state[data-state="error"] {color:#f0a294;}
.save-state[data-state="error"] .save-icon {color:#f0a294;}
@keyframes hd-spin {to{transform:rotate(360deg)}}
.app-header .saved-label {display:inline !important;font-size:11px;color:inherit;overflow:hidden;text-overflow:ellipsis;}
.meta-sep {width:3px;height:3px;border-radius:50%;background:#55534f;flex:none;}
.project-meta-text {font-family:ui-monospace,'SFMono-Regular',monospace;font-size:10.5px;color:#7b7973;overflow:hidden;text-overflow:ellipsis;}
/* Connection pill */
.online-chip {height:26px;padding:0 10px;margin-right:4px;border-radius:13px;border:1px solid #ffffff12;background:#ffffff06;color:#a9a7a0;}
.online-chip .online-dot {background:#8d8b85;}
.online-chip[data-state="ready"] .online-dot {background:#e2ab77;}
.online-chip[data-state="live"] {color:#a8dcc0;border-color:#7fc4a033;background:#7fc4a00f;}
.online-chip[data-state="live"] .online-dot {background:#7fc4a0;box-shadow:0 0 0 3px #7fc4a022;animation:pv-pulse 2s ease-in-out infinite;}
.online-chip[data-state="warn"] {color:#efc597;border-color:#e2ab7733;background:#e2ab770f;}
.online-chip[data-state="warn"] .online-dot {background:#e2ab77;animation:pv-pulse .8s ease-in-out infinite;}
/* History group */
.history-group {display:inline-flex;align-items:center;height:34px;padding:2px;border-radius:9px;border:1px solid #36383b;background:#1a1b1d;}
.history-group .icon-button {width:30px;height:28px;border-radius:7px;}
.history-group .icon-button svg {width:15px;height:15px;}
.history-group .icon-button:disabled {opacity:.32;}
.history-sep {width:1px;height:16px;background:#36383b;}
/* Buttons */
.app-header .button {height:34px;border-radius:9px;gap:7px;font-size:12px;font-weight:500;}
.app-header .button svg {width:15px;height:15px;}
.app-header .button-primary {padding:0 14px 0 12px;background:#e9e3d9;color:#1b1c1c;box-shadow:inset 0 1px 0 #fff8,0 4px 14px #0006;}
.app-header .button-primary:hover {background:#fff9ed;}
.app-header .button-ghost {padding:0 12px;}
.app-header .cloud-account-btn {height:34px;border-radius:9px;background:#1a1b1d;border-color:#36383b;padding:0 10px 0 6px;}
.app-header .cloud-account-btn:hover {background:#242527;border-color:#4a4c4d;}
.app-header .cloud-avatar {width:22px;height:22px;border-radius:6px;background:linear-gradient(140deg,#e9bc8b,#c98f5a);font-size:11px;}
@media (max-width:1180px) {.project-meta-text,.meta-sep{display:none}.online-chip{display:none}}
@media (prefers-reduced-motion:reduce) {.save-state[data-state="saving"] .save-icon svg,.online-chip .online-dot{animation:none}}

/* ---------- Left rail (v2) ---------- */
.nav-rail {width:72px;background:#121314;}
.nav-main {position:relative;padding:14px 8px;gap:2px;align-items:center;}
.nav-bottom {display:flex;flex-direction:column;align-items:center;gap:2px;padding:10px 8px 14px;border-top:1px solid #222425;}
.rail-indicator {position:absolute;top:0;left:8px;right:8px;height:58px;border-radius:10px;background:#e2ab7712;box-shadow:inset 0 0 0 1px #e2ab7726;pointer-events:none;transition:transform .28s cubic-bezier(.3,.9,.3,1),height .2s,opacity .2s;}
.rail-indicator:before {content:'';position:absolute;left:-8px;top:50%;width:3px;height:22px;margin-top:-11px;border-radius:0 3px 3px 0;background:#e2ab77;}
.rail-indicator.is-dim {opacity:.45;}
.nav-rail .rail-item {position:relative;z-index:1;width:56px;height:58px;gap:5px;border-radius:10px;color:#8f8e89;font-size:10px;font-weight:500;}
.nav-rail .rail-item.active {background:transparent;color:#f3e9dc;}
.nav-rail .rail-item.active:before {display:none;}
.nav-rail .rail-item:hover {background:#ffffff08;color:#ece9e3;}
.nav-rail .rail-item.active:hover {background:transparent;}
.rail-icon {display:grid;place-items:center;width:30px;height:26px;border-radius:8px;transition:background-color .16s,color .16s,transform .16s;}
.nav-rail .rail-item svg {width:18px;height:18px;}
.nav-rail .rail-item.active .rail-icon {color:#efbd8a;}
.nav-rail .rail-item:active .rail-icon {transform:scale(.92);}
.rail-label {line-height:1;letter-spacing:.1px;}
.rail-sep {display:block;width:24px;height:1px;margin:6px 0;background:#2a2c2d;}
.rail-badge {position:absolute;top:6px;right:8px;min-width:16px;height:16px;padding:0 4px;border-radius:8px;background:#e2ab77;color:#1a1612;font:600 9px/16px ui-monospace,'SFMono-Regular',monospace;text-align:center;box-shadow:0 0 0 2px #121314;opacity:0;transform:scale(.6);transition:opacity .16s,transform .16s;pointer-events:none;}
.rail-badge.is-on {opacity:1;transform:scale(1);}
.rail-badge.is-dot {min-width:8px;width:8px;height:8px;padding:0;top:9px;right:13px;}
.nav-rail .rail-mini {height:46px;gap:3px;}
.nav-rail .rail-mini .rail-icon {height:22px;}
.nav-rail .rail-mini svg {width:16px;height:16px;}
#railCollapse[aria-pressed="true"] {color:#efbd8a;}
#railCollapse[aria-pressed="true"] svg {transform:scaleX(-1);}
/* Collapsed asset panel (desktop) */
@media (min-width:981px) {.workspace.assets-collapsed .asset-panel{display:none}}
@media (max-width:980px) {#railCollapse{display:none}.nav-rail{width:60px}.nav-rail .rail-item{width:46px}}
@media (prefers-reduced-motion:reduce) {.rail-indicator,.rail-badge,.rail-icon{transition:none}}

/* ---------- Program monitor (pro) ---------- */
.preview-section {background:#0f1011;}
.preview-workspace {padding:14px 18px 10px;}
.preview-frame {border-radius:2px;background:#000;box-shadow:0 0 0 1px #2a2c2e,0 18px 50px #000c;}
/* Viewer zoom */
.preview-section.is-zoomed .preview-workspace {overflow:auto;display:block;padding:18px;}
.preview-section.is-zoomed .preview-stage {display:flex;width:max-content;height:auto;min-width:100%;min-height:100%;max-height:none;}
.preview-section.is-zoomed .preview-frame {margin:auto;max-width:none;flex:none;}
/* Burn-in overlay */
.viewer-burnin {position:absolute;inset:0;z-index:2;display:none;pointer-events:none;font:600 11px/1 ui-monospace,'SFMono-Regular',monospace;color:#fff;}
.viewer-burnin.visible {display:block;}
.viewer-burnin span {position:absolute;padding:4px 6px;border-radius:3px;background:#000000a6;letter-spacing:.4px;}
.vb-tc {top:8px;left:50%;transform:translateX(-50%);color:#ffd9ae;font-size:12px !important;}
.vb-clip {top:8px;left:8px;max-width:38%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:500 !important;}
.vb-clip:empty {display:none;}
.vb-res {top:8px;right:8px;font-weight:500 !important;color:#d6d3cc;}
/* In/out range on the scrub bar and ruler */
.po-range {position:absolute;top:3px;height:8px;border-radius:2px;background:#e2ab7733;box-shadow:inset 0 0 0 1px #e2ab7799;pointer-events:none;display:none;}
.ruler-inout {position:absolute;top:0;bottom:0;background:#e2ab771f;border-left:0;pointer-events:none;z-index:0;}
.ruler-inout .ri-in,.ruler-inout .ri-out {position:absolute;top:0;bottom:0;width:2px;background:#e2ab77;}
.ruler-inout .ri-in {left:0;}
.ruler-inout .ri-out {right:0;}
.ruler-inout .ri-in:after,.ruler-inout .ri-out:after {content:'';position:absolute;top:0;width:6px;height:6px;border-top:2px solid #e2ab77;}
.ruler-inout .ri-in:after {left:0;}
.ruler-inout .ri-out:after {right:0;}
/* Monitor control bar */
.monitor-bar {display:grid !important;grid-template-columns:1fr auto 1fr;align-items:center;gap:12px;height:46px !important;padding:0 14px !important;border-top:1px solid #222425;background:#141516;}
.mb-left,.mb-right {display:flex;align-items:center;gap:6px;min-width:0;}
.mb-right {justify-content:flex-end;}
.mb-center {display:flex;align-items:center;gap:2px;padding:3px;border-radius:10px;background:#0f1011;border:1px solid #26282a;}
.mb-btn {display:inline-grid;place-items:center;min-width:30px;height:28px;padding:0 6px;border-radius:7px;color:#bdbab3;}
.mb-btn:hover:not(:disabled) {background:#ffffff0f;color:#f1ede6;}
.mb-btn:disabled {opacity:.35;}
.mb-btn svg {width:15px;height:15px;}
.mb-btn.is-on {color:#efbd8a;background:#e2ab7714;}
.mb-play {min-width:38px;background:#e9e3d9;color:#161616;margin:0 3px;}
.mb-play:hover:not(:disabled) {background:#fff9ed !important;color:#161616 !important;}
.mb-play svg {width:15px;height:15px;}
.mb-select {display:inline-flex;gap:4px;border:1px solid #2c2e30;font:500 11px/1 ui-monospace,'SFMono-Regular',monospace;color:#d6d3cc;}
.mb-select svg {width:11px;height:11px;}
.mb-menu-wrap {position:relative;}
.mb-menu {position:absolute;bottom:calc(100% + 6px);left:0;z-index:30;min-width:170px;padding:4px;border-radius:9px;background:#1f2021;border:1px solid #3a3c3d;box-shadow:0 14px 34px #000c;}
.mb-menu[hidden] {display:none;}
.mb-menu-opt {display:flex;align-items:baseline;justify-content:space-between;gap:10px;width:100%;padding:7px 9px;border-radius:6px;color:#e6e2da;font:500 11.5px ui-monospace,'SFMono-Regular',monospace;text-align:left;}
.mb-menu-opt small {font:400 10.5px var(--font,system-ui);color:#8d8b85;}
.mb-menu-opt:hover {background:#ffffff0d;}
.mb-menu-opt.is-current {color:#efbd8a;background:#e2ab7714;}
.monitor-bar .preview-helper {margin-left:4px;font-size:11px;}
.mb-tc {font:600 15px/1 ui-monospace,'SFMono-Regular',monospace;letter-spacing:.5px;color:#f3c48f;font-variant-numeric:tabular-nums;}
.mb-dur {font:500 11px/1 ui-monospace,'SFMono-Regular',monospace;color:#77756f;}
.mb-dur:before {content:'/ ';}
.mb-res {font:500 10px/1 ui-monospace,monospace;color:#77756f;padding:4px 6px;border:1px solid #26282a;border-radius:5px;margin-left:4px;}
.mb-range {display:inline-flex;align-items:center;gap:2px;height:24px;padding:0 2px 0 8px;border-radius:6px;background:#e2ab7712;border:1px solid #e2ab7740;color:#efc597;font:500 10px/1 ui-monospace,monospace;white-space:pre;margin-right:6px;}
.mb-range[hidden] {display:none;}
.mb-range-clear {display:grid;place-items:center;width:18px;height:18px;border-radius:4px;color:#efc597;}
.mb-range-clear:hover {background:#e2ab7726;}
.mb-range-clear svg {width:11px;height:11px;}
@media (max-width:1280px) {.mb-res,.monitor-bar .preview-helper{display:none}}
@media (max-width:1100px) {.mb-range{display:none !important}.mb-dur{display:none}}
@media (max-width:700px) {.monitor-bar{grid-template-columns:auto 1fr auto}.mb-left .mb-menu-wrap,#overlaysBtn{display:none}.mb-tc{font-size:12px}}
/* Pro empty state */
.preview-empty {background:#060607;}
.preview-empty:before {content:'';position:absolute;inset:0;background:linear-gradient(#ffffff05 1px,transparent 1px) 0 0/100% 25%,linear-gradient(90deg,#ffffff05 1px,transparent 1px) 0 0/25% 100%;pointer-events:none;}
.pe-slate {position:relative;display:flex;flex-direction:column;align-items:center;gap:6px;width:min(86%,250px);padding:26px 16px 18px;text-align:center;}
.pe-tick {position:absolute;width:12px;height:12px;border-color:#e2ab7799;border-style:solid;border-width:0;}
.pe-tick.tl {top:0;left:0;border-top-width:2px;border-left-width:2px;}
.pe-tick.tr {top:0;right:0;border-top-width:2px;border-right-width:2px;}
.pe-tick.bl {bottom:0;left:0;border-bottom-width:2px;border-left-width:2px;}
.pe-tick.br {bottom:0;right:0;border-bottom-width:2px;border-right-width:2px;}
.pe-kicker {font:600 9.5px/1 ui-monospace,'SFMono-Regular',monospace;letter-spacing:1.2px;text-transform:uppercase;color:#e2ab77;}
.preview-empty .pe-slate strong {font-size:14px;font-weight:600;color:#f1ede6;margin-top:4px;}
.pe-sub {font-size:11px;line-height:1.5;color:#7b7973;}
.preview-empty .pe-actions {margin-top:10px;gap:6px;}
.preview-empty .pe-btn {height:28px;padding:0 10px;font-size:11px;border-radius:7px;}
.pe-keys {display:flex;flex-wrap:wrap;justify-content:center;gap:4px 10px;margin-top:12px;font-size:10px;color:#6f6d68;}
.pe-keys kbd {display:inline-grid;place-items:center;min-width:16px;height:16px;padding:0 4px;margin-right:2px;border-radius:4px;border:1px solid #2f3133;background:#151617;color:#a9a7a0;font:500 9px/1 ui-monospace,monospace;}
/* Monitor fixes: compact range chip, container-aware bar, stacked burn-in */
.preview-section {container-type:inline-size;container-name:monitor;}
.monitor-bar {grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);}
.mb-left,.mb-right {overflow:hidden;}
.mb-range {white-space:nowrap;gap:4px;padding-left:6px;}
.mb-range:before {content:'[ ]';font-weight:700;letter-spacing:-1px;opacity:.8;}
@container monitor (max-width:1100px) {.mb-res,.monitor-bar .preview-helper{display:none}}
@container monitor (max-width:900px) {.mb-dur{display:none}.mb-tc{font-size:13px}}
@container monitor (max-width:720px) {.mb-range{display:none !important}#overlaysBtn{display:none}}
@container monitor (max-width:560px) {.mb-left .mb-menu-wrap{display:none}.mb-center .mb-btn[data-action="mark-in"],.mb-center .mb-btn[data-action="mark-out"]{display:none}}
.viewer-burnin {display:none;flex-direction:column;align-items:flex-start;gap:4px;padding:8px;}
.viewer-burnin.visible {display:flex;}
.viewer-burnin span {position:static;transform:none;max-width:100%;}
.vb-tc {order:-1;}

/* ---------- Empty program monitor (v3): full workspace, responsive ---------- */
.preview-workspace {position:relative;}
.preview-section.is-empty .preview-stage {visibility:hidden;}
.preview-section.is-empty .monitor-bar .mb-center,.preview-section.is-empty #previewTimecode,.preview-section.is-empty #previewDuration {opacity:.45;}
.preview-empty {position:absolute;inset:0;z-index:5;display:none;flex-direction:column;align-items:center;justify-content:center;gap:clamp(10px,3cqh,22px);padding:clamp(12px,4cqw,32px);background:none !important;container-type:size;container-name:empty;}
.preview-empty:before {display:none !important;}
.preview-empty.visible {display:flex;}
.pe-card {display:flex;align-items:center;gap:clamp(16px,4cqw,28px);width:100%;max-width:560px;padding:clamp(16px,4cqmin,28px);border-radius:16px;border:1.5px dashed #3a3c3e;background:#ffffff04;transition:border-color .16s,background-color .16s,transform .16s;}
.preview-empty.is-drag .pe-card {border-color:#e2ab77;background:#e2ab770d;transform:scale(1.01);}
.pe-art {flex:none;display:flex;flex-direction:column;align-items:center;gap:6px;}
.pe-ghost {display:grid;place-items:center;height:clamp(64px,22cqh,112px);max-width:120px;border-radius:7px;border:1.5px solid #4a4c4e;background:repeating-linear-gradient(135deg,#ffffff05 0 6px,transparent 6px 12px);color:#e2b386;}
.pe-ghost-icon svg {width:22px;height:22px;}
.preview-empty.is-drag .pe-ghost {border-color:#e2ab77;}
.pe-ghost-label {font:500 10px/1 ui-monospace,'SFMono-Regular',monospace;color:#6f6d68;}
.pe-body {display:flex;flex-direction:column;align-items:flex-start;gap:6px;min-width:0;text-align:left;}
.preview-empty .pe-kicker {font:600 10px/1.2 ui-monospace,'SFMono-Regular',monospace;letter-spacing:1.1px;text-transform:uppercase;color:#d1a476;white-space:nowrap;}
.pe-title {font-size:clamp(15px,2.2cqw + 6px,19px);font-weight:600;line-height:1.25;letter-spacing:-.2px;color:#f1ede6;text-wrap:balance;}
.preview-empty .pe-sub {font-size:12px;line-height:1.5;color:#8d8b85;max-width:340px;text-wrap:pretty;}
.preview-empty .pe-actions {display:flex;flex-wrap:wrap;gap:8px;margin-top:8px;justify-content:flex-start;}
.preview-empty .pe-btn {height:34px;padding:0 14px 0 12px;gap:7px;border-radius:9px;font-size:12px;font-weight:500;white-space:nowrap;flex:none;}
.preview-empty .pe-btn svg {width:14px;height:14px;}
.preview-empty .pe-btn.primary {box-shadow:0 4px 14px #0006;}
.preview-empty .pe-keys {display:flex;flex-wrap:wrap;justify-content:center;gap:6px 16px;margin:0;font-size:11px;color:#6f6d68;}
.preview-empty .pe-keys span {display:inline-flex;align-items:center;gap:3px;white-space:nowrap;}
.preview-empty .pe-keys kbd {display:inline-grid;place-items:center;min-width:18px;height:18px;padding:0 5px;margin-right:2px;border-radius:5px;border:1px solid #2f3133;border-bottom-width:2px;background:#18191a;color:#a9a7a0;font:500 10px/1 ui-monospace,monospace;}
/* Narrow: stack and centre */
@container empty (max-width:520px) {
 .pe-card {flex-direction:column;text-align:center;gap:14px;}
 .pe-body {align-items:center;text-align:center;}
 .preview-empty .pe-actions {justify-content:center;}
}
/* Very narrow: full-width buttons, fewer hints */
@container empty (max-width:340px) {
 .pe-card {padding:16px 14px;border-radius:12px;}
 .preview-empty .pe-actions {flex-direction:column;align-self:stretch;}
 .preview-empty .pe-btn {justify-content:center;width:100%;}
 .preview-empty .pe-keys span:nth-child(n+3) {display:none;}
}
/* Short: drop the art, then the hints, then the sub-line */
@container empty (max-height:420px) {.pe-art{display:none}.pe-card{flex-direction:row}.pe-body{align-items:flex-start;text-align:left}}
@container empty (max-height:420px) and (max-width:520px) {.pe-body{align-items:center;text-align:center}}
@container empty (max-height:330px) {.preview-empty .pe-keys{display:none}}
@container empty (max-height:250px) {.preview-empty .pe-sub{display:none}.pe-card{padding:12px 16px}.preview-empty .pe-actions{margin-top:4px}}
@container empty (max-height:170px) {.preview-empty .pe-kicker{display:none}.pe-title{font-size:14px}}
@media (hover:none) {.preview-empty .pe-keys{display:none}}

/* ---------- Responsive pass: toolbars adapt to their own width ---------- */
.editor-main {container-type:inline-size;container-name:editor;min-width:0;}
.editor-toolbar,.timeline-toolbar {flex-wrap:nowrap;gap:8px;}
.toolbar-left,.toolbar-right,.timeline-left,.timeline-right {flex-wrap:nowrap;min-width:0;}
.toolbar-right {flex-shrink:0;}
.small-toolbar-btn,.editor-title,.timeline-heading,.timeline-clip-count,.preview-badge {white-space:nowrap;flex-shrink:0;}
@container editor (max-width:760px) {
 .small-toolbar-btn .hide-narrow {display:none;}
 .small-toolbar-btn {padding:0 7px;}
 .editor-toolbar .toolbar-sep,.editor-toolbar .editor-section-icon {display:none;}
}
@container editor (max-width:600px) {.timeline-clip-count,.keyboard-hint{display:none}}
@container editor (max-width:520px) {#snapshotBtn{display:none}.editor-toolbar .preview-badge{display:none !important}}
/* Header: when undo/redo hide on small screens, hide their (now empty) group too */
@media (max-width:980px) {.history-group{display:none}}
/* Toasts clear the mobile bottom navigation */
@media (max-width:700px) {.toast-area{bottom:76px}}

/* ---------- Empty program monitor (v4): borderless, centred, calm ---------- */
.preview-empty {gap:14px;padding:20px;}
.pe-card {flex-direction:column !important;align-items:center;gap:14px;max-width:380px;padding:0 !important;border:0 !important;border-radius:0;background:none !important;text-align:center;transform:none !important;}
.pe-art {gap:6px;}
.pe-ghost {height:clamp(52px,14cqh,84px);border-width:1.5px;border-color:#3a3c3e;border-radius:8px;background:none;}
.pe-ghost-icon svg {width:20px;height:20px;}
.pe-body {align-items:center !important;text-align:center !important;gap:6px;}
.pe-title {font-size:17px;}
.preview-empty .pe-sub {max-width:300px;font-size:12px;}
.preview-empty .pe-actions {justify-content:center !important;margin-top:10px;}
.preview-empty .pe-keys {gap:6px 14px;opacity:.85;}
/* Drag feedback is the only time an outline appears */
.preview-empty:after {content:'';position:absolute;inset:12px;border-radius:14px;border:1.5px dashed #e2ab77;background:#e2ab770a;opacity:0;transition:opacity .15s;pointer-events:none;}
.preview-empty.is-drag:after {opacity:1;}
.preview-empty.is-drag .pe-ghost {border-color:#e2ab77;color:#efbd8a;}
/* Height-aware: shed the least important parts first */
@container empty (max-height:460px) {.pe-art{display:none}}
@container empty (max-height:340px) {.preview-empty .pe-keys{display:none}}
@container empty (max-height:250px) {.preview-empty .pe-sub{display:none}.preview-empty .pe-actions{margin-top:4px}}
@container empty (max-height:180px) {.preview-empty .pe-kicker{display:none}.pe-title{font-size:14px}}
/* Width-aware: stack buttons on very narrow panels */
@container empty (max-width:340px) {.preview-empty .pe-actions{flex-direction:column;align-self:stretch;width:100%;max-width:260px;margin-left:auto;margin-right:auto}.preview-empty .pe-btn{width:100%;justify-content:center}.preview-empty .pe-keys span:nth-child(n+3){display:none}}
/* Override the earlier wide/short horizontal variants */
@container empty (max-height:420px) {.pe-card{flex-direction:column !important}.pe-body{align-items:center !important;text-align:center !important}}

/* ---------- Empty program monitor (v5): one icon, one line, two buttons ---------- */
.preview-empty {gap:0;}
.pe-card {gap:0 !important;max-width:320px;}
.pe-icon2 {display:grid;place-items:center;width:40px;height:40px;margin-bottom:14px;border-radius:12px;background:#ffffff0a;color:#d9b08a;}
.pe-icon2 svg {width:18px;height:18px;}
.pe-body {gap:4px !important;}
.pe-card .pe-title {font-size:15px;font-weight:600;letter-spacing:-.1px;color:#ece9e3;}
.pe-card .pe-sub {display:block;max-width:none;font-size:12px;line-height:1.5;color:#8a8882;white-space:nowrap;}
.pe-card .pe-actions {display:flex;gap:8px;margin-top:18px !important;}
.pe-card .pe-btn {height:32px;padding:0 13px;border-radius:8px;font-size:12px;font-weight:500;box-shadow:none !important;}
.pe-card .pe-btn svg {width:13px;height:13px;}
.pe-card .pe-btn.primary {padding-left:10px;}
.pe-card .pe-btn.ghost {border-color:transparent;background:none;color:#b8b5ae;}
.pe-card .pe-btn.ghost:hover {background:#ffffff0a;color:#ece9e3;}
.preview-empty .pe-keys {margin-top:28px;font-size:10.5px;opacity:.7;}
.preview-empty.is-drag .pe-icon2 {background:#e2ab771f;color:#efbd8a;}
/* Responsive shedding (height first, then width) */
@container empty (max-height:360px) {.preview-empty .pe-keys{display:none}}
@container empty (max-height:220px) {.pe-icon2{display:none}}
@container empty (max-height:150px) {.pe-card .pe-sub{display:none}.pe-card .pe-actions{margin-top:10px !important}}
@container empty (max-width:330px) {.pe-card .pe-sub{white-space:normal;max-width:220px}.pe-card .pe-actions{flex-direction:column;width:100%;max-width:220px}.pe-card .pe-btn{width:100%;justify-content:center}}

/* =====================================================================
   Mobile (≤700px): same design language as desktop, built for touch
   ===================================================================== */
.mb-phone,.mobile-tools {display:none;}
@media (max-width:700px) {
 :root {--mnav:calc(62px + env(safe-area-inset-bottom,0px));}
 /* Header: logo mark, project name + save state, account, export */
 .app-header {gap:10px;padding:0 12px;}
 .header-brand {gap:0;}
 .brand-name,.beta-tag {display:none !important;}
 .brand-mark svg {height:19px;}/* mark stands alone here, so it gets icon size */
 .app-header .header-middle {display:flex !important;flex:1;min-width:0;gap:0;}
 .app-header .header-divider {display:none;}
 .app-header .project-block {min-width:0;}
 .app-header .project-title-wrap {margin-left:0;padding:1px 4px;}
 .app-header .project-name {font-size:14px;max-width:46vw;}
 .app-header .project-edit {display:none;}
 .app-header .project-meta {padding-left:4px;font-size:10.5px;}
 .app-header .project-meta-text,.app-header .meta-sep {display:none;}
 .action-divider {display:none !important;}
 .app-header .button-primary {height:34px;padding:0 12px;}
 .app-header .cloud-account-btn {height:34px;width:34px;padding:0;justify-content:center;}

 /* Bottom navigation: pill-highlighted icon over label, clears the home indicator */
 .mobile-bottom-nav {height:var(--mnav) !important;padding:6px 8px env(safe-area-inset-bottom,0px);background:#151617 !important;border-top:1px solid #26282a !important;}
 .mobile-bottom-nav button {flex:1;flex-direction:column;gap:3px !important;font-size:10.5px !important;font-weight:500;color:#8f8e89 !important;-webkit-tap-highlight-color:transparent;}
 .mobile-bottom-nav button > span:first-child {display:grid;place-items:center;width:52px;height:28px;border-radius:14px;transition:background-color .18s,color .18s;}
 .mobile-bottom-nav button svg {width:18px !important;height:18px !important;}
 .mobile-bottom-nav button.mobile-nav-active {color:#f1e6d8 !important;}
 .mobile-bottom-nav button.mobile-nav-active > span:first-child {background:#e2ab7726;color:#efbd8a;}
 .editor-main {padding-bottom:var(--mnav) !important;}
 .asset-panel,.right-panel {bottom:var(--mnav) !important;}
 .toast-area {bottom:calc(var(--mnav) + 14px) !important;}

 /* One transport: the monitor bar becomes the phone's play bar; the timeline row hides */
 .transport-bar {display:none !important;}
 .monitor-bar {grid-template-columns:auto 1fr auto !important;height:52px !important;padding:0 10px !important;gap:8px;}
 .mb-phone {display:inline-grid;}
 .monitor-bar .preview-helper,.monitor-bar .mb-menu-wrap,#overlaysBtn,.mb-range,.mb-dur,.mb-res {display:none !important;}
 .mb-left {gap:2px;}
 .mb-center {justify-self:center;padding:2px;}
 .mb-center .mb-btn[data-action="mark-in"],.mb-center .mb-btn[data-action="mark-out"] {display:none;}
 .mb-btn {min-width:38px;height:36px;}
 .mb-play {min-width:48px;}
 .mb-tc {font-size:13px;}
 .timeline-section {height:auto !important;flex:0 0 clamp(210px,34dvh,300px);}

 /* Tools drawer: swipeable tool chips replace the hidden rail */
 .mobile-tools {display:flex;gap:6px;overflow-x:auto;padding:0 16px 12px;margin-top:-4px;scroll-snap-type:x proximity;scrollbar-width:none;-webkit-overflow-scrolling:touch;border-bottom:1px solid #222425;flex-shrink:0;}
 .mobile-tools::-webkit-scrollbar {display:none;}
 .mt-chip {flex:none;display:inline-flex;align-items:center;gap:6px;height:34px;padding:0 13px 0 11px;border-radius:17px;border:1px solid #2f3133;background:#1b1c1d;color:#b8b5ae;font-size:12px;font-weight:500;scroll-snap-align:start;}
 .mt-chip svg {width:15px;height:15px;}
 .mt-chip.is-active {background:#e2ab7722;border-color:#e2ab7766;color:#f3d3ae;}
 .asset-header {padding:16px 16px 12px !important;}
 .asset-content {padding-left:16px !important;padding-right:16px !important;}

 /* Export (and other dialogs) as a bottom sheet */
 .modal-backdrop {align-items:flex-end !important;padding:0 !important;}
 .modal {max-width:none !important;border-radius:18px 18px 0 0 !important;border-bottom:0 !important;max-height:92dvh;overflow:auto;padding-bottom:env(safe-area-inset-bottom,0px);animation:sheet-up .24s cubic-bezier(.2,.8,.2,1);}
 .modal:before {content:'';display:block;width:38px;height:4px;margin:8px auto -2px;border-radius:2px;background:#4a4c4e;}
 @keyframes sheet-up {from{transform:translateY(24px);opacity:.6}}
 .modal-header {padding:14px 18px !important;}
 .modal-content {padding:16px 18px !important;}
 .export-footer {flex-wrap:wrap;gap:8px;padding:12px 18px 16px !important;}
 .export-note {display:none !important;}
 .export-footer .button {flex:1 1 140px;justify-content:center;height:42px;}
}
/* Touch screens: no keyboard hints, comfortable tap targets */
@media (hover:none) {
 .dr-keys,.keyboard-hint,.preview-empty .pe-keys {display:none !important;}
 .pp-empty .pp-section:has(.pp-keys) {display:none;}
 .po-icon {width:34px;height:34px;}
 .section-add {height:32px;}
 .timeline-tool,.transport-button {min-width:36px;min-height:36px;}
 .dr-chip,.dr-undo {min-height:32px;}
}
@media (prefers-reduced-motion:reduce) {.modal{animation:none}}
/* Mobile fixes: brand width, touch copy, text tool cards */
@media (max-width:700px) {.header-brand{width:auto !important;flex:none}.app-header .header-middle{margin-left:4px}}
.pe-sub-touch {display:none !important;}
@media (hover:none) {.pe-sub-pointer{display:none !important}.pe-card .pe-sub-touch{display:block !important}}
.text-item {display:flex;align-items:center;gap:12px;}
.text-item > span:nth-child(2) {flex:1;min-width:0;text-align:left;}
.text-item > svg:last-child {margin-left:auto;flex:none;}
/* Tablet & landscape phones (701–980px): the right panel can be hidden and brought back */
#rightToggleBtn {display:none;}
@media (min-width:701px) and (max-width:980px) {
 #rightToggleBtn {display:inline-grid;}
 #rightToggleBtn.is-on {color:#efbd8a;background:#e2ab7714;}
 .workspace.right-collapsed .right-panel {display:none !important;}
}
/* Short landscape screens: compact chrome so the preview and timeline both fit */
@media (max-height:520px) and (min-width:701px) {
 .app-header {height:48px !important;min-height:48px !important;}
 .app-header .project-meta {display:none;}
 .app-header .button,.app-header .cloud-account-btn,.history-group {height:32px;}
 .editor-toolbar {height:40px !important;}
 .preview-workspace {padding:6px 10px !important;}
 .monitor-bar {height:40px !important;}
 .monitor-bar .preview-helper {display:none !important;}
 .timeline-section {height:min(46dvh,230px) !important;}
 .timeline-toolbar {height:36px !important;}
 .transport-bar {height:34px !important;}
 .nav-main {padding:6px 6px;}
 .nav-rail .rail-item {height:40px;}
 .nav-rail .rail-label {display:none;}
 .rail-sep {margin:3px 0;}
 .rail-badge {top:2px;right:6px;}
 .rail-indicator {height:40px;}
 .nav-bottom {padding:6px;}
 .nav-rail .rail-mini {height:36px;}
 .right-header {height:44px;}
}
/* Narrow phones (≤380px): keep the transport and timeline toolbar on one line */
@media (max-width:380px) {
 #loopBtn {display:none;}
 .mb-btn {min-width:34px;}
 .mb-play {min-width:44px;}
 .mb-tc {font-size:12px;}
 .timeline-toolbar .toolbar-sep,#zoomLabel {display:none;}
 .timeline-toolbar .timeline-tool {min-width:32px;}
 .timeline-heading {font-size:12px;}
}
@media (max-height:520px) and (min-width:701px) {.transport-bar{display:none !important}.timeline-section{height:min(50dvh,240px) !important}}

/* ---------- On-canvas text editing ---------- */
.text-select {position:absolute;z-index:6;pointer-events:none;border:1.5px solid #e2ab77;border-radius:4px;box-shadow:0 0 0 1px #0008,inset 0 0 0 1px #0006;}
.text-select[hidden] {display:none;}
.ts-label {position:absolute;left:-1px;bottom:calc(100% + 5px);padding:3px 7px;border-radius:5px;background:#e2ab77;color:#1a1612;font:600 10px/1.2 var(--font,system-ui);white-space:nowrap;pointer-events:none;opacity:.95;}
.text-select.label-below .ts-label {bottom:auto;top:calc(100% + 5px);}
.ts-handle {position:absolute;right:-7px;bottom:-7px;width:13px;height:13px;border-radius:3px;background:#fff;border:2px solid #e2ab77;box-shadow:0 1px 4px #0009;cursor:nwse-resize;pointer-events:auto;touch-action:none;}
.ts-handle:after {content:'';position:absolute;inset:-10px;}
.preview-overlay.over-text {cursor:move;}
.preview-overlay.over-text .po-play {opacity:.25 !important;}
body.is-text-dragging .po-play,body.is-text-dragging .po-bar,body.is-text-dragging .ts-label {opacity:0 !important;}
body.is-text-dragging,body.is-text-dragging * {cursor:grabbing !important;user-select:none;}
.preview-overlay {touch-action:none;}
.preview-section.is-zoomed .preview-overlay {touch-action:auto;}
.text-guides {position:absolute;inset:0;z-index:5;pointer-events:none;}
.text-guides i {position:absolute;display:none;background:#ff5fa2;box-shadow:0 0 0 .5px #0006;}
.text-guides .tg-v {left:50%;top:0;bottom:0;width:1px;}
.text-guides .tg-h {top:50%;left:0;right:0;height:1px;}
.text-guides.show-v .tg-v,.text-guides.show-h .tg-h {display:block;}
.pp-label-row {display:flex;align-items:baseline;justify-content:space-between;gap:8px;}
.pp-custom {font:500 10px/1 ui-monospace,'SFMono-Regular',monospace;color:#efc597;padding:3px 6px;border-radius:5px;background:#e2ab7714;}
.pp-hint {font-size:10.5px;color:#6f6d68;}
.track-area .text-clip,.track-area .caption-clip {cursor:grab;}
@media (hover:none) {.ts-label{display:none}.ts-handle{width:18px;height:18px;right:-10px;bottom:-10px}}
.preview-overlay.has-text-selection .po-play {opacity:0 !important;pointer-events:none;}

/* ---------- One transport: the monitor bar is the only play bar ---------- */
.transport-bar {display:none !important;}
.mb-center .mb-btn[data-action="mark-in"] {margin-right:2px;}
.mb-center .mb-btn[data-action="mark-out"] {margin-left:2px;}
.mb-center {gap:1px;}
/* Shed controls by the monitor's own width, least important first */
@container monitor (max-width:1100px) {.mb-res,.monitor-bar .preview-helper{display:none !important}}
@container monitor (max-width:900px)  {.mb-range{display:none !important}}
@container monitor (max-width:760px)  {.mb-dur{display:none !important}.mb-tc{font-size:13px}}
@container monitor (max-width:640px)  {.mb-jump{display:none}}
@container monitor (max-width:540px)  {.mb-center .mb-btn[data-action="mark-in"],.mb-center .mb-btn[data-action="mark-out"]{display:none}#overlaysBtn{display:none}}
@container monitor (max-width:440px)  {.mb-left .mb-menu-wrap{display:none}}

/* ---------- Editing features: framing, looks, fades, markers, snapping ---------- */
.fade-veil {position:absolute;inset:0;z-index:1;background:#000;opacity:0;pointer-events:none;}
.preview-video {transform-origin:50% 50%;}
.preview-overlay.has-text-selection .po-bar {opacity:0 !important;pointer-events:none;}
.preview-overlay.is-panning {cursor:grabbing;}
.pp-looks {display:grid;grid-template-columns:repeat(3,1fr);gap:6px;margin-bottom:12px;}
.pp-look {display:flex;flex-direction:column;align-items:center;gap:5px;padding:6px 4px 7px;border-radius:9px;border:1px solid #2f3133;background:#191a1b;color:#b8b5ae;font-size:10.5px;}
.pp-look:hover {border-color:#4a4c4d;color:#ece9e3;}
.pp-look.is-on {border-color:#e2ab77;background:#e2ab7712;color:#f3d3ae;}
.pp-look-swatch {width:100%;height:30px;border-radius:6px;background:linear-gradient(135deg,#d98b5f 0%,#e6c27a 35%,#5f8f8a 70%,#2e4a63 100%);}
.pp-btn.is-on {color:#efbd8a;border-color:#e2ab7766;background:#e2ab7714;}
.pp-inline {margin:0;align-self:center;font-size:10.5px;}
.ruler-marker {position:absolute;top:0;width:0;height:100%;pointer-events:none;z-index:1;}
.ruler-marker:before {content:'';position:absolute;top:2px;left:-5px;width:10px;height:12px;background:#7fc4a0;clip-path:polygon(0 0,100% 0,100% 65%,50% 100%,0 65%);}
.ruler-marker:after {content:'';position:absolute;top:14px;bottom:0;left:-.5px;width:1px;background:#7fc4a066;}
.timeline-tool.is-on {color:#efbd8a;background:#e2ab7714;}
@container editor (max-width:600px) {#markerBtn{display:none}}

/* ---------- Precise trimming ---------- */
.clip-overhang {position:absolute;top:0;bottom:0;right:0;width:var(--over,0px);z-index:0;pointer-events:none;background:repeating-linear-gradient(135deg,#0000 0 5px,#00000066 5px 10px);border-left:1.5px dashed #ffffff73;}
.clip-block.has-overhang {border-right-style:dashed;}
/* Bigger, always-grabbable handles; tiny blocks keep their handles outside the block */
.trim-handle {width:10px;}
.trim-handle:after {content:'';position:absolute;top:-4px;bottom:-4px;left:-6px;right:-6px;}
.trim-handle.l:after {right:-2px;}
.trim-handle.r:after {left:-2px;}
@media (hover:none) {.track-area .clip-block.selected .trim-handle{width:16px}}
.trim-badge {position:fixed;z-index:120;padding:5px 9px;border-radius:7px;background:#121314f2;border:1px solid #e2ab7766;color:#d6d3cc;font:500 11px/1.2 ui-monospace,'SFMono-Regular',monospace;white-space:nowrap;pointer-events:none;box-shadow:0 6px 18px #000a;}
.trim-badge[hidden] {display:none;}
.trim-badge b {color:#f3d3ae;font-weight:600;}
.trim-badge i {font-style:normal;margin-left:4px;padding:1px 5px;border-radius:4px;background:#ff5fa2;color:#1a0d12;font-weight:700;}
.trim-badge em {font-style:normal;margin-left:4px;color:#f0a294;}
.snap-guide {position:absolute;top:0;bottom:0;left:0;width:0;z-index:6;pointer-events:none;border-left:1px solid #ff5fa2;box-shadow:0 0 0 .5px #ff5fa255;}
.snap-guide[hidden] {display:none;}
.pp-warn {display:flex;flex-wrap:wrap;align-items:center;gap:6px 8px;margin-bottom:12px;padding:9px 10px;border-radius:8px;background:#e2ab7714;border:1px solid #e2ab7740;color:#efc597;font-size:11.5px;line-height:1.4;}
.pp-warn svg {width:14px;height:14px;flex:none;}
.pp-warn > span {flex:1;min-width:150px;}
.pp-grid3 {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;}
.pp-help kbd {display:inline-grid;place-items:center;min-width:16px;height:16px;padding:0 4px;border-radius:4px;border:1px solid #3d3f40;background:#262728;color:#e6e2da;font:500 10px/1 ui-monospace,monospace;}

/* ---------- Timeline selection group: Duplicate / Remove ---------- */
.tl-sel {display:inline-flex;align-items:center;gap:2px;min-width:0;padding:2px;border-radius:9px;border:1px solid transparent;transition:border-color .16s,background-color .16s;}
.tl-sel.has-selection {border-color:#e2ab7733;background:#e2ab770a;}
.tl-sel-name {display:none;align-items:center;gap:5px;max-width:150px;min-width:0;padding:0 8px 0 6px;font-size:11.5px;color:#f3d3ae;white-space:nowrap;}
.tl-sel.has-selection .tl-sel-name {display:inline-flex;}
.tl-sel-name svg {width:13px;height:13px;flex:none;color:#e2ab77;}
.tl-sel-name span {overflow:hidden;text-overflow:ellipsis;}
.timeline-tool.tl-act {display:inline-flex;align-items:center;gap:6px;width:auto;padding:0 10px 0 8px;font-size:11.5px;font-weight:500;white-space:nowrap;}
.timeline-tool.tl-act:disabled {opacity:.35;cursor:not-allowed;}
.timeline-tool.tl-act:not(:disabled):hover {background:#ffffff0f;color:#f1ede6;}
.timeline-tool.tl-danger:not(:disabled):hover {background:#f0a29414;color:#f0a294;}
/* Collapse by available width: name first, then labels */
@container editor (max-width:820px) {.tl-sel.has-selection .tl-sel-name{display:none}}
@container editor (max-width:680px) {.timeline-tool.tl-act .tl-lbl{display:none}.timeline-tool.tl-act{padding:0;width:30px;justify-content:center}}
@container editor (max-width:600px) {.tl-sel{border:0;background:none;padding:0}}

/* ---------- Crossfade transitions on the timeline ---------- */
.cut-btn {position:absolute;top:50%;z-index:4;display:grid;place-items:center;width:20px;height:20px;margin:-10px 0 0 -10px;border-radius:6px;border:1px solid #ffffff33;background:#1c1d1ee6;color:#c9c6bf;opacity:0;transform:scale(.8);transition:opacity .14s,transform .14s,background-color .14s,border-color .14s;cursor:pointer;}
.cut-btn svg {width:12px;height:12px;}
.track-row:hover .cut-btn,.cut-btn:focus-visible,.cut-btn.has-xfade,.cut-btn.selected {opacity:1;transform:scale(1);}
.cut-btn:hover {background:#2a2b2c;border-color:#e2ab77;color:#f3d3ae;transform:scale(1.12);}
.cut-btn.has-xfade {background:#e2ab77;border-color:#e2ab77;color:#1a1612;}
.cut-btn.selected {box-shadow:0 0 0 2px #121314,0 0 0 4px #f0b981;}
.cut-btn:after {content:'';position:absolute;inset:-8px;}
.xfade-band {position:absolute;top:4px;bottom:4px;z-index:3;pointer-events:none;border-radius:5px;background:linear-gradient(90deg,#e2ab7700,#e2ab7759 50%,#e2ab7700);box-shadow:inset 0 0 0 1px #e2ab7766;}
.xfade-band.selected {box-shadow:inset 0 0 0 1.5px #f0b981;}
.pp-thumb-xf {background:linear-gradient(90deg,#3b3f45,#7a5c40);color:#f3d3ae;}
.pp-thumb-xf svg {width:22px;height:22px;}
.pp-btn.full {width:100%;}
@media (hover:none) {.cut-btn{opacity:1;transform:scale(1);width:24px;height:24px;margin:-12px 0 0 -12px}}

/* ---------- Timeline toolbar (v2): grouped, consistent, responsive ---------- */
.tl-v2 {gap:10px;padding:0 14px;height:48px;}
.tl-v2 .timeline-left,.tl-v2 .timeline-right {gap:8px;min-width:0;}
.tl-v2 .toolbar-sep {display:none;}
.tl-title {display:flex;align-items:baseline;gap:8px;min-width:0;margin-right:2px;}
.tl-v2 .timeline-heading {font-size:13px;font-weight:600;color:#ece9e3;margin:0;}
.tl-v2 .timeline-clip-count {margin:0;font:500 10.5px/1 ui-monospace,'SFMono-Regular',monospace;color:#7b7973;white-space:nowrap;}
.tl-group {display:inline-flex;align-items:center;gap:1px;padding:2px;border-radius:9px;background:#0f1011;border:1px solid #232527;flex-shrink:0;}
.tl-v2 .timeline-tool {width:30px;height:28px;border-radius:7px;color:#a9a7a0;}
.tl-v2 .timeline-tool:hover:not(:disabled) {background:#ffffff0d;color:#f1ede6;}
.tl-v2 .timeline-tool.active {background:#e2ab771f;color:#efbd8a;box-shadow:inset 0 0 0 1px #e2ab7740;}
.tl-v2 .timeline-tool svg {width:15px;height:15px;}
.tl-v2 .timeline-tool.tl-act {width:auto;padding:0 10px 0 8px;gap:6px;font-size:11.5px;font-weight:500;}
/* Selection group shares the pill styling; it lights up when something is selected */
.tl-v2 .tl-sel {padding:2px;border:1px solid #232527;background:#0f1011;}
.tl-v2 .tl-sel.has-selection {border-color:#e2ab7740;background:#e2ab770a;}
.tl-v2 .tl-sel:not(.has-selection) .timeline-tool {opacity:.45;}
.tl-v2 .tl-sel .timeline-tool.tl-act:disabled {opacity:1;}
/* Snap toggle */
.tl-v2 .tl-toggle {height:32px;border:1px solid #232527;background:#0f1011;border-radius:9px;}
.tl-v2 .tl-toggle.is-on {color:#efbd8a;background:#e2ab7714;border-color:#e2ab7740;}
/* Zoom: − slider + 100% Fit */
.tl-zoom {gap:4px;padding:2px 4px;}
.tl-zoom .zoom-value {min-width:42px;font:500 10.5px/1 ui-monospace,'SFMono-Regular',monospace;color:#b8b5ae;text-align:center;}
.tl-v2 .tl-fit {padding:0 9px;height:24px;border-radius:6px;background:#1d1e1f;color:#d6d3cc;font-size:11px;}
.tl-zoom-slider {-webkit-appearance:none;appearance:none;width:96px;height:20px;margin:0 2px;background:transparent;cursor:pointer;}
.tl-zoom-slider::-webkit-slider-runnable-track {height:3px;border-radius:2px;background:linear-gradient(90deg,#e2ab77 var(--fill,50%),#3a3c3d var(--fill,50%));}
.tl-zoom-slider::-moz-range-track {height:3px;border-radius:2px;background:linear-gradient(90deg,#e2ab77 var(--fill,50%),#3a3c3d var(--fill,50%));}
.tl-zoom-slider::-webkit-slider-thumb {-webkit-appearance:none;width:12px;height:12px;margin-top:-4.5px;border-radius:50%;background:#f6efe6;box-shadow:0 1px 3px #000a;}
.tl-zoom-slider::-moz-range-thumb {width:12px;height:12px;border:0;border-radius:50%;background:#f6efe6;}
.tl-zoom-slider:focus-visible {outline:none;}
.tl-zoom-slider:focus-visible::-webkit-slider-thumb {box-shadow:0 0 0 3px #e2ab7799;}
/* Collapse by available width (least important first) */
@container editor (max-width:1080px) {.tl-insert .tl-lbl,.tl-toggle .tl-lbl{display:none}.tl-insert .timeline-tool.tl-act,.tl-v2 .tl-toggle{padding:0;width:30px;justify-content:center}}
@container editor (max-width:1000px) {.tl-sel.has-selection .tl-sel-name{display:none}}
@container editor (max-width:820px) {.tl-v2 .tl-sel .tl-lbl{display:none}.tl-v2 .tl-sel .timeline-tool.tl-act{padding:0;width:30px;justify-content:center}}
@container editor (max-width:720px) {.tl-zoom-slider{display:none}}
@container editor (max-width:620px) {.tl-v2 .timeline-clip-count{display:none}.tl-v2 .tl-fit{display:none}}
@container editor (max-width:540px) {#markerBtn,.tl-zoom .zoom-value{display:none}.tl-v2{gap:6px;padding:0 10px}.tl-v2 .timeline-left,.tl-v2 .timeline-right{gap:5px}}
@container editor (max-width:420px) {.tl-v2 .timeline-heading{display:none}.tl-title{display:none}}
@media (hover:none) {.tl-v2 .timeline-tool{min-width:32px;min-height:30px}}

.tl-title {flex:none;}
.tl-v2 .timeline-tool.tl-fit {width:auto !important;padding:0 9px !important;}
.tl-v2 .tl-fit .tl-lbl {display:inline !important;}
.tl-v2 .tl-sel-name {max-width:130px;}

/* ---------- Keyframes (zoom & position) ---------- */
.kf-bar {display:flex;align-items:center;justify-content:space-between;gap:8px;margin:12px 0 4px;}
.kf-toggle {display:inline-flex;align-items:center;gap:6px;height:30px;padding:0 11px 0 9px;border-radius:8px;border:1px solid #3d3f40;color:#d6d3cc;font-size:11.5px;font-weight:500;}
.kf-toggle svg {width:12px;height:12px;}
.kf-toggle:hover {background:#ffffff0a;}
.kf-toggle.is-on {color:#efbd8a;border-color:#e2ab7766;background:#e2ab7714;}
.kf-toggle.is-on svg {fill:#e2ab77;}
.kf-nav {display:inline-flex;align-items:center;gap:1px;padding:2px;border-radius:8px;background:#151617;border:1px solid #2c2e30;}
.kf-btn {display:grid;place-items:center;width:28px;height:26px;border-radius:6px;color:#bdbab3;}
.kf-btn:hover {background:#ffffff0f;color:#f1ede6;}
.kf-btn svg {width:13px;height:13px;}
.kf-add.is-key {color:#1a1612;background:#e2ab77;}
.kf-add.is-key svg {fill:#1a1612;}
.kf-track {position:relative;height:24px;margin:8px 0 4px;border-radius:6px;background:#151617;border:1px solid #2c2e30;cursor:pointer;}
.kf-track:before {content:'';position:absolute;left:8px;right:8px;top:50%;height:1px;background:#3a3c3e;}
.kf-dia {position:absolute;top:50%;width:11px;height:11px;margin:-5.5px 0 0 -5.5px;transform:rotate(45deg);border-radius:2px;background:#e2ab77;border:1.5px solid #1a1612;box-shadow:0 0 0 1px #e2ab77;z-index:1;}
.kf-dia:hover {background:#fff3e4;}
.kf-now {position:absolute;top:2px;bottom:2px;width:2px;margin-left:-1px;background:#f6efe6;border-radius:1px;pointer-events:none;}
.kf-foot {display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:6px;font-size:10.5px;color:#7b7973;}
.kf-dots {position:absolute;left:0;right:0;bottom:3px;height:8px;z-index:2;pointer-events:none;}
.kf-dots i {position:absolute;bottom:0;width:7px;height:7px;margin-left:-3.5px;transform:rotate(45deg);border-radius:1px;background:#e2ab77;border:1px solid #1a1612;}

/* ---------- Timeline interactions: reorder, playhead scrub, touch ---------- */
.track-area .clip-block[data-clip] {cursor:grab;}
.clip-block.is-lifted {z-index:8 !important;opacity:.92;cursor:grabbing;box-shadow:0 10px 26px #000b,0 0 0 1.5px #f0b981 !important;transition:none !important;}
body.is-reordering,body.is-reordering * {cursor:grabbing !important;user-select:none;}
.reorder-marker {position:absolute;top:30px;bottom:0;left:0;width:0;z-index:7;pointer-events:none;border-left:3px solid #f0b981;box-shadow:0 0 12px #e2ab77aa;}
.reorder-marker:before {content:'';position:absolute;top:-2px;left:-7px;width:11px;height:11px;border-radius:50%;background:#f0b981;}
.reorder-marker[hidden] {display:none;}
/* The playhead head is grabbable (bigger invisible hit area) */
#playheadLine .playhead-handle {pointer-events:auto;cursor:ew-resize;touch-action:none;z-index:9;}
#playheadLine .playhead-handle:after {content:'';position:absolute;inset:-10px -12px -14px;}
#playheadLine .playhead-handle:hover {filter:brightness(1.15);}
body.is-scrubbing,body.is-scrubbing * {cursor:ew-resize !important;user-select:none;}
/* Touch: gestures on selected blocks, handles, ruler and playhead edit; elsewhere they scroll the timeline */
.timeline-ruler {touch-action:none;}
.track-area .clip-block.selected,.trim-handle,.cut-btn {touch-action:none;}
.track-area .clip-block:not(.selected) {touch-action:pan-x pan-y;}
@media (hover:none) {#playheadLine .playhead-handle{width:16px;height:18px;left:-7px}}

/* Studio logo links back to the landing page */
.brand-link {display:inline-flex;align-items:center;gap:13px;margin:-4px -6px;padding:4px 6px;border-radius:9px;color:inherit;text-decoration:none;transition:background-color .15s;}
.brand-link:hover {background:#ffffff0a;}
.brand-link:hover .brand-mark {transform:translateX(-1px);}
.brand-link .brand-mark {transition:transform .15s;}
@media (max-width:700px) {.brand-link{margin:-4px;padding:4px}}

/* =====================================================================
   RESPONSIVE STUDIO v3 (desktop & tablet, > 700px wide)
   Measured problem: the timeline was a fixed 288px at every window height and the chrome was sized for tall
   monitors, so on common laptop screens the program monitor got squeezed (1280×720: a 9:16 frame only
   141×250px, smaller than the timeline). Now:
   · side panels scale fluidly with the window instead of jumping between fixed widths
   · on short screens (≤820px tall) the chrome and track rows compact, so the timeline needs less height,
     with all three tracks still visible without scrolling (~240px instead of 288px)
   · on very tall screens (≥1200px) the timeline grows a little, since there is room for it
   Phone layout (≤700px) and the very-short-landscape mode (≤520px tall) keep their own rules.
   ===================================================================== */
@media (min-width:981px){
  .asset-panel {width:clamp(216px,calc(10vw + 100px),300px);}
  .right-panel {width:clamp(282px,calc(8vw + 200px),380px);}
}
@media (min-width:701px) and (min-height:1200px){
  .timeline-section {height:clamp(300px,24vh,360px);}
  .timeline-section.expanded {height:clamp(480px,46vh,640px);}
}
@media (min-width:701px) and (max-height:820px){
  .app-header {height:52px;min-height:52px;}
  .editor-toolbar {height:44px;}
  .right-header {height:44px;min-height:44px;}
  .monitor-bar {height:40px;}
  .timeline-toolbar {height:42px;}
  .timeline-section {height:240px;}
  .timeline-section.expanded {height:clamp(320px,52vh,420px);}
  .timeline-ruler {height:24px;}
  .tracks {padding:4px 0;}
  .track-row.text-row {height:32px;}
  .track-row:not(.text-row):not(.audio-row) {height:46px;}
  .track-row.audio-row {height:32px;}
  .track-area .clip-label {margin-top:4px;height:16px;font-size:10px;}
}

/* Responsive centre play button — scales with the preview frame instead of a fixed 54px disc */
.preview-overlay {container-type:size;}
.po-play {
 --po-size:clamp(32px,16cqmin,48px);
 width:var(--po-size);height:var(--po-size);
 background:#0b0b0c80;
 backdrop-filter:blur(10px) saturate(140%);-webkit-backdrop-filter:blur(10px) saturate(140%);
 box-shadow:0 4px 14px #0006,inset 0 0 0 1px #ffffff2e;
}
.po-play svg {width:46%;height:46%;}
.preview-overlay:not(.is-playing) .po-play svg {margin-left:8%;} /* optical centring of the play triangle */
.po-play:hover {background:#000000b3;transform:scale(1.05) !important;}
@container (max-height:180px) {
 .po-play {--po-size:28px;}
}

/* ---------- Mobile: AI Director docked in the timeline slot ---------- */
.dr-head-actions {display:flex;align-items:center;gap:2px;flex:none;}
.dr-dock-btn {display:none;place-items:center;width:32px;height:32px;border-radius:9px;color:inherit;opacity:.7;-webkit-tap-highlight-color:transparent;transition:opacity .15s,background-color .15s;}
.dr-dock-btn:hover,.dr-dock-btn:active {opacity:1;background:color-mix(in srgb,currentColor 9%,transparent);}
.dr-dock-btn svg {width:17px;height:17px;transition:transform .25s;}
.dr-footnote {display:none;}
.rh-dock-btn {display:none;}
.dr-grab {display:none;position:absolute;top:0;left:50%;width:72px;height:20px;margin-left:-36px;padding:0;border-radius:0 0 10px 10px;background:transparent;cursor:grab;touch-action:none;-webkit-tap-highlight-color:transparent;z-index:1;}
.dr-grab::before {content:'';position:absolute;top:6px;left:50%;width:34px;height:4px;margin-left:-17px;border-radius:2px;background:currentColor;opacity:.22;transition:width .18s,opacity .18s;}
.dr-grab:focus-visible {outline:none;}
.dr-grab:focus-visible::before {opacity:.6;width:44px;box-shadow:0 0 0 3px color-mix(in srgb,currentColor 25%,transparent);}

@media all { /* sheet + panel design: phones and desktop */
 .right-panel.is-ai {
  --dk-card:#202223;--dk-line:#36383a;--dk-chip:#2a2c2e;--dk-muted:#8e8c86;--dk-accent:#d9a877;--dk-send:#ece5da;--dk-send-ink:#1b1b1b;
  transition:top .3s cubic-bezier(.2,.8,.2,1);
 }
 
 .right-panel.is-ai .dr-dock-btn {display:grid;}
 .right-panel.is-ai:not(.is-expanded) .dr-dock-toggle svg {transform:rotate(180deg);}
 .right-panel.is-ai.is-expanded .dr-dock-btn[data-action="ai-dock-close"] {display:none;}

 /* ---- Docked sheet ---- */
 .right-panel.is-ai.is-open:not(.is-expanded) {
  top:var(--ai-dock-top,48%) !important;
  border-radius:16px 16px 0 0;border-top:1px solid var(--dk-line);
  box-shadow:0 -8px 24px #00000038;animation:aiDockIn .28s cubic-bezier(.2,.8,.2,1);
 }

 /* ---- Header (both states): one slim row ---- */
 .right-panel.is-ai .dr-header {position:relative;gap:8px;padding:10px 6px 8px 14px;border-bottom:0 !important;}
 .right-panel.is-ai .dr-id {display:flex;align-items:center;gap:9px;min-width:0;}
 .right-panel.is-ai .dr-id > div:last-child {display:flex;align-items:center;gap:8px;min-width:0;}
 .right-panel.is-ai .agent-avatar {width:28px;height:28px;border-radius:8px;}
 .right-panel.is-ai .agent-avatar svg {width:15px;height:15px;}
 .right-panel.is-ai .dr-id h3 {font-size:14.5px;font-weight:600;letter-spacing:-.2px;white-space:nowrap;}
 .right-panel.is-ai .dr-mode {margin:0;height:22px;padding:0 9px;border-radius:999px;background:var(--dk-chip);color:var(--dk-muted);font-size:11px;font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
 .right-panel.is-ai .dr-new {height:30px;padding:0 10px 0 8px;border-radius:9px;}
 .right-panel.is-ai .dr-grab {display:block;}
 .right-panel.is-ai.is-dragging {transition:none !important;animation:none !important;user-select:none;-webkit-user-select:none;}
 .right-panel.is-ai.is-dragging .dr-grab::before,.dr-grab:active::before {width:44px;opacity:.5;}
 .right-panel.is-ai.is-closing {transition:top .26s cubic-bezier(.4,0,1,1),opacity .26s !important;opacity:.4;}
 /* Expanded: the tab already says "AI Director", so the row only carries status + actions */
 .right-panel.is-ai .agent-avatar,
 .right-panel.is-ai .dr-id h3 {display:none;}
 .right-panel.is-ai .dr-header {padding:2px 10px 6px 16px;min-height:0;}
 .right-panel.is-ai:not(.is-expanded):has(.dr-thread > .dr-welcome) .dr-header {display:none;}
 .right-panel.is-ai .dr-dock-btn {display:none !important;}
 .right-panel.is-ai:not(.is-expanded) .dr-header {padding:0 12px 0 16px;}
 .right-panel.is-ai:not(.is-expanded) .dr-mode {height:20px;font-size:10.5px;}
 .right-panel.is-ai:not(.is-expanded) .dr-new {height:26px;padding:0 9px 0 7px;font-size:11.5px;}

 /* ---- Conversation ---- */
 .right-panel.is-ai .dr-thread {padding:4px 14px 10px;gap:12px;}
 .right-panel.is-ai .dr-thread > * {flex-shrink:0;}
 .right-panel.is-ai:not(.is-expanded) .dr-suggest-grid,
 .right-panel.is-ai:not(.is-expanded) .dr-followups {display:none !important;}

 /* ---- Composer card (both states): context chip, input and footer in one surface ---- */
 .right-panel.is-ai .dr-compose {
  display:flex;flex-direction:column;flex:none;min-height:0;
  margin:0 12px 12px;padding:10px 10px 8px;border:1px solid var(--dk-line) !important;border-radius:16px;background:var(--dk-card) !important;
  transition:border-color .18s,box-shadow .18s;
 }
 .right-panel.is-ai .dr-compose:focus-within {border-color:color-mix(in srgb,var(--dk-accent) 70%,transparent) !important;box-shadow:0 0 0 3px color-mix(in srgb,var(--dk-accent) 16%,transparent);}
 .right-panel.is-ai .dr-context {align-self:flex-start;max-width:100%;height:24px;margin:0 0 4px;padding:0 10px 0 8px;gap:6px;border-radius:999px;background:var(--dk-chip);font-size:11px;}
 .right-panel.is-ai .dr-context-detail {opacity:.85;}
 .right-panel.is-ai .dr-box {display:flex;flex-direction:column;flex:1;min-height:0;border:0 !important;border-radius:0;background:transparent !important;overflow:visible;}
 .right-panel.is-ai .dr-box:focus-within {border:0;}
 .right-panel.is-ai .dr-box .dr-input {flex:1 1 auto;min-height:52px !important;max-height:120px;padding:6px 2px;background:transparent;font-size:16px;line-height:1.45;resize:none;}
 .right-panel.is-ai .dr-box .dr-input::placeholder {font-size:15px;color:var(--dk-muted);white-space:normal;}
 .right-panel.is-ai .composer-footer {position:static;display:flex;align-items:center;justify-content:space-between;gap:8px;padding:2px 0 0;}
 .right-panel.is-ai .dr-keys,
 .right-panel.is-ai .composer-hint {display:none;}
 .right-panel.is-ai .dr-footnote {display:inline-flex;align-items:center;gap:6px;min-width:0;font-size:11px;color:var(--dk-muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
 .right-panel.is-ai .dr-footnote i {flex:none;width:5px;height:5px;border-radius:50%;background:currentColor;opacity:.7;}
 .right-panel.is-ai .send-button {flex:none;width:36px;height:36px;border-radius:50%;background:var(--dk-send);color:var(--dk-send-ink);transition:transform .15s,background-color .15s,opacity .15s;}
 .right-panel.is-ai .send-button:not(:disabled):active {transform:scale(.92);}
 .right-panel.is-ai .send-button:disabled {background:var(--dk-chip);color:var(--dk-muted);opacity:1;}
 .right-panel.is-ai .send-button svg {width:17px;height:17px;}

 /* Docked + empty: no thread yet, so the composer card takes the whole body */
 .right-panel.is-ai:not(.is-expanded):has(.dr-thread > .dr-welcome) .dr-thread {display:none;}
 .right-panel.is-ai:not(.is-expanded):has(.dr-thread > .dr-welcome) .dr-compose {flex:1;margin-top:2px;}
 .right-panel.is-ai:not(.is-expanded):has(.dr-thread > .dr-welcome) .dr-box .dr-input {max-height:none;}

 /* ---- With a conversation: thread gets the room, composer collapses to one row ---- */
 .right-panel.is-ai:not(:has(.dr-thread > .dr-welcome)) .dr-compose {padding:7px 6px 6px 10px;border-radius:20px;}
 .right-panel.is-ai:not(:has(.dr-thread > .dr-welcome)) .dr-context {height:22px;margin:0 0 2px;padding:0 9px 0 7px;font-size:10.5px;}
 .right-panel.is-ai:not(:has(.dr-thread > .dr-welcome)) .dr-box {flex-direction:row;align-items:flex-end;gap:6px;}
 .right-panel.is-ai:not(:has(.dr-thread > .dr-welcome)) .dr-box .dr-input {min-height:38px !important;max-height:96px;padding:8px 2px 7px;}
 .right-panel.is-ai:not(:has(.dr-thread > .dr-welcome)) .dr-box .dr-input::placeholder {white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
 .right-panel.is-ai:not(:has(.dr-thread > .dr-welcome)) .composer-footer {flex:none;padding:0 0 1px;}
 .right-panel.is-ai:not(:has(.dr-thread > .dr-welcome)) .dr-footnote {display:none;}
 .right-panel.is-ai:not(:has(.dr-thread > .dr-welcome)) .send-button {width:36px;height:36px;}

 /* Thread: readable sizes, soft fade under the header instead of a hard cut */
 .right-panel.is-ai .dr-thread:not(:has(> .dr-welcome)) {
  padding:10px 14px 12px;gap:14px;overscroll-behavior:contain;
  -webkit-mask-image:linear-gradient(180deg,transparent 0,#000 14px,#000 calc(100% - 8px),transparent);mask-image:linear-gradient(180deg,transparent 0,#000 14px,#000 calc(100% - 8px),transparent);
 }
 .right-panel.is-ai .dr-msg {gap:10px;}
 .right-panel.is-ai .dr-avatar {width:26px;height:26px;border-radius:8px;}
 .right-panel.is-ai .dr-text {font-size:13.5px;line-height:1.55;padding-top:3px;}
 .right-panel.is-ai .dr-user .dr-bubble {max-width:84%;padding:9px 13px;border-radius:16px 16px 4px 16px;font-size:13.5px;line-height:1.45;}
 .right-panel.is-ai .dr-result {border-radius:12px;}
 .right-panel.is-ai .dr-result-head {padding:8px 8px 8px 12px;font-size:12.5px;}
 .right-panel.is-ai .dr-result ul {padding:8px 12px 10px;gap:7px;}
 .right-panel.is-ai .dr-result li {font-size:12.5px;}
 .right-panel.is-ai .dr-undo {height:30px;min-height:30px;padding:0 11px;border-radius:9px;font-size:12px;}
 .right-panel.is-ai .dr-thinking {font-size:13px;}
 .right-panel.is-ai .dr-chip {height:34px;padding:0 12px;border-radius:999px;font-size:12.5px;}

 /* ---- Expanded empty state: compact intro + one grouped suggestion list ---- */
 .right-panel.is-ai.is-expanded .dr-thread:has(> .dr-welcome) {
  padding:6px 16px 18px;gap:16px;overscroll-behavior:contain;
  -webkit-mask-image:linear-gradient(180deg,#000 calc(100% - 22px),transparent);mask-image:linear-gradient(180deg,#000 calc(100% - 22px),transparent);
 }
 .right-panel.is-ai.is-expanded .dr-welcome {align-items:flex-start;text-align:left;gap:6px;padding:6px 2px 0;}
 .right-panel.is-ai.is-expanded .dr-hero {display:none;}
 .right-panel.is-ai.is-expanded .dr-welcome h3 {font-size:20px;font-weight:600;letter-spacing:-.5px;line-height:1.25;margin:0;}
 .right-panel.is-ai.is-expanded .dr-welcome p {max-width:36ch;font-size:13.5px;line-height:1.5;color:var(--dk-muted);}
 .right-panel.is-ai.is-expanded .dr-suggest-grid {display:flex;flex-direction:column;gap:0;margin:0;border:1px solid var(--dk-line);border-radius:16px;background:var(--dk-card);overflow:hidden;}
 .right-panel.is-ai.is-expanded .dr-suggest-grid::before {content:'Try an edit';display:block;padding:12px 16px 6px;font-size:11px;font-weight:600;letter-spacing:.6px;text-transform:uppercase;color:var(--dk-muted);}
 .right-panel.is-ai.is-expanded .dr-suggest {
  position:relative;display:grid;grid-template-columns:34px minmax(0,1fr) 14px;grid-template-rows:auto auto;column-gap:12px;row-gap:1px;align-items:center;
  width:100%;min-height:60px;padding:10px 16px 10px 14px;border:0;border-radius:0;background:transparent;transition:background-color .15s;
 }
 .right-panel.is-ai.is-expanded .dr-suggest + .dr-suggest::before {content:'';position:absolute;top:0;left:60px;right:0;height:1px;background:var(--dk-line);}
 .right-panel.is-ai.is-expanded .dr-suggest::after {content:'';grid-column:3;grid-row:1 / span 2;width:7px;height:7px;border-top:1.6px solid currentColor;border-right:1.6px solid currentColor;transform:rotate(45deg);opacity:.35;justify-self:center;}
 .right-panel.is-ai.is-expanded .dr-suggest:hover {transform:none;background:transparent;}
 .right-panel.is-ai.is-expanded .dr-suggest:active {transform:none;background:var(--dk-chip);}
 .right-panel.is-ai.is-expanded .dr-suggest svg {grid-column:1;grid-row:1 / span 2;width:34px;height:34px;padding:8px;margin:0;border-radius:10px;background:var(--dk-chip);box-sizing:border-box;}
 .right-panel.is-ai.is-expanded .dr-suggest strong {grid-column:2;font-size:14px;font-weight:600;align-self:end;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
 .right-panel.is-ai.is-expanded .dr-suggest span {grid-column:2;font-size:12.5px;color:var(--dk-muted);-webkit-line-clamp:1;align-self:start;}
 .right-panel.is-ai.is-expanded .dr-followups {display:flex;flex-wrap:wrap;gap:8px;}
 /* Shorter screens: shorter intro so the list fits */
 @media (max-height:760px) {
  .right-panel.is-ai.is-expanded .dr-welcome p {display:none;}
  .right-panel.is-ai.is-expanded .dr-welcome h3 {font-size:18px;}
  .right-panel.is-ai.is-expanded .dr-suggest {min-height:54px;padding-top:8px;padding-bottom:8px;}
  .right-panel.is-ai.is-expanded .dr-suggest-grid::before {padding-top:10px;padding-bottom:2px;}
  .right-panel.is-ai.is-expanded .dr-welcome {padding-top:0;}
  .right-panel.is-ai.is-expanded .dr-thread:has(> .dr-welcome) {gap:12px;padding-bottom:14px;}
  .right-panel.is-ai.is-expanded:has(.dr-thread > .dr-welcome) .dr-box .dr-input {min-height:40px !important;}
  .right-panel.is-ai.is-expanded:has(.dr-thread > .dr-welcome) .dr-box .dr-input::placeholder {white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
 }

 /* Short phones: drop the clip chip once chatting so messages get the extra row */
 @media (max-height:720px) {
  .right-panel.is-ai:not(.is-expanded):not(:has(.dr-thread > .dr-welcome)) .dr-context {display:none;}
  .right-panel.is-ai:not(.is-expanded):not(:has(.dr-thread > .dr-welcome)) .dr-compose {padding-top:6px;}
 }

 /* Keyboard open: sheet rides on top of the keyboard, keeping its height */
 .right-panel.is-ai.is-open.kb-open {top:var(--kb-top) !important;bottom:var(--kb-bottom) !important;z-index:30;}
 .right-panel.is-ai.is-open.kb-open:not(.is-expanded) {box-shadow:0 -8px 30px #00000059;}
 .right-panel.is-ai.kb-open .dr-header {touch-action:auto;}

 /* Full screen: a visible handle on the tabs row (dragging it collapses the sheet) */

 /* ---- Shared sheet header (both tabs, both states): handle + pill tabs + expand/close ---- */
 .right-panel.is-ai .right-header {position:relative;display:flex;align-items:center;gap:4px;height:auto !important;min-height:0 !important;padding:16px 8px 8px 12px;border-bottom:0 !important;touch-action:none;cursor:grab;}
 .right-panel.is-ai .right-tabs {display:flex;gap:2px;padding:3px;border-radius:999px;background:var(--dk-chip);cursor:auto;}
 .right-panel.is-ai .right-tab {height:32px;padding:0 14px 0 12px;gap:6px;border-radius:999px;font-size:13px;font-weight:500;color:var(--dk-muted);transition:background-color .18s,color .18s;}
 .right-panel.is-ai .right-tab::after {display:none !important;}
 .right-panel.is-ai .right-tab.active {background:var(--dk-card);color:inherit;box-shadow:0 1px 3px #00000040;}
 .right-panel.is-ai .right-tab svg {width:15px;height:15px;}
 .right-panel.is-ai .rh-dock-btn {display:grid;place-items:center;margin-left:auto;}
 .right-panel.is-ai .right-header .icon-button {width:34px;height:34px;border-radius:10px;}
 .right-panel.is-ai .rh-dock-btn svg {transition:transform .25s;}

 /* ---- Properties on mobile: touch-sized controls, works docked under the preview ---- */
 .right-panel.is-ai .property-scroll {padding:4px 12px 18px;overscroll-behavior:contain;
  -webkit-mask-image:linear-gradient(180deg,transparent 0,#000 10px,#000 calc(100% - 14px),transparent);mask-image:linear-gradient(180deg,transparent 0,#000 10px,#000 calc(100% - 14px),transparent);}
 .right-panel.is-ai .pp-head {gap:12px;padding:4px 2px 2px;}
 .right-panel.is-ai .pp-thumb {--th:46px;border-radius:10px;}
 .right-panel.is-ai .pp-thumb.is-portrait {--th:72px;}
 .right-panel.is-ai .pp-head-name {font-size:15px;}
 .right-panel.is-ai .pp-section {background:var(--dk-card) !important;border:1px solid var(--dk-line) !important;border-radius:14px;padding:14px;}
 .right-panel.is-ai .pp-section-title {font-size:13px;margin-bottom:12px;}
 .right-panel.is-ai .pp-section-title svg {width:15px;height:15px;}
 .right-panel.is-ai .pp-label,.right-panel.is-ai .pp-num > span {font-size:12px;}
 .right-panel.is-ai .pp-value {font-size:12.5px;}
 .right-panel.is-ai .pp .pp-num .property-input {height:42px;font-size:16px;border-radius:10px;}
 .right-panel.is-ai .pp-num em {bottom:13px;}
 .right-panel.is-ai .pp-textarea,.right-panel.is-ai .pp input[type=text],.right-panel.is-ai .pp select {font-size:16px;}
 .right-panel.is-ai .pp-textarea {min-height:84px;border-radius:12px;}
 .right-panel.is-ai .pp-btn {height:40px;border-radius:10px;font-size:13px;}
 .right-panel.is-ai .pp-seg {padding:3px;border-radius:12px;overflow-x:auto;scrollbar-width:none;}
 .right-panel.is-ai .pp-seg::-webkit-scrollbar {display:none;}
 .right-panel.is-ai .pp-seg-opt {flex:1 0 auto;min-width:46px;}
 .right-panel.is-ai .pp-seg-opt span {height:36px;padding:0 8px;border-radius:9px;font-size:13px;}
 .right-panel.is-ai .pp-range {height:30px;}
 .right-panel.is-ai .pp-range::-webkit-slider-runnable-track {height:5px;border-radius:3px;}
 .right-panel.is-ai .pp-range::-webkit-slider-thumb {width:22px;height:22px;margin-top:-8.5px;}
 .right-panel.is-ai .pp-range::-moz-range-thumb {width:22px;height:22px;}
 .right-panel.is-ai .pp-looks {gap:8px;}
 .right-panel.is-ai .pp-look {padding:7px 6px 8px;border-radius:12px;font-size:12px;}
 .right-panel.is-ai .pp-look-swatch {height:34px;border-radius:8px;}
 .right-panel.is-ai .pp-swatches {gap:10px;}
 .right-panel.is-ai .pp-swatch {width:34px;height:34px;}
 /* Docked: slimmer clip header so controls start sooner */
 .right-panel.is-ai:not(.is-expanded) .pp-thumb {--th:36px;}
 .right-panel.is-ai:not(.is-expanded) .pp-thumb.is-portrait {--th:52px;}
 .right-panel.is-ai:not(.is-expanded) .pp-meta {display:none;}
 .right-panel.is-ai:not(.is-expanded) .pp {gap:10px;}
 @media (max-height:720px) {
  .right-panel.is-ai:not(.is-expanded) .pp-thumb {--th:34px;}
  .right-panel.is-ai:not(.is-expanded) .pp-thumb.is-portrait {--th:46px;}
  .right-panel.is-ai:not(.is-expanded) .right-header {padding-top:14px;padding-bottom:6px;}
 }

 /* Toasts float above the playback controls instead of covering the sheet */
 body:has(.right-panel.is-ai.is-dragging) .toast-area {opacity:0;transition:opacity .12s;}
 body:has(.right-panel.is-ai.is-open:not(.is-expanded)) .toast-area {bottom:var(--ai-sheet-clear,calc(var(--mnav) + 14px)) !important;transition:bottom .3s cubic-bezier(.2,.8,.2,1);}
}
@keyframes aiDockIn {from{transform:translateY(32px);opacity:0}to{transform:none;opacity:1}}
@media (prefers-reduced-motion:reduce) {.right-panel.is-ai{transition:none;animation:none !important}}

/* Clip thumbnail takes the clip's real shape (vertical clips are no longer cropped into a landscape box) */
.pp-thumb {--th:54px;height:var(--th) !important;width:calc(var(--th) * var(--ar,1.5556)) !important;max-width:96px;}
.pp-thumb.is-portrait {--th:76px;}
.pp-thumb.is-portrait .pp-thumb-time {right:3px;bottom:3px;padding:2px 3px;font-size:8.5px;}
.pp-thumb-text {--ar:1.5556;}
@media all { /* sheet + panel design: phones and desktop */
 .right-panel.is-ai:not(.is-expanded) .pp-thumb.is-portrait .pp-thumb-time {display:none;}
}

/* ---- Mobile Properties: clip header, stats and trim strip ---- */
@media all { /* sheet + panel design: phones and desktop */
 /* never let the flex column squash blocks (stats row was collapsing to a 2px line) */
 .right-panel.is-ai .pp > * {flex-shrink:0;}

 /* Header: thumbnail + name on top, kicker chip and meta underneath */
 .right-panel.is-ai .pp-head {display:flex;align-items:center;gap:12px;padding:2px 2px 0;}
 .right-panel.is-ai .pp-thumb {box-shadow:0 2px 8px #00000040;border-color:color-mix(in srgb,currentColor 12%,transparent);}
 .right-panel.is-ai .pp-head-text {display:flex !important;flex-direction:column !important;align-items:stretch !important;gap:4px !important;}
 .right-panel.is-ai .pp-name,.right-panel.is-ai .pp-head-name {order:0 !important;height:30px;font-size:16px;font-weight:600;letter-spacing:-.2px;}
 .right-panel.is-ai .pp-head-name {height:auto;}
 .right-panel.is-ai .pp-name {margin-left:-7px;padding:0 7px;border-radius:8px;}
 .right-panel.is-ai .pp-kicker {order:1;align-self:flex-start;height:20px;display:inline-flex;align-items:center;padding:0 8px;border-radius:999px;background:var(--dk-chip);color:var(--dk-accent);font-size:10px !important;font-weight:600;letter-spacing:.5px;white-space:nowrap;}
 .right-panel.is-ai .pp-meta {order:2;display:block !important;font-size:11.5px;color:var(--dk-muted);}
 .right-panel.is-ai:not(.is-expanded) .pp-meta {display:none !important;}

 /* Stats: compact three-up readout */
 .right-panel.is-ai .pp-stats {border-radius:12px;border:1px solid var(--dk-line) !important;background:var(--dk-line) !important;}
 .right-panel.is-ai .pp-stats > div {flex-direction:row;align-items:baseline;justify-content:space-between;gap:6px;padding:9px 12px;background:var(--dk-card) !important;}
 .right-panel.is-ai .pp-stats span {font-size:11px;color:var(--dk-muted) !important;}
 .right-panel.is-ai .pp-stats strong {font-size:12.5px;}
 @media (max-width:380px) {
  .right-panel.is-ai .pp-stats > div {flex-direction:column;gap:2px;}
 }

 /* Trim strip: taller, rounded, visible grips on the kept range */
 .right-panel.is-ai .pp-trimviz {height:48px;border-radius:12px;border-color:var(--dk-line);margin-bottom:2px;}
 .right-panel.is-ai .pp-trimviz-strip i:not(:last-child) {box-shadow:inset -1px 0 0 #0000004d;}
 .right-panel.is-ai .pp-trimviz-mask {background:#0d0e0fcc;}
 .right-panel.is-ai .pp-trimviz-scale {margin:7px 2px 0;font-size:11px;color:var(--dk-muted);}
}
@media all { /* sheet + panel design: phones and desktop */
 .right-panel.is-ai .pp-thumb.is-portrait {border-radius:8px;}
 .right-panel.is-ai:not(.is-expanded) .pp-thumb.is-portrait {border-radius:6px;}
}

/* ---- Mobile Properties: header + stats as one card ---- */
@media all { /* sheet + panel design: phones and desktop */
 .right-panel.is-ai .pp-head:has(+ .pp-stats) {
  padding:12px 12px 12px;border:1px solid var(--dk-line);border-bottom:0;border-radius:16px 16px 0 0;background:var(--dk-card);
 }
 .right-panel.is-ai .pp-head + .pp-stats {
  margin-top:-12px;border-radius:0 0 16px 16px !important;border:1px solid var(--dk-line) !important;
  background:var(--dk-line) !important;gap:1px;padding-top:0;
 }
 .right-panel.is-ai .pp-head + .pp-stats > div {flex-direction:column !important;align-items:flex-start !important;justify-content:center;gap:3px !important;padding:9px 12px 10px;background:var(--dk-card) !important;}
 .right-panel.is-ai .pp-head + .pp-stats span {font-size:10px;font-weight:600;letter-spacing:.5px;text-transform:uppercase;}
 .right-panel.is-ai .pp-head + .pp-stats strong {font-size:14px;letter-spacing:-.2px;}
 .right-panel.is-ai .pp-head:has(+ .pp-stats) .pp-head-text {gap:5px !important;}
 .right-panel.is-ai .pp-head:has(+ .pp-stats) .pp-kicker {height:19px;padding:0 7px;font-size:9.5px !important;}
 .right-panel.is-ai .pp-head:has(+ .pp-stats) .pp-name {height:28px;font-size:15.5px;}
}
@media all { /* sheet + panel design: phones and desktop */
 .right-panel.is-ai:not(.is-expanded) .pp-head + .pp-stats {margin-top:-10px;}
}

/* ---- Mobile Properties: cleaner Speed (segmented) and Color (looks + sliders) ---- */
@media all { /* sheet + panel design: phones and desktop */
 /* Segmented controls: soft track, raised selected pill (matches the tab switcher) */
 .right-panel.is-ai .pp-seg {padding:3px !important;gap:2px;border:0 !important;border-radius:12px;background:var(--dk-chip) !important;}
 .right-panel.is-ai .pp-seg-opt span {height:34px;border-radius:9px;color:var(--dk-muted) !important;font-weight:500;background:transparent !important;transition:background-color .18s,color .18s,box-shadow .18s;}
 .right-panel.is-ai .pp-seg-opt input:checked + span {background:var(--dk-card) !important;color:var(--dk-accent) !important;font-weight:700;box-shadow:0 1px 3px #00000038,inset 0 0 0 1px color-mix(in srgb,var(--dk-accent) 30%,transparent);}
 .right-panel.is-ai .pp-seg-opt:active span {transform:scale(.96);}

 /* Looks: no card chrome, just a swatch (the clip's own frame with the look applied) + label */
 .right-panel.is-ai .pp-looks {grid-template-columns:repeat(3,minmax(0,1fr));gap:12px 10px;margin-bottom:4px;}
 .right-panel.is-ai .pp-look {gap:6px;padding:0 !important;border:0 !important;background:transparent !important;color:var(--dk-muted) !important;font-size:12px;font-weight:500;transition:transform .15s;}
 .right-panel.is-ai .pp-look:active {transform:scale(.96);}
 .right-panel.is-ai .pp-look-swatch {height:auto !important;aspect-ratio:16/10;border-radius:12px;box-shadow:inset 0 0 0 1px #ffffff1a;transition:box-shadow .18s;}
 .right-panel.is-ai .pp-look-swatch.has-frame {background-size:cover !important;background-position:center !important;}
 .right-panel.is-ai .pp-look.is-on {color:inherit !important;font-weight:600;}
 .right-panel.is-ai .pp-look.is-on .pp-look-swatch {box-shadow:0 0 0 2px var(--dk-card),0 0 0 4px var(--dk-accent);}

 /* Sliders: separated from the looks, tighter rhythm, value as a small pill */
 .right-panel.is-ai .pp-looks + .pp-slider {margin-top:14px;padding-top:14px;border-top:1px solid var(--dk-line);}
 .right-panel.is-ai .pp-slider {margin-top:10px;}
 .right-panel.is-ai .pp-slider-top {align-items:center;margin-bottom:0;}
 .right-panel.is-ai .pp-label {font-size:13px;color:inherit;opacity:.85;}
 .right-panel.is-ai .pp-value {min-width:46px;padding:4px 7px;border-radius:7px;background:var(--dk-chip);text-align:center;font-size:12px !important;}
 .right-panel.is-ai .pp-section-title .pp-link {height:26px;padding:0 10px;border-radius:999px;background:var(--dk-chip);font-size:12px;}
}
@media all { /* sheet + panel design: phones and desktop */
 .right-panel.is-ai {--dk-track:#3a3c3d;}
 
 .right-panel.is-ai .pp-range::-webkit-slider-runnable-track {background:linear-gradient(90deg,var(--dk-accent) var(--fill,50%),var(--dk-track) var(--fill,50%)) !important;}
 .right-panel.is-ai .pp-range::-moz-range-track {background:linear-gradient(90deg,var(--dk-accent) var(--fill,50%),var(--dk-track) var(--fill,50%)) !important;}
 
}

/* ---------- Interactive trim strip (all sizes) ---------- */
.pp-trimviz {--acc:var(--dk-accent,#e2ab77);overflow:visible !important;touch-action:none;user-select:none;-webkit-user-select:none;cursor:pointer;}
.pp-trimviz-strip {border-radius:inherit;overflow:hidden;}
.pp-trimviz-mask.is-l {border-radius:inherit;border-top-right-radius:0;border-bottom-right-radius:0;}
.pp-trimviz-mask.is-r {border-radius:inherit;border-top-left-radius:0;border-bottom-left-radius:0;}
.pp-trimviz .pp-trimviz-range {border:0 !important;border-top:2px solid var(--acc) !important;border-bottom:2px solid var(--acc) !important;border-radius:0 !important;box-shadow:none !important;cursor:grab;transition:background-color .15s;}
.pp-trimviz .pp-trimviz-range::before,.pp-trimviz .pp-trimviz-range::after {content:none !important;}
.pp-trimviz[data-drag="body"] .pp-trimviz-range {cursor:grabbing;background:color-mix(in srgb,var(--acc) 14%,transparent);}
.pp-tv-handle {position:absolute;top:-1px;bottom:-1px;z-index:2;width:14px;padding:0;border:0 !important;background:var(--acc) !important;cursor:ew-resize;touch-action:none;-webkit-tap-highlight-color:transparent;transition:transform .12s,box-shadow .12s;}
.pp-tv-handle.is-in {border-radius:8px 2px 2px 8px;}
.pp-tv-handle.is-out {transform:translateX(-100%);border-radius:2px 8px 8px 2px;}
.pp-tv-handle::before {content:'';position:absolute;top:50%;left:50%;width:2px;height:14px;margin:-7px 0 0 -1px;border-radius:1px;background:#1a1612a6;}
.pp-tv-handle::after {content:'';position:absolute;inset:-6px -12px;} /* bigger touch target */
.pp-tv-handle:focus-visible {outline:none;box-shadow:0 0 0 3px color-mix(in srgb,var(--acc) 45%,transparent);}
.pp-trimviz[data-drag="in"] .is-in,.pp-trimviz[data-drag="out"] .is-out {box-shadow:0 0 0 3px color-mix(in srgb,var(--acc) 35%,transparent),0 4px 12px #00000059;}
.pp-tv-tip {position:absolute;bottom:calc(100% + 8px);left:50%;transform:translateX(-50%) translateY(4px);padding:4px 7px;border-radius:7px;background:#111213;color:#f6f1ea;font:600 11px/1 ui-monospace,'SFMono-Regular',monospace;white-space:nowrap;box-shadow:0 4px 12px #0006;opacity:0;pointer-events:none;transition:opacity .12s,transform .12s;}
.pp-trimviz[data-drag="in"] .is-in .pp-tv-tip,.pp-trimviz[data-drag="out"] .is-out .pp-tv-tip,.pp-trimviz[data-drag="body"] .pp-tv-tip,.pp-tv-handle:focus-visible .pp-tv-tip {opacity:1;transform:translateX(-50%);}
.pp-trimviz-scale {align-items:center;}
.pp-tv-kept {font:600 11px/1 'DM Sans',Inter,sans-serif;color:var(--dk-accent,#d1a476);letter-spacing:.1px;}
/* − value + steppers */
.pp-step-row {display:flex;align-items:stretch;gap:4px;}
.pp-step-row .property-input {flex:1;min-width:0;text-align:center;padding:0 4px !important;}
.pp-step-btn {flex:none;display:grid;place-items:center;width:32px;border-radius:8px;border:1px solid #3d3f40;background:#2a2b2c;color:#e6e2da;-webkit-tap-highlight-color:transparent;}
.pp-step-btn svg {width:14px;height:14px;}
.pp-step-btn:active {transform:scale(.94);}

@media all { /* sheet + panel design: phones and desktop */
 .right-panel.is-ai .pp-trimviz {height:54px;margin-top:20px;}
 .right-panel.is-ai .pp-tv-handle {width:16px;}
 .right-panel.is-ai .pp-step-btn {width:42px;border:0;border-radius:10px;background:var(--dk-chip);color:inherit;}
 .right-panel.is-ai .pp-step-row .property-input {height:42px;}
 .right-panel.is-ai .pp-trimviz-scale {margin-top:8px;}
}

/* ---- Expanded Director: compact 2-up suggestion tiles (was a tall 4-row list) ---- */
@media all { /* sheet + panel design: phones and desktop */
 .right-panel.is-ai.is-expanded .dr-suggest-grid {display:grid !important;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;padding:0;border:0;border-radius:0;background:transparent;overflow:visible;}
 .right-panel.is-ai.is-expanded .dr-suggest-grid::before {grid-column:1 / -1;padding:0 2px 2px;}
 .right-panel.is-ai.is-expanded .dr-suggest {
  display:flex !important;align-items:center;gap:10px;min-height:52px;padding:8px 10px !important;
  border:1px solid var(--dk-line) !important;border-radius:14px !important;background:var(--dk-card) !important;
 }
 .right-panel.is-ai.is-expanded .dr-suggest + .dr-suggest::before,
 .right-panel.is-ai.is-expanded .dr-suggest::after {content:none !important;display:none !important;}
 .right-panel.is-ai.is-expanded .dr-suggest svg {flex:none;width:32px !important;height:32px !important;padding:8px !important;border-radius:9px;}
 .right-panel.is-ai.is-expanded .dr-suggest strong {font-size:13px;line-height:1.25;white-space:normal;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;text-align:left;}
 .right-panel.is-ai.is-expanded .dr-suggest span {display:none !important;}
 .right-panel.is-ai.is-expanded .dr-suggest:active {background:var(--dk-chip) !important;border-color:color-mix(in srgb,var(--dk-accent) 50%,transparent) !important;}
}
@media (max-width:340px) {
 .right-panel.is-ai.is-expanded .dr-suggest-grid {grid-template-columns:1fr;}
}
@media all { /* sheet + panel design: phones and desktop */
 .right-panel.is-ai.is-expanded .dr-suggest {flex-direction:row !important;justify-content:flex-start !important;text-align:left;}
 .right-panel.is-ai.is-expanded .dr-suggest svg {margin:0 !important;align-self:center !important;}
 .right-panel.is-ai.is-expanded .dr-suggest strong {flex:1;min-width:0;align-self:center !important;margin:0;}
}

/* ---- Expanded Director tiles: tinted per action, borderless, with an action arrow ---- */
@media all { /* sheet + panel design: phones and desktop */
 .right-panel.is-ai.is-expanded .dr-welcome {gap:4px;}
 .right-panel.is-ai.is-expanded .dr-thread:has(> .dr-welcome) {gap:14px;}
 .right-panel.is-ai.is-expanded .dr-suggest-grid {gap:10px;}
 .right-panel.is-ai.is-expanded .dr-suggest-grid::before {padding-bottom:0;font-size:10.5px;letter-spacing:.8px;}
 .right-panel.is-ai.is-expanded .dr-suggest {
  --tint:#d9a877;position:relative;min-height:58px;padding:10px 26px 10px 10px !important;
  border:0 !important;border-radius:16px !important;
  background:color-mix(in srgb,var(--tint) 9%,var(--dk-card)) !important;
  box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--tint) 16%,transparent);
  transition:transform .15s,box-shadow .15s,background-color .15s;
 }
 .right-panel.is-ai.is-expanded .dr-suggest:nth-child(4n+1) {--tint:#6fa3d9;}
 .right-panel.is-ai.is-expanded .dr-suggest:nth-child(4n+2) {--tint:#d9a877;}
 .right-panel.is-ai.is-expanded .dr-suggest:nth-child(4n+3) {--tint:#d98a8a;}
 .right-panel.is-ai.is-expanded .dr-suggest:nth-child(4n+4) {--tint:#7fbf96;}
 .right-panel.is-ai.is-expanded .dr-suggest svg {
  width:34px !important;height:34px !important;border-radius:11px !important;
  background:color-mix(in srgb,var(--tint) 20%,transparent) !important;color:var(--tint) !important;
 }
 .right-panel.is-ai.is-expanded .dr-suggest strong {font-size:13.5px;font-weight:600;letter-spacing:-.1px;}
 .right-panel.is-ai.is-expanded .dr-suggest::after {
  content:'' !important;display:block !important;position:absolute;top:12px;right:12px;width:6px;height:6px;
  border-top:1.6px solid currentColor;border-right:1.6px solid currentColor;opacity:.35;transform:none;
 }
 .right-panel.is-ai.is-expanded .dr-suggest:active {transform:scale(.97);background:color-mix(in srgb,var(--tint) 16%,var(--dk-card)) !important;box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--tint) 40%,transparent);}
}
@media all { /* sheet + panel design: phones and desktop */
 .right-panel.is-ai.is-expanded .dr-suggest::after {content:'↗' !important;width:auto;height:auto;border:0 !important;top:8px;right:10px;font-size:13px;line-height:1;color:var(--tint);opacity:.75;}
}
/* Tiles: one uniform surface, no borders; colour only on the icon glyph */
@media all { /* sheet + panel design: phones and desktop */
 .right-panel.is-ai.is-expanded .dr-suggest,
 .right-panel.is-ai.is-expanded .dr-suggest:active {
  border:0 !important;box-shadow:none !important;background:var(--dk-chip) !important;
 }
 .right-panel.is-ai.is-expanded .dr-suggest:active {background:color-mix(in srgb,currentColor 10%,var(--dk-chip)) !important;}
 .right-panel.is-ai.is-expanded .dr-suggest svg {background:var(--dk-card) !important;}
 .right-panel.is-ai.is-expanded .dr-suggest::after {color:inherit;opacity:.3;}
}
/* Expanded Director suggestions: simple wrapping chips (icon + label), naturally responsive */
@media all { /* sheet + panel design: phones and desktop */
 .right-panel.is-ai.is-expanded .dr-suggest-grid {display:flex !important;flex-wrap:wrap;gap:8px;grid-template-columns:none;}
 .right-panel.is-ai.is-expanded .dr-suggest-grid::before {flex-basis:100%;}
 .right-panel.is-ai.is-expanded .dr-suggest,
 .right-panel.is-ai.is-expanded .dr-suggest:active {
  flex:0 0 auto;width:auto !important;min-height:0 !important;height:38px;gap:7px !important;padding:0 14px 0 11px !important;
  border-radius:999px !important;border:0 !important;box-shadow:none !important;background:var(--dk-chip) !important;
 }
 .right-panel.is-ai.is-expanded .dr-suggest:active {transform:scale(.96);background:color-mix(in srgb,var(--dk-accent) 14%,var(--dk-chip)) !important;}
 .right-panel.is-ai.is-expanded .dr-suggest svg {width:16px !important;height:16px !important;padding:0 !important;border-radius:0 !important;background:none !important;color:var(--dk-accent) !important;}
 .right-panel.is-ai.is-expanded .dr-suggest strong {flex:none;font-size:13px;font-weight:500;white-space:nowrap;-webkit-line-clamp:unset;display:block;}
 .right-panel.is-ai.is-expanded .dr-suggest::after {content:none !important;display:none !important;}
}
@media all { /* sheet + panel design: phones and desktop */
 .right-panel.is-ai.is-expanded .dr-suggest-grid {flex-direction:row !important;align-items:center;justify-content:flex-start;}
 .right-panel.is-ai.is-expanded .dr-suggest-grid::before {flex:0 0 100%;width:100%;}
 .right-panel.is-ai .right-tab {white-space:nowrap;}
}
@media (max-width:360px) {
 .right-panel.is-ai .right-tab {padding:0 10px 0 9px;font-size:12.5px;gap:5px;}
 .right-panel.is-ai .right-tab svg {width:14px;height:14px;}
}

/* Director undo/redo replies */
.dr-hist .dr-result-head {color:#d9b48c;}
.dr-hist.is-redo .dr-result-head {color:#9fd2b5;}
.dr-hist li svg {opacity:.7;}
.dr-hist-more {display:block;width:100%;padding:9px 12px;border-top:1px solid #2c2e2f;font-size:11.5px;font-weight:500;color:#cfcac2;text-align:left;}
.dr-hist-more:hover {background:#ffffff08;}



@media all { /* sheet + panel design: phones and desktop */
 .right-panel.is-ai .dr-hist-more {padding:11px 12px;font-size:12.5px;border-top-color:var(--dk-line);}
}
.dr-didyoumean {display:flex;flex-wrap:wrap;gap:6px;}
.dr-didyoumean .dr-chip {color:#efbd8a;border-color:#e2ab7755;}


/* ---- Director: edit / resend your own prompts ---- */
.dr-user {flex-direction:column;align-items:flex-end;gap:4px;}
.dr-user .dr-bubble {cursor:text;}
.dr-user-actions {display:flex;gap:2px;opacity:0;transition:opacity .15s;}
.dr-user:hover .dr-user-actions,.dr-user:focus-within .dr-user-actions,.dr-msg.dr-user:last-of-type .dr-user-actions {opacity:1;}
.dr-user-actions button {display:grid;place-items:center;width:28px;height:28px;border-radius:8px;color:#9b9891;}
.dr-user-actions button:hover {background:#ffffff0d;color:#ece9e3;}
.dr-user-actions svg {width:14px;height:14px;}
.dr-edit {width:100%;max-width:100%;padding:8px;border-radius:14px;border:1px solid #e2ab7799;background:#1f2021;box-shadow:0 0 0 3px #e2ab7722;}
.dr-edit-input {display:block;width:100%;min-height:30px;max-height:140px;padding:4px 6px;border:0;background:transparent;color:#f1ede6;font:inherit;font-size:13.5px;line-height:1.45;resize:none;outline:none;}
.dr-edit-bar {display:flex;align-items:center;gap:6px;margin-top:6px;}
.dr-edit-hint {flex:1;min-width:0;font-size:11px;color:#8d8b85;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.dr-edit-btn {display:inline-flex;align-items:center;gap:5px;height:30px;padding:0 12px;border-radius:9px;font-size:12px;font-weight:500;color:#d6d3cc;}
.dr-edit-btn:hover {background:#ffffff0d;}
.dr-edit-btn.is-primary {background:#ece5da;color:#1b1b1b;}
.dr-edit-btn.is-primary:hover {background:#fff9ed;}
.dr-edit-btn svg {width:13px;height:13px;}
@media (hover:none),(max-width:700px) {
 .dr-user-actions {opacity:1;}
 .right-panel.is-ai .dr-user-actions button {width:34px;height:32px;}
 .right-panel.is-ai .dr-edit {background:var(--dk-card);border-color:color-mix(in srgb,var(--dk-accent) 60%,transparent);}
 .right-panel.is-ai .dr-edit-input {font-size:16px;color:inherit;}
 .right-panel.is-ai .dr-edit-btn {height:34px;}
 .right-panel.is-ai .dr-edit-btn.is-primary {background:var(--dk-send);color:var(--dk-send-ink);}
}
.dr-thread:has(.dr-edit) {-webkit-mask-image:none !important;mask-image:none !important;}
.dr-session-sep {display:flex;align-items:center;gap:10px;margin:2px 0;font-size:10.5px;color:#8d8b85;letter-spacing:.2px;}
.dr-session-sep::before,.dr-session-sep::after {content:'';flex:1;height:1px;background:#ffffff14;}
/* Prompt editor v2: one clean surface, no double border, compact footer */
.dr-user.is-editing {align-self:stretch;}
.dr-edit {display:flex;flex-direction:column;gap:8px;padding:10px 10px 8px 12px;border-radius:16px;}
.dr-edit-input,.dr-edit-input:focus,.dr-edit-input:focus-visible {border:0 !important;outline:none !important;box-shadow:none !important;background:transparent !important;padding:2px 0 !important;}
.dr-edit-bar {margin-top:0;gap:4px;}
.dr-edit-hint {flex:1;display:inline-flex;align-items:center;gap:5px;font-size:11.5px;font-weight:500;}
.dr-edit-hint svg {flex:none;width:12px;height:12px;}
.dr-edit-hint.is-replace {color:#d9a877;}
.dr-edit-btn {height:32px;padding:0 12px;border-radius:999px;}
.dr-edit-btn.is-primary {padding:0 14px 0 11px;font-weight:600;}
@media all { /* sheet + panel design: phones and desktop */
 .right-panel.is-ai .dr-edit {padding:10px 10px 8px 14px;}
 .right-panel.is-ai .dr-edit-btn {height:34px;font-size:13px;}
 .right-panel.is-ai .dr-edit-hint.is-replace {color:var(--dk-accent);}
}
/* Editing a sent prompt happens in the main composer */
.dr-editing-bar {display:flex;align-items:center;gap:7px;margin:0 0 8px;padding:0 2px 0 4px;font-size:12px;font-weight:600;color:#ece9e3;}
.dr-editing-bar > svg {flex:none;width:13px;height:13px;color:#d9a877;}
.dr-editing-bar span {min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.dr-editing-bar em {flex:none;height:20px;display:inline-flex;align-items:center;padding:0 8px;border-radius:999px;background:#ffffff10;font-style:normal;font-size:10.5px;font-weight:600;color:#a9a7a0;}
.dr-editing-bar em.is-replace {background:#e2ab7722;color:#efbd8a;}
.dr-editing-bar button {flex:none;display:grid;place-items:center;width:26px;height:26px;margin-left:auto;border-radius:8px;color:#a9a7a0;}
.dr-editing-bar button:hover {background:#ffffff10;color:#ece9e3;}
.dr-editing-bar button svg {width:14px;height:14px;}
.dr-compose.is-editing {border-color:#e2ab7799 !important;}
.dr-user.is-editing-src .dr-bubble {opacity:.6;border-style:dashed !important;border-color:#e2ab77aa !important;}
@media all { /* sheet + panel design: phones and desktop */
 .right-panel.is-ai .dr-compose.is-editing {border-color:color-mix(in srgb,var(--dk-accent) 70%,transparent) !important;box-shadow:0 0 0 3px color-mix(in srgb,var(--dk-accent) 16%,transparent);}
 .right-panel.is-ai .dr-editing-bar {font-size:12.5px;margin-bottom:6px;}
 .right-panel.is-ai .dr-editing-bar > svg {color:var(--dk-accent);}
 .right-panel.is-ai .dr-editing-bar em {background:var(--dk-chip);color:var(--dk-muted);}
 .right-panel.is-ai .dr-editing-bar em.is-replace {background:color-mix(in srgb,var(--dk-accent) 16%,transparent);color:var(--dk-accent);}
 .right-panel.is-ai .dr-editing-bar button {width:32px;height:32px;color:var(--dk-muted);}
 /* the context chip stays hidden while editing: the bar replaces it */
 .right-panel.is-ai .dr-compose.is-editing .dr-context {display:none;}
}
/* Long prompts: the box grows with the text (up to a cap, then scrolls) instead of clipping to one line */
@media all { /* sheet + panel design: phones and desktop */
 .right-panel.is-ai:not(.is-expanded):has(.dr-thread > .dr-welcome) .dr-box .dr-input {height:auto !important;} /* empty state: card fills the slot */
 .right-panel.is-ai .dr-compose.is-editing .dr-box .dr-input {max-height:116px;}
 .right-panel.is-ai:not(.is-expanded) .dr-compose.is-editing {padding-top:8px;}
 .right-panel.is-ai:not(.is-expanded) .dr-compose.is-editing .dr-editing-bar {margin-bottom:2px;}
 .right-panel.is-ai .dr-compose.is-editing .composer-footer {align-self:flex-end;}
 .right-panel.is-ai:not(:has(.dr-thread > .dr-welcome)) .dr-box {align-items:flex-end;}
}

/* ---------- Desktop: the Director / Properties panel uses the same design as the phone sheet, wider ---------- */
@media (min-width:701px) {
 .right-panel,.right-panel.is-ai {width:clamp(340px,26vw,460px) !important;}
 .right-panel.is-ai .dr-grab,.right-panel.is-ai .rh-dock-btn {display:none !important;}
 .right-panel.is-ai .right-header {padding:12px 10px 8px 14px;cursor:default;touch-action:auto;border-bottom:0 !important;}
 .right-panel.is-ai .right-tabs {cursor:pointer;}
 .right-panel.is-ai .right-tab {height:34px;}
 .right-panel.is-ai.is-expanded .dr-header {padding:4px 12px 6px 16px;}
 .right-panel.is-ai .dr-thread {padding-left:16px;padding-right:16px;}
 .right-panel.is-ai .dr-compose {margin:0 14px 14px;}
 .right-panel.is-ai .dr-keys {display:inline-flex !important;align-items:center;gap:4px;margin-left:auto;margin-right:8px;font-size:10.5px;color:var(--dk-muted);}
 .right-panel.is-ai .dr-keys kbd {min-width:18px;height:18px;padding:0 4px;font-size:10px;}
 .right-panel.is-ai .dr-footnote {flex:0 1 auto;}
 .right-panel.is-ai .property-scroll {padding:4px 14px 20px;}
 .right-panel.is-ai .pp-section {padding:16px;}
 .right-panel.is-ai .dr-user-actions button {width:28px;height:28px;}
}
@media (min-width:1500px) {
 .right-panel,.right-panel.is-ai {width:clamp(390px,25vw,480px) !important;}
}

/* With room (desktop, or the full-screen sheet), the composer keeps its roomy layout during a conversation too:
   two-line text area that grows, placeholder wraps, footer row with status + hints + send. Only the docked phone sheet goes compact. */
.right-panel.is-ai.is-expanded:not(:has(.dr-thread > .dr-welcome)) .dr-compose {padding:10px 10px 8px 12px;border-radius:16px;}
.right-panel.is-ai.is-expanded:not(:has(.dr-thread > .dr-welcome)) .dr-context {height:24px;margin:0 0 2px;font-size:11px;}
.right-panel.is-ai.is-expanded:not(:has(.dr-thread > .dr-welcome)) .dr-box {flex-direction:column;align-items:stretch;gap:2px;}
.right-panel.is-ai.is-expanded:not(:has(.dr-thread > .dr-welcome)) .dr-box .dr-input {min-height:48px !important;max-height:160px;padding:6px 2px;}
.right-panel.is-ai.is-expanded:not(:has(.dr-thread > .dr-welcome)) .dr-box .dr-input::placeholder {white-space:normal;overflow:visible;}
.right-panel.is-ai.is-expanded:not(:has(.dr-thread > .dr-welcome)) .composer-footer {display:flex;justify-content:space-between;align-items:center;padding:2px 0 0;}
.right-panel.is-ai.is-expanded:not(:has(.dr-thread > .dr-welcome)) .dr-footnote {display:inline-flex;}
.right-panel.is-ai.is-expanded .dr-compose.is-editing .composer-footer {align-self:auto;}
@media (max-height:560px) {
 .right-panel.is-ai.is-expanded:not(:has(.dr-thread > .dr-welcome)) .dr-box .dr-input {min-height:36px !important;max-height:96px;}
 .right-panel.is-ai.is-expanded:not(:has(.dr-thread > .dr-welcome)) .dr-context {display:none;}
}
.right-panel.is-ai .dr-keys {white-space:nowrap;}
@media (min-width:701px) and (max-height:640px),(min-width:701px) and (max-width:1100px) {
 .right-panel.is-ai .dr-keys {display:none !important;}
}

/* ---------- Effects & Transitions tools ---------- */
.fx-vignette {position:absolute;inset:0;z-index:1;pointer-events:none;transition:opacity .15s;}
#assetContent .fx {--dk-card:#202223;--dk-line:#36383a;--dk-chip:#2a2c2e;--dk-muted:#8e8c86;--dk-accent:#d9a877;display:flex;flex-direction:column;gap:12px;padding:2px 0 16px;}
#assetContent .fx > * {flex-shrink:0;}
#assetContent .fx .pp-section {background:var(--dk-card);border:1px solid var(--dk-line);border-radius:14px;padding:14px;}
.fx-scope {display:flex;gap:2px;padding:3px;border-radius:12px;background:var(--dk-chip);}
.fx-scope button {flex:1;min-width:0;display:inline-flex;align-items:center;justify-content:center;gap:6px;height:34px;padding:0 10px;border-radius:9px;font-size:12px;font-weight:500;color:var(--dk-muted);}
.fx-scope button span {overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.fx-scope button svg {flex:none;width:14px;height:14px;}
.fx-scope button.is-on {background:var(--dk-card);color:inherit;box-shadow:0 1px 3px #00000038;}
#assetContent .fx .pp-looks {grid-template-columns:repeat(3,minmax(0,1fr));gap:10px 8px;}
#assetContent .fx .pp-look {padding:0;border:0;background:transparent;gap:5px;color:var(--dk-muted);font-size:11.5px;}
#assetContent .fx .pp-look-swatch {height:auto;aspect-ratio:16/10;border-radius:10px;background-size:cover;background-position:center;box-shadow:inset 0 0 0 1px #ffffff1a;}
#assetContent .fx .pp-look.is-on {color:inherit;font-weight:600;}
#assetContent .fx .pp-look.is-on .pp-look-swatch {box-shadow:0 0 0 2px var(--dk-card),0 0 0 4px var(--dk-accent);}
#assetContent .fx .pp-value {min-width:42px;padding:3px 6px;border-radius:6px;background:var(--dk-chip);text-align:center;}
.fx-empty {display:flex;flex-direction:column;align-items:center;text-align:center;gap:6px;padding:28px 12px;color:var(--dk-muted,#8e8c86);}
.fx-empty svg {width:22px;height:22px;padding:11px;box-sizing:content-box;border-radius:14px;background:#e2ab7714;color:#d1a476;}
.fx-empty h3 {font-size:14px;color:inherit;filter:brightness(1.6);}
.fx-empty p {font-size:12px;line-height:1.5;max-width:240px;}
.tr-styles {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin-bottom:12px;}
.tr-style {display:flex;flex-direction:column;align-items:flex-start;gap:3px;padding:10px;border-radius:12px;background:var(--dk-chip);text-align:left;transition:transform .12s,background-color .15s;}
.tr-style:hover {background:color-mix(in srgb,var(--dk-accent) 12%,var(--dk-chip));}
.tr-style:active {transform:scale(.97);}
.tr-style svg {width:16px;height:16px;color:var(--dk-accent);margin-bottom:4px;}
.tr-style strong {font-size:12.5px;font-weight:600;}
.tr-style span {font-size:10.5px;line-height:1.35;color:var(--dk-muted);}
.tr-cuts {display:flex;flex-direction:column;gap:2px;margin:-4px -6px;}
.tr-cut {display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:10px;padding:8px 6px;border-radius:9px;text-align:left;}
.tr-cut:hover,.tr-cut.is-on {background:var(--dk-chip);}
.tr-cut-time {font:500 11px ui-monospace,'SFMono-Regular',monospace;color:var(--dk-muted);}
.tr-cut-names {font-size:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.tr-badge {height:20px;display:inline-flex;align-items:center;padding:0 8px;border-radius:999px;font-size:10.5px;font-weight:600;background:var(--dk-chip);color:var(--dk-muted);}
.tr-badge.is-crossfade {background:color-mix(in srgb,var(--dk-accent) 18%,transparent);color:var(--dk-accent);}
.tr-badge.is-dip {background:#ffffff14;color:inherit;}

/* Director "working" state: staged status with shimmer, bouncing dots and skeleton lines */
.dr-think-text {background-image:linear-gradient(90deg,currentColor 0%,currentColor 40%,#f3d3ae 50%,currentColor 60%,currentColor 100%);background-size:220% 100%;-webkit-background-clip:text !important;background-clip:text !important;-webkit-text-fill-color:transparent;animation:dr-shimmer 1.6s linear infinite;}
.dr-agent:has(.dr-thinking) .dr-body {gap:8px;}
.dr-skeleton {display:flex;flex-direction:column;gap:6px;max-width:240px;}
.dr-skeleton span {height:8px;border-radius:4px;background-image:linear-gradient(90deg,#ffffff0d 0%,#ffffff1f 50%,#ffffff0d 100%);background-size:200% 100%;animation:dr-skel 1.3s ease-in-out infinite;}
.dr-skeleton span:last-child {width:62%;animation-delay:.15s;}
.dr-avatar.is-thinking svg {animation:dr-bob 1.2s ease-in-out infinite;}
@keyframes dr-shimmer {from{background-position:110% 0}to{background-position:-110% 0}}
@keyframes dr-skel {0%{background-position:150% 0}100%{background-position:-50% 0}}
@keyframes dr-bob {0%,100%{transform:translateY(0)}50%{transform:translateY(-2px)}}
@media (prefers-reduced-motion:reduce) {.dr-think-text,.dr-skeleton span,.dr-avatar.is-thinking svg{animation:none}.dr-think-text{-webkit-text-fill-color:currentColor;background:none}}
/* Clip header card: compact (smaller thumb, kicker inline with meta, one-line stats) */
.right-panel.is-ai .pp-head:has(+ .pp-stats) {padding:10px 12px;gap:10px;}
.right-panel.is-ai .pp-head:has(+ .pp-stats) .pp-thumb {--th:40px !important;border-radius:8px;}
.right-panel.is-ai .pp-head:has(+ .pp-stats) .pp-thumb.is-portrait {--th:52px !important;}
.right-panel.is-ai .pp-head:has(+ .pp-stats) .pp-thumb-time {display:none;}
.right-panel.is-ai .pp-head:has(+ .pp-stats) .pp-head-text {display:grid !important;grid-template-columns:auto minmax(0,1fr);align-items:center;gap:3px 7px !important;}
.right-panel.is-ai .pp-head:has(+ .pp-stats) .pp-name {grid-column:1 / -1;height:26px;font-size:14.5px;}
.right-panel.is-ai .pp-head:has(+ .pp-stats) .pp-kicker {grid-column:1;height:18px;padding:0 6px;font-size:9px !important;}
.right-panel.is-ai .pp-head:has(+ .pp-stats) .pp-meta {grid-column:2;font-size:11px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.right-panel.is-ai .pp-head + .pp-stats > div {flex-direction:row !important;align-items:baseline !important;justify-content:center !important;gap:6px !important;padding:7px 8px !important;}
.right-panel.is-ai .pp-head + .pp-stats span {font-size:9.5px;}
.right-panel.is-ai .pp-head + .pp-stats strong {font-size:12.5px;}

/* ---------- Export dialog v2 ---------- */
.ex-summary {display:flex;align-items:center;gap:12px;padding:10px;border-radius:14px;background:#232526;border:1px solid #343637;margin-bottom:16px;}
.ex-thumb {flex:none;height:56px;max-width:100px;border-radius:9px;background:#2c2e2f center/cover no-repeat;box-shadow:0 2px 8px #0005;}
.ex-sum-text {min-width:0;flex:1;}
.ex-sum-text strong {display:block;font-size:14px;font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.ex-chips {display:flex;flex-wrap:wrap;gap:5px;margin-top:6px;}
.ex-chips span {height:20px;display:inline-flex;align-items:center;padding:0 8px;border-radius:999px;background:#2c2e2f;font-size:11px;color:#a9a7a0;}
.ex-label {margin:0 2px 7px;font-size:11px;font-weight:600;letter-spacing:.6px;text-transform:uppercase;color:#8e8c86;}
.ex-formats {display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-bottom:16px;}
.ex-format {display:flex;flex-direction:column;align-items:flex-start;gap:2px;padding:12px;border-radius:12px;border:1px solid #343637;background:#1f2021;text-align:left;transition:border-color .15s,background-color .15s;}
.ex-format:hover {border-color:#4a4c4d;}
.ex-format.is-on {border-color:#d9a877;background:#d9a87712;box-shadow:0 0 0 3px #d9a8771f;}
.ex-format strong {font-size:15px;font-weight:700;}
.ex-format small {font-size:11.5px;color:#a9a7a0;}
.ex-format em {margin-top:6px;font-style:normal;font-size:10.5px;font-weight:600;color:#9fd2b5;}
.ex-format em.is-warn {color:#efbd8a;}
.ex-res {margin-bottom:4px;}
.ex-res .export-option {position:relative;}
.ex-size {position:absolute;top:12px;right:12px;font:600 11px ui-monospace,'SFMono-Regular',monospace;color:#8e8c86;}
.ex-details {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:1px;margin-top:16px;border-radius:12px;overflow:hidden;border:1px solid #303233;background:#303233;}
.ex-details > div {display:flex;flex-direction:column;gap:3px;padding:10px 12px;background:#1f2021;}
.ex-details span {font-size:10px;font-weight:600;letter-spacing:.5px;text-transform:uppercase;color:#8e8c86;}
.ex-details strong {font-size:13px;font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.ex-details p {grid-column:1 / -1;margin:0;padding:8px 12px;background:#1c1d1e;font-size:11px;color:#8e8c86;}
.ex-footer {justify-content:flex-end;gap:8px;}
.ex-footer .button-primary {min-width:150px;justify-content:center;}
@media (max-width:520px) {.ex-details{grid-template-columns:1fr 1fr}.ex-details > div:nth-child(3){grid-column:1 / -1}.ex-footer .button{flex:1}}
