/* Local style editing complements the existing generation workbench. */
.studio-shell { grid-template-columns: minmax(0,3fr) minmax(0,7fr); height: calc(100dvh - 64px); gap: 16px; padding: 16px 20px; }
.creator-panel, .preview-panel { height: 100%; min-height: 0; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #41414a transparent; }
.creator-panel { padding: 20px; overflow: hidden; }
.creator-scroll { min-height: 0; overflow-y: auto; flex: 1; padding-right: 5px; scrollbar-width: thin; scrollbar-color: #41414a transparent; }
.creator-topline h1 { font-size: 20px; letter-spacing: -.5px; }
.mode-tabs { grid-template-columns: 1fr 1fr; margin: 0 0 16px; }
.mode-tab { padding: 10px 5px; font-size: 12px; }
.media-input { height: 150px; }
.quick-library { display: none; }
.quick-templates { gap: 6px; }
.input-note { line-height: 1.6; }
.creator-settings { margin-top: 8px; flex-shrink: 0; }
.creator-settings .generate-button { margin: 0; }
.meme-settings { border-top: 1px solid var(--control-line); padding-top: 16px; margin-top: 1px; }
.meme-settings .section-topline h2 { font-size: 13px; color: var(--ink); }
.style-header-actions { display: flex; align-items: center; gap: 14px; }
#jump-to-edit { display: none; }
.style-presets { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 9px; margin: 12px 0 17px; }
.style-preset { min-width: 0; padding: 0; border: 0; background: none; text-align: center; font-size: 10px; color: var(--muted); }
.style-preset > span:last-child { display: block; margin-top: 6px; }
.style-swatch { display: grid; place-items: center; aspect-ratio: 1.3; border: 2px solid transparent; border-radius: 7px; background-size: cover; background-position: 50% 35%; overflow: hidden; }
.swatch-rainbow { background-image: linear-gradient(120deg,#f52f926e,#28f5a466,#f3ff235e),url('./assets/generator/cat-character-stage.png'); }
.swatch-acid { background-image: linear-gradient(135deg,#e1ff00aa,#37ff0777),url('./assets/generator/cat-character-stage.png'); }
.swatch-night { background-image: linear-gradient(135deg,#1322e099,#f00d8988),url('./assets/generator/cat-character-stage.png'); }
.swatch-clean { background-image: url('./assets/generator/cat-character-stage.png'); }
.style-preset:hover .style-swatch { border-color: #77737b; }
.style-preset.is-selected { color: var(--green); }
.style-preset.is-selected .style-swatch { border-color: var(--green); box-shadow: 0 0 0 2px #2ee59d18; }
.caption-label { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 7px; font-size: 11px; }
.caption-label > span { font-size: 9px; color: var(--muted); }
.meme-caption-input, #meme-scene { width: 100%; padding: 10px 11px; border: 1px solid var(--line); background: var(--paper); color: var(--ink); border-radius: 6px; font-size: 12px; }
.caption-suggestions { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.caption-suggestions button { padding: 3px 6px; border: 1px solid var(--control-line); border-radius: 4px; background: none; color: var(--muted); font-size: 9px; }
.caption-suggestions button:hover { color: var(--ink); border-color: var(--muted); }
.remix-details { margin-top: 9px; font-size: 11px; }
.remix-details summary, .generation-details > summary { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 7px 0; list-style: none; cursor: pointer; color: var(--muted); }
.remix-details summary::-webkit-details-marker, .generation-details > summary::-webkit-details-marker { display: none; }
.remix-details[open] summary { margin-bottom: 9px; }
.remix-details[open] summary > span, .generation-details[open] > summary > span { transform: rotate(45deg); }
.remix-details .field-label { font-size: 11px; display: flex; justify-content: space-between; }
.remix-details output { font-size: 10px; color: var(--muted); }
.advanced-edit { margin-top: 8px; border-top: 1px solid var(--control-line); }
.advanced-edit > summary { font-size: 12px; min-height: 32px; }
.advanced-edit .caption-suggestions { margin: 0 0 16px; }
.scene-setting { border-top: 1px solid var(--control-line); padding-top: 14px; margin-top: 12px; }
.save-edit-settings { margin: 14px 0 8px; font-size: 11px; }
input[type=range] { accent-color: var(--green); cursor: pointer; }
#meme-intensity { width: 100%; height: 14px; margin: 3px 0 10px; }
.remix-option-row, .remix-check { display: flex; justify-content: space-between; align-items: center; min-height: 33px; gap: 10px; color: var(--soft); }
.position-picker { display: flex; padding: 2px; background: var(--paper); border-radius: 5px; }
.position-picker button { padding: 3px 8px; border: 0; background: transparent; color: var(--muted); border-radius: 4px; font-size: 9px; }
.position-picker .is-selected { background: var(--surface-raised); color: var(--ink); }
.remix-check input { accent-color: var(--green); width: 15px; height: 15px; }
.scene-setting p { color: var(--muted); font-size: 10px; margin-top: 6px; }
.clip-panel { margin-bottom: 18px; }
.clip-upload { display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 9px; width: 100%; min-height: 170px; padding: 20px; border: 1px dashed var(--line); border-radius: 8px; background: var(--paper); }
.clip-upload .icon { width: 25px; height: 25px; color: var(--green); }
.clip-upload strong { font-size: 13px; font-weight: 500; }
.clip-upload > span, .clip-file-name { color: var(--muted); font-size: 10px; }
.clip-upload:hover, .clip-upload.is-dragover { border-color: var(--green); background: var(--accent-wash); }
.clip-file-name { margin-top: 8px; overflow-wrap: anywhere; }
body.is-clip .creator-inputs, body.is-clip .quick-library, body.is-clip .prompt-panel, body.is-clip .creator-settings, body.is-clip .plan-settings, body.is-clip .scene-setting, body.is-clip .mobile-action-bar { display: none !important; }
body.is-clip .meme-settings { margin-top: 0; }
.preview-toolbar { padding: 20px 24px 16px; }
.preview-toolbar h2 { font: 600 14px var(--body-font); margin: 0; }
.stage-tabs { padding: 0; background: transparent; }
.stage-tab { font-size: 10px; }
.stage-tab.is-active { background: var(--surface-raised); }
.meme-workspace { display: flex; align-items: center; flex-direction: column; padding: 8px 24px 24px; flex: 1; }
.meme-workspace-heading { text-align: center; margin-bottom: 13px; }
.meme-workspace-heading .eyebrow { font-size: 8px; letter-spacing: 2px; }
.meme-workspace-heading h2 { font-family: var(--body-font); font-size: clamp(24px,2.8vw,38px); letter-spacing: -1.3px; font-weight: 750; margin: 4px 0 6px; line-height: 1.25; }
.meme-workspace-heading p { font-size: 11px; color: var(--muted); }
.meme-player-shell { width: min(100%,320px); border-radius: 10px; border: 1px solid #f7f1e32b; overflow: hidden; background: #08080b; box-shadow: 0 18px 45px #0004; }
.meme-player-topline { display: flex; justify-content: space-between; gap: 10px; padding: 10px 12px; font-size: 8px; letter-spacing: .7px; color: var(--muted); border-bottom: 1px solid #ffffff14; }
.preview-live-dot { color: var(--green); white-space: nowrap; }
.preview-live-dot::before { content: ''; display: inline-block; width: 4px; height: 4px; border-radius: 50%; background: currentColor; margin-right: 6px; vertical-align: middle; }
.meme-canvas-wrap { position: relative; height: clamp(260px,47dvh,480px); display: flex; justify-content: center; background: #08080b; overflow: hidden; }
#meme-canvas { display: block; height: 100%; width: auto; max-width: 100%; object-fit: contain; }
.canvas-play { position: absolute; left: calc(50% - 23px); top: calc(50% - 23px); width: 46px; height: 46px; display: grid; place-items: center; border: 1px solid #ffffff80; border-radius: 50%; background: #0b0b0f99; backdrop-filter: blur(6px); color: white; }
.canvas-play .icon { width: 21px; height: 21px; margin-left: 3px; }
.canvas-play:hover { background: #ffffff40; }
.before-label { position: absolute; top: 12px; left: 12px; padding: 3px 7px; border-radius: 4px; background: #0009; color: white; font-size: 9px; }
.meme-playback { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-top: 1px solid #ffffff14; }
.meme-playback .icon-button { width: 25px; height: 25px; flex-basis: 25px; border: 0; }
#meme-seek { width: 100%; min-width: 30px; height: 12px; }
#meme-time { color: var(--muted); font-size: 9px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.before-button { background: transparent; border: 1px solid #ffffff25; padding: 4px 7px; border-radius: 4px; color: var(--muted); font-size: 9px; }
.before-button[aria-pressed=true] { border-color: var(--green); color: var(--green); }
.edit-summary { display: flex; gap: 8px; align-items: center; justify-content: center; margin-top: 14px; max-width: 100%; font-size: 10px; color: var(--soft); }
.edit-summary span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 200px; }
.edit-summary span + span::before { content: '·'; color: #747078; padding-right: 8px; }
.meme-preview-note { max-width: 450px; margin-top: 8px; color: var(--muted); font-size: 10px; text-align: center; line-height: 1.6; }
.meme-export-row { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 14px; margin-top: 18px; }
.meme-export-row .button { min-height: 44px; min-width: 230px; font-size: 13px; }
.download-icon { transform: rotate(180deg); }
.meme-export-row #download-result { margin: 0; font-size: 11px; }
body.is-clip #download-result { display: none; }
.meme-export-row .text-button { font-size: 10px; }
.export-progress { font-size: 11px; color: var(--green); margin-top: 10px; max-width: 450px; text-align: center; }
.export-file-link { font-size: 11px; color: var(--green); margin-top: 8px; text-decoration: underline; text-underline-offset: 4px; }
#meme-exported-preview { max-height: 180px; max-width: 300px; margin-top: 12px; border-radius: 6px; background: #09090d; }
.generation-details { border-top: 1px solid var(--control-line); margin: 0 20px; }
.generation-details > summary { font-size: 10px; min-height: 40px; }
.generation-details > .stage-tabs { display: flex; margin: 8px 0 0; width: fit-content; }
.generation-details .stage-content { margin: 0; padding: 20px 10px 30px; }
.generation-details .stage-heading h2 { font-size: 22px; }
.generation-details .stage-heading { margin-bottom: 20px; }
.generation-details .demo-media, .generation-details .plan-preview { max-height: 330px; }
.review-remix-summary { margin: 15px 0 0; font-size: 11px; line-height: 1.7; color: var(--soft); }
body.is-clip .generation-details, body.is-clip .preview-toolbar .stage-tabs { display: none; }
.preview-footer { flex-shrink: 0; }
body.is-recording .meme-settings, body.is-recording .mode-tabs, body.is-recording .creator-inputs, body.is-recording .quick-library, body.is-recording .clip-panel { pointer-events: none; opacity: .55; }
body.is-recording .canvas-play { display: none; }
@media (min-width:1700px) { .media-input { height: 165px; } }
@media (min-width:901px) {
  .creator-settings { padding-top: 12px; border-top: 1px solid var(--control-line); }
}
@media (min-width:901px) and (max-width:1450px) {
  .mode-tab { padding-inline: 3px; font-size: 11px; }
}
@media (max-width:1180px) { .studio-shell { padding: 14px; } .creator-panel { padding: 17px; } .meme-workspace { padding-inline: 20px; } }
@media (min-width:901px) and (max-height:820px) {
  .mode-tabs { margin: 0 0 12px; }
  .media-input { height: 110px; }
  .input-caption { bottom: 45px; left: 8px; right: 8px; }
  .input-caption strong { font-size: 10px; }
  .input-caption p { display: none; }
  .tile-action { left: 8px; right: 8px; bottom: 8px; min-height: 28px; }
  .input-upload { margin-top: 5px; }
  .meme-settings { padding-top: 11px; }
  .style-presets { margin-top: 9px; margin-bottom: 9px; }
  .style-swatch { aspect-ratio: 2.3; }
  .meme-canvas-wrap { height: clamp(260px,45dvh,365px); }
  .meme-workspace-heading h2 { font-size: 29px; }
  .meme-workspace-heading { margin-bottom: 10px; }
}
@media (max-width:900px) {
  .studio-shell { display: flex; flex-direction: column; height: auto; padding: 14px; }
  .creator-panel, .preview-panel { height: auto; overflow: visible; }
  .creator-panel { min-height: 0; padding: 20px; }
  .creator-scroll { overflow: visible; padding-right: 0; flex: initial; }
  #jump-to-edit { display: inline-block; color: var(--green); }
  .creator-inputs { gap: 14px; }
  .media-input { height: 170px; }
  .style-presets { max-width: 450px; }
  .style-swatch { aspect-ratio: 1.8; }
  .caption-suggestions button { font-size: 11px; padding: 4px 8px; }
  .meme-settings { margin-top: 0; }
  .plan-settings { display: block; }
  .extra-settings { padding-top: 0; margin-top: 6px; }
  .meme-workspace { padding: 18px 20px 28px; }
  .meme-workspace-heading h2 { font-size: 29px; }
  .meme-canvas-wrap { height: 420px; }
  .meme-settings .remix-check { min-height: 37px; }
  .position-picker button { padding: 5px 10px; }
  .stage-status { display: flex; }
  .mobile-action-bar { z-index: 20; }
}
@media (max-width:540px) {
  .studio-shell { padding: 10px; gap: 12px; }
  .creator-panel { padding: 16px; }
  .creator-topline h1 { font-size: 19px; }
  .mode-tab { min-height: 36px; font-size: 12px; }
  .media-input { height: 165px; }
  .meme-caption-input, #meme-scene { font-size: 16px; }
  .caption-label { font-size: 12px; }
  .style-preset { font-size: 11px; }
  .meme-workspace { padding: 19px 14px 23px; }
  .meme-workspace-heading h2 { font-size: 25px; letter-spacing: -.8px; }
  .meme-workspace-heading p { font-size: 10px; max-width: 270px; margin: auto; }
  .meme-player-topline { font-size: 7px; padding: 9px; }
  .meme-canvas-wrap { height: 390px; }
  .meme-playback { gap: 7px; padding: 9px; }
  .meme-export-row { gap: 13px; }
  .generation-details { margin: 0 14px; }
  .edit-summary { font-size: 9px; gap: 5px; }
  .edit-summary span { max-width: 135px; }
  .meme-preview-note { font-size: 9px; }
}
