/* r14: keep the existing brand; one scroll surface and explicit task panels. */
body #studio-shell [hidden] { display: none !important; }
.project-step-tabs,.editor-panel-tabs,.transcript-actions { display:flex;flex-wrap:wrap;gap:8px;margin:0 0 18px; }
.project-step-tabs button,.editor-panel-tabs button,.transcript-actions button { min-height:44px;padding:10px 14px;border:1px solid #bacac2;border-radius:6px;background:#fffdf7;color:#14382b;font:inherit;cursor:pointer; }
body #studio-shell .project-step-tabs button[aria-current="page"],body #studio-shell .editor-panel-tabs button[aria-pressed="true"] { background:#14382b;color:#fffdf7;border-color:#14382b; }
body #studio-shell .editor-stage { height:auto;max-height:none;overflow:visible;grid-template-rows:auto auto auto auto auto;align-items:start; }
body #studio-shell .editor-stage>.editor-toolbar { position:static;z-index:auto; }
body #studio-shell .editor-inspector-stack { display:grid;grid-template-columns:minmax(0,1fr);height:auto;max-height:none;overflow:visible; }
body #studio-shell .studio-properties,body #studio-shell .transcript-column,body #studio-shell #desktop-transcript { height:auto;max-height:none;overflow:visible;min-width:0; }
body #studio-shell .editor-preview-canvas { width:min(100%,calc(64vh * var(--preview-aspect-ratio, 1.777778)));aspect-ratio:var(--preview-aspect-ratio, 1.777778);height:auto;min-height:0;max-height:none;max-width:100%; }
body #studio-shell .editor-preview-canvas[data-aspect] { aspect-ratio:var(--preview-aspect-ratio, 1.777778); }
body #studio-shell .editor-primary-workspace { min-height:0;align-self:start; }
body #studio-shell .editor-panel-tabs { position:sticky;top:0;z-index:3;background:#f7f5ed;padding:8px 0; }
body #studio-shell .studio-properties { width:100%;max-width:none; }
body #studio-shell .transcript-segment-web { display:grid;grid-template-columns:64px minmax(0,1fr) 44px;gap:8px;align-items:start; }
body #studio-shell .transcript-segment-web textarea { width:100%;min-height:64px;box-sizing:border-box;resize:vertical;font:inherit;line-height:1.5;background:#fffdf7;border:1px solid #bacac2;border-radius:4px;padding:8px; }
body #studio-shell .transcript-actions label { display:grid;gap:6px; }
body #studio-shell .transcript-actions select { min-height:44px; }
body[data-project-tab="montage"] .transcript-column,
body:not([data-project-tab]) .transcript-column { display:none!important; }
body[data-project-tab="material"] #editor-properties,
body[data-project-tab="material"] .quick-editor,
body[data-project-tab="material"] #desktop-timeline { display:none!important; }
body[data-project-tab="moments"] #editor-stage,
body[data-project-tab="results"] #editor-stage { display:none!important; }
body #project-moments-slot [data-panel="viral"] { display:block; }
body #studio-shell .integration-list span { display:flex;flex-wrap:wrap;justify-content:space-between;gap:8px; }
body #studio-shell .integration-list b { position:static;white-space:normal;text-align:left; }
body #studio-shell .editor-effect-group { min-width:0; }
body #studio-shell .viral-card button { min-height:44px;margin:8px 8px 0 0; }
body #studio-shell .studio-properties label { max-width:100%; }
@media(min-width:1000px) {
 body #studio-shell #editor-properties-fields { display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px; }
 body #studio-shell #editor-properties-fields>.editor-effect-group,
 body #studio-shell #editor-properties-fields>.editor-warnings { grid-column:1/-1; }
}

/* Web Studio r28. These rules are loaded by /web only. */
body.web-workspace { --web-line:#d6ded5; --web-surface:#fffdf7; --web-muted:#53685e; }
body.web-workspace #studio-shell .workspace { padding:0 28px 32px; }
body.web-workspace #studio-shell .topbar { height:54px;margin-bottom:0; }
body.web-workspace #studio-shell .workspace-heading { padding:20px 0 14px; }
body.web-workspace #studio-shell .workspace-heading h1 { font-size:26px; }
body.web-workspace #studio-shell .workspace-heading p { margin:5px 0 0; }
body.web-workspace #studio-shell .project-step-tabs { gap:6px;margin:12px 0 18px; }
body.web-workspace #studio-shell .project-step-tabs button { padding:10px 18px;font-size:14px; }
body.web-workspace #studio-shell .editor-stage-widescreen {
  grid-template-columns:minmax(0,1.15fr) minmax(360px,1fr);
  grid-template-areas:"toolbar toolbar" "primary inspectors" "clips clips" "timeline timeline" "extras extras";
  grid-template-rows:auto auto auto auto auto;gap:18px;align-items:start;
}
body.web-workspace #studio-shell .editor-toolbar { display:flex;flex-wrap:wrap;align-items:center;gap:12px;padding:14px;background:var(--web-surface);border:1px solid var(--web-line);border-radius:10px; }
body.web-workspace #studio-shell .editor-project-context { flex:1 1 280px;display:block;min-width:0; }
body.web-workspace #studio-shell .editor-project-context .eyebrow { display:none; }
body.web-workspace #studio-shell .editor-project-context b { display:block;margin-top:6px;font-size:14px;line-height:1.4;overflow-wrap:anywhere; }
body.web-workspace #studio-shell .editor-project-context b { display:none; }
body.web-workspace #studio-shell .web-version-tools { position:relative;font-size:13px; }
body.web-workspace #studio-shell .web-version-tools summary { min-height:44px;padding:12px;cursor:pointer; }
body.web-workspace #studio-shell .web-version-tools[open] { flex-basis:100%; }
body.web-workspace #studio-shell .web-version-tools .editor-draft-versions { margin-top:10px; }
body.web-workspace[data-project-tab=material] #studio-shell .web-version-tools { display:none; }
body.web-workspace #studio-shell .editor-project-context label { display:block;font-size:12px; }
body.web-workspace #studio-shell .editor-project-context select { display:block;margin-top:5px; }
body.web-workspace #studio-shell .editor-aspect-control { flex:0 1 210px;min-width:170px;font-size:12px; }
body.web-workspace #studio-shell .editor-toolbar :is(button,select) { min-height:42px;font-size:13px; }
body.web-workspace #studio-shell #editor-save-state { font-size:12px;color:var(--web-muted); }
body.web-workspace #studio-shell .editor-draft-versions { flex-basis:100%;justify-content:flex-start; }
body.web-workspace[data-project-tab=material] #studio-shell .editor-toolbar :is(.editor-aspect-control,.editor-history,.editor-draft-versions,#editor-add-scene,#editor-export,#editor-save-state) { display:none; }
body.web-workspace #studio-shell .editor-primary-workspace { position:sticky;top:16px; }
body.web-workspace #studio-shell .editor-primary-workspace .player-column { display:flex;flex-direction:column;align-items:center;justify-content:center;padding:12px;background:#112c25;border-radius:12px;min-width:0; }
body.web-workspace #studio-shell .editor-primary-workspace .editor-preview-canvas { max-height:64vh;margin:auto; }
body.web-workspace[data-project-tab=material] #studio-shell #editor-preview-canvas { width:100%;aspect-ratio:auto; }
body.web-workspace[data-project-tab=material] #studio-shell #editor-preview-canvas > :not(#desktop-video) { display:none!important; }
body.web-workspace[data-project-tab=material] #studio-shell #desktop-video { position:static;width:100%;height:50vh;max-height:620px;object-fit:contain!important; }
body.web-workspace[data-project-tab=material] #studio-shell .player-meta b { font-size:0; }
body.web-workspace[data-project-tab=material] #studio-shell .player-meta b::after { content:'Полное исходное видео';font-size:12px; }
body.web-workspace #studio-shell .player-meta { display:flex;flex-wrap:wrap;justify-content:space-between;gap:8px;margin:10px 0 0;line-height:1.5; }
body.web-workspace #studio-shell .player-meta :is(b,span) { font-size:12px;font-weight:400; }
body.web-workspace #studio-shell .player-column > .editor-preview-mode { position:static;display:block;align-self:stretch;margin:10px 0 0;padding:0;background:none;border:0;border-radius:0;color:#dff4ec;font-size:12px;line-height:1.5;white-space:normal;pointer-events:none; }
body.web-workspace[data-project-tab=material] #studio-shell .player-column > .editor-preview-mode { display:none; }
body.web-workspace #studio-shell .editor-inspector-stack { display:block;min-width:0; }
body.web-workspace #studio-shell .transcript-column { display:block;padding:0;border:0;background:transparent; }
/* The old generic >div height made the action row as tall as the transcript. */
body.web-workspace #studio-shell .transcript-column > div { height:auto;overflow:visible;padding:0; }
body.web-workspace #studio-shell .transcript-column > header { height:auto;padding:12px 0;align-items:start;gap:12px; }
body.web-workspace #studio-shell .transcript-column.has-phrase-selection > header { display:flex;flex-wrap:wrap; }
body.web-workspace #studio-shell .transcript-column.has-phrase-selection > header > :not(.transcript-export-menu) { display:none; }
body.web-workspace #studio-shell .transcript-export-menu { max-width:100%;justify-content:flex-start;gap:6px; }
body.web-workspace #studio-shell .transcript-export-menu a { min-width:44px;min-height:44px;padding:8px 12px;font-size:12px; }
body.web-workspace #studio-shell .transcript-column.has-phrase-selection:has(#desktop-transcript[hidden]) > .transcript-actions { display:none; }
body.web-workspace #studio-shell .transcript-actions { height:auto;align-items:end;margin:12px 0; }
body.web-workspace #studio-shell .transcript-column > #editor-transcript-status:empty { display:none; }
body.web-workspace #studio-shell .mms-phrases { padding:16px;border-color:var(--web-line);border-radius:10px;font-size:15px; }
body.web-workspace #studio-shell .mms-phrases h3 { font-size:19px; }
body.web-workspace #studio-shell .phrase-tools { margin:10px 0; }
body.web-workspace #studio-shell .phrase-tools :is(button,label,input) { font-size:13px; }
body.web-workspace #studio-shell .phrase-status { font-size:12px;margin:6px 0;color:var(--web-muted); }
body.web-workspace #studio-shell .phrase-list { max-height:48vh; }
body.web-workspace #studio-shell .phrase-row { padding:8px;grid-template-columns:32px minmax(0,1fr); }
body.web-workspace #studio-shell .phrase-row p { font-size:15px;line-height:1.5; }
body.web-workspace #studio-shell .phrase-footer { position:static;margin-top:12px;padding:12px 0 0; }
body.web-workspace #studio-shell .phrase-actions button { font-size:13px;flex-basis:120px; }
body.web-workspace #studio-shell .phrase-options { align-items:end; }
body.web-workspace #studio-shell .phrase-blocks > div { gap:8px;padding:10px 0;border-bottom:1px solid var(--web-line); }
body.web-workspace #studio-shell .phrase-blocks label { display:grid;gap:4px;font-size:12px; }
body.web-workspace #studio-shell .phrase-blocks > div > span { flex-basis:100%;font-size:13px; }
body.web-workspace #studio-shell .studio-properties { padding:16px;background:var(--web-surface);border:1px solid var(--web-line);border-radius:10px;max-height:none;overflow:visible; }
body.web-workspace #studio-shell .studio-properties :is(p,small,label,summary) { font-size:14px;line-height:1.5; }
body.web-workspace #studio-shell .studio-properties :is(input,select,button) { font-size:14px;min-height:42px; }
body.web-workspace #studio-shell .studio-properties input[type=checkbox] { min-height:20px; }
body.web-workspace #studio-shell .studio-properties .eyebrow { display:none; }
body.web-workspace #studio-shell .editor-panel-tabs { position:static;display:flex;gap:4px;padding:0 0 12px;margin:0 0 14px;border-bottom:1px solid var(--web-line);background:transparent; }
body.web-workspace #studio-shell .editor-panel-tabs button { flex:1 0 auto;min-height:42px;font-size:13px;padding:8px 10px;color:#14382b!important;background:transparent!important; }
body.web-workspace #studio-shell .editor-panel-tabs button[aria-pressed=true] { color:#fffdf7!important;background:#14382b!important; }
body.web-workspace #studio-shell #editor-properties-fields { display:block; }
body.web-workspace #studio-shell .editor-effect-group { margin:12px 0;border-color:var(--web-line); }
body.web-workspace #studio-shell .editor-effect-group > summary { padding:10px;font-weight:600; }
body.web-workspace #studio-shell .quick-editor > header { grid-template-columns:minmax(0,1fr) auto; }
body.web-workspace #studio-shell .quick-editor > header small { grid-column:1/-1;text-align:left; }
body.web-workspace #studio-shell .export-package { padding:20px;border:1px solid var(--web-line);border-radius:10px;background:var(--web-surface); }
body.web-workspace #studio-shell .export-package h3 { font-size:16px;overflow-wrap:anywhere; }
body.web-workspace #studio-shell .export-row { display:flex;flex-wrap:wrap;align-items:center;gap:12px;padding:14px 0; }
body.web-workspace #studio-shell .export-row > div { flex:1 1 220px;min-width:0; }
body.web-workspace #studio-shell .export-row :is(button,a) { min-height:44px;display:inline-flex;align-items:center;padding:10px 16px;font-size:14px;border:1px solid var(--web-line);border-radius:6px;color:#14382b;background:#fffdf7;text-decoration:none; }
body.web-workspace #studio-shell :focus-visible { outline:2px solid #087a68;outline-offset:3px; }

/* Same clip editor and server recipe as Mini App, with a web-only workbench. */
body.web-workspace .web-clip-editor .de-shell { max-width:1580px;padding:0 32px; }
body.web-workspace .web-clip-editor .de-header { padding:18px 0;gap:18px; }
body.web-workspace .web-clip-editor .de-heading h2 { font-size:24px; }
body.web-workspace .web-clip-editor [data-title] { font-size:14px;margin-top:4px; }
body.web-workspace .web-clip-editor .de-scroll { display:grid;grid-template-columns:minmax(0,1.35fr) minmax(360px,1fr);gap:28px;padding:20px 0;align-items:start; }
body.web-workspace .web-clip-editor .de-player { top:0;grid-column:1;grid-row:1;padding:0; }
body.web-workspace .web-clip-editor .de-player video { height:calc(100dvh - 330px);max-height:680px;min-height:240px;background:#112c25; }
body.web-workspace .web-clip-editor .de-settings { grid-column:2;background:#f4f6ef;border:1px solid #d6ded5;border-radius:12px;padding:16px; }
body.web-workspace .web-clip-editor .de-tabs { position:sticky;top:-20px;z-index:3;background:#f4f6ef;padding:8px 0 12px!important;border-bottom:1px solid #d6ded5;margin-bottom:12px; }
body.web-workspace .web-clip-editor .de-tabs button { font-size:14px; }
body.web-workspace .web-clip-editor .de-shell > .de-actions { display:flex;justify-content:flex-end;padding:14px 0;border-top:1px solid #d6ded5; }
body.web-workspace .web-clip-editor .de-shell > .de-actions button { flex:0 1 230px; }
body.web-workspace .web-clip-editor .de-shell > .de-actions [data-download] { margin-right:auto; }
body.web-workspace .web-clip-editor .de-bottom-status { padding:8px 0; }
@media(min-width:1600px) {
  body.web-workspace #studio-shell .editor-stage-widescreen { grid-template-columns:minmax(0,1.3fr) minmax(460px,1fr); }
}
@media(max-width:1100px) {
  body.web-workspace #studio-shell .workspace { padding:0 18px 24px; }
  body.web-workspace #studio-shell .editor-stage-widescreen { grid-template-columns:minmax(0,1fr) minmax(320px,1fr); }
  body.web-workspace #studio-shell .editor-toolbar { gap:8px; }
  body.web-workspace .web-clip-editor .de-shell { padding:0 20px; }
  body.web-workspace .web-clip-editor .de-scroll { grid-template-columns:minmax(0,1fr) minmax(320px,1fr);gap:18px; }
}
@media(max-width:850px) {
  body.web-workspace #studio-shell .editor-stage-widescreen { grid-template-columns:minmax(0,1fr);grid-template-areas:"toolbar" "primary" "inspectors" "clips" "timeline" "extras"; }
  body.web-workspace #studio-shell .editor-primary-workspace { position:static; }
  body.web-workspace .web-clip-editor .de-scroll { display:block; }
  body.web-workspace .web-clip-editor .de-player { position:relative;margin-bottom:16px; }
  body.web-workspace .web-clip-editor .de-player video { height:40dvh;min-height:180px; }
  body.web-workspace .web-clip-editor .de-tabs { position:static; }
  body.web-workspace .web-clip-editor .de-shell > .de-actions { flex-wrap:wrap; }
  body.web-workspace .web-clip-editor .de-shell > .de-actions button { flex:1 1 150px; }
}
@media(max-width:600px) {
  body.web-workspace #studio-shell .workspace { padding:0 12px 24px; }
  body.web-workspace #studio-shell .editor-toolbar { padding:12px; }
  body.web-workspace #studio-shell .studio-properties :is(input,select) { font-size:16px; }
  body.web-workspace .web-clip-editor .de-shell { padding:0 12px; }
  body.web-workspace .web-clip-editor .de-header { padding:10px 0;gap:8px; }
  body.web-workspace .web-clip-editor .de-heading h2 { font-size:18px; }
}
@media(max-width:600px) {
 .project-step-tabs,.editor-panel-tabs { display:grid;grid-template-columns:repeat(2,minmax(0,1fr)); }
 .project-step-tabs button,.editor-panel-tabs button { min-width:0;padding:8px;font-size:14px; }
 body #studio-shell .editor-toolbar { display:flex;flex-wrap:wrap;gap:10px; }
 body #studio-shell .transcript-segment-web { grid-template-columns:52px minmax(0,1fr) 44px; }
 body #studio-shell .transcript-segment-web textarea { font-size:16px; }
}

/* One responsive shell contract, overriding the legacy mixed rail breakpoints. */
body.web-workspace { min-width:0; }
body.web-workspace #studio-shell { display:grid;grid-template-columns:216px minmax(0,1fr); }
body.web-workspace #studio-shell > .rail {
  display:flex;flex-direction:column;align-items:stretch;position:sticky;top:0;
  width:auto;min-width:0;height:100vh;height:100dvh;max-height:none;
  padding:20px 12px;overflow-y:auto;border-right:1px solid var(--web-line);
}
body.web-workspace #studio-shell .rail-nav {
  display:grid!important;grid-template-columns:minmax(0,1fr);align-content:start;
  align-items:stretch;gap:4px;width:100%;min-width:0;flex:0 0 auto;overflow:visible;
}
body.web-workspace #studio-shell .rail-nav > :is(a,button) {
  display:flex!important;align-items:center;justify-content:flex-start;gap:10px;
  width:100%;min-width:0;min-height:44px;height:auto;flex:none;
  padding:10px 12px;font-size:14px;line-height:1.35;text-align:left;
  white-space:normal;word-break:normal;overflow-wrap:normal;
}
body.web-workspace #studio-shell .rail-nav > :is(a,button) > span {
  min-width:0;white-space:normal;word-break:normal;overflow-wrap:normal;
}
body.web-workspace #studio-shell .rail-nav :is(i,em) { flex:0 0 20px;width:20px;text-align:center; }
body.web-workspace #studio-shell .rail-nav button i { display:block; }
body.web-workspace #studio-shell .workspace-menu-toggle {
  display:none;min-height:44px;padding:10px 16px;border:1px solid #14382b;
  border-radius:8px;color:#14382b;background:transparent;font-size:14px;font-weight:700;
}
body.web-workspace #studio-shell .rail-bottom { margin-top:auto;padding-top:24px; }
body.web-workspace #studio-shell .projects-table {
  grid-template-columns:repeat(auto-fit,minmax(min(100%, 280px), 1fr))!important;
}
body.web-workspace #studio-shell :is(.project-card-premium,.project-card-title,.projects-search,.project-library-controls>label) { min-width:0; }
body.web-workspace #studio-shell :is(.project-card-actions,.project-video-folders) { flex-wrap:wrap; }
body.web-workspace #studio-shell .project-card-actions > :is(a,button) { max-width:100%;white-space:normal;overflow-wrap:break-word; }
body.web-workspace #studio-shell .project-library-controls { display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,160px),1fr));gap:12px; }
body.web-workspace #studio-shell .project-library-controls > label { width:auto; }
body.web-workspace #studio-shell :is(input,select,textarea) { max-width:100%;min-width:0; }
body.web-workspace #studio-shell .topbar-route { min-width:0;flex-wrap:wrap;gap:8px; }
body.web-workspace #studio-shell .topbar-utility { flex-shrink:0; }
@media(max-width:1024px) {
  body.web-workspace #studio-shell { grid-template-columns:minmax(0,1fr); }
  body.web-workspace #studio-shell > .rail {
    /* Legacy desktop.css uses !important for its mobile rail reset. */
    display:grid!important;grid-template-columns:minmax(0,1fr) auto;gap:0 16px;align-items:center;
    height:auto;padding:10px 18px!important;border-right:0;border-bottom:1px solid #14382b24;
    position:sticky!important;top:0!important;overflow:visible;z-index:20;
  }
  body.web-workspace #studio-shell .rail .brand {
    width:fit-content;height:48px;min-height:48px!important;max-width:100%;
    margin:0!important;padding:0!important;justify-content:flex-start;transform:none;
  }
  body.web-workspace #studio-shell .rail .brand > span { font-size:14px!important;line-height:1.05;text-align:left; }
  body.web-workspace #studio-shell .rail .brand::before,
  body.web-workspace #studio-shell .rail .brand::after,
  body.web-workspace #studio-shell .rail-nav::before,
  body.web-workspace #studio-shell .rail-bottom { display:none; }
  body.web-workspace #studio-shell .workspace-menu-toggle { display:block; }
  body.web-workspace #studio-shell .rail-nav {
    grid-column:1/-1;grid-template-columns:repeat(auto-fit,minmax(min(100%,160px),1fr));
    max-height:calc(100vh - 100px);max-height:calc(100dvh - 100px);
    margin-top:10px!important;padding:4px!important;gap:4px!important;overflow-y:auto!important;overscroll-behavior:contain;
  }
  body.web-workspace #studio-shell .rail[data-menu-expanded="false"] .rail-nav { display:none!important; }
  body.web-workspace #studio-shell .workspace { padding:0 18px 32px; }
  body.web-workspace #studio-shell .workspace-heading { padding:24px 0 18px; }
  body.web-workspace #studio-shell .workspace-heading h1 { font-size:clamp(24px,3.4vw,30px); }
  body.web-workspace #studio-shell .topbar { min-height:54px;height:auto;padding:6px 0;gap:12px; }
  body.web-workspace #studio-shell .editor-panel-tabs { position:static; }
}
@media(max-width:600px) {
  body.web-workspace #studio-shell > .rail { padding-inline:12px!important; }
  body.web-workspace #studio-shell .workspace { padding:0 12px 24px; }
  body.web-workspace #studio-shell .projects-toolbar { grid-template-columns:minmax(0,1fr); }
  body.web-workspace #studio-shell .filter-chips { display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:4px; }
  body.web-workspace #studio-shell .filter-chips button { font-size:13px;white-space:normal; }
  body.web-workspace #studio-shell .project-video-folders button { min-width:0;white-space:normal;line-height:1.4; }
  body.web-workspace #studio-shell :is(input:not([type=checkbox]):not([type=radio]),select,textarea) { font-size:16px; }
}
