@font-face{font-family:Manrope;src:url('assets/fonts/manrope-cyrillic.woff2') format('woff2');font-weight:200 800;font-display:swap;unicode-range:U+0400-052F,U+2116}
@font-face{font-family:Manrope;src:url('assets/fonts/manrope-latin.woff2') format('woff2');font-weight:200 800;font-display:swap;unicode-range:U+0000-024F,U+2000-206F,U+20A0-20CF}
#save-file-mobile{display:none}
:root{color-scheme:dark;--bg:#111216;--surface:#191a20;--panel-alt:#17181d;--input-bg:#111216;--line:#2c2d35;--muted:#999ba9;--ink:#f1f0f4;--accent:#c2adfa;--lime:#deedaf;font-family:Manrope,'Golos Text',sans-serif;font-size:12px;color:var(--ink);background:var(--bg)}
html[data-theme="light"]{color-scheme:light;--bg:#f6f1ea;--surface:#ffffff;--panel-alt:#f0e9df;--input-bg:#ffffff;--line:rgba(34,27,22,0.14);--muted:#65594f;--ink:#1f1914;--accent:#5145d6;--lime:#355918}
html[data-theme="light"] body{background:var(--bg);color:var(--ink)}
html[data-theme="light"] .topbar,html[data-theme="light"] .rail,html[data-theme="light"] .timeline,html[data-theme="light"] #ruler{background:var(--panel-alt)}
html[data-theme="light"] .library,html[data-theme="light"] .inspector{background:var(--surface)}
html[data-theme="light"] .center{background:var(--bg)}
html[data-theme="light"] button,html[data-theme="light"] .button,html[data-theme="light"] input,html[data-theme="light"] select,html[data-theme="light"] textarea{background:var(--input-bg);color:var(--ink)}
html[data-theme="light"] .primary{background:var(--accent);border-color:var(--accent);color:#fff}
html[data-theme="light"] dialog{background:var(--surface);color:var(--ink);border-color:var(--line)}
.top-nav{display:flex;align-items:center;gap:8px;margin-left:8px}.top-nav a{font-size:11px;color:var(--muted);text-decoration:none;padding:5px 8px;border-radius:6px}.top-nav a:hover{color:var(--ink);background:#ffffff12}
@media(max-width:1190px){.top-nav{display:none}}
*{box-sizing:border-box}body{margin:0}button,input,textarea,select,a{font:inherit}button,.button{border:1px solid var(--line);background:#22232a;color:var(--ink);border-radius:7px;padding:9px 12px;cursor:pointer;text-decoration:none;text-align:center;transition:background .15s,border-color .15s}button:hover,.button:hover{background:#33343f;border-color:#686575}button:disabled{opacity:.35;cursor:default}button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible,canvas:focus-visible{outline:2px solid var(--accent);outline-offset:3px}input,select,textarea{border:1px solid var(--line);border-radius:6px;background:#111216;color:var(--ink);padding:9px;min-width:0}input[type=number]{width:74px}input[type=color]{height:36px;width:100%;padding:4px}input[type=checkbox]{accent-color:var(--accent);width:auto}input[type=range]{accent-color:var(--accent);padding:0}textarea{width:100%;resize:vertical;line-height:1.6}label{display:flex;flex-direction:column;gap:7px;color:#b7b8c5;font-size:11px;margin:14px 0}h1,h2,p{margin:0}h1{font-size:17px;font-weight:650;letter-spacing:-.6px}h2{font-size:14px;font-weight:600}hr{border:0;border-top:1px solid var(--line);margin:24px 0}a{color:inherit}[hidden]{display:none!important}.primary{background:var(--accent);border-color:var(--accent);color:#201a2e;font-weight:800}.primary:hover{background:#d5c3ff;border-color:#d5c3ff}.full{width:100%;display:block;margin-top:12px}.subtle{background:transparent}.muted{color:var(--muted);font-size:11px;line-height:1.7;margin:9px 0 17px}.button-row{display:flex;gap:7px;align-items:center;margin-top:12px}.button-row>*{flex:1;margin-top:0}.panel-heading{display:flex;align-items:center;justify-content:space-between;gap:8px}.panel-heading>span{color:#8c8d9b}.topbar{height:74px;display:flex;align-items:center;gap:10px;padding:0 20px;border-bottom:1px solid var(--line);background:#17181d}.wordmark{display:flex;align-items:center;gap:8px;text-decoration:none;font-size:19px;letter-spacing:-.8px;font-weight:800;white-space:nowrap}.brand-icon{font-size:29px;color:var(--accent)}.video-word{font-weight:400;color:#b0afbd}.draft-badge{font-size:8px;letter-spacing:1px;padding:5px 7px;border:1px solid #515040;border-radius:4px;color:var(--lime)}.project-heading{margin-left:28px;display:flex;flex-direction:column;gap:3px;flex:1}.project-heading input{background:none;border:none;padding:0;font-weight:600;width:190px}.project-heading>span{color:var(--muted);font-size:10px}.history-actions{display:flex;gap:3px}.history-actions button{font-size:23px;background:none;border:none;padding:5px 9px}.topbar>.primary{min-width:112px}.topbar>.primary span{margin-left:14px}.studio{height:calc(100dvh - 74px);min-height:650px;display:grid;grid-template-columns:76px 280px minmax(360px,1fr) 250px;grid-template-rows:minmax(370px,1fr) 265px;grid-template-areas:'rail library center inspector' 'rail library timeline timeline'}.rail{grid-area:rail;border-right:1px solid var(--line);display:flex;flex-direction:column;align-items:center;padding:16px 5px;gap:12px;background:#17181d}.rail button,.rail a{border:0;background:none;display:flex;flex-direction:column;align-items:center;gap:6px;font-size:9px;color:var(--muted);padding:8px 2px;width:65px;text-decoration:none}.rail button span,.rail a span{font-size:24px;line-height:28px}.rail button.active{color:var(--accent);background:#292434;border-radius:8px}.rail a{margin-top:auto}.library{grid-area:library;border-right:1px solid var(--line);background:#191a20;overflow:auto;padding:23px 17px}.chips{display:flex;gap:5px;margin:19px 0}.chips button{font-size:10px;padding:6px 9px;border-radius:20px;background:transparent}.chips .active{background:#ded8e8;color:#25212e;border-color:transparent}.template-grid{display:grid;grid-template-columns:1fr 1fr;gap:17px 10px}.template-card{padding:0;border:0;background:none;text-align:left;overflow:hidden}.template-card:hover{background:none}.template-card canvas{width:100%;height:auto;aspect-ratio:9/12;object-fit:cover;border-radius:8px;border:1px solid #44404d;display:block;transition:transform .2s}.template-card:hover canvas{transform:translateY(-3px);border-color:var(--accent)}.template-card strong{display:block;font-size:11px;margin:9px 0 5px;font-weight:600}.template-card small{font-size:9px;color:var(--muted)}.center{grid-area:center;display:flex;flex-direction:column;min-width:0;background:#111216}.stage-toolbar{display:flex;align-items:center;gap:12px;padding:12px 18px;border-bottom:1px solid #25262d}.stage-toolbar select{font-size:11px;padding:6px;background:#202127}.safe-label{flex-direction:row;align-items:center;font-size:10px;margin:0;gap:4px}.preview-label{margin-left:auto;font-size:8px;letter-spacing:1.5px;color:#6d6f7d}.stage{flex:1;min-height:0;padding:20px 20px 28px;display:flex;align-items:center;justify-content:center;position:relative;background:radial-gradient(ellipse at 50% 35%,#23242b 0,transparent 65%)}#preview{display:block;max-width:100%;max-height:100%;height:100%;width:auto;object-fit:contain;box-shadow:0 15px 40px #0005;touch-action:none;background:#191a20;border-radius:2px}.stage-caption{position:absolute;bottom:8px;color:#656673;font-size:7px;letter-spacing:2px}.transport{height:52px;display:flex;gap:10px;align-items:center;justify-content:center;border-top:1px solid #25262d;flex-shrink:0;padding:0 12px}.transport button{border:0;background:transparent;padding:4px 8px;font-size:20px}.transport .play-button{border-radius:50%;background:#ece9f2;color:#17151d;width:30px;height:30px;padding:0;font-size:11px}.transport output{font:10px 'IBM Plex Mono',monospace;color:#b5b4c2;white-space:nowrap}.duration-label{flex-direction:row;gap:4px;align-items:center;margin:0 0 0 12px;font-size:10px}.duration-label input{width:48px;padding:5px}.transport select{padding:5px;font-size:10px}.inspector{grid-area:inspector;border-left:1px solid var(--line);background:#191a20;padding:20px 16px;overflow:auto}.empty-inspector{color:#9696a6;line-height:1.8;text-align:center;padding:55px 10px}.property-grid{display:grid;grid-template-columns:1fr 1fr;gap:0 10px}.property-grid label{margin:8px 0}.property-grid input,.property-grid select{width:100%}.inspector .small-row{display:flex;gap:5px;flex-wrap:wrap;margin-top:12px}.small-row button{font-size:10px;padding:6px 8px}.keyframe-chip.active{color:#201a2e;background:var(--accent)}.inspector textarea{min-height:62px}.timeline{grid-area:timeline;min-width:0;border-top:1px solid var(--line);background:#17181d;display:flex;flex-direction:column}.timeline-toolbar{height:43px;display:flex;align-items:center;padding:0 16px;gap:10px;border-bottom:1px solid var(--line);flex-shrink:0}.timeline-label{font-size:9px;letter-spacing:1.6px}.timeline-toolbar #layer-count{font-size:9px;color:#838492}.timeline-actions{display:flex;gap:4px;margin-left:10px}.timeline-actions button{font-size:10px;padding:5px 7px;background:transparent;border:none}.zoom-label{flex-direction:row;align-items:center;margin:0 0 0 auto;gap:8px;font-size:9px}.zoom-label input{width:80px}#timeline-scroll{overflow:auto;flex:1;position:relative;scrollbar-color:#484852 #191a20;scrollbar-width:thin}#timeline-inner{position:relative;min-height:100%}#ruler{height:28px;position:sticky;top:0;background:#17181d;z-index:4;margin-left:145px;border-bottom:1px solid var(--line);cursor:crosshair}.ruler-tick{position:absolute;top:6px;font:8px 'IBM Plex Mono',monospace;color:#a5a3b3;border-left:1px solid #474650;padding-left:4px;height:22px}.beat-tick{position:absolute;top:17px;height:10px;border-left:1px solid #d6ed9a66}.track{height:34px;position:relative;border-bottom:1px solid #24252d}.track.selected{background:#27232f}.track-name{position:sticky;left:0;z-index:3;width:145px;height:33px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding:9px 10px;text-align:left;background:#1d1e25;border:0;border-right:1px solid #35333e;border-radius:0;font-size:9px;color:#c4c1cf}.clip{position:absolute;top:5px;height:24px;border:1px solid #9c8fbc66;border-radius:4px;background:#5c4a7b;color:#eee7fa;min-width:8px;cursor:grab;overflow:hidden;touch-action:none}.clip.audio{background:#304742;border-color:#6b9b85;color:#bfe6d1}.clip.image,.clip.video{background:#3b465d;color:#d7e5ff;border-color:#879bc466}.clip.shape{background:#4e4640;color:#ead9c9;border-color:#ac927a55}.clip.selected{border:2px solid #e7dafa}.clip .clip-text{display:block;white-space:nowrap;overflow:hidden;padding:4px 8px;font-size:9px;pointer-events:none}.trim-handle{position:absolute;top:0;height:100%;width:7px;cursor:ew-resize;touch-action:none;background:#ffffff12}.trim-handle.left{left:0}.trim-handle.right{right:0}#playhead{position:absolute;top:15px;bottom:0;width:1px;background:#e9dfa6;z-index:5;pointer-events:none}#playhead>span{position:absolute;left:-4px;top:0;border-top:7px solid #e9dfa6;border-left:4px solid transparent;border-right:4px solid transparent}.media-list{display:grid;grid-template-columns:1fr 1fr;gap:9px;margin-top:18px}.media-card{padding:8px;text-align:left;overflow:hidden}.media-card img{width:100%;height:82px;object-fit:cover;border-radius:5px}.media-card .media-symbol{display:block;font-size:30px;height:55px;color:var(--accent);text-align:center;padding:8px}.media-card strong{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:10px;margin:8px 0 3px}.media-card small{color:var(--muted);font-size:9px}.upload-card{display:flex;flex-direction:column;align-items:center;gap:12px;padding:25px 12px;width:100%;border:1px dashed #5d526f;font-size:23px;background:#292331}.upload-card strong{font-size:12px}.upload-card span{font-size:8px;color:var(--muted)}.add-title{font-size:18px;text-align:left;padding:16px}.add-title span{float:right;font-size:14px}.music-card{display:flex;width:100%;align-items:center;gap:12px;text-align:left;margin:10px 0;padding:12px}.music-card>.music-art{background:#3c314d;padding:10px;color:var(--accent);border-radius:7px;font-size:18px}.music-card strong{display:block;font-size:12px}.music-card small{font-size:9px;color:var(--muted);display:block;margin-top:4px}.music-card>.plus{margin-left:auto;font-size:20px}.sfx-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:13px}.inline-label{flex-direction:row;align-items:center;justify-content:space-between}#toast{position:fixed;bottom:24px;left:50%;transform:translateX(-50%) translateY(20px);padding:12px 20px;background:#e4dded;color:#24202c;box-shadow:0 8px 35px #0006;border-radius:10px;opacity:0;pointer-events:none;transition:.2s;z-index:100;max-width:90vw;line-height:1.5}#toast.visible{transform:translateX(-50%);opacity:1}dialog{width:470px;max-width:94vw;background:#202127;border:1px solid #47444f;border-radius:18px;padding:28px;color:var(--ink);box-shadow:0 30px 100px #0009}dialog::backdrop{background:#08090bc9;backdrop-filter:blur(8px)}.dialog-top{display:flex;justify-content:space-between;align-items:center;margin-bottom:20px}.dialog-top button{border:0;background:none;font-size:25px;padding:0}.eyebrow{font-size:9px;letter-spacing:2px;color:var(--accent)}dialog h2{font-size:26px;letter-spacing:-1px}dialog>p{margin-top:10px;color:var(--muted);line-height:1.6}dialog progress{width:100%;accent-color:var(--accent);margin-top:15px}#export-result{width:100%;max-height:300px;margin-top:15px;background:#101116;border-radius:8px}
@media(min-width:1700px){.studio{grid-template-columns:82px 310px minmax(360px,1fr) 280px;grid-template-rows:minmax(400px,1fr) 300px}.library{padding:24px}.template-grid{gap:23px 16px}.stage{padding:30px 30px 35px}}
@media(max-width:1190px){.studio{grid-template-columns:64px 235px minmax(300px,1fr) 215px}.rail button,.rail a{width:54px}.library{padding:20px 12px}.project-heading{margin-left:10px}.topbar{gap:7px;padding:0 12px}.topbar .draft-badge{display:none}.topbar>button{font-size:10px;padding:9px}.video-word{display:none}.safe-label{font-size:9px}.preview-label{display:none}.timeline-actions{margin-left:0}.zoom-label{font-size:0}.transport{gap:4px}.duration-label{margin-left:2px}}
@media(max-width:900px){
  .studio{height:auto;min-height:calc(100dvh - 65px);grid-template-columns:58px minmax(0,1fr);grid-template-rows:minmax(380px,56vh) auto 250px auto;grid-template-areas:'rail center' 'rail library' 'rail timeline' 'rail inspector'}
  .library{border-right:0;border-bottom:1px solid var(--line);max-height:44vh}
  .inspector{border-left:0;border-top:1px solid var(--line)}
  #inspector-content{max-width:650px}
  .topbar{height:auto;min-height:65px;flex-wrap:wrap;padding:8px 12px}
  .topbar .project-heading input{width:140px}
  .topbar #save-file{display:none}
  .topbar>.primary{min-width:80px}
  .topbar .wordmark{font-size:16px}
  .history-actions{display:none}
  .stage{padding:12px 12px 20px;min-height:300px}
}
@media(max-width:620px){
  .topbar{flex-wrap:wrap;height:auto;min-height:84px;gap:8px;padding:10px 12px}
  .topbar .wordmark{font-size:16px}
  .topbar .project-heading{order:6;flex-basis:100%;flex-direction:row;align-items:center;justify-content:space-between;margin:0}
  .topbar #open-project{margin-left:auto}
  .topbar .primary{min-width:90px}
  .studio{display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:auto minmax(340px,52vh) auto 240px auto;grid-template-areas:'rail' 'center' 'library' 'timeline' 'inspector'}
  .rail{flex-direction:row;overflow-x:auto;border-right:0;border-bottom:1px solid var(--line);padding:6px 8px;gap:6px;justify-content:flex-start}
  .rail button,.rail a{min-width:64px;width:auto;min-height:48px;flex:0 0 auto;margin-top:0;font-size:9px;padding:6px 8px}
  .rail button span,.rail a span{font-size:18px;line-height:20px}
  .library{border-top:0;border-right:0;max-height:430px}
  .template-grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:14px 8px}
  .template-card strong{font-size:9px}
  .template-card small{font-size:8px}
  .stage-toolbar{padding:10px;gap:8px;flex-wrap:wrap}
  .stage-toolbar select{max-width:135px;font-size:9px}
  .transport{flex-wrap:wrap;height:auto;min-height:64px;gap:5px;padding:6px}
  .transport output{font-size:9px}
  .transport .duration-label{font-size:9px}
  .stage{padding:12px 12px 22px}
  .timeline-toolbar{padding:0 8px;gap:4px}
  .timeline-actions button{font-size:9px;padding:5px}
  .timeline-label{font-size:8px}
  .timeline-toolbar #layer-count{display:none}
  .zoom-label{display:none}
  .track-name{width:105px}
  .media-list{grid-template-columns:repeat(3,1fr)}
  .inspector{padding:16px}
  .property-grid{grid-template-columns:1fr 1fr}
  .chips{gap:4px;flex-wrap:wrap}
  .chips button{font-size:9px;padding:5px 8px}
  dialog{padding:22px}
}
@media(max-width:900px){#save-file-mobile{display:block}}

/* Product studio v4: compact workbench topbar, unclipped rail/duration, sleek chips & stage. */
.product-ui.video-workbench { --panel-alt: var(--ui-panel); --input-bg: var(--ui-input); }
.product-ui.video-workbench .topbar { display: block; height: auto; padding: 0; }
.product-ui.video-workbench .video-identity-row {
  display: flex; align-items: center; gap: 20px; min-height: 58px; padding: 8px 20px;
  border-bottom: 1px solid var(--ui-edge);
}
.product-ui.video-workbench .wordmark { font-size: 22px; }
.product-ui.video-workbench .top-nav { display: flex; margin: 0 0 0 auto; flex-wrap: wrap; align-items: center; }
.product-ui.video-workbench .top-nav .interface-language { margin-block: 0; }
.product-ui.video-workbench .top-nav a { white-space: nowrap; min-height: 34px; padding: 7px 13px; font-size: 12px; }
.product-ui.video-workbench .theme-toggle { width: 38px; height: 38px; min-height: 38px; flex: none; }

.product-ui.video-workbench .video-project-row {
  display: flex; gap: 8px; align-items: center; padding: 8px 20px; min-height: 54px;
}
.product-ui.video-workbench .project-heading {
  flex: 1; margin: 0; gap: 3px; min-width: 0; border-inline-start: 0; padding-inline-start: 0;
}
.product-ui.video-workbench .project-heading input {
  background: transparent; border: 1px solid transparent; padding: 4px 8px; margin-left: -8px;
  min-height: 30px; font-size: 15px; width: min(320px, 100%); font-weight: 650; border-radius: 9px;
}
.product-ui.video-workbench .project-heading input:hover { background: var(--ui-input); border-color: var(--ui-edge); }
.product-ui.video-workbench .project-heading input:focus { background: var(--ui-input); border-color: var(--ui-accent); }
.product-ui.video-workbench .project-heading > span { padding-left: 0; font-size: 11px; color: var(--brand-muted); }
.product-ui.video-workbench .video-project-row > button {
  min-height: 38px; font-size: 12px; font-weight: 600; border-radius: 999px; padding: 8px 16px;
}
.product-ui.video-workbench #export { padding-inline: 20px; }
.product-ui.video-workbench .history-actions {
  display: flex; gap: 2px; padding: 3px; margin-right: 4px;
  background: var(--brand-surface); border: 1px solid var(--ui-edge); border-radius: 999px;
}
.product-ui.video-workbench .history-actions button {
  width: 34px; height: 34px; min-height: 34px; font-size: 19px; padding: 0;
  border: 0; border-radius: 999px; background: transparent; box-shadow: none;
}
.product-ui.video-workbench .history-actions button:hover:not(:disabled) { background: var(--brand-soft); }

.product-ui.video-workbench .studio {
  height: calc(100dvh - 114px); min-height: 680px; padding: 12px; gap: 10px;
  grid-template-columns: 74px 268px minmax(0, 1fr) 276px;
  grid-template-rows: minmax(390px, 1fr) 256px;
}
.product-ui.video-workbench :is(.rail, .library, .center, .inspector, .timeline) {
  min-width: 0; background: var(--brand-surface); border: 1px solid var(--ui-edge);
  border-radius: 18px; box-shadow: var(--ui-shadow-sm);
}

/* Rail — compact height so all 8 tools including Карточки never clip */
.product-ui.video-workbench .rail {
  padding: 8px 5px; gap: 4px; overflow-y: auto; scrollbar-width: none;
}
.product-ui.video-workbench .rail :is(button, a) {
  width: 62px; min-height: 54px; border: 1px solid transparent; border-radius: 12px;
  background: transparent; color: var(--brand-muted); font-size: 10px; font-weight: 550;
  padding: 6px 3px; gap: 4px; box-shadow: none; flex: 0 0 auto;
}
.product-ui.video-workbench .rail :is(button, a) span { font-size: 18px; line-height: 20px; }
.product-ui.video-workbench .rail .active {
  background: var(--brand-accent-soft); color: var(--brand-accent-ink);
  border-color: color-mix(in srgb, var(--ui-accent) 28%, transparent);
  box-shadow: inset 0 1px 0 var(--ui-highlight); font-weight: 650;
}
.product-ui.video-workbench .rail :is(button, a):hover { background: var(--ui-panel); color: var(--brand-ink); }

.product-ui.video-workbench .library {
  padding: 0 14px 18px; scrollbar-width: thin; scrollbar-color: var(--brand-line) transparent;
}
.library-label {
  display: flex; align-items: center; justify-content: space-between;
  height: 46px; border-bottom: 1px solid var(--ui-edge); margin-bottom: 16px;
  color: var(--brand-muted); font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
}
.library-label-mark { height: 6px; width: 6px; background: var(--ui-accent); border-radius: 50%; box-shadow: 0 0 9px rgba(234, 120, 78, .55); }
.product-ui.video-workbench .panel-heading h1 { font-size: 18px; font-weight: 650; }
.product-ui.video-workbench .panel-heading > span {
  color: var(--brand-accent-ink); background: var(--brand-accent-soft);
  padding: 3px 8px; border-radius: 999px; font: 600 11px/1.2 var(--ui-mono);
}
.product-ui.video-workbench .muted { color: var(--brand-muted); font-size: 12px; line-height: 1.55; margin: 8px 0 14px; }
.product-ui.video-workbench .template-search { min-height: 38px; padding: 8px 12px; font-size: 12px; border-radius: 999px; }

/* Horizontal sleek pill chips instead of cramped multi-row wall */
.product-ui.video-workbench .chips {
  display: flex; flex-wrap: nowrap; overflow-x: auto; max-height: none;
  padding: 4px; gap: 4px; margin: 12px 0 14px;
  background: var(--ui-input); border-radius: 12px; border: 1px solid var(--ui-edge);
  scrollbar-width: thin; scrollbar-color: var(--brand-line) transparent;
}
.product-ui.video-workbench .chips button {
  flex: 0 0 auto; white-space: nowrap;
  background: transparent; border: 0; border-radius: 8px;
  padding: 7px 11px; min-height: 32px; color: var(--brand-muted);
  font-size: 11px; font-weight: 550; box-shadow: none;
}
.product-ui.video-workbench .chips button:hover { color: var(--brand-ink); background: var(--brand-soft); }
.product-ui.video-workbench .chips button.active {
  color: var(--brand-accent-ink); background: var(--brand-accent-soft);
  border: 1px solid color-mix(in srgb, var(--ui-accent) 26%, transparent); font-weight: 650;
}

.product-ui.video-workbench .template-grid { gap: 14px 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.product-ui.video-workbench .template-card {
  border-radius: 12px; padding: 6px; background: var(--ui-input);
  border: 1px solid var(--ui-edge); box-shadow: none;
}
.product-ui.video-workbench .template-card:hover {
  background: var(--ui-panel); border-color: color-mix(in srgb, var(--ui-accent) 42%, var(--brand-line));
  transform: translateY(-2px);
}
.product-ui.video-workbench .template-card canvas { border-radius: 8px; border-color: var(--ui-edge); }
.product-ui.video-workbench .template-card strong { font-size: 11px; line-height: 1.35; margin: 8px 0 3px; color: var(--brand-ink); }
.product-ui.video-workbench .template-card small { font-size: 10px; color: var(--brand-muted); }

/* Center Stage & Transport (Fixes clipped #duration input!) */
.product-ui.video-workbench .center { overflow: hidden; box-shadow: var(--ui-shadow); }
.product-ui.video-workbench .stage-toolbar {
  min-height: 48px; border-bottom: 1px solid var(--ui-edge); padding: 8px 14px; gap: 12px; background: var(--brand-surface);
}
.product-ui.video-workbench .stage-toolbar :is(select, button) {
  min-height: 34px; padding: 5px 14px; font-size: 12px; font-weight: 550; border-radius: 999px;
}
.product-ui.video-workbench .stage-toolbar select {
  padding: 5px 36px 5px 14px; background-position: right 11px center;
}
.product-ui.video-workbench .preview-label {
  display: flex; align-items: center; gap: 7px; color: var(--brand-ink); font-size: 12px; font-weight: 600;
}
.canvas-indicator, .timeline-indicator {
  display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  background: var(--ui-accent); box-shadow: 0 0 8px rgba(234, 120, 78, .55);
}
.product-ui.video-workbench .stage {
  padding: 24px;
  background-color: var(--brand-bg);
  background-image:
    radial-gradient(ellipse at 50% 50%, rgba(234, 120, 78, .07), transparent 66%),
    radial-gradient(var(--ui-grid) .8px, transparent .95px);
  background-size: 100% 100%, 18px 18px;
}
.product-ui.video-workbench #preview {
  border-radius: 10px;
  box-shadow: 0 18px 52px -12px rgba(0, 0, 0, .48), 0 0 70px -28px rgba(234, 120, 78, .32);
}
.product-ui.video-workbench .transport {
  height: 54px; padding: 8px 14px; border-top: 1px solid var(--ui-edge);
  background: var(--brand-surface); color: var(--brand-muted); gap: 8px;
}
.product-ui.video-workbench .transport button {
  border-radius: 999px; min-width: 34px; height: 34px; padding: 0;
  background: var(--ui-panel); border: 1px solid var(--ui-edge); color: var(--brand-ink); font-size: 16px;
}
.product-ui.video-workbench #play {
  width: 36px; height: 36px; font-size: 12px;
  background: linear-gradient(120deg, #ea784e, #f4a448); color: #20120d;
  border-color: rgba(255, 216, 184, .34); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .4);
}
.product-ui.video-workbench .transport output {
  font: 500 11px/1 var(--ui-mono); color: var(--brand-ink); padding: 6px 10px;
  background: var(--ui-input); border: 1px solid var(--ui-edge); border-radius: 8px;
}
.product-ui.video-workbench .duration-label {
  display: inline-flex; flex-direction: row; align-items: center; gap: 6px;
  margin: 0 0 0 8px; font-size: 11px; color: var(--brand-muted);
}
.product-ui.video-workbench #duration {
  width: 64px; min-width: 64px; min-height: 34px; padding: 5px 8px;
  text-align: center; font: 550 12px/1 var(--ui-mono);
}
.product-ui.video-workbench #fps {
  min-height: 34px; padding: 5px 34px 5px 12px; font-size: 12px; border-radius: 9px; background-position: right 10px center;
}

/* Inspector & Structured Empty State */
.product-ui.video-workbench .inspector {
  padding: 18px 16px; scrollbar-width: thin; scrollbar-color: var(--brand-line) transparent;
}
.product-ui.video-workbench .inspector label { font-size: 12px; color: var(--brand-muted); margin: 10px 0; }
.product-ui.video-workbench .inspector h2 { font-size: 16px; font-weight: 650; }
.product-ui.video-workbench .empty-inspector {
  min-height: 180px; display: grid; place-content: center; gap: 8px;
  padding: 28px 18px; margin: 18px 0;
  border: 1px dashed var(--brand-line); border-radius: 16px;
  background: radial-gradient(ellipse at 50% 0%, rgba(234, 120, 78, .08), transparent 72%), var(--ui-input);
  color: var(--brand-muted); font-size: 12px; line-height: 1.65; text-align: center;
}
.product-ui.video-workbench .property-grid { gap: 10px; }
.product-ui.video-workbench .property-grid input { width: 100%; }

/* Timeline */
.product-ui.video-workbench .timeline { overflow: hidden; }
.product-ui.video-workbench .timeline-toolbar {
  min-height: 46px; background: var(--brand-surface); border-bottom: 1px solid var(--ui-edge); padding: 6px 14px; gap: 10px;
}
.product-ui.video-workbench .timeline-label { display: flex; align-items: center; gap: 7px; color: var(--brand-ink); font-size: 12px; font-weight: 600; letter-spacing: 0; }
.product-ui.video-workbench .timeline-toolbar #layer-count { font: 500 11px/1 var(--ui-mono); color: var(--brand-muted); }
.product-ui.video-workbench .timeline-actions {
  display: flex; gap: 3px; padding: 3px; background: var(--ui-input);
  border: 1px solid var(--ui-edge); border-radius: 10px;
}
.product-ui.video-workbench .timeline-actions button {
  border: 0; min-height: 28px; padding: 5px 10px; font-size: 11px; font-weight: 550;
  border-radius: 7px; background: transparent; box-shadow: none;
}
.product-ui.video-workbench .timeline-actions button:hover { background: var(--brand-soft); }
.product-ui.video-workbench #timeline-scroll { scrollbar-color: var(--brand-line) var(--brand-surface); }
.product-ui.video-workbench #ruler { background: var(--brand-surface); height: 30px; }
.product-ui.video-workbench .ruler-tick { color: var(--brand-muted); font: 500 10px/1 var(--ui-mono); }
.product-ui.video-workbench .track { height: 40px; border-bottom: 1px solid var(--ui-edge); }
.product-ui.video-workbench .track.selected { background: color-mix(in srgb, var(--ui-accent) 7%, transparent); }
.product-ui.video-workbench .track-name {
  height: 39px; background: var(--brand-surface); color: var(--brand-muted);
  border-right: 1px solid var(--ui-edge); border-radius: 0; padding: 10px 12px; font-size: 11px;
}
.product-ui.video-workbench .track.selected .track-name { color: var(--brand-ink); font-weight: 600; }
.product-ui.video-workbench .clip {
  top: 6px; height: 28px; border-radius: 8px;
  background: linear-gradient(100deg, #5d4037, #7e5140); border: 1px solid #b07c60; color: #fff0e8;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12);
}
.product-ui.video-workbench .clip.text { background: linear-gradient(100deg, #3e415f, #555d7e); border-color: #818bb6; color: #edefff; }
.product-ui.video-workbench .clip.audio { background: linear-gradient(100deg, #244d46, #35675b); border-color: #5a9486; color: #dbf9ed; }
.product-ui.video-workbench .clip.shape { background: linear-gradient(100deg, #554166, #766184); border-color: #9f82b0; }
.product-ui.video-workbench .clip.selected { outline: 1.5px solid #ffb98d; outline-offset: 1px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22), 0 0 14px rgba(234, 120, 78, .28); }
.product-ui.video-workbench .clip-text { line-height: 26px; font-size: 10px; font-weight: 550; }
.product-ui.video-workbench #playhead { width: 2px; background: #f6a265; box-shadow: 0 0 10px rgba(245, 158, 11, .42); }
.product-ui.video-workbench #playhead > span { background: #f6a265; color: #20120d; border-radius: 4px 4px 0 0; }
.product-ui.video-workbench .upload-card {
  background: var(--brand-accent-soft); border-color: color-mix(in srgb, var(--ui-accent) 44%, transparent); border-radius: 14px;
}
.product-ui.video-workbench .music-card > .music-art { background: var(--brand-accent-soft); color: var(--brand-accent-ink); }
.product-ui.video-workbench #toast { background: var(--brand-ink); color: var(--brand-bg); border-radius: 12px; }
.product-ui.video-workbench .video-help-tip {
  border-radius: 16px; border: 1px solid color-mix(in srgb, var(--ui-accent) 26%, var(--ui-edge));
  background: radial-gradient(ellipse at 0% 0%, rgba(234, 120, 78, .12), transparent 65%), var(--ui-input);
}

@media (min-width: 1700px) { .product-ui.video-workbench .studio { grid-template-columns: 80px 290px minmax(0, 1fr) 304px; } }
@media (max-width: 1200px) {
  .product-ui.video-workbench .studio { grid-template-columns: 66px 224px minmax(0, 1fr) 232px; gap: 8px; padding: 8px; }
  .product-ui.video-workbench .rail :is(button, a) { width: 54px; font-size: 9px; }
  .product-ui.video-workbench .stage-toolbar { flex-wrap: wrap; gap: 6px; }
  .product-ui.video-workbench .preview-label { display: none; }
  .product-ui.video-workbench .transport { flex-wrap: wrap; height: auto; min-height: 58px; }
  .product-ui.video-workbench .timeline-actions button { padding: 6px; }
}
@media (max-width: 1000px) {
  .product-ui.video-workbench .topbar { position: static; }
  .product-ui.video-workbench .video-identity-row { flex-wrap: wrap; gap: 10px; padding: 10px 16px; }
  .product-ui.video-workbench .top-nav { order: 3; width: 100%; justify-content: center; border-radius: 16px; }
  .product-ui.video-workbench .theme-toggle { margin-left: auto; }
  .product-ui.video-workbench .studio { height: auto; min-height: 0; grid-template-columns: 68px 236px minmax(0, 1fr); grid-template-rows: 520px 264px auto; grid-template-areas: 'rail library center' 'rail timeline timeline' 'rail inspector inspector'; }
  .product-ui.video-workbench .library { max-height: none; }
  .product-ui.video-workbench .inspector { overflow: visible; }
  .product-ui.video-workbench #inspector-content { max-width: none; }
  .product-ui.video-workbench .stage { min-height: 0; }
}
@media (max-width: 700px) {
  .product-ui.video-workbench :is(.library, .inspector) :is(input, textarea, select):not([type=range]):not([type=color]):not([type=checkbox]) { font-size: 16px; }
  .product-ui.video-workbench .timeline-toolbar { height: auto; }
  .product-ui.video-workbench .video-project-row { flex-wrap: wrap; padding: 10px 12px; }
  .product-ui.video-workbench .project-heading { flex-basis: calc(100% - 95px); flex-direction: column; order: 0; align-items: flex-start; }
  .product-ui.video-workbench .history-actions { order: 1; }
  .product-ui.video-workbench .video-project-row > button { order: 2; flex: 1; min-height: 40px; }
  .product-ui.video-workbench #save-file { display: block; }
  .product-ui.video-workbench .top-nav { justify-content: flex-start; gap: 2px; border-radius: 16px; }
  .product-ui.video-workbench .top-nav a { font-size: 11px; padding: 8px 10px; }
  .product-ui.video-workbench .top-nav .interface-language { margin-left: auto; }
  .product-ui.video-workbench .studio { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 480px 254px auto auto; grid-template-areas: 'rail' 'center' 'timeline' 'library' 'inspector'; padding: 10px; }
  .product-ui.video-workbench .rail { display: flex; flex-direction: row; overflow-x: auto; gap: 4px; justify-content: flex-start; padding: 6px; }
  .product-ui.video-workbench .rail :is(button, a) { min-height: 54px; min-width: 64px; width: auto; font-size: 9px; margin: 0; flex: 0 0 auto; }
  .product-ui.video-workbench .library { max-height: 490px; }
  .product-ui.video-workbench .template-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .product-ui.video-workbench .timeline-toolbar { flex-wrap: wrap; gap: 6px; }
  .product-ui.video-workbench .timeline-actions { order: 3; width: 100%; justify-content: space-between; }
  .product-ui.video-workbench .timeline-actions button { min-height: 32px; font-size: 10px; }
  .product-ui.video-workbench .timeline-label { font-size: 11px; }
  .product-ui.video-workbench .zoom-label { margin-left: auto; }
}

/* Keep navigation and project actions in two rows on short landscape screens. */
@media (min-width: 620px) and (max-width: 1000px) and (max-height: 600px) {
  .product-ui.video-workbench .video-identity-row { display: grid; grid-template-columns: auto minmax(0, 1fr) 40px; gap: 8px; min-height: 52px; padding: 6px 12px; }
  .product-ui.video-workbench .wordmark { font-size: 18px; gap: 6px; }
  .product-ui.video-workbench .brand-icon { width: 26px; height: 26px; }
  .product-ui.video-workbench .top-nav { order: 0; width: auto; min-width: 0; flex-wrap: nowrap; overflow-x: auto; gap: 1px; justify-content: flex-start; border-radius: 12px; }
  .product-ui.video-workbench .top-nav a { flex: none; min-height: 32px; font-size: 10px; padding: 6px; }
  .product-ui.video-workbench .top-nav .interface-language { flex: none; margin: 0; }
  .product-ui.video-workbench #workspace .top-nav .interface-language select { min-height: 32px; max-width: 80px; padding: 6px; font-size: 10px; }
  .product-ui.video-workbench .video-project-row { flex-wrap: nowrap; min-height: 54px; padding: 6px 12px; }
  .product-ui.video-workbench .project-heading { flex: 1 1 120px; min-width: 0; order: 0; }
  .product-ui.video-workbench #project-name { min-height: 28px; height: 28px; font-size: 13px; }
  .product-ui.video-workbench .project-heading > span { font-size: 9px; }
  .product-ui.video-workbench .history-actions { order: 0; margin-right: 0; }
  .product-ui.video-workbench .video-project-row > button { order: 0; flex: 0 0 auto; min-height: 36px; padding: 6px 10px; font-size: 11px; }
}
