/* Creative tools are focused workspaces, opened from the selected block. */
.builder-workspace .creative-launch{display:flex;align-items:center;gap:10px;text-align:left;padding:12px;min-height:64px;background:#f1f7ff;border-color:#b8d2f4}
.builder-workspace .creative-launch>span{flex:1;min-width:0}
.creative-launch strong,.creative-launch small{display:block}
.creative-launch small{font-size:13px;font-weight:500;color:#526e86;line-height:1.4;margin-top:3px}
.creative-launch>.ui-icon:first-child{color:#426bff;width:24px;height:24px;flex-shrink:0}
.creative-hidden-option{display:flex;align-items:flex-start;gap:9px;font-size:14px;line-height:1.5;margin:16px 0 7px}
.creative-hidden-option input{accent-color:#426bff;width:18px;height:18px;flex:none;margin-top:2px}
.creative-action-summary{padding:12px;border-radius:8px;background:#edf4ff;font-size:15px;line-height:1.5}
.inspector-block-actions .save-to-backpack{grid-column:1/-1}
.creative-rocode-info{padding:14px;border:1px solid #c9def0;border-radius:8px;background:#f1f8ff;margin-bottom:14px;font-size:15px;line-height:1.5}.creative-rocode-info p{font-size:13px;color:#526e86;margin:6px 0 0}
.builder-workspace .jr-block[data-starts-hidden=true]{outline:1px dashed #829bb1;outline-offset:3px}
.builder-workspace .jr-block[data-starts-hidden=true]:before{content:'Starts hidden on your site';display:block;font:600 11px/1.4 var(--rocode-font-family,Pretendard,Arial,sans-serif);color:#54718a;background:#edf4ff;padding:3px 6px;margin-bottom:4px;border-radius:4px;width:max-content;max-width:100%}
dialog.creative-dialog{width:min(760px,calc(100vw - 28px));max-width:none;max-height:calc(100dvh - 28px);padding:0;overflow:auto;border:1px solid #c7d3dd;border-radius:18px;background:#fff;box-shadow:0 24px 80px #142d4733;color:#203b59;font-size:16px}
.creative-dialog::backdrop{background:#182d4580;backdrop-filter:blur(3px)}
.creative-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:20px;padding:22px 24px;border-bottom:1px solid #d4e3ef;background:#f0f8ff}
.creative-heading>div{min-width:0}
.creative-heading p{font-size:11px;letter-spacing:1px;font-weight:750;color:#426989;margin:0 0 5px}
.creative-heading h2{font-size:26px;line-height:1.25;letter-spacing:-.5px;margin:0 0 7px}
.creative-heading span{display:block;color:#526e86;font-size:15px;line-height:1.5}
.creative-dialog button{border:1px solid #bdd2e6;background:white;border-radius:7px;padding:9px 14px;min-height:44px;color:#2f5478;font-weight:650;display:inline-flex;gap:8px;align-items:center;justify-content:center;cursor:pointer;transition:background-color .16s,border-color .16s}
.creative-dialog button:hover:not(:disabled){background:#eaf4ff;border-color:#7eacec}
.creative-dialog button:disabled{opacity:.45;cursor:default}
.creative-dialog button.primary{background:#426bff;color:#fff;border-color:#426bff}
.creative-dialog button.primary:hover{background:#315bea}
.creative-dialog .creative-heading>button{width:44px;flex:none;padding:10px;background:#fff9}
.creative-dialog .ui-icon{width:19px;height:19px;flex:none}
.creative-body{padding:22px 24px}
.creative-footer{position:sticky;bottom:0;display:flex;gap:16px;align-items:center;justify-content:space-between;padding:16px 24px;background:#fff;border-top:1px solid #d4e3ef;z-index:3}
.creative-footer>div{display:flex;gap:8px;flex:none}
.creative-status{font-size:13px;line-height:1.5;color:#49657d;margin:0;min-width:0}
.creative-dialog :is(input:not([type=checkbox]),select,textarea){min-width:0;display:block;width:100%;padding:10px 11px;border:1px solid #aec8df;border-radius:6px;min-height:44px;margin-top:6px;color:#244766;background:white;font:inherit;line-height:1.4}
.creative-dialog input[type=checkbox]{accent-color:#426bff;width:20px;height:20px;flex:none;margin:0}
.creative-dialog label{font-size:14px;font-weight:650;line-height:1.5;min-width:0}
.creative-dialog .sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}
.creative-dialog :is(button,input,select,textarea,summary):focus-visible{outline:3px solid #426bff;outline-offset:3px}
.creative-dialog .creative-hint{font-size:13px;font-weight:400;line-height:1.55;margin:10px 0;color:#526e86}
.creative-dialog .creative-empty{min-height:140px;display:flex;flex-direction:column;justify-content:center;align-items:center;gap:9px;border:1px dashed #acc7e0;border-radius:10px;padding:20px;background:#f7fbff;text-align:center}
.creative-empty>.ui-icon{width:32px;height:32px;color:#426bff}.creative-empty p{font-size:14px;line-height:1.5;margin:0;color:#526e86}
.creative-add-row{display:flex;align-items:center;gap:14px;justify-content:space-between;margin:16px 0}.creative-add-row>span{font-size:12px;color:#5d7488}
.creative-item-controls{display:flex;gap:3px;align-items:center;flex:none}.creative-dialog .creative-item-controls button{width:36px;min-height:36px;padding:7px;border-color:transparent;background:transparent}.creative-dialog .creative-item-controls button:last-child{color:#a64d5a}
.creative-item-heading{display:flex;gap:10px;align-items:center}.creative-step-number{display:grid;place-items:center;width:30px;height:30px;flex:none;background:#426bff;color:white;border-radius:6px;font-size:14px;font-weight:750}.creative-step-type{flex:1}.creative-step-type select{margin-top:0}
.behavior-trigger{display:flex;align-items:center;gap:12px;padding:14px 16px;border:1px solid #c9e8dd;border-radius:10px;background:#effaf4;font-size:15px;color:#246746}.behavior-trigger>.ui-icon{width:24px;height:24px}
.behavior-steps{list-style:none;padding:0;margin:18px 0;display:flex;flex-direction:column;gap:12px}.behavior-step{padding:14px;border:1px solid #d5e2ee;border-left:4px solid #b956f4;border-radius:9px;background:#fff}.behavior-step:nth-child(3n+2){border-left-color:#ffaf00}.behavior-step:nth-child(3n+3){border-left-color:#05b7d4}.behavior-step-fields{margin:14px 0 0 40px;display:grid;grid-template-columns:minmax(0,1fr);gap:10px}.behavior-step-fields .creative-hint{margin:0}.creative-dialog .creative-media-choice{justify-content:flex-start;min-width:0;text-align:left;background:#f6fbff;width:100%}.creative-media-choice>img{width:40px;height:40px;object-fit:contain}.creative-media-choice>span{flex:1;overflow-wrap:anywhere}
.creative-preview{border-top:1px solid #d5e2ee;padding-top:16px;margin-top:22px}.creative-preview summary{cursor:pointer;font-weight:650;font-size:15px;padding:8px 0}.creative-preview p{font-size:14px;line-height:1.6;color:#526e86}.creative-preview-frame{margin-top:14px;border:1px solid #c5d8ea;border-radius:8px;overflow:hidden}.creative-preview-frame iframe{display:block;width:100%;height:360px;border:0;background:white}
.creative-tabs{display:flex;gap:0;max-width:320px;border:1px solid #9ebaff;border-radius:7px;overflow:hidden}.creative-dialog .creative-tabs button{flex:1;border:0;border-radius:0;white-space:nowrap}.creative-dialog .creative-tabs button[aria-selected=true]{background:#426bff;color:white}
.animation-draft-history{display:flex;gap:6px;justify-content:flex-end;margin:12px 0}.creative-dialog .animation-draft-history button{min-height:36px;padding:6px 10px;font-size:13px}.creative-enable{display:flex;align-items:center;gap:10px;padding:13px 14px;background:#f1f7ff;border:1px solid #c7ddf0;border-radius:8px;font-size:15px!important}
.animation-path-stage{position:relative;aspect-ratio:4/3;max-height:310px;border:1px solid #c5d8ea;border-radius:10px;background:radial-gradient(#d6e8f5 1px,transparent 1px) 0 0/12px 12px,#f2faff;overflow:hidden;padding:32px 36px;margin:15px 0 12px}.animation-path-space{position:relative;width:100%;height:100%}.animation-route{position:absolute;inset:0;width:100%;height:100%;overflow:visible;pointer-events:none}.animation-route polyline{fill:none;stroke:#a476e7;stroke-width:2;vector-effect:non-scaling-stroke;stroke-dasharray:5 5}
.creative-dialog button.animation-waypoint{position:absolute;transform:translate(-50%,-50%);width:56px;min-height:44px;padding:7px 4px;border:2px solid #a078dc;background:#fff;color:#6c36a6;box-shadow:0 2px 6px #2447661a;touch-action:none;user-select:none;cursor:grab;font-size:12px;font-weight:750}.creative-dialog button.animation-waypoint[aria-pressed=true]{background:#8d4de0;border-color:#8d4de0;color:white}.creative-dialog button.animation-waypoint:active{cursor:grabbing;transform:translate(-50%,-50%)}
.animation-points{display:flex;flex-direction:column;gap:5px}.animation-point-row{display:flex;gap:8px;align-items:center}.animation-point-row>[data-select-waypoint]{flex:1;justify-content:space-between;font-size:14px;background:#f8fbfe}.animation-point-row>[data-select-waypoint][aria-pressed=true]{border-color:#9b77e6;background:#f7f0ff}.animation-point-row small{font-size:12px;font-weight:500;color:#617a90}
.animation-position{display:grid;grid-template-columns:1fr 1fr;gap:14px;min-width:0;border:1px solid #d5e2ee;border-radius:8px;padding:12px 14px;margin:16px 0}.animation-position legend{font-size:14px;font-weight:650;padding:0 6px}.animation-options{display:grid;grid-template-columns:1fr 1fr;gap:14px;margin:16px 0}
.animation-frames{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;padding:0;list-style:none;margin:16px 0}.animation-frame{border:1px solid #d2e1ee;border-radius:9px;padding:6px;background:#f8fcff}.animation-frame>[data-animation-frame]{display:flex;flex-direction:column;gap:6px;width:100%;min-width:0;border:0;background:none;padding:8px}.animation-frame img{height:76px;object-fit:contain;max-width:100%}.animation-frame span{font-size:13px}.animation-frame small{font-size:11px;line-height:1.4;font-weight:500;color:#597289;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.animation-frame>.creative-item-controls{justify-content:center;border-top:1px solid #d2e1ee;padding-top:3px}
.animation-preview-section{border-top:1px solid #d5e2ee;margin-top:22px;padding-top:16px}.creative-preview-heading{display:flex;align-items:center;gap:8px}.creative-preview-heading h3{font-size:16px;margin:0;flex:1}.animation-preview-stage{position:relative;aspect-ratio:4/3;border:1px solid #d2e1ee;border-radius:9px;margin-top:13px;overflow:hidden;background:#f5fbff;max-height:300px}.animation-preview-character{position:absolute;left:0;top:0;width:35%;height:35%;object-fit:contain;pointer-events:none}
@media(max-width:560px){.creative-heading,.creative-body{padding:18px}.creative-heading h2{font-size:23px}.creative-footer{padding:14px 18px;align-items:stretch;flex-direction:column;gap:8px}.creative-footer>div{justify-content:flex-end}.creative-item-heading{flex-wrap:wrap}.creative-step-type{flex-basis:calc(100% - 42px)}.behavior-step .creative-item-controls{margin-left:40px}.behavior-step-fields{margin-left:0}.animation-frames{grid-template-columns:repeat(2,minmax(0,1fr))}.animation-position,.animation-options{gap:10px}.creative-preview-heading{flex-wrap:wrap}.creative-preview-heading h3{flex-basis:100%}.animation-point-row small{font-size:11px}.animation-path-stage{padding:30px;max-height:240px}.creative-dialog button.animation-waypoint{width:48px}.creative-dialog .creative-item-controls button{width:34px;padding:6px}.animation-point-row>.creative-item-controls{gap:0}}
@media(pointer:coarse){.creative-dialog .creative-item-controls button{width:44px;min-height:44px;padding:10px}}
@media(max-width:380px){.animation-frames{grid-template-columns:1fr}.animation-point-row{flex-wrap:wrap}.animation-point-row>[data-select-waypoint]{flex-basis:100%}.animation-point-row>.creative-item-controls{margin-left:auto}.animation-position,.animation-options{grid-template-columns:1fr}}
@media(prefers-reduced-motion:reduce){.creative-dialog *{scroll-behavior:auto!important;transition:none!important}}

/* Keep the work and its result together, with actions outside the scroll area. */
dialog.animation-studio[open]{display:flex;flex-direction:column;height:min(860px,calc(100dvh - 28px));overflow:hidden}
.animation-studio>.creative-heading,.animation-studio>.creative-footer{flex:none}
.animation-studio>.creative-body{flex:1;min-height:0;overflow:auto;overscroll-behavior:contain;scroll-padding-block:16px}
.animation-studio>.creative-footer{position:relative;bottom:auto}
.animation-studio .animation-path-stage{width:100%;height:clamp(190px,32dvh,280px);aspect-ratio:auto;max-height:none}
@media(min-width:840px){
  dialog.animation-studio{width:min(860px,calc(100vw - 28px))}
  .animation-studio>.creative-heading{padding:18px 22px}
  .animation-studio>.creative-body{display:grid;grid-template-columns:minmax(0,1.2fr) minmax(0,1fr);grid-template-rows:auto 1fr;gap:18px 24px;padding:18px 22px;align-items:start}
  .animation-studio .creative-tabs{grid-column:1;grid-row:1;max-width:none}
  .animation-studio .animation-draft-history{grid-column:2;grid-row:1;margin:0;align-self:center}
  .animation-studio .creative-body>[role=tabpanel]{grid-column:1;grid-row:2;min-width:0}
  .animation-studio .animation-preview-section{grid-column:2;grid-row:2;position:sticky;top:0;align-self:start;border:1px solid #d2e1ee;border-radius:10px;background:#f8fcff;margin:0;padding:14px;min-width:0}
  .animation-studio .creative-preview-heading{display:grid;grid-template-columns:1fr 1fr;gap:8px}
  .animation-studio .creative-preview-heading h3{grid-column:1/-1;font-size:15px}
  .animation-studio .animation-preview-stage{width:100%;aspect-ratio:4/3;max-height:none;margin-top:12px}
  .animation-studio .animation-preview-section>.creative-hint{font-size:12px;margin-bottom:0}
  .animation-studio .animation-frames{grid-template-columns:repeat(2,minmax(0,1fr))}
}
