/* Media first creation and a local, touch-sized editor. */
.composer-dialog .dialog-header { grid-template-columns: 44px minmax(0, 1fr) auto; }
.composer-dialog .dialog-header > div { min-width: 0; }
.composer-dialog .dialog-header:has(#composer-back:not([hidden])) > [data-close-dialog] { display: none; }
.composer-dialog .dialog-header:has(#composer-back:not([hidden])) #composer-back { grid-column: 1; grid-row: 1; }
.composer-media-intro { text-align: center; padding: 24px 8px 12px; }
.composer-media-intro h3 { margin: 0 0 8px; font-size: 24px; letter-spacing: -0.03em; }
.composer-media-intro p { color: var(--text-secondary); font-size: 14px; line-height: 1.5; }
#composer-media-step > .upload-field { min-height: 150px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 10px; margin: 16px 0; }
#composer-media-step > .upload-field.has-file { min-height: 76px; flex-direction: row; text-align: left; }
#composer-media-step:has(.composer-gallery-item) > :is(.composer-media-intro, .composer-capture-actions, .composer-create-options) { display: none; }
#composer-media-step:has(.composer-gallery-preview video) > .upload-field { display: none; }
#composer-media-step .upload-field-copy strong { font-size: 17px; }
#composer-media-step .upload-field-copy small { font-size: 12px; }
.composer-capture-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 16px 0; }
.studio-file-button { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 10px 14px; border: 1px solid var(--border-strong); border-radius: 12px; color: var(--text); background: var(--surface-soft); font-size: 14px; font-weight: 600; cursor: pointer; overflow: hidden; }
.studio-file-button input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.studio-file-button:focus-within { outline: 2px solid var(--accent-hover); outline-offset: 2px; }
.studio-file-button svg { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.composer-create-options { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 20px 0; }
.composer-create-options .secondary-button { flex: 1; }
.composer-media-review { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 18px; padding: 8px 12px; border-radius: 12px; background: var(--surface-soft); font-size: 14px; }
#composer-details-step .composer-author { margin: 8px 0 20px; }
#composer-details-step .composer-more { margin-top: 18px; }
.composer-more > summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; padding: 12px 0; color: var(--text); cursor: pointer; list-style: none; border-top: 1px solid var(--border); }
.composer-more > summary::-webkit-details-marker { display: none; }
.composer-more > summary:focus-visible { outline: 2px solid var(--accent-hover); outline-offset: 4px; border-radius: 4px; }
.composer-more > summary > svg { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.composer-more[open] > summary > svg { transform: rotate(180deg); }
.composer-more-body { display: grid; gap: 16px; padding: 12px 0 4px; }

.composer-dialog .composer-gallery-item { grid-template-columns: minmax(0, 1fr); gap: 10px; padding: 0 0 16px; margin: 12px 0; overflow: hidden; }
.composer-dialog .composer-gallery-preview { width: 100%; height: min(52dvh, 340px); max-height: 340px; aspect-ratio: auto; border-radius: 12px; background: #0b0b0d; }
.composer-dialog .composer-gallery-preview :is(img, video) { width: 100%; height: 100%; max-height: 340px; object-fit: contain; }
.composer-dialog .composer-gallery-copy { padding: 0 4px; }
.composer-dialog .composer-gallery-copy > strong { display: none; }
.gallery-accessibility { margin: 0; padding: 0 14px; font-size: 13px; color: var(--text-secondary); }
.gallery-accessibility summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; }
.gallery-accessibility[open] { padding-bottom: 12px; }
.gallery-accessibility textarea { margin: 8px 0; font-size: 16px; }
.drop-copy:has(> .drop-title[hidden]):has(> .drop-description[hidden]):not(:has(.project-badge, .translation-control)) { display: none; }
.composer-dialog .composer-gallery-actions { display: flex; flex-direction: row; justify-content: flex-end; gap: 8px; }
.composer-gallery-actions .gallery-studio { width: auto; padding: 8px 18px; min-height: 44px; margin-right: auto; border-radius: 22px; font-size: 14px; font-weight: 600; }
/* The editor keeps the site's dark palette in both site themes, like the video player. */
.sheet-dialog.studio-dialog {
  --bg: #0b0b0d; --chrome: #0a0a0c; --surface: #111114; --surface-raised: #151519; --surface-soft: #1b1b20;
  --surface-hover: #202026; --surface-inset: #0d0d10; --surface-control: #101013; --surface-menu: #19191e;
  --text: #f5f5f7; --text-secondary: #b2b2ba; --text-muted: #9696a1;
  --border: #29292f; --border-strong: #383840; --border-control: #62626c;
  --accent: #ff4a2e; --accent-hover: #ff6a4d; --accent-soft: rgba(255, 74, 46, 0.15); --on-accent: #101013; --link: #f0a088;
  --danger: #ff6673; --danger-text: #ffb7bd; --danger-panel-bg: #211516; --danger-panel-border: #6c3030;
  width: min(1080px, calc(100vw - 48px)); height: min(880px, calc(100dvh - 48px));
  max-width: none; max-height: calc(100dvh - 48px); padding: 0; border: 1px solid var(--border-strong);
  border-radius: 18px; background: var(--bg); color: var(--text); overflow: hidden; color-scheme: dark;
  font-size: 14px; line-height: 1.4;
}
.studio-dialog[open] { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: 64px minmax(0, 1fr) 48px auto 84px; grid-template-areas: "header" "preview" "transport" "timeline" "tools"; }
.studio-dialog.tool-open { grid-template-columns: minmax(0, 1fr) 310px; grid-template-areas: "header header" "preview drawer" "transport drawer" "timeline drawer" "tools tools"; }
.studio-dialog::backdrop { background: rgb(0 0 0 / 78%); }
.studio-dialog [hidden] { display: none !important; }
.studio-dialog svg { display: block; flex: none; width: 22px; height: 22px; }
.studio-dialog button, .studio-dialog input, .studio-dialog select, .studio-dialog textarea { font: inherit; letter-spacing: normal; }
.studio-dialog button { cursor: pointer; color: inherit; }
.studio-dialog button:disabled { opacity: .3; cursor: default; }
.studio-dialog :is(button, input, select, textarea, summary):focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.studio-header { grid-area: header; display: flex; align-items: center; gap: 10px; padding: 10px 16px; background: var(--surface); border-bottom: 1px solid var(--border); }
.studio-dialog .studio-header h2 { flex: 1; margin: 0; font-size: 16px; font-weight: 600; letter-spacing: -.02em; }
.studio-header h2:focus, #studio-tool-title:focus { outline: none; }
.studio-icon { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; min-width: 44px; padding: 10px; border: 0; border-radius: 10px; background: transparent; }
.studio-icon:hover:not(:disabled) { background: var(--surface-hover); }
.studio-save { display: inline-flex; align-items: center; gap: 6px; height: 42px; padding: 0 16px; border: 0; border-radius: 9px; background: var(--accent); color: var(--on-accent) !important; font-size: 13px !important; font-weight: 650 !important; }
.studio-save svg { width: 16px; height: 16px; }
/* Save to phone and the draft panel sit in the header; the panel floats so the grid stays fixed. */
#studio-download, #studio-draft-toggle { color: var(--text-secondary); }
#studio-download:hover:not(:disabled), #studio-draft-toggle:hover:not(:disabled) { color: var(--text); }
.studio-draft-panel { position: absolute; top: 68px; right: 16px; z-index: 12; width: min(320px, calc(100% - 32px)); padding: 12px 14px; border: 1px solid var(--border-strong); border-radius: 12px; background: var(--surface-menu); box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45); }
.studio-draft-panel .studio-note { margin: 0 0 10px; font-size: 12px; line-height: 1.45; }
.studio-draft-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.studio-status { position: absolute; bottom: 91px; left: 16px; right: 16px; z-index: 8; margin: 0; padding: 10px 14px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface-menu); color: var(--text); font-size: 12px; }
/* The standalone Studio entry: a small sheet with one file button, a draft to resume, and a result to publish. */
.studio-start-dialog { width: min(520px, calc(100vw - 32px)); }
.studio-start-body { display: grid; gap: 14px; padding: 18px 22px 24px; }
.studio-start-pick { width: 100%; min-height: 56px; font-size: 15px; }
.studio-start-note { margin: 0; color: var(--text-secondary); font-size: 13px; line-height: 1.5; }
.studio-start-draft, .studio-start-result { padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-soft); }
.studio-start-draft p, .studio-start-result p { margin: 0 0 10px; font-size: 14px; }
.studio-start-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.composer-resume-studio { margin: -8px 0 12px; }
.studio-preview { grid-area: preview; position: relative; min-width: 0; min-height: 0; display: flex; align-items: center; justify-content: center; overflow: hidden; padding: 14px 16px 8px; background: var(--bg); }
#studio-canvas { display: block; width: auto; height: auto; max-width: 100%; max-height: 100%; object-fit: contain; touch-action: none; }
.studio-format-shortcut { position: absolute; top: 24px; right: 24px; min-height: 34px; padding: 4px 11px; border: 1px solid rgb(255 255 255 / 25%); border-radius: 6px; background: rgba(11, 11, 13, 0.85); color: var(--text); font-size: 11px !important; font-weight: 600 !important; }
.studio-preview-hint { position: absolute; bottom: 17px; left: 50%; transform: translateX(-50%); padding: 5px 10px; border-radius: 5px; background: rgba(11, 11, 13, 0.85); color: var(--text); font-size: 11px; white-space: nowrap; pointer-events: none; }
.studio-transport { grid-area: transport; display: grid; grid-template-columns: 1fr 44px 1fr; align-items: center; padding: 0 16px; background: var(--surface); }
.studio-time { font-size: 11px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.studio-time span { color: var(--text-muted); }
.studio-history { display: flex; justify-content: flex-end; gap: 0; }
.studio-history .studio-icon { width: 36px; min-width: 36px; height: 44px; padding: 9px; }
.studio-history svg { width: 19px; height: 19px; }
#studio-play { border-radius: 50%; }
#studio-play svg { width: 22px; height: 22px; }
/* Transport: frame steps around play; timeline: waveforms, transition marks and a zoom control beside Add. */
.studio-transport { grid-template-columns: 1fr auto 1fr; }
.studio-transport-center { display: flex; align-items: center; justify-content: center; gap: 2px; }
.studio-time-group { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.studio-frame { padding: 1px 5px; border-radius: 4px; background: var(--surface-soft); color: var(--text-muted); font-size: 10px; font-variant-numeric: tabular-nums; }
.studio-step svg { width: 18px; height: 18px; }
.studio-timeline-side { display: flex; flex-direction: column; align-items: center; gap: 6px; margin-top: 38px; }
.studio-timeline-side .studio-add-clip { margin-top: 0; }
.studio-zoom { display: flex; align-items: center; gap: 2px; }
.studio-zoom button { width: 22px; height: 22px; padding: 0; border: 1px solid var(--border-strong); border-radius: 6px; background: var(--surface-soft); color: var(--text-secondary); font-size: 13px; line-height: 1; }
.studio-zoom output { min-width: 32px; text-align: center; font-size: 9px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.studio-clip-wave { position: absolute; left: 0; bottom: 0; width: 100%; height: 16px; background: rgba(0, 0, 0, 0.45); pointer-events: none; }
.studio-clip-transition { position: absolute; top: 2px; right: 4px; padding: 0 4px; border-radius: 3px; background: rgba(0, 0, 0, 0.72); color: var(--link); font-size: 10px; line-height: 14px; }
.studio-audio-track { position: relative; overflow: hidden; }
.studio-audio-wave { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .55; pointer-events: none; }
.studio-audio-track span, .studio-audio-track svg { position: relative; }
.studio-trim-wave { position: absolute; left: 14px; bottom: 8px; width: calc(100% - 28px); height: 18px; pointer-events: none; opacity: .9; }
/* Drawer sections: a quiet title, one rule, no boxes inside boxes. */
.studio-section { margin: 14px 0 0; padding-top: 12px; border-top: 1px solid var(--border); }
.studio-section-title { display: flex; justify-content: space-between; margin: 0 0 8px; color: var(--text-muted); font-size: 10px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.studio-section-title output { text-transform: none; letter-spacing: 0; color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.studio-inout { display: flex; gap: 8px; margin: 8px 0 0; }
.studio-inout .studio-command { flex: 1; border: 1px solid var(--border-strong); }
.studio-segmented { display: flex; border: 1px solid var(--border-strong); border-radius: 8px; overflow: hidden; }
.studio-segmented button { flex: 1; min-height: 40px; padding: 6px 4px; border: 0; background: transparent; color: var(--text-secondary); font-size: 11px !important; }
.studio-segmented button + button { border-left: 1px solid var(--border-strong); }
.studio-segmented button[aria-pressed="true"] { background: var(--accent-soft); color: var(--link); }
.studio-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 10px; }
.studio-chips .studio-chips { margin: 0; }
.studio-chip { max-width: 150px; min-height: 32px; padding: 4px 11px; overflow: hidden; border: 1px solid var(--border-strong); border-radius: 999px; background: transparent; color: var(--text-secondary) !important; font-size: 11px !important; text-overflow: ellipsis; white-space: nowrap; }
.studio-chip[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--link) !important; }
.studio-chip-add { border-style: dashed; }
.studio-text-empty { margin: 4px 0 10px; color: var(--text-muted); font-size: 12px; line-height: 1.5; }
.studio-check { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 40px; margin: 0; font-size: 12px; color: var(--text-secondary); }
.studio-dialog .studio-check input[type="checkbox"] { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); box-shadow: none; }
.studio-check-row { display: flex; gap: 16px; }
.studio-check-row > * { flex: 1; min-width: 0; }
.studio-adjust .studio-range { margin: 0; }
.studio-adjust-head { display: flex; align-items: center; justify-content: space-between; }
.studio-adjust-head .studio-section-title { margin: 0; }
.studio-timeline { grid-area: timeline; position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 10px; min-height: 124px; padding: 0 16px 18px; background: var(--surface); }
.studio-timeline-scroll { min-width: 0; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: thin; scrollbar-color: var(--border-control) transparent; padding: 0 2px 5px; }
.studio-timeline-inner { position: relative; min-width: 1px; }
.studio-ruler { position: relative; height: 38px; overflow: hidden; color: var(--text-muted); font-size: 10px; font-variant-numeric: tabular-nums; background: repeating-linear-gradient(90deg, var(--border-strong) 0 1px, transparent 1px 10px) 0 27px / 100% 3px no-repeat; }
.studio-ruler span { position: absolute; top: 5px; padding: 0 3px; background: var(--surface); }
.studio-dialog .studio-position { position: absolute; top: 0; left: 0; width: 100%; height: 38px; padding: 0; margin: 0; border: 0; border-radius: 0; appearance: none; background: transparent; cursor: ew-resize; z-index: 3; box-shadow: none; }
.studio-position::-webkit-slider-runnable-track { height: 2px; background: transparent; }
.studio-position::-webkit-slider-thumb { appearance: none; height: 18px; width: 2px; margin-top: -8px; border: 0; background: var(--text); }
.studio-position::-moz-range-track { height: 2px; background: transparent; }
.studio-position::-moz-range-thumb { height: 18px; width: 2px; border: 0; background: var(--text); }
.studio-playhead { position: absolute; top: 28px; bottom: 0; width: 2px; background: var(--text); z-index: 4; pointer-events: none; }
.studio-playhead::before { content: ""; position: absolute; top: -3px; left: -3px; width: 8px; height: 7px; border-radius: 2px 2px 4px 4px; background: var(--text); }
.studio-clips { display: flex; height: 62px; gap: 0; overflow: hidden; border-radius: 5px; }
.studio-clip { position: relative; flex: none; min-width: 0; height: 62px; padding: 0; overflow: hidden; border: 2px solid var(--border-strong); border-radius: 5px; background: var(--surface-soft); }
.studio-clip[aria-pressed="true"] { border-color: var(--accent); z-index: 1; }
.studio-clip-frames { display: flex; height: 100%; width: 100%; pointer-events: none; }
.studio-clip-frames img { min-width: 0; flex: 1 1 0; width: 0; height: 100%; object-fit: cover; opacity: .85; }
.studio-clip-duration { position: absolute; right: 4px; bottom: 3px; max-width: calc(100% - 6px); overflow: hidden; padding: 1px 4px; border-radius: 3px; font-size: 10px; font-variant-numeric: tabular-nums; background: rgb(0 0 0 / 72%); color: #fff; white-space: nowrap; }
.studio-audio-track { display: flex; align-items: center; gap: 6px; width: 100%; height: 25px; margin: 6px 0 0; padding: 3px 8px; border: 0; border-radius: 4px; background: var(--accent-soft); color: var(--link) !important; text-align: left; }
.studio-audio-track svg { width: 13px; height: 13px; }
.studio-audio-track span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; }
.studio-add-clip { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; width: 44px; height: 62px; margin-top: 38px; border: 1px solid var(--border-strong); border-radius: 6px; background: var(--surface-soft); color: var(--text-secondary); font-size: 10px; overflow: hidden; }
.studio-add-clip input, .studio-audio-picker input, .studio-custom-color input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.studio-add-clip:focus-within, .studio-audio-picker:focus-within, .studio-custom-color:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.studio-add-clip:has(input:disabled) { opacity: .3; }
.studio-duration { grid-column: 1 / -1; font-size: 11px; color: var(--danger-text); }
.studio-duration:empty { display: none; }
.studio-tools { grid-area: tools; display: flex; align-items: stretch; justify-content: space-evenly; padding: 9px 12px 10px; border-top: 1px solid var(--border); background: var(--surface-menu); }
.studio-tool { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; min-width: 54px; max-width: 120px; flex: 1; padding: 6px 5px; border: 0; border-radius: 8px; background: transparent; color: var(--text-secondary) !important; }
.studio-tool svg { width: 23px; height: 23px; }
.studio-tool span { font-size: 11px; font-weight: 500; white-space: nowrap; }
.studio-tool[aria-expanded="true"] { color: var(--link) !important; background: var(--accent-soft); }
.studio-tool:hover { background: var(--surface-hover); }
.studio-drawer { grid-area: drawer; display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow: hidden; border-left: 1px solid var(--border-strong); background: var(--surface-raised); }
.studio-drawer-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex: none; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.studio-drawer-header > div { min-width: 0; }
.studio-drawer h3 { margin: 0 0 2px; font-size: 14px; font-weight: 600; }
#studio-selection-label { color: var(--text-muted); font-size: 11px; }
.studio-dialog #studio-clip-select { display: block; width: 100%; max-width: 218px; min-height: 30px; margin: 0; padding: 3px 22px 3px 0; overflow: hidden; text-overflow: ellipsis; border: 0; border-radius: 4px; background-color: transparent; color: var(--text-secondary); font-size: 11px; }
.studio-done { display: flex; align-items: center; gap: 6px; flex: none; height: 44px; padding: 8px 0 8px 12px; border: 0; background: transparent; color: var(--accent) !important; font-size: 12px !important; font-weight: 600 !important; }
.studio-done svg { width: 17px; height: 17px; }
.studio-drawer-body { min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 14px 16px 16px; }
.studio-range { display: block; margin: 8px 0; }
.studio-range > span, .studio-inline-field > span { display: flex; justify-content: space-between; color: var(--text-secondary); font-size: 12px; }
.studio-range output { font-variant-numeric: tabular-nums; }
.studio-dialog .studio-range input[type="range"] { display: block; width: 100%; height: 34px; margin: 0; padding: 0; background: transparent; border: 0; accent-color: var(--accent); box-shadow: none; }
.studio-inline-field { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; margin: 8px 0 0; }
.studio-dialog .studio-inline-field select { width: auto; min-width: 88px; height: 38px; padding: 7px 28px 7px 11px; border: 1px solid var(--border-control); border-radius: 7px; background-color: var(--surface-control); color: var(--text); font-size: 12px; }
.studio-command { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 44px; padding: 8px 12px; border: 0; border-radius: 8px; background: transparent; font-size: 12px !important; }
.studio-command svg { width: 18px; height: 18px; }
.studio-command:hover, .studio-small-button:hover { background: var(--surface-hover); }
.studio-clip-commands { display: flex; align-items: center; justify-content: space-between; gap: 3px; padding: 4px 0; border-bottom: 1px solid var(--border); }
.studio-clip-commands .studio-command { padding: 8px 4px; }
.studio-clip-commands .studio-icon { min-width: 36px; width: 36px; }
.studio-trim-info { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 0 0 8px; font-size: 10px; color: var(--text-secondary); }
.studio-trim-info output { color: var(--text); font-variant-numeric: tabular-nums; white-space: nowrap; }
.studio-trim-track { position: relative; height: 68px; }
.studio-trim-frames { position: absolute; inset: 8px 14px; display: flex; overflow: hidden; border-radius: 4px; }
.studio-trim-frames img { min-width: 0; width: 0; flex: 1 1 0; height: 100%; object-fit: cover; opacity: .55; }
.studio-trim-selection { position: absolute; top: 6px; bottom: 6px; border: 2px solid var(--accent); background: var(--accent-soft); border-radius: 4px; pointer-events: none; }
.studio-dialog .studio-trim-handle { position: absolute; top: 0; left: 0; appearance: none; width: 100%; height: 68px; margin: 0; padding: 0; border: 0; border-radius: 0; background: transparent; pointer-events: none; box-shadow: none; }
.studio-trim-handle::-webkit-slider-runnable-track { height: 56px; background: transparent; }
.studio-trim-handle::-webkit-slider-thumb { appearance: none; pointer-events: auto; width: 28px; height: 56px; border: 0; border-radius: 4px; background: linear-gradient(90deg, transparent 9px, var(--accent) 9px 19px, transparent 19px); cursor: ew-resize; }
.studio-trim-handle::-moz-range-track { height: 56px; background: transparent; }
.studio-trim-handle::-moz-range-thumb { pointer-events: auto; width: 28px; height: 56px; border: 0; border-radius: 4px; background: linear-gradient(90deg, transparent 9px, var(--accent) 9px 19px, transparent 19px); cursor: ew-resize; }
.studio-trim-handle:focus-visible { outline-offset: 1px !important; }
.studio-formats { display: flex; gap: 6px; justify-content: space-between; }
.studio-formats button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 9px; min-width: 0; flex: 1; min-height: 76px; padding: 8px 3px; border: 1px solid var(--border-strong); border-radius: 8px; background: transparent; font-size: 10px !important; color: var(--text-secondary); }
.studio-formats button[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--link); }
.studio-ratio-shape { display: block; height: 22px; border: 1.5px solid currentColor; border-radius: 2px; }
.studio-formats [data-format="original"] .studio-ratio-shape { aspect-ratio: 1.2; }
.studio-formats [data-format="portrait"] .studio-ratio-shape { aspect-ratio: 9 / 16; }
.studio-formats [data-format="square"] .studio-ratio-shape { aspect-ratio: 1; }
.studio-formats [data-format="feed"] .studio-ratio-shape { aspect-ratio: 4 / 5; }
.studio-formats [data-format="wide"] .studio-ratio-shape { aspect-ratio: 16 / 9; }
.studio-crop-actions { display: flex; justify-content: center; gap: 16px; margin: 8px 0; }
.studio-fine-position { color: var(--text-muted); font-size: 11px; }
.studio-fine-position summary { display: flex; align-items: center; min-height: 38px; cursor: pointer; }
.studio-fine-position summary::after { content: "+"; margin-left: auto; }
.studio-fine-position[open] summary::after { content: "−"; }
.studio-dialog .studio-text-field textarea { display: block; width: 100%; min-height: 60px; max-height: 100px; padding: 10px 12px; resize: none; border: 1px solid var(--border-control); border-radius: 8px; background: var(--surface-inset); color: var(--text); font-size: 16px; }
.studio-colors { display: flex; align-items: center; justify-content: space-between; gap: 2px; margin: 10px -4px; }
.studio-colors > button { display: flex; align-items: center; justify-content: center; width: 36px; height: 40px; min-width: 30px; padding: 7px; border: 0; background: transparent; border-radius: 50%; }
.studio-colors > button::before { content: ""; display: block; width: 22px; height: 22px; border-radius: 50%; background: var(--swatch); border: 1px solid var(--text-muted); }
.studio-colors [data-color="#ffffff"] { --swatch: #ffffff; }
.studio-colors [data-color="#14171b"] { --swatch: #14171b; }
.studio-colors [data-color="#d4f4de"] { --swatch: #d4f4de; }
.studio-colors [data-color="#f9dc97"] { --swatch: #f9dc97; }
.studio-colors [data-color="#ff91a7"] { --swatch: #ff91a7; }
.studio-colors [data-color="#a9c9ff"] { --swatch: #a9c9ff; }
.studio-colors > button[aria-pressed="true"]::before { outline: 2px solid var(--accent); outline-offset: 3px; }
.studio-custom-color { position: relative; display: flex; align-items: center; justify-content: center; width: 34px; height: 34px; border: 1px solid var(--text-muted); border-radius: 50%; overflow: hidden; }
.studio-custom-color svg { width: 15px; height: 15px; pointer-events: none; }
.studio-looks { display: flex; gap: 10px; overflow-x: auto; padding: 3px 2px 10px; scrollbar-width: thin; }
.studio-look { display: flex; flex-direction: column; align-items: center; gap: 8px; width: 65px; flex: none; padding: 0 0 5px; border: 0; background: transparent; color: var(--text-secondary) !important; font-size: 11px !important; }
.studio-look canvas { display: block; width: 65px; height: 75px; object-fit: cover; border: 2px solid transparent; border-radius: 7px; }
.studio-look[aria-pressed="true"] { color: var(--accent) !important; }
.studio-look[aria-pressed="true"] canvas { border-color: var(--accent); }
.studio-audio-heading { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.studio-audio-heading > span { flex: 1; }
.studio-audio-heading svg { width: 17px; height: 17px; }
.studio-small-button { min-height: 36px; padding: 5px 10px; border: 0; border-radius: 6px; background: transparent; color: var(--text-secondary) !important; font-size: 11px !important; }
.studio-audio-picker { position: relative; display: flex; align-items: center; gap: 10px; width: 100%; min-height: 54px; padding: 10px 12px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface-soft); overflow: hidden; }
.studio-audio-picker span { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 12px; }
.studio-audio-picker svg:last-of-type { width: 16px; height: 16px; }
.studio-note { color: var(--text-secondary); font-size: 11px; }
.studio-error { position: absolute; bottom: 91px; left: 16px; right: 16px; z-index: 8; margin: 0; max-height: 100px; overflow: auto; padding: 12px 14px; border: 1px solid var(--danger); border-radius: 8px; background: var(--danger-panel-bg); color: var(--danger-text); font-size: 12px; }
.studio-export-state { position: absolute; inset: 0; z-index: 10; display: grid; place-items: center; padding: 24px; background: rgba(11, 11, 13, 0.94); }
.studio-export-card { width: min(100%, 330px); text-align: center; }
.studio-export-mark { display: inline-flex; align-items: center; justify-content: center; width: 56px; height: 56px; margin: 0 0 20px; border: 1px solid var(--accent); border-radius: 16px; background: var(--accent-soft); color: var(--accent); }
.studio-export-card h3 { margin: 0 0 20px; font-size: 18px; font-weight: 500; }
.studio-export-card output { display: block; margin: 0 0 12px; font-size: 36px; font-variant-numeric: tabular-nums; letter-spacing: -.05em; }
.studio-export-card progress { width: 100%; height: 5px; accent-color: var(--accent); }
.studio-export-card p { margin: 18px 0 24px; color: var(--text-muted); font-size: 12px; }
.studio-cancel-save { height: 42px; min-width: 100px; padding: 8px 20px; border: 1px solid var(--border-control); border-radius: 8px; background: transparent; font-size: 12px !important; }
@media (max-width: 700px) {
  .sheet-dialog.studio-dialog { width: 100%; height: 100dvh; max-width: 100%; max-height: 100dvh; margin: 0; border: 0; border-radius: 0; }
  .studio-dialog[open], .studio-dialog.tool-open { display: flex; flex-direction: column; }
  .studio-header { flex: none; height: calc(60px + env(safe-area-inset-top, 0px)); padding: calc(8px + env(safe-area-inset-top, 0px)) 12px 8px; }
  .studio-preview { flex: 1 1 0; padding: 8px 12px; }
  .studio-format-shortcut { top: 18px; right: 22px; }
  .studio-transport { flex: none; height: 48px; padding: 0 14px; }
  .studio-timeline { flex: none; min-height: 116px; padding: 0 14px 12px; }
  .studio-tools { flex: none; min-height: calc(82px + env(safe-area-inset-bottom, 0px)); padding: 9px 10px calc(10px + env(safe-area-inset-bottom, 0px)); }
  .studio-drawer { flex: none; max-height: min(290px, 40dvh); border-left: 0; border-top: 1px solid var(--border-strong); border-radius: 14px 14px 0 0; }
  .studio-drawer-header { min-height: 60px; padding: 8px 18px; }
  .studio-drawer-body { padding: 12px 18px 14px; }
  .studio-formats { gap: 8px; }
  .studio-formats button { min-height: 68px; }
  .studio-looks { gap: 12px; }
  .studio-look, .studio-look canvas { width: 62px; }
  .studio-history .studio-icon { width: 40px; min-width: 40px; }
  .studio-error, .studio-status { bottom: calc(91px + env(safe-area-inset-bottom, 0px)); }
  .studio-dialog .studio-inline-field select { font-size: 16px; min-width: 88px; }
  .studio-dialog.tool-open .studio-timeline { display: none; }
  .studio-dialog[data-tool="trim"] .studio-timeline { display: grid; min-height: 40px; padding-bottom: 0; }
  .studio-dialog[data-tool="trim"] :is(#studio-clips, #studio-audio-track, .studio-add-clip, .studio-timeline-side) { display: none; }
  .studio-check-row { flex-direction: column; gap: 0; }
  .studio-dialog[data-tool="trim"] .studio-timeline { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 700px) and (max-height: 650px) {
  .studio-dialog.tool-open .studio-timeline { display: none; }
  .studio-drawer { max-height: 48dvh; }
  .studio-tools { min-height: 66px; padding-top: 4px; padding-bottom: calc(4px + env(safe-area-inset-bottom, 0px)); }
  .studio-tool { gap: 3px; }
}
@media (max-width: 600px) {
  .sheet-dialog.composer-dialog { width: 100%; max-width: 100%; height: 100dvh; max-height: 100dvh; margin: 0; border-radius: 0; border: 0; }
  .composer-dialog .dialog-header { padding: calc(10px + env(safe-area-inset-top, 0px)) 12px 10px; }
  .composer-dialog .composer-scroll { padding: 12px 16px calc(22px + env(safe-area-inset-bottom, 0px)); }
  .composer-media-intro { padding: 28px 0 12px; }
  .composer-media-intro h3 { font-size: 23px; }
}
