
    /* Unslop Graphite Neutral Ramp & Tokens (by Damir Sokolovsky, CC BY 4.0) */
    :root {
      --bg-deep: #0f0f10;
      --background: #141415;
      --card: #19191b;
      --raised: #232325;
      --border: rgba(237, 237, 237, 0.08);
      --border-strong: rgba(237, 237, 237, 0.14);
      --foreground: #ededed;
      --secondary-foreground: #a1a1a6;
      --muted-foreground: #9b9ba1;
      --primary: #ededed;
      --primary-foreground: #141415;
      --secondary: #232325;
      --muted: #19191b;
      --semantic-positive: #4cc38a;
      --semantic-warning: #d97706;
      --semantic-negative: #e5484d;
      --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
    }
    body {
      background-color: var(--background);
      color: var(--foreground);
      font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
      font-weight: 400;
      letter-spacing: 0;
      font-variant-numeric: tabular-nums;
    }
    .font-mono {
      font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
      font-variant-numeric: tabular-nums;
    }
    .studio-card {
      background-color: var(--card);
      border: 1px solid var(--border);
      border-radius: 16px;
    }
    .studio-sub {
      background-color: var(--bg-deep);
      border: 1px solid var(--border);
      border-radius: 12px;
    }
    .studio-input {
      background-color: var(--raised);
      border: 1px solid var(--border);
      border-radius: 8px;
      color: var(--foreground);
      transition: border-color 150ms var(--ease-out), background-color 150ms var(--ease-out);
    }
    .studio-input::placeholder {
      color: var(--muted-foreground);
    }
    .studio-input:focus {
      outline: none;
      border-color: rgba(237, 237, 237, 0.32);
      background-color: #28282b;
    }
    .btn-primary, .btn-secondary, .studio-tab {
      white-space: nowrap;
    }
    .btn-primary {
      background-color: var(--primary);
      color: var(--primary-foreground);
      border-radius: 8px;
      font-weight: 500;
      box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
      transition: background-color 150ms var(--ease-out), transform 120ms var(--ease-out);
    }
    .btn-primary:hover {
      background-color: #dcdce0;
    }
    .btn-primary:active {
      transform: scale(0.98);
    }
    .btn-secondary {
      background-color: var(--raised);
      color: var(--foreground);
      border: 1px solid var(--border);
      border-radius: 8px;
      font-weight: 500;
      box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
      transition: background-color 150ms var(--ease-out), border-color 150ms var(--ease-out), transform 120ms var(--ease-out);
    }
    .btn-secondary:hover {
      background-color: #2b2b2e;
      border-color: var(--border-strong);
    }
    .btn-secondary:active {
      transform: scale(0.98);
    }
    .monitor-frame {
      background-color: var(--bg-deep);
      border: 1px solid var(--border-strong);
      border-radius: 20px;
    }
    .tag-chip {
      background-color: var(--raised);
      border: 1px solid var(--border);
      border-radius: 6px;
      color: var(--secondary-foreground);
    }
    .studio-tablist {
      display: grid;
      grid-template-columns: repeat(6, minmax(0, 1fr)); /* 주제·대본·사진·사운드·명함·발행 한 줄 */
      gap: 4px;
      padding: 4px;
      background-color: var(--bg-deep);
      border: 1px solid var(--border);
      border-radius: 10px;
    }
    .studio-tab {
      height: 34px;
      border-radius: 7px;
      font-size: 13px;
      white-space: nowrap;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 6px;
      transition: background-color 150ms var(--ease-out), color 150ms var(--ease-out);
    }
    .studio-tab:focus-visible {
      outline: 2px solid rgba(237, 237, 237, 0.5);
      outline-offset: 1px;
    }
    details.fold > summary {
      cursor: pointer;
      list-style: none;
      user-select: none;
    }
    details.fold > summary::-webkit-details-marker {
      display: none;
    }
    details.fold > summary::after {
      content: "펼치기 ▾";
      font-size: 12px;
      color: var(--muted-foreground);
      margin-left: 8px;
      white-space: nowrap;
    }
    details.fold[open] > summary::after {
      content: "접기 ▴";
    }
    @media (max-width: 420px) {
      .studio-tab { font-size: 12px; gap: 3px; }
      .studio-tab > span { display: none; }
    }

    /* ===== 텍스트 정렬·줄바꿈 정리 & 모바일 반응형 가드 ===== */
    html, body {
      width: 100%;
      max-width: 100vw;
      overflow-x: clip;
    }
    /* 한글이 단어 중간에서 끊기지 않도록 (띄어쓰기 단위로만 줄바꿈) */
    body {
      word-break: keep-all;
      overflow-wrap: break-word;
    }
    h1, h2, h3, h4, summary { text-wrap: balance; }
    p, li { text-wrap: pretty; }
    .font-mono { word-break: break-all; overflow-wrap: anywhere; }

    /* 버튼: 글자가 테두리 밖으로 나가지 않게. 고정 높이 대신 최소 높이 + 내용에 맞춰 늘어남 */
    button, .btn-primary, .btn-secondary, label.btn-secondary {
      max-width: 100%;
      min-width: 0;
    }
    .btn-primary, .btn-secondary {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 6px;
      text-align: center;
      line-height: 1.3;
    }
    button.h-7, button.h-8, button.h-9, button.h-10, button.h-11, button.h-12,
    label.h-7, label.h-8, label.h-9, label.h-10 {
      height: auto !important;
      padding-top: 5px;
      padding-bottom: 5px;
      white-space: normal;
      text-wrap: balance;
    }
    button.h-7, label.h-7 { min-height: 28px; }
    button.h-8, label.h-8 { min-height: 32px; }
    button.h-9, label.h-9 { min-height: 36px; }
    button.h-10, label.h-10 { min-height: 40px; }
    button.h-11 { min-height: 44px; }
    button.h-12 { min-height: 48px; }
    .studio-tab { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    #customDurationInput { -moz-appearance: textfield; appearance: textfield; padding: 0 2px; }
    #customDurationInput::-webkit-inner-spin-button, #customDurationInput::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }

    /* 모달 모바일 반응형: 화면 폭 100vw를 절대 넘지 않게 */
    .fixed.inset-0 {
      max-width: 100vw;
      box-sizing: border-box;
    }
    :where(.fixed.inset-0) > div {
      max-width: min(100%, calc(100vw - 32px));
      margin-left: auto;
      margin-right: auto;
    }

    /* ===== 모달 공통 디자인 (모든 팝업 창이 같은 모양) ===== */
    .ar-modal {
      background: rgba(6, 6, 7, 0.74);
      -webkit-backdrop-filter: blur(6px);
      backdrop-filter: blur(6px);
      align-items: center;
      justify-content: center;
      padding: 16px;
      overflow-y: auto;
    }
    .ar-modal > .ar-modal-card {
      width: 100%;
      max-width: min(var(--mw, 480px), calc(100vw - 32px));
      max-height: calc(100vh - 32px);
      overflow-y: auto;
      background: var(--card);
      border: 1px solid var(--border-strong);
      border-radius: 16px;
      box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
      padding: 22px 22px 20px;
      animation: arModalIn 180ms var(--ease-out);
    }
    @keyframes arModalIn { from { opacity: 0; transform: translateY(8px) scale(0.985); } to { opacity: 1; transform: none; } }
    .ar-modal-head {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 12px;
      padding-bottom: 14px;
      border-bottom: 1px solid var(--border);
    }
    .ar-modal-head h3 { font-size: 16px !important; font-weight: 600 !important; color: var(--foreground); line-height: 1.35; margin-top: 0 !important; }
    .ar-modal-head p { font-size: 12px; margin-top: 3px; }
    .ar-modal-x {
      width: 32px; height: 32px; min-height: 32px !important; padding: 0 !important; flex: none;
      display: inline-flex; align-items: center; justify-content: center;
      border-radius: 8px; color: var(--secondary-foreground); background: transparent; border: 1px solid transparent; cursor: pointer;
      font-size: 18px; line-height: 1;
    }
    .ar-modal-x:hover { background: var(--raised); border-color: var(--border); color: var(--foreground); }
    .ar-modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding-top: 4px; }
    .ar-choice { border: 1px solid var(--border); background: var(--raised); color: #d4d4d8; border-radius: 10px; }
    .ar-choice:hover { border-color: var(--border-strong); }
    .ar-choice.on { border-color: #ededed; background: #2b2b2f; color: #fff; box-shadow: inset 0 0 0 1px #ededed; }

    /* 작은 배지/칩: 한 줄 유지, 넘치면 말줄임 */
    .tag-chip {
      display: inline-flex;
      align-items: center;
      max-width: 100%;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      vertical-align: middle;
    }

    /* 셀렉트·입력창: 글자가 칸을 넘으면 말줄임 */
    select.studio-input, input.studio-input {
      min-width: 0;
      max-width: 100%;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    select.studio-input {
      padding-right: 2rem !important;
    }

    /* flex 자식이 내용 때문에 부모 밖으로 밀려나지 않게 */
    .flex > *, .grid > * { min-width: 0; }
    .flex > .rounded-full, .flex > svg, .flex > img, .flex > input[type="checkbox"], .flex > input[type="radio"] { flex-shrink: 0; }

    /* 컷 편집: 완료 위치는 유지하고 도구만 가로로 스크롤 */
    #igTopBar { display: grid; gap: 6px; color: #ededed; }
    #igTopBar .ig-header-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 4px;
      border-radius: 10px;
      background: #19191b;
      pointer-events: auto;
    }
    #igTopBar .ig-header-actions { display: flex; gap: 4px; flex-shrink: 0; }
    #igToolRow {
      display: flex;
      gap: 4px;
      min-width: 0;
      overflow-x: auto;
      border-radius: 10px;
      background: #19191b;
    }
    #igTopBar button {
      display: flex;
      align-items: center;
      justify-content: center;
      flex: 0 0 auto;
      min-width: 40px;
      min-height: 40px;
      width: 40px;
      height: 40px;
      padding: 0;
      border: 0;
      border-radius: 8px;
      background: #232325;
      color: #ededed;
      font-family: inherit;
      cursor: pointer;
    }
    #igTopBar button:hover:not(:disabled) { background: #19191b; }
    #igTopBar button:focus-visible { outline: 2px solid #ededed; outline-offset: -3px; }
    #igTopBar button:disabled { opacity: .35; cursor: default; }
    #igTopBar #igDoneBtn { min-width: 44px; width: 44px; background: #ededed; color: #19191b; font-size: 12px; font-weight: 700; }
    /* 투명한 그리기 화면 뒤에 일반 도구·선택 바가 비치지 않게 */
    #igEditorHud:has(#igDrawOverlay:not(.hidden)) #igTopBar,
    #igEditorHud:has(#igDrawOverlay:not(.hidden)) #igSelectedBar { display: none; }
    @media (max-width: 1023px) {
      body.ar-cut-editing #mobileLiveDock { display: none; }
    }

    /* 모바일 실시간 라이브 스튜디오 도크 (메인 9:16 미리보기가 화면에서 사라질 때만 상단에 나타남) */
    #mobileLiveDock {
      display: none;
      backdrop-filter: blur(20px);
      -webkit-backdrop-filter: blur(20px);
    }
    @media (max-width: 1023px) {
      #mobileLiveDock.dock-fixed-mode {
        display: block;
        position: fixed;
        top: 8px;
        left: 12px;
        right: 12px;
        width: calc(100% - 24px);
        margin-left: auto;
        margin-right: auto;
        z-index: 50;
        box-shadow: 0 10px 30px rgba(0,0,0,0.85);
      }
      body.ar-cut-editing #mobileLiveDock.dock-fixed-mode { display: none; }
    }
    .theme-swatch-chip {
      transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
      cursor: pointer;
    }
    .theme-swatch-chip.active {
      transform: scale(1.08);
      box-shadow: 0 0 12px rgba(255, 255, 255, 0.4);
      border-color: #ffffff !important;
    }
    .story-arc-card {
      transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
      cursor: pointer;
    }
    .story-arc-card:hover {
      transform: translateY(-2px);
      border-color: rgba(255, 255, 255, 0.35);
    }
    .story-arc-card.active {
      border-color: var(--accent, #facc15) !important;
      background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02));
      box-shadow: 0 0 16px rgba(0, 0, 0, 0.4), inset 0 0 0 1.5px var(--accent, #facc15);
    }
    .storyboard-track-card {
      transition: all 0.15s ease;
      cursor: pointer;
    }
    .storyboard-track-card:hover {
      background: #232325;
    }
    .storyboard-track-card.active {
      border-color: #38bdf8 !important;
      background: #141f2e;
    }
    .killer-copy-chip {
      transition: all 0.15s ease;
      cursor: pointer;
    }
    .killer-copy-chip:hover {
      background: #27272a;
      border-color: #71717a;
      color: #ededed;
    }
  
    /* ★ 차종 프리셋 사이드바 (미리보기 위로 옆에서 밀려 나옴) */
    .preset-drawer { position: absolute; top: 0; bottom: 0; right: 0; width: 84%; z-index: 30; display: flex; flex-direction: column;
      background: rgba(14, 14, 16, 0.94); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
      border-left: 1px solid rgba(255,255,255,0.08); transform: translateX(104%); transition: transform 0.28s cubic-bezier(.2,.8,.2,1); }
    .preset-drawer.from-left { right: auto; left: 0; border-left: 0; border-right: 1px solid rgba(255,255,255,0.08); transform: translateX(-104%); }
    .preset-drawer.open { transform: translateX(0); }
    .pd-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 14px 14px 10px; border-bottom: 1px solid rgba(255,255,255,0.06); }
    .pd-close { width: 28px; height: 28px; border-radius: 8px; color: #a1a1a6; background: #1b1b1e; }
    .pd-list { flex: 1; overflow-y: auto; padding: 8px; display: flex; flex-direction: column; gap: 6px; -webkit-overflow-scrolling: touch; }
    .pd-item { text-align: left; padding: 11px 12px; border-radius: 10px; border: 1px solid rgba(255,255,255,0.07); background: #18181b; cursor: pointer; transition: border-color .15s, background .15s; }
    .pd-item:hover { border-color: rgba(255,255,255,0.22); }
    .pd-item.on { border-color: #ededed; background: #232326; }
    .pd-cats { display: flex; gap: 5px; overflow-x: auto; padding: 8px 10px 4px; scrollbar-width: none; }
    .pd-cats::-webkit-scrollbar { display: none; }
    .pd-cat { flex: 0 0 auto; height: 32px; padding: 0 10px; border-radius: 6px; font-size: 12px; color: #a1a1a6; border: 1px solid rgba(255,255,255,0.08); background: #18181b; }
    .pd-cat.on { color: #fff; border-color: #ededed; background: #232326; }
    .pd-grid { display: grid !important; grid-template-columns: 1fr 1fr; gap: 6px; align-content: start; }
    .pd-card { padding: 4px; border-radius: 9px; border: 1px solid rgba(255,255,255,0.07); background: #18181b; text-align: left; cursor: pointer; }
    .pd-card.on { border-color: #ededed; background: #232326; }
    .pd-card img { width: 100%; aspect-ratio: 9 / 16; object-fit: cover; border-radius: 6px; background: #0f0f10; display: block; }
    .pd-random .pd-dice { display: flex; align-items: center; justify-content: center; width: 100%; aspect-ratio: 9 / 16; border-radius: 6px; font-size: 34px;
      background: linear-gradient(135deg, #3b82f6 0%, #a855f7 50%, #f97316 100%); }
    .pd-random:hover .pd-dice { filter: brightness(1.12); }
    .pd-card div { margin-top: 4px; padding: 0 2px; font-size: 12px; color: #d4d4d8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .pd-handle { position: absolute; right: 0; top: 50%; transform: translateY(-50%); z-index: 25; display: flex; flex-direction: column; align-items: center; gap: 2px;
      padding: 10px 5px; border-radius: 10px 0 0 10px; background: rgba(0,0,0,0.55); color: #ededed; font-size: 12px; font-weight: 600; writing-mode: horizontal-tb;
      -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); border: 1px solid rgba(255,255,255,0.12); border-right: 0; opacity: 0.75; }
    .pd-handle:hover { opacity: 1; }
    .pd-handle span:first-child { writing-mode: vertical-rl; letter-spacing: 2px; }
    .pd-chev { font-size: 14px; line-height: 1; }

    /* ===== 컷 편집기 요소별 편집 모드 (Element-by-Element Edit Mode) ===== */
    #cutEditorPanel {
      background-color: #141415;
      border: 1px solid rgba(237, 237, 237, 0.12);
      border-radius: 14px;
      padding: 10px;
      color: #ededed;
      box-shadow: 0 14px 36px rgba(0, 0, 0, 0.45);
    }
    #cutEditorPanel:not(.hidden) {
      display: flex;
      flex-direction: column;
      gap: 8px;
    }
    #cutEditorPanel.hidden,
    #arInlineEditBar.hidden,
    .ar-inline-edit-bar.hidden {
      display: none !important;
    }
    .no-scrollbar {
      scrollbar-width: none;
      -ms-overflow-style: none;
    }
    .no-scrollbar::-webkit-scrollbar {
      display: none;
    }
    .ar-el-mode-bar {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 6px;
      flex-wrap: wrap;
      padding: 6px 8px;
      background-color: #0f0f10;
      border: 1px solid rgba(237, 237, 237, 0.08);
      border-radius: 10px;
    }
    .ar-el-chip-list {
      display: flex;
      align-items: center;
      gap: 6px;
      flex-wrap: wrap;
    }
    .ar-el-chip {
      display: inline-flex;
      flex: 0 0 auto;
      align-items: center;
      gap: 5px;
      min-height: 30px;
      padding: 4px 10px;
      border-radius: 8px;
      background-color: #18181b;
      border: 1px solid rgba(237, 237, 237, 0.08);
      color: #a1a1a6;
      font-size: 12px;
      font-weight: 500;
      line-height: 1.25;
      white-space: nowrap;
      cursor: pointer;
      user-select: none;
      transition: background-color 140ms var(--ease-out), border-color 140ms var(--ease-out), color 140ms var(--ease-out), transform 100ms var(--ease-out);
    }
    .ar-el-chip:hover {
      background-color: #232325;
      border-color: rgba(237, 237, 237, 0.18);
      color: #ededed;
    }
    .ar-el-chip:active {
      transform: scale(0.98);
    }
    .ar-el-chip.active,
    .ar-el-chip.on,
    .ar-el-chip[aria-selected="true"] {
      background-color: #232325;
      border-color: #3b82f6;
      color: #ededed;
      font-weight: 600;
      box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.35), 0 2px 10px rgba(59, 130, 246, 0.16);
    }
    .ar-el-chip.modified {
      border-color: rgba(76, 195, 138, 0.45);
    }
    .ar-el-chip.is-hidden {
      opacity: 0.55;
      text-decoration: line-through;
    }
    .ar-el-inspector {
      background-color: #18181b;
      border: 1px solid rgba(237, 237, 237, 0.08);
      border-radius: 12px;
      padding: 8px;
      display: flex;
      flex-direction: column;
      gap: 6px;
      color: #ededed;
    }
    .ar-el-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 6px;
      flex-wrap: wrap;
      padding: 5px 8px;
      background-color: #141415;
      border: 1px solid rgba(237, 237, 237, 0.06);
      border-radius: 8px;
    }
    .ar-el-row label,
    .ar-el-row .ar-el-label {
      font-size: 11.5px;
      color: #a1a1a6;
      font-weight: 500;
      flex-shrink: 0;
    }
    .ar-el-row input[type="range"] {
      flex: 1;
      min-width: 80px;
      accent-color: #3b82f6;
      cursor: pointer;
    }
    .ar-el-row .ar-el-val {
      font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
      font-size: 11px;
      color: #ededed;
      min-width: 38px;
      text-align: right;
      font-variant-numeric: tabular-nums;
    }
    .ar-el-badge {
      display: inline-flex;
      align-items: center;
      gap: 4px;
      padding: 2px 7px;
      border-radius: 9999px;
      background-color: rgba(76, 195, 138, 0.14);
      border: 1px solid rgba(76, 195, 138, 0.35);
      color: #4cc38a;
      font-size: 10.5px;
      font-weight: 600;
      line-height: 1.2;
      white-space: nowrap;
    }
    .ar-el-badge.blue {
      background-color: rgba(59, 130, 246, 0.15);
      border-color: rgba(59, 130, 246, 0.4);
      color: #60a5fa;
    }
    .ar-el-badge.muted {
      background-color: #232325;
      border-color: rgba(237, 237, 237, 0.1);
      color: #a1a1a6;
    }
    /* 캔버스 직접 선택/이동 인터랙션 커서 및 힌트 */
    #previewViewport.ar-el-canvas-mode #reelCanvas,
    #reelCanvas.ar-el-canvas-interactive,
    body:has(#cutEditorPanel:not(.hidden)) #reelCanvas {
      cursor: grab;
    }
    #previewViewport.ar-el-canvas-dragging #reelCanvas,
    #reelCanvas.ar-el-canvas-dragging {
      cursor: grabbing !important;
    }
    .ar-el-canvas-hint {
      pointer-events: none;
      display: inline-flex;
      align-items: center;
      gap: 5px;
      padding: 4px 10px;
      border-radius: 9999px;
      background-color: rgba(15, 15, 16, 0.82);
      border: 1px solid rgba(59, 130, 246, 0.45);
      color: #ededed;
      font-size: 11px;
      font-weight: 500;
      white-space: nowrap;
      backdrop-filter: blur(6px);
      -webkit-backdrop-filter: blur(6px);
      box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
    }
    #cutOverlayEditorLayer > .ar-el-canvas-hint,
    #cutOverlayEditorLayer > .ar-inline-edit-badge {
      position: absolute;
      left: 50%;
      bottom: 10px;
      transform: translateX(-50%);
      z-index: 15;
      max-width: calc(100% - 20px);
      overflow: hidden;
      text-overflow: ellipsis;
    }
    #cutOverlayEditorLayer [data-el-key],
    #cutOverlayEditorLayer [data-ov-idx] {
      transition: box-shadow 120ms var(--ease-out), border-color 120ms var(--ease-out);
    }
    #cutOverlayEditorLayer [data-el-key].active,
    #cutOverlayEditorLayer [data-ov-idx].active {
      outline: none;
      background-color: transparent;
    }

    /* ===== 미리보기 롱프레스 인라인 퀵 편집 모드 (#arInlineEditBar & 롱프레스 피드백) ===== */
    #previewViewport.ar-longpress-holding {
      box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.65);
      transition: box-shadow 180ms var(--ease-out);
    }
    #previewViewport.ar-inline-edit-active,
    #previewViewport:has(#arInlineEditBar:not(.hidden)) {
      border-color: #3b82f6 !important;
      box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.32), 0 12px 32px rgba(0, 0, 0, 0.55);
    }
    .ar-longpress-ring {
      position: absolute;
      width: 52px;
      height: 52px;
      margin-left: -26px;
      margin-top: -26px;
      border-radius: 9999px;
      border: 2.5px solid #3b82f6;
      background: rgba(59, 130, 246, 0.16);
      pointer-events: none;
      z-index: 40;
      animation: arLongPressPulse 380ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
    }
    .ar-longpress-ripple {
      position: absolute;
      inset: 0;
      border-radius: 9999px;
      border: 1.5px solid rgba(76, 195, 138, 0.85);
      pointer-events: none;
    }
    @keyframes arLongPressPulse {
      0% { transform: scale(0.45); opacity: 0.95; }
      75% { transform: scale(1.08); opacity: 0.9; border-color: #4cc38a; background: rgba(76, 195, 138, 0.22); }
      100% { transform: scale(1.22); opacity: 0; }
    }
    .ar-inline-edit-badge {
      display: inline-flex;
      align-items: center;
      gap: 5px;
      padding: 3px 9px;
      border-radius: 9999px;
      background: rgba(15, 15, 16, 0.88);
      border: 1px solid rgba(76, 195, 138, 0.5);
      color: #4cc38a;
      font-size: 11px;
      font-weight: 600;
      white-space: nowrap;
      backdrop-filter: blur(8px);
      -webkit-backdrop-filter: blur(8px);
      box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
    }
    #arInlineEditBar,
    .ar-inline-edit-bar {
      width: 100%;
      background: #141415;
      border: 1px solid rgba(59, 130, 246, 0.42);
      border-radius: 14px;
      padding: 10px 11px;
      color: #ededed;
      box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.06);
      display: flex;
      flex-direction: column;
      gap: 8px;
      z-index: 35;
      animation: arInlineBarIn 160ms var(--ease-out);
    }
    /* 미리보기 캔버스 요소 위에서 바로 열리는 인라인 직접 텍스트 편집창 (#arCanvasInlineInputWrap) */
    #arCanvasInlineInputWrap {
      position: absolute;
      z-index: 38;
      transform: translate(-50%, -50%);
      display: none;
      flex-direction: column;
      align-items: center;
      gap: 5px;
      pointer-events: auto;
      animation: arCanvasInlineFade 130ms var(--ease-out);
    }
    @keyframes arCanvasInlineFade {
      from { opacity: 0; }
      to { opacity: 1; }
    }
    #arCanvasInlineInputWrap.is-open {
      display: flex;
    }
    #arCanvasInlineInput {
      width: 100%;
      min-height: 44px;
      padding: 8px 12px;
      border-radius: 12px;
      background: rgba(12, 12, 16, 0.92);
      backdrop-filter: blur(12px);
      -webkit-backdrop-filter: blur(12px);
      border: 2px solid #4cc38a;
      color: #ffffff;
      font-size: 14px;
      font-weight: 700;
      line-height: 1.35;
      text-align: center;
      resize: none;
      box-shadow: 0 12px 32px rgba(0, 0, 0, 0.72), 0 0 0 3px rgba(76, 195, 138, 0.25);
    }
    #arCanvasInlineInput:focus {
      outline: none;
      border-color: #38bdf8;
      box-shadow: 0 12px 32px rgba(0, 0, 0, 0.75), 0 0 0 3px rgba(56, 189, 248, 0.32);
    }
    .ar-canvas-inline-toolbar {
      display: inline-flex;
      align-items: center;
      gap: 5px;
      padding: 3px 8px;
      border-radius: 9999px;
      background: rgba(15, 15, 18, 0.94);
      border: 1px solid rgba(255, 255, 255, 0.18);
      box-shadow: 0 6px 18px rgba(0, 0, 0, 0.55);
      font-size: 11px;
      color: #ededed;
      white-space: nowrap;
    }
    /* 미리보기 화면 위에서 밑에서 올라오는 바텀시트 모달 (#arInlineEditBar, #cutEditorPanel, #cutPhotoReplaceModal) */
    #previewViewport .ar-preview-sheet-backdrop {
      position: absolute;
      inset: 0;
      z-index: 32;
      background: rgba(0, 0, 0, 0.38);
      display: flex;
      flex-direction: column;
      justify-content: flex-end;
      pointer-events: auto;
    }
    #previewViewport .ar-preview-bottom-sheet {
      width: 100%;
      max-height: 44%;
      overflow-y: auto;
      overflow-x: hidden;
      scrollbar-width: none;
      overscroll-behavior: contain;
      border-radius: 18px 18px 0 0;
      background: rgba(22, 22, 26, 0.96);
      backdrop-filter: blur(18px);
      -webkit-backdrop-filter: blur(18px);
      border-top: 1px solid rgba(255, 255, 255, 0.16);
      padding: 8px 10px 10px;
      color: #ededed;
      box-shadow: 0 -14px 36px rgba(0, 0, 0, 0.65);
      display: flex;
      flex-direction: column;
      gap: 6px;
      animation: arPreviewSheetUp 180ms cubic-bezier(0.22, 1, 0.36, 1);
    }
    #previewViewport .ar-preview-bottom-sheet::-webkit-scrollbar,
    #previewViewport #arInlineEditBar.ar-preview-floating-sheet::-webkit-scrollbar {
      display: none;
    }
    #previewViewport .ar-preview-bottom-sheet > *,
    #previewViewport #arInlineEditBar.ar-preview-floating-sheet > * {
      flex-shrink: 0;
    }
    #previewViewport #arInlineEditBar.ar-preview-floating-sheet {
      position: absolute;
      left: 0;
      right: 0;
      bottom: 0;
      z-index: 28;
      max-height: 42%;
      overflow-y: auto;
      overflow-x: hidden;
      scrollbar-width: none;
      border-radius: 18px 18px 0 0;
      border: none;
      border-top: 1px solid rgba(255, 255, 255, 0.16);
      background: rgba(20, 20, 24, 0.94);
      backdrop-filter: blur(16px);
      -webkit-backdrop-filter: blur(16px);
      padding: 8px 10px 10px;
      box-shadow: 0 -12px 32px rgba(0, 0, 0, 0.65);
      pointer-events: auto;
      animation: arPreviewSheetUp 170ms cubic-bezier(0.22, 1, 0.36, 1);
    }
    .ar-sheet-grabber {
      width: 32px;
      height: 4px;
      border-radius: 9999px;
      background: rgba(255, 255, 255, 0.25);
      margin: 0 auto 2px;
      flex-shrink: 0;
    }
    @keyframes arPreviewSheetUp {
      from { opacity: 0; transform: translateY(24px); }
      to { opacity: 1; transform: translateY(0); }
    }
    @keyframes arInlineBarIn {
      from { opacity: 0; transform: translateY(-4px) scale(0.99); }
      to { opacity: 1; transform: none; }
    }
    .ar-inline-head {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 6px;
      flex-wrap: wrap;
      padding-bottom: 6px;
      border-bottom: 1px solid rgba(237, 237, 237, 0.08);
    }
    .ar-inline-title {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      font-size: 12px;
      font-weight: 600;
      color: #ededed;
    }
    .ar-inline-scroll-row,
    .ar-inline-font-bar,
    .ar-inline-style-bar,
    .ar-inline-anim-bar,
    .ar-inline-color-bar {
      display: flex;
      align-items: center;
      gap: 6px;
      min-width: 0;
      width: 100%;
      overflow-x: auto;
      -webkit-overflow-scrolling: touch;
      padding: 2px 0;
      scrollbar-width: none;
    }
    .ar-inline-scroll-row::-webkit-scrollbar,
    .ar-inline-font-bar::-webkit-scrollbar,
    .ar-inline-style-bar::-webkit-scrollbar,
    .ar-inline-anim-bar::-webkit-scrollbar,
    .ar-inline-color-bar::-webkit-scrollbar {
      display: none;
    }
    .ar-inline-font-chip,
    .ar-inline-style-chip,
    .ar-inline-anim-chip,
    .ar-el-pill {
      flex: 0 0 auto;
      min-height: 26px;
      padding: 3px 9px;
      border-radius: 7px;
      background-color: #18181b;
      border: 1px solid rgba(237, 237, 237, 0.09);
      color: #a1a1a6;
      font-size: 11px;
      font-weight: 500;
      cursor: pointer;
      white-space: nowrap;
      transition: background-color 130ms var(--ease-out), border-color 130ms var(--ease-out), color 130ms var(--ease-out);
    }
    .ar-inline-font-chip:hover,
    .ar-inline-style-chip:hover,
    .ar-inline-anim-chip:hover,
    .ar-el-pill:hover {
      background-color: #232325;
      color: #ededed;
      border-color: rgba(237, 237, 237, 0.2);
    }
    .ar-inline-font-chip.active,
    .ar-inline-font-chip.on,
    .ar-inline-style-chip.active,
    .ar-inline-style-chip.on,
    .ar-inline-anim-chip.active,
    .ar-inline-anim-chip.on,
    .ar-el-pill.active,
    .ar-el-pill.on {
      background-color: #232325;
      border-color: #3b82f6;
      color: #ededed;
      font-weight: 600;
      box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.35);
    }
    .ar-inline-anim-chip.active,
    .ar-inline-anim-chip.on {
      border-color: #4cc38a;
      color: #4cc38a;
      box-shadow: inset 0 0 0 1px rgba(76, 195, 138, 0.32);
    }
    .ar-inline-color-swatch,
    .ar-el-color-swatch {
      width: 24px;
      height: 24px;
      min-width: 24px;
      min-height: 24px;
      padding: 0;
      border-radius: 9999px;
      border: 1.5px solid rgba(255, 255, 255, 0.28);
      flex: 0 0 24px;
      cursor: pointer;
      transition: transform 120ms var(--ease-out), border-color 120ms var(--ease-out);
    }
    .ar-inline-color-swatch:hover,
    .ar-el-color-swatch:hover {
      transform: scale(1.12);
    }
    .ar-inline-color-swatch.active,
    .ar-inline-color-swatch.on,
    .ar-el-color-swatch.active,
    .ar-el-color-swatch.on {
      transform: scale(1.18);
      border-color: #ffffff;
      box-shadow: 0 0 0 2px rgba(76, 195, 138, 0.65);
    }
    #cutEditorPanel .ar-modal-card,
    #cutPhotoReplaceModal .ar-modal-card {
      max-height: 88vh;
      overflow-y: auto;
    }
/* 내 스타일 만들기: 스튜디오 공통 색과 키보드/모바일 조작 영역 */
.ar-custom-entry{min-height:44px;padding:10px 14px;border:1px solid #424246;border-radius:8px;background:#232325;color:#ededed;font-weight:600;cursor:pointer}
.ar-custom-panel{box-sizing:border-box;width:min(1000px,calc(100vw - 32px));max-height:calc(100dvh - 32px);margin:auto;padding:28px;border:1px solid #303033;border-radius:16px;background:#0f0f10;color:#ededed;font:14px/1.5 'Pretendard Variable',Pretendard,sans-serif;overflow:auto;color-scheme:dark}
.ar-custom-panel::backdrop{background:rgba(0,0,0,.72)}
.ar-custom-panel *{box-sizing:border-box}
.ar-custom-panel button,.ar-custom-panel select,.ar-custom-panel input{font:inherit}
.ar-custom-panel button,.ar-custom-panel select{min-height:40px;padding:8px 12px;border:1px solid #3c3c40;border-radius:8px;background:#232325;color:#ededed;cursor:pointer}
.ar-custom-panel button:disabled{opacity:.45;cursor:wait}
.ar-custom-panel :focus-visible,.ar-custom-entry:focus-visible,.ar-custom-picker button:focus-visible{outline:2px solid #ededed;outline-offset:3px}
.ar-custom-heading{display:flex;justify-content:space-between;align-items:flex-start;gap:16px;margin-bottom:24px}
.ar-custom-heading h2{margin:0 0 6px;font-size:26px;font-weight:700;letter-spacing:-.8px}
.ar-custom-panel p{margin:6px 0;color:#a1a1a6;font-size:12px}
.ar-custom-workspace{display:grid;grid-template-columns:290px minmax(0,1fr);gap:32px}
.ar-custom-preview{align-self:start;padding:18px;border:1px solid #303033;border-radius:12px;background:#18181b}
.ar-custom-preview>span{display:block;margin-bottom:14px;font-size:12px;color:#a1a1a6}
.ar-custom-preview canvas{display:block;width:204px;max-width:100%;height:auto;margin:0 auto 18px;border-radius:10px;background:#232325}
.ar-custom-preview strong{font-size:18px;overflow-wrap:anywhere}
.ar-custom-form>label{display:block;margin-bottom:8px;font-weight:600}
.ar-custom-form input[name="name"]{width:100%;min-height:44px;padding:10px 12px;border:1px solid #3c3c40;border-radius:8px;background:#18181b;color:#ededed}
.ar-custom-form fieldset{margin:20px 0 0;padding:16px 0 0;border:0;border-top:1px solid #303033;min-width:0}
.ar-custom-form legend{padding:0 8px 0 0;font-weight:600}
.ar-custom-two{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.ar-custom-color{display:grid;grid-template-columns:44px 1fr;align-items:center;column-gap:10px;padding:10px;border:1px solid #303033;border-radius:8px;font-size:12px}
.ar-custom-color input{grid-column:1;grid-row:1/3;width:44px;height:44px;padding:2px;background:none;border:0;cursor:pointer}
.ar-custom-color output{grid-column:2;color:#a1a1a6;font-size:11px}
.ar-custom-choices{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
.ar-custom-choices label{position:relative;cursor:pointer}
.ar-custom-choices input{position:absolute;opacity:0;width:1px;height:1px}
.ar-custom-choices span{display:flex;flex-direction:column;justify-content:center;min-height:44px;height:100%;padding:10px 5px;border:1px solid #303033;border-radius:8px;background:#18181b;text-align:center;font-size:12px}
.ar-custom-choices small{font-size:10px;color:#a1a1a6;margin-top:3px}
.ar-custom-choices input:checked+span{border-color:#ededed;background:#232325}
.ar-custom-choices input:focus-visible+span{outline:2px solid #ededed;outline-offset:3px}
.ar-custom-upload{display:flex;flex-wrap:wrap;align-items:center;gap:10px}
.ar-custom-upload img{width:48px;height:48px;object-fit:contain;background:#ede8df;border-radius:6px}
.ar-custom-upload label{flex:1;min-width:180px;font-size:12px;color:#a1a1a6}
.ar-custom-upload input{display:block;width:100%;min-height:40px;max-width:270px;margin-top:4px;font-size:11px}
.ar-custom-upload input::file-selector-button{min-height:40px;border:1px solid #3c3c40;border-radius:6px;background:#232325;color:#ededed;cursor:pointer}
.ar-custom-inline{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:12px;font-size:12px}
.ar-custom-inline input[type="range"]{width:45%;height:40px;accent-color:#ededed}
.ar-custom-inline output{min-width:28px;color:#a1a1a6}
.ar-custom-save{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:16px}
.ar-custom-save button{background:#ededed;color:#141415;font-weight:700;min-height:44px;white-space:nowrap}
#arCustomStatus{color:#b9dccb;min-height:18px;margin-top:16px;overflow-wrap:anywhere}
.ar-custom-saved{margin-top:16px;padding-top:12px;border-top:1px solid #303033}
.ar-custom-saved>div{display:flex;align-items:center;gap:5px;margin-top:6px;font-size:12px}
.ar-custom-saved span{flex:1;min-width:0;overflow-wrap:anywhere}
.ar-custom-saved button{padding:6px 8px;flex-shrink:0}
.ar-custom-picker{min-width:0;padding:5px;border:1px solid #55514a;border-radius:9px;background:#1c1b19}
.ar-custom-picker.on{border-color:#ededed}
.ar-custom-picker button{display:block;width:100%;min-height:40px;border:0;border-radius:6px;background:none;color:#ededed;cursor:pointer;text-align:left;padding:3px}
.ar-custom-picker img{display:block;width:100%;aspect-ratio:9/16;object-fit:cover;border-radius:6px;background:#141415}
.ar-custom-picker small{display:block;color:#b7ad9c;font-size:10px;margin-top:7px}
.ar-custom-picker span{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px}
.ar-custom-picker button+button{margin-top:5px;text-align:center;background:#2e2b26;font-size:11px}
@media(max-width:650px){
  .ar-custom-panel{width:calc(100vw - 16px);max-height:calc(100dvh - 16px);padding:18px;border-radius:12px}
  .ar-custom-heading{gap:10px;margin-bottom:18px}.ar-custom-heading h2{font-size:23px}.ar-custom-heading p{font-size:11px}.ar-custom-heading button{flex-shrink:0}
  .ar-custom-workspace{grid-template-columns:1fr;gap:22px}
  .ar-custom-preview{display:grid;grid-template-columns:104px minmax(0,1fr);gap:10px 14px;padding:14px}
  .ar-custom-preview>span{grid-column:1/-1;margin:0}.ar-custom-preview canvas{grid-column:1;grid-row:2/4;width:104px;margin:0}.ar-custom-preview>div{grid-column:2}.ar-custom-preview strong{font-size:15px}
  .ar-custom-saved{margin-top:0;padding-top:8px}.ar-custom-saved>div{flex-wrap:wrap}.ar-custom-saved span{flex-basis:100%}
  .ar-custom-form fieldset{margin-top:18px}.ar-custom-color{column-gap:5px;padding:8px}.ar-custom-save{align-items:stretch;flex-direction:column}.ar-custom-save button{width:100%}
}


    /* ===== 모바일 아래 고정 단계 바 ===== */
    #mobileStepBar { display: none; }
    @media (max-width: 1023px) {
      #mobileStepBar {
        display: flex; align-items: center; gap: 8px;
        position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
        padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
        background: rgba(13, 13, 16, 0.94);
        -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
        border-top: 1px solid var(--border);
      }
      #mobileStepBar .msb-btn {
        height: 44px; min-width: 84px; padding: 0 12px; border-radius: 12px;
        background: #232325; color: #ededed; font-size: 13px; font-weight: 600; border: 1px solid var(--border);
      }
      #mobileStepBar .msb-btn:disabled { opacity: .35; }
      #mobileStepBar .msb-next { background: #ededed; color: #111; border-color: #ededed; min-width: 120px; }
      #mobileStepBar .msb-mid { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; line-height: 1.15; background: transparent; border: 0; }
      #mobileStepBar .msb-count { font-size: 11px; color: #85858b; font-family: ui-monospace, monospace; }
      #mobileStepBar .msb-name { font-size: 14px; font-weight: 700; color: #ededed; }
      body { padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
      body.ar-cut-editing #mobileStepBar { display: none; }
      /* 아래 고정 바가 있으니 단계 끝의 [이전]·[다음] 줄은 모바일에서 숨김 */
      .studio-panel div:has(> button[onclick^="switchStudioTab("]):not(:has(> :not(button[onclick^="switchStudioTab("]))) { display: none; }
      /* 위 작은 미리보기 바는 간단하게: 색상 줄은 사진 단계에 있으니 숨기고 미리보기 썸네일은 조금 크게 */
      #mobileLiveDock.dock-fixed-mode > div:nth-child(2) { display: none; }
      #mobileLiveDock.dock-fixed-mode button:has(#mobileMiniCanvas) { width: 45px; height: 80px; }
    }

/* 사진 탭 컷 카드: 선택 상자마다 이름표를 붙이고, 좁은 화면에서 글자가 잘리지 않게 한 줄씩 */
.cut-ctl-grid { display: grid; grid-template-columns: 1fr; gap: 8px; }
@media (min-width: 640px) { .cut-ctl-grid { grid-template-columns: 1fr 1fr 1fr; } .cut-ctl-grid .cut-upload { grid-column: 1 / -1; } }
.cut-ctl { display: flex; align-items: center; gap: 8px; min-width: 0; }
.cut-ctl > span { flex: 0 0 44px; font-size: 12px; color: #85858b; }
.cut-ctl > select { flex: 1 1 auto; min-width: 0; height: 36px; padding: 0 10px; font-size: 13px; background: #1a1a1d; color: #e4e4e7; cursor: pointer; text-overflow: ellipsis; }
.cut-upload { display: flex; align-items: center; justify-content: center; height: 38px; border-radius: 8px; border: 1px dashed #3a3a40; background: #18181b; color: #ededed; font-size: 13px; cursor: pointer; }
.cut-upload:hover { border-color: #3b82f6; }

/* 모바일: 작은 미리보기 바를 화면 맨 위에 딱 붙이고, 단계 탭 바는 그 바로 밑에 고정 (예전엔 미리보기 바가 탭을 덮었음) */
@media (max-width: 1023px) {
  #mobileLiveDock.dock-fixed-mode { top: 0; left: 0; right: 0; width: 100%; border-radius: 0 0 14px 14px; border-top: 0; }
  div.sticky:has(> .studio-tablist) { top: var(--dock-h, 0px); padding-top: 8px; padding-bottom: 8px; transition: top .15s ease; }
}

/* 영상 크게 보기 팝업 (작은 미리보기를 누르면 그 자리에서 열림) */
#arPreviewPop { padding: 12px; }
#arPreviewPop .arpp-wrap { display: flex; flex-direction: column; align-items: center; gap: 10px; width: 100%; max-width: 420px; animation: arModalIn 180ms var(--ease-out); }
#arPreviewPop .arpp-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; }
#arPreviewPop .arpp-cut { font-size: 13px; color: #d4d4d8; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#arPreviewPop .arpp-video { position: relative; height: min(72vh, calc((100vw - 24px) * 16 / 9)); aspect-ratio: 9 / 16; max-width: 100%; }
#arPreviewPop canvas { height: 100%; width: 100%; border-radius: 14px; background: #000; box-shadow: 0 20px 60px rgba(0,0,0,.6); }
.ar-play-feedback { position: absolute; z-index: 5; left: 50%; top: 50%; display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: rgba(16, 16, 18, .68); color: #fff; font-size: 24px; line-height: 1; opacity: 0; transform: translate(-50%, -50%) scale(.88); transition: opacity .18s ease, transform .18s ease; pointer-events: none; }
.ar-play-feedback.is-visible { opacity: 1; transform: translate(-50%, -50%) scale(1); }
@media (prefers-reduced-motion: reduce) { .ar-play-feedback { transition: none; } }
#arPreviewPop .arpp-ctl { display: flex; gap: 8px; width: 100%; }
#arPreviewPop .arpp-btn { flex: 1; height: 46px; border-radius: 12px; border: 1px solid var(--border); background: #1c1c1f; color: #ededed; font-size: 14px; font-weight: 600; }
#arPreviewPop .arpp-main { background: #f4f4f5; color: #111; border-color: #f4f4f5; }

/* 모바일 사진·대본 단계: 컷 카드를 세로로 길게 쌓지 않고 옆으로 넘겨 보기 */
@media (max-width: 1023px) {
  #cutMediaCardsContainer, #dynamicCutCardsContainer {
    display: flex !important; max-height: none !important; overflow-y: visible !important; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch; padding: 2px 2px 10px; margin: 0 -2px; scrollbar-width: none;
  }
  #cutMediaCardsContainer::-webkit-scrollbar, #dynamicCutCardsContainer::-webkit-scrollbar { display: none; }
  #cutMediaCardsContainer > div, #dynamicCutCardsContainer > div { flex: 0 0 86%; scroll-snap-align: center; }
  /* 대본 카드도 옆으로: 입력칸을 조금 크게 */
  #dynamicCutCardsContainer input { height: 40px !important; font-size: 14px !important; }
}

/* 주제 카드 페이지 넘기기 (5개씩) */
.topic-pager { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 4px; }
.topic-pager button { height: 40px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--border); background: #18181b; color: #ededed; font-size: 13px; font-weight: 600; cursor: pointer; }
.topic-pager button:disabled { opacity: .35; cursor: default; }
.topic-pager span { font-size: 12px; color: #85858b; font-family: ui-monospace, monospace; }

/* 컷 편집: 도구 줄을 영상 위에 겹치지 않고 영상 바깥(위)으로, 선택 조절바는 영상 아래로 빼서 자막·사진이 가려지지 않게 */
body.ar-cut-editing #previewViewport { overflow: visible; margin-top: 100px; }
body.ar-cut-editing #previewViewport:has(#igSelectedBar:not(.hidden)) { margin-bottom: 96px; }
body.ar-cut-editing #reelCanvas { border-radius: 12px; }
body.ar-cut-editing #igTopBar { top: auto !important; bottom: calc(100% + 8px); left: 0 !important; right: 0 !important; }
body.ar-cut-editing #igSelectedBar { bottom: auto !important; top: calc(100% + 8px); left: 0 !important; right: 0 !important; }
/* 닫혀 있는 디자인 서랍이 화면 밖 버튼/비침으로 남지 않게 */
#presetDrawer:not(.open) { visibility: hidden; }

/* 명함 단계: 보일 항목 고르기 */
.card-show-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.card-show-chip { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--border); background: #18181b; font-size: 13px; color: #a1a1a6; cursor: pointer; user-select: none; }
.card-show-chip input { width: 16px; height: 16px; accent-color: #4cc38a; }
.card-show-chip:has(input:checked) { border-color: #4cc38a66; background: #12201a; color: #ededed; }

/* 색상 고르기: 네모 견본만 */
.color-swatch { width: 34px; height: 34px; border-radius: 8px; flex: 0 0 auto; border: 2px solid transparent; box-shadow: inset 0 0 0 1px rgba(255,255,255,.12); cursor: pointer; transition: transform .12s ease; }
.color-swatch:hover { transform: scale(1.06); }
.color-swatch.on { border-color: #ededed; box-shadow: 0 0 0 2px #0d0d10 inset; }

/* 휴대폰 기본 선택창 대신 쓰는 아래 시트 */
#arOptionSheet { align-items: flex-end; padding: 0; }
#arOptionSheet .aos-card { width: 100%; max-width: 520px; margin: 0 auto; max-height: 78vh; display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--border-strong); border-bottom: 0; border-radius: 18px 18px 0 0; padding: 14px 14px calc(14px + env(safe-area-inset-bottom)); animation: aosUp 200ms var(--ease-out); }
@keyframes aosUp { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
#arOptionSheet .aos-head { display: flex; align-items: center; justify-content: space-between; padding: 2px 4px 10px; }
#arOptionSheet .aos-head strong { font-size: 15px; color: #ededed; }
#arOptionSheet .aos-list { overflow-y: auto; display: flex; flex-direction: column; gap: 4px; }
#arOptionSheet .aos-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 48px; padding: 0 14px; border-radius: 12px; background: #18181b; border: 1px solid transparent; color: #d4d4d8; font-size: 14px; text-align: left; cursor: pointer; }
#arOptionSheet .aos-item.on { background: #12201a; border-color: #4cc38a66; color: #fff; }
#arOptionSheet .aos-item b { color: #4cc38a; }
#arOptionSheet .aos-grid { overflow-y: auto; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
#arOptionSheet .aos-photo { position: relative; aspect-ratio: 9 / 13; border-radius: 12px; overflow: hidden; border: 2px solid transparent; background: #000; padding: 0; cursor: pointer; }
#arOptionSheet .aos-photo img { width: 100%; height: 100%; object-fit: cover; }
#arOptionSheet .aos-photo em { position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 6px 6px; font-style: normal; font-size: 11px; line-height: 1.25; color: #fff; text-align: left; background: linear-gradient(transparent, rgba(0,0,0,.75)); }
#arOptionSheet .aos-photo.on { border-color: #4cc38a; }
#arOptionSheet .aos-grid { flex: 1 1 auto; min-height: 0; align-content: start; grid-auto-rows: calc((min(100vw, 520px) - 44px) / 3 * 13 / 9); }
#arOptionSheet .aos-photo { aspect-ratio: auto; height: 100%; }
#arOptionSheet .aos-photo img { position: absolute; inset: 0; }
#arOptionSheet .aos-photo em { z-index: 1; }

/* 편집 모드 스위치 (쉬운 모드 / 전체 기능 버튼을 대신함) */
.edit-mode-switch { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px 0 8px; border-radius: 999px; border: 1px solid var(--border); background: #141415; color: #a1a1a6; font-size: 13px; font-weight: 600; cursor: pointer; }
.edit-mode-switch .ems-track { position: relative; width: 34px; height: 20px; border-radius: 999px; background: #2a2a2e; transition: background .15s ease; }
.edit-mode-switch .ems-knob { position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #85858b; transition: transform .15s ease, background .15s ease; }
.edit-mode-switch[aria-checked="true"] { color: #ededed; border-color: #4cc38a66; }
.edit-mode-switch[aria-checked="true"] .ems-track { background: #1f6f4c; }
.edit-mode-switch[aria-checked="true"] .ems-knob { transform: translateX(14px); background: #fff; }

/* ===== 컷 편집창 (인스타 스토리 편집 느낌): 영상 아래에 붙는 깔끔한 시트 ===== */
#cutEditorPanel.ar-preview-sheet-backdrop { position: static; background: transparent; border: 0; padding: 0; box-shadow: none; margin-top: 10px; }
#cutEditorPanel .ig-sheet { display: flex; flex-direction: column; gap: 12px; padding: 12px; border-radius: 18px; background: #141416; border: 1px solid rgba(255,255,255,.08); color: #ededed; }
body:has(#cutEditorPanel:not(.hidden)) #previewCutPinBar { display: none !important; }
.ig-sheet-head { display: flex; align-items: center; gap: 6px; }
.ig-sheet-head strong { font-size: 16px; font-weight: 700; min-width: 64px; text-align: center; }
.ig-sheet-head strong small { font-size: 12px; color: #85858b; font-weight: 500; }
.ig-nav { width: 34px; height: 34px; border-radius: 50%; background: #232327; color: #fff; font-size: 20px; line-height: 1; border: 0; cursor: pointer; }
.ig-nav:disabled { opacity: .3; cursor: default; }
.ig-flex { flex: 1; }
.ig-text-btn { height: 32px; padding: 0 10px; border-radius: 999px; background: transparent; border: 0; color: #a1a1a6; font-size: 13px; cursor: pointer; }
.ig-text-btn:hover { color: #fff; background: #232327; }
.ig-cut-actions { display: flex; align-items: center; gap: 8px; overflow-x: auto; }
.ig-act { flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 52px; padding: 6px 4px; border-radius: 12px; background: transparent; border: 0; color: #d4d4d8; font-size: 11px; cursor: pointer; }
.ig-act span { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: #232327; font-size: 14px; color: #fff; }
.ig-act:disabled { opacity: .3; cursor: default; }
.ig-len { flex: 0 0 auto; margin-left: auto; display: flex; align-items: center; gap: 4px; height: 40px; padding: 0 4px; border-radius: 999px; background: #232327; }
.ig-len button { width: 32px; height: 32px; border-radius: 50%; border: 0; background: transparent; color: #fff; font-size: 18px; cursor: pointer; }
.ig-len span { min-width: 44px; text-align: center; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
#cutEditorPanel .ig-el-tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; border-bottom: 1px solid rgba(255,255,255,.06); }
#cutEditorPanel .ig-el-tabs .ar-el-chip { border-radius: 999px; min-height: 34px; padding: 0 14px; font-size: 13px; background: transparent; border-color: transparent; }
#cutEditorPanel .ig-el-tabs .ar-el-chip.active { background: #fff; color: #09090b; }
#cutEditorPanel .ar-el-inspector { display: flex; flex-direction: column; gap: 10px; }
.ig-ins-top { display: flex; gap: 6px; flex-wrap: wrap; }
.ig-pill { height: 36px; padding: 0 14px; border-radius: 999px; background: #232327; border: 0; color: #ededed; font-size: 13px; font-weight: 600; cursor: pointer; }
.ig-pill-main { background: #fff; color: #09090b; }
.ig-pill.off { color: #85858b; }
.ig-ins-fonts, .ig-ins-colors, .ig-ins-row { display: flex; align-items: center; gap: 6px; overflow-x: auto; padding: 2px 0; }
.ig-font { flex: 0 0 auto; height: 38px; padding: 0 14px; border-radius: 999px; background: rgba(255,255,255,.06); border: 1px solid transparent; color: #ededed; font-size: 15px; cursor: pointer; }
.ig-font.on { background: #fff; color: #09090b; }
.ig-dot { flex: 0 0 auto; width: 28px; height: 28px; border-radius: 50%; border: 2px solid rgba(255,255,255,.9); cursor: pointer; padding: 0; }
.ig-dot.on { box-shadow: 0 0 0 3px #141416, 0 0 0 5px #fff; }
.ig-dot-auto { background: conic-gradient(#f43f5e, #f59e0b, #22c55e, #3b82f6, #a855f7, #f43f5e); }
.ig-ins-size { display: flex; align-items: center; gap: 10px; }
.ig-ins-size input { flex: 1; accent-color: #fff; }
.ig-ins-size span { font-size: 12px; color: #a1a1a6; }
.ig-ins-size span.big { font-size: 18px; color: #fff; }
.ig-chip { flex: 0 0 auto; height: 32px; min-width: 32px; padding: 0 10px; border-radius: 999px; background: rgba(255,255,255,.06); border: 0; color: #d4d4d8; font-size: 12px; cursor: pointer; }
.ig-chip.on { background: #fff; color: #09090b; }
.ig-sep { flex: 0 0 1px; height: 20px; background: rgba(255,255,255,.12); margin: 0 2px; }
.ig-row-label { flex: 0 0 auto; font-size: 12px; color: #85858b; margin-right: 2px; }
.ig-ins-more { border-top: 1px solid rgba(255,255,255,.06); padding-top: 8px; }
.ig-ins-more summary { font-size: 12px; color: #85858b; cursor: pointer; list-style: none; }
.ig-ins-more[open] summary { margin-bottom: 8px; }
.ig-ins-more .ig-pill { margin-top: 6px; }
.ig-text-btn { white-space: nowrap; }
.ig-cut-actions { flex-wrap: wrap; overflow: visible; gap: 4px; }
.ig-act { min-width: 46px; }
.ig-len { margin-left: auto; }
#cutEditorPanel .ar-el-inspector { border: 0 !important; padding: 0 !important; background: transparent !important; }
.ig-len { width: 100%; margin-left: 0; padding: 0 6px 0 14px; }
.ig-len em { flex: 1; font-style: normal; font-size: 13px; color: #a1a1a6; }

/* 터치 화면: 문구 고치는 칸을 화면 아래(키보드 위)에 띄워서, 영상 속 글자가 어떻게 나뉘는지 그대로 보이게 */
@media (pointer: coarse) {
  #arCanvasInlineInputWrap.is-open { position: fixed !important; left: 12px !important; right: 12px !important; top: auto !important; bottom: 12px !important; width: auto !important; transform: none !important; z-index: 120; }
  #arCanvasInlineInputWrap textarea { font-size: 16px !important; min-height: 64px; }
}

/* 내 스타일 만들기: 미리볼 컷 고르기 */
.ar-custom-cutnav { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ar-custom-cutnav > span { font-size: 12px; color: #85858b; }
#arCustomCutTabs { display: flex; gap: 4px; flex-wrap: wrap; }
#arCustomCutTabs button { min-width: 30px; height: 28px; padding: 0 8px; border-radius: 999px; border: 1px solid rgba(255,255,255,.12); background: transparent; color: #a1a1a6; font-size: 12px; cursor: pointer; }
#arCustomCutTabs button.on { background: #fff; color: #09090b; border-color: #fff; }
.ar-custom-preview .ar-custom-cutnav { grid-column: 1 / -1; margin-bottom: 12px; }
.ar-custom-cutnav #arCustomCutTabs { flex-wrap: nowrap; }
.ar-custom-cutnav #arCustomCutTabs button { padding: 0 6px; min-width: 28px; height: 26px; }
/* 모바일: 미리보기를 위에 고정해 두고, 아래 설정을 올려 가며 바꾸면 바로 보이게 */
@media (max-width: 650px) {
  .ar-custom-preview { position: sticky; top: -18px; z-index: 5; box-shadow: 0 12px 24px rgba(0,0,0,.55); }
  .ar-custom-preview > div:not(.ar-custom-cutnav) p { display: none; }
  .ar-custom-preview .ar-custom-saved { display: none; }
}
/* 로고 불러오기: 기본 파일 선택 버튼 대신 우리 버튼 모양 */
.ar-custom-upload input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.ar-custom-upload > label { display: inline-flex; align-items: center; height: 40px; padding: 0 16px; border-radius: 10px; background: #232325; border: 1px solid #303033; color: #ededed; font-size: 13px; font-weight: 600; cursor: pointer; }

/* 디자인 목록: 세부 편집이 다 되는 디자인 표시 */
.pd-card { position: relative; }
.fine-edit-badge { position: absolute; top: 8px; left: 8px; z-index: 2; padding: 2px 7px; border-radius: 999px; background: rgba(12,12,14,.72); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); border: 1px solid rgba(255,255,255,.18); color: #fff; font-size: 10px; font-weight: 600; line-height: 1.5; pointer-events: none; }

/* 디자인 서랍: 분위기 추천 (인스타 템플릿 추천처럼) */
.pd-reco { padding: 10px 10px 6px; border-bottom: 1px solid var(--border); }
.pd-reco-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.pd-reco-head strong { font-size: 13px; color: #ededed; }
.pd-reco-head button { width: 28px; height: 28px; border-radius: 50%; border: 0; background: #232327; color: #ededed; cursor: pointer; }
.pd-reco-row { display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 4px; }
.pd-reco-card { position: relative; flex: 0 0 104px; scroll-snap-align: start; padding: 0; border: 0; background: transparent; text-align: left; cursor: pointer; }
.pd-reco-card img { width: 104px; aspect-ratio: 9 / 16; object-fit: cover; border-radius: 12px; background: #0f0f10; display: block; }
.pd-reco-card em { position: absolute; left: 6px; right: 6px; bottom: 26px; padding: 3px 7px; border-radius: 999px; background: rgba(12,12,14,.72); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); color: #fff; font-size: 10px; font-style: normal; font-weight: 600; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pd-reco-card span { display: block; margin-top: 4px; font-size: 11px; color: #d4d4d8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pd-mood-row { display: flex; gap: 6px; overflow-x: auto; padding: 8px 0 4px; }
.pd-mood { flex: 0 0 auto; height: 30px; padding: 0 12px; border-radius: 999px; border: 1px solid rgba(255,255,255,.12); background: transparent; color: #d4d4d8; font-size: 12px; cursor: pointer; }
.pd-mood.on { background: #fff; color: #09090b; border-color: #fff; }

/* ===== 배경음악: 인스타 음악 고르기처럼 ===== */
.bgm-now { width: 100%; display: flex; align-items: center; gap: 12px; padding: 8px 10px 8px 8px; border-radius: 14px; border: 1px solid var(--border); background: #141416; text-align: left; cursor: pointer; }
.bgm-now:hover { border-color: rgba(255,255,255,.2); }
.bgm-cover { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; color: rgba(255,255,255,.9); font-size: 18px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.08); }
.bgm-now-txt, .bgm-row-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.bgm-now-txt strong, .bgm-row-txt strong { font-size: 14px; color: #ededed; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bgm-now-txt small, .bgm-row-txt small { font-size: 12px; color: #85858b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bgm-row-txt small b { color: #4cc38a; font-weight: 600; }
.bgm-now-go { flex: 0 0 auto; font-size: 13px; color: #a1a1a6; }
#arBgmSheet { align-items: flex-end; padding: 0; }
.bgm-sheet { width: 100%; max-width: 520px; margin: 0 auto; height: 82vh; display: flex; flex-direction: column; background: #121214; border: 1px solid var(--border-strong); border-bottom: 0; border-radius: 18px 18px 0 0; padding: 12px 14px 0; animation: aosUp 200ms var(--ease-out); }
.bgm-head { display: flex; align-items: center; justify-content: space-between; padding: 2px 2px 10px; }
.bgm-head strong { font-size: 17px; color: #fff; }
.bgm-done { height: 32px; padding: 0 14px; border-radius: 999px; border: 0; background: #fff; color: #09090b; font-size: 13px; font-weight: 700; cursor: pointer; }
.bgm-search { width: 100%; height: 40px; padding: 0 14px; border-radius: 12px; border: 0; background: #232327; color: #fff; font-size: 14px; outline: none; }
.bgm-search::placeholder { color: #85858b; }
.bgm-moods { display: flex; gap: 6px; overflow-x: auto; padding: 10px 0 8px; }
.bgm-moods button { flex: 0 0 auto; height: 32px; padding: 0 14px; border-radius: 999px; border: 0; background: #232327; color: #d4d4d8; font-size: 13px; font-weight: 600; cursor: pointer; }
.bgm-moods button.on { background: #fff; color: #09090b; }
.bgm-list { flex: 1; overflow-y: auto; padding-bottom: calc(14px + env(safe-area-inset-bottom)); }
.bgm-row { width: 100%; display: flex; align-items: center; gap: 12px; padding: 8px 2px; border: 0; background: transparent; text-align: left; cursor: pointer; border-radius: 10px; }
.bgm-row:hover { background: rgba(255,255,255,.03); }
.bgm-row-state { flex: 0 0 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; color: #d4d4d8; font-size: 13px; }
.bgm-row.on .bgm-row-state { color: #4cc38a; font-size: 16px; }
.bgm-row.on strong { color: #4cc38a; }
.bgm-cover-make { width: 48px; height: 48px; background: #232327 !important; font-size: 20px; }
.bgm-make strong { color: #ededed; }
.bgm-empty { padding: 24px 0; text-align: center; color: #85858b; font-size: 13px; }
.bgm-eq { display: inline-flex; align-items: flex-end; gap: 2px; height: 14px; }
.bgm-eq i { width: 3px; background: #4cc38a; border-radius: 1px; animation: bgmEq .9s ease-in-out infinite; }
.bgm-eq i:nth-child(2) { animation-delay: .2s; } .bgm-eq i:nth-child(3) { animation-delay: .4s; }
@keyframes bgmEq { 0%,100% { height: 4px; } 50% { height: 14px; } }

/* ===== 제작 단계 전체를 인스타 느낌으로 (사운드 탭과 같은 결) ===== */
/* 입력칸: 테두리 없는 둥근 회색 칸 */
.studio-panel input.studio-input:not([type=range]):not([type=checkbox]):not([type=file]),
.studio-panel textarea.studio-input,
.studio-panel .studio-input[type=text] { background: #1f1f22 !important; border: 1px solid transparent !important; border-radius: 12px !important; min-height: 44px; font-size: 15px !important; color: #f4f4f5 !important; padding-left: 14px !important; }
.studio-panel input.studio-input:focus, .studio-panel textarea.studio-input:focus { border-color: rgba(255,255,255,.28) !important; outline: none; background: #232327 !important; }
.studio-panel input.studio-input::placeholder, .studio-panel textarea.studio-input::placeholder { color: #6e6e73; }
.studio-panel label.block, .studio-panel .studio-sub > label { font-size: 13px !important; color: #a1a1a6 !important; }
.studio-panel .studio-sub { border-radius: 18px; background: #121214; border-color: rgba(255,255,255,.07); }
/* 선택 상자 → 한 줄 (지금 값 ›) */
select.ig-select-src { display: none !important; }
.ig-select-row { width: 100%; min-height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 14px; border-radius: 12px; border: 0; background: #1f1f22; color: #f4f4f5; font-size: 15px; text-align: left; cursor: pointer; }
.ig-select-row span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ig-select-row b { color: #85858b; font-weight: 400; font-size: 18px; }
.ig-select-row:hover { background: #26262a; }
.ig-select-row:disabled { opacity: .5; }
/* 주제 목록 */
.ig-list { display: flex; flex-direction: column; gap: 2px; }
.ig-list .topic-row { padding: 8px 4px; }
.ig-list .topic-row small b { color: #4cc38a; font-weight: 600; }
.ig-list .topic-row .bgm-row-state { color: #85858b; font-size: 20px; }
.ig-list .topic-row.on .bgm-row-state { color: #4cc38a; }
.ig-list .topic-pager { margin-top: 8px; }
.topic-pager button { border: 0 !important; background: #232327 !important; border-radius: 999px !important; }
/* 디자인: 지금 디자인 한 줄 */
.ig-now-wrap { display: flex; align-items: center; gap: 8px; }
.ig-now-wrap .bgm-now { flex: 1; min-width: 0; }
.ig-now-thumb { width: 40px; height: 64px; flex: 0 0 auto; border-radius: 8px; object-fit: cover; background: #0f0f10; box-shadow: inset 0 0 0 1px rgba(255,255,255,.08); }
.ig-round-btn { flex: 0 0 auto; width: 48px; height: 48px; border-radius: 50%; border: 0; background: #232327; font-size: 20px; cursor: pointer; }
.ig-round-btn:hover { background: #2c2c31; }
/* 엔딩: 보일 항목 = 인스타 설정 스위치 줄 */
#cardShowToggles.card-show-grid { display: flex; flex-direction: column; gap: 0; }
.ig-switch-row { display: flex; align-items: center; justify-content: space-between; min-height: 48px; padding: 0 2px; border-bottom: 1px solid rgba(255,255,255,.06); font-size: 15px; color: #ededed; cursor: pointer; user-select: none; }
.ig-switch-row:last-child { border-bottom: 0; }
.ig-switch-row input { position: absolute; opacity: 0; pointer-events: none; }
.ig-switch-row i { position: relative; width: 44px; height: 26px; border-radius: 999px; background: #3a3a40; transition: background .15s ease; flex: 0 0 auto; }
.ig-switch-row i::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .15s ease; }
.ig-switch-row input:checked + i { background: #4cc38a; }
.ig-switch-row input:checked + i::after { transform: translateX(18px); }
/* 버튼: 흰 알약(주 버튼) / 회색 알약(보조) */
.studio-panel .btn-primary { border-radius: 999px !important; min-height: 46px; font-weight: 700; }
.studio-panel .btn-secondary { border-radius: 999px !important; border-color: transparent !important; background: #232327 !important; }
.studio-panel .btn-secondary:hover { background: #2c2c31 !important; }
/* 단계 안내 상자 */
.studio-panel .ar-easy-only, #easyGuideBox { border-radius: 16px !important; }
.cut-ctl > select { background: #1f1f22 !important; border: 0 !important; border-radius: 10px !important; height: 40px !important; }
.cut-upload { border: 0 !important; background: #1f1f22 !important; border-radius: 999px !important; }
/* 발행: 인스타 '공유 대상'처럼 */
.ig-sns-list { display: flex; flex-direction: column; }
.ig-sns-row { display: flex; align-items: center; gap: 12px; min-height: 60px; border-bottom: 1px solid rgba(255,255,255,.06); }
.ig-sns-row:last-child { border-bottom: 0; }
.ig-sns-ic { flex: 0 0 40px; width: 40px; height: 40px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: #fff; font-size: 14px; font-weight: 800; }
.ig-sns-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ig-sns-txt strong { font-size: 15px; color: #ededed; font-weight: 600; }
.ig-sns-txt small { font-size: 12px; color: #85858b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ig-sns-row [id^=snsStatusBtn_] { flex: 0 0 auto; height: 30px; padding: 0 12px; border-radius: 999px; border: 0; background: #fff; color: #09090b; font-size: 12px; font-weight: 700; cursor: pointer; }
.ig-sns-row [id^=snsStatusBtn_].is-on { background: #232327; color: #a1a1a6; font-weight: 500; }
.ig-switch { position: relative; flex: 0 0 auto; cursor: pointer; }
.ig-switch input { position: absolute; opacity: 0; pointer-events: none; }
.ig-switch i { display: block; position: relative; width: 44px; height: 26px; border-radius: 999px; background: #3a3a40; transition: background .15s ease; }
.ig-switch i::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .15s ease; }
.ig-switch input:checked + i { background: #4cc38a; }
.ig-switch input:checked + i::after { transform: translateX(18px); }
.ig-switch input:disabled + i { opacity: .35; }
.ig-sns-txt strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 주제·대본 흐름 (인스타 순서: 고르고 → 보고 → 고치기) */
.ig-search-row { display: flex; align-items: center; gap: 6px; padding: 4px 4px 4px 0; border-radius: 14px; background: #1f1f22; }
.ig-search-row input { flex: 1; min-width: 0; background: transparent !important; border: 0 !important; }
.ig-search-go { flex: 0 0 auto; height: 38px; padding: 0 16px; border-radius: 10px; border: 0; background: #fff; color: #09090b; font-size: 14px; font-weight: 700; cursor: pointer; }
.ig-chip-row { display: flex; gap: 6px; flex-wrap: wrap; }
.ig-ctx-chip { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; height: 34px; padding: 0 12px; border-radius: 999px; border: 0; background: #1f1f22; cursor: pointer; }
.ig-ctx-chip span { font-size: 12px; color: #85858b; }
.ig-ctx-chip strong { font-size: 13px; color: #ededed; font-weight: 600; max-width: 180px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ig-variant-row { display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 2px 0 6px; }
.ig-variant { flex: 0 0 82%; scroll-snap-align: start; display: flex; flex-direction: column; gap: 6px; padding: 14px; border-radius: 16px; border: 1.5px solid rgba(255,255,255,.08); background: #1a1a1d; text-align: left; cursor: pointer; }
@media (min-width: 640px) { .ig-variant { flex-basis: calc(33.333% - 6px); } }
.ig-variant.on { border-color: #4cc38a; background: #10201a; }
.ig-variant-top { display: flex; align-items: center; gap: 6px; font-size: 12px; color: #85858b; }
.ig-variant-top em { font-style: normal; padding: 1px 8px; border-radius: 999px; background: #2a2a2e; color: #ededed; font-weight: 700; }
.ig-variant-top b { margin-left: auto; color: #4cc38a; font-weight: 600; }
.ig-variant strong { font-size: 16px; line-height: 1.35; color: #fff; font-weight: 700; }
.ig-variant small { font-size: 12px; line-height: 1.45; color: #a1a1a6; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
#productSheet { align-items: flex-end; padding: 0; }
.product-sheet-card { width: 100%; max-width: 520px; margin: 0 auto; max-height: 85vh; display: flex; flex-direction: column; gap: 10px; background: #121214; border: 1px solid var(--border-strong); border-bottom: 0; border-radius: 18px 18px 0 0; padding: 14px 14px calc(16px + env(safe-area-inset-bottom)); animation: aosUp 200ms var(--ease-out); }
#productSheet .aos-head { display: flex; align-items: center; justify-content: space-between; padding: 2px 2px 6px; }
#productSheet .aos-head strong { font-size: 17px; color: #fff; }
#todayTopicBadge { display: none !important; } /* 위쪽 '주제 · 상품' 칩이 대신 보여 줌 */
#aiGenNotice { font-size: 12px; line-height: 1.5; }
.cut-mix-row { display: flex; align-items: center; gap: 6px; padding: 2px 4px 2px 12px; border-radius: 14px; background: #141416; border: 1px solid var(--border); }
.cut-mix-row .ig-switch-row { flex: 1; min-width: 0; }
.cut-mix-row .ig-switch-row small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 230px; }

/* ==========================================================================
   ★ 미리보기 고정 + 바텀시트 (2026-11-17 사장님 요청)
   휴대폰: 위에는 재생 중인 미리보기가 항상 떠 있고, 아래 바텀시트(화면 약 절반)에서 단계별로 고름.
   손잡이를 누르거나 끌어내리면 시트가 접히고 미리보기가 커짐. 컷 편집 중에는 원래 화면 흐름으로.
   ========================================================================== */
/* PC: 미리보기 틀 바깥 오른쪽 / 휴대폰: 화면 오른쪽 */
#mainMonitorColumn > .monitor-frame { position: relative; }
@media (min-width: 1024px) {
  /* 데스크톱에서 오른쪽 빠른 버튼(#arQuickBar)이 우측 대본/주제 카드와 겹치지 않게 프레임 오른쪽 여백 확보 */
  #mainMonitorColumn > .monitor-frame { margin-right: 54px; }
}
#arQuickBar { position: absolute; left: calc(100% + 8px); top: 50%; transform: translateY(-50%); z-index: 15; display: flex; flex-direction: column; gap: 10px; }
#arQuickBar .aq-btn { width: 52px; display: flex; flex-direction: column; align-items: center; gap: 3px; border: 0; background: transparent; color: #fff; cursor: pointer; padding: 0; font-family: inherit; }
#arQuickBar .aq-dot { width: 40px; height: 40px; border-radius: 20px; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,0.42); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); transition: transform .12s ease, background .15s ease; }
#arQuickBar .aq-btn:active .aq-dot { transform: scale(0.9); }
#arQuickBar .aq-btn.is-off .aq-dot { background: rgba(0,0,0,0.65); opacity: .75; }
#arQuickBar .aq-label { font-size: 11px; font-weight: 700; line-height: 1.1; text-shadow: 0 1px 4px rgba(0,0,0,.6); white-space: nowrap; }
body.ar-cut-editing #arQuickBar { display: none; }
#arSheetHandle { display: none; }
#customDurationInput, #topCustomDurationInput { padding: 0 2px !important; text-align: center; -moz-appearance: textfield; }
#customDurationInput::-webkit-outer-spin-button,
#customDurationInput::-webkit-inner-spin-button,
#topCustomDurationInput::-webkit-outer-spin-button,
#topCustomDurationInput::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

@media (max-width: 1023px) {
  body.ar-sheet { --ar-msb: 64px; --ar-sheet: calc(52dvh - var(--ar-msb)); overflow: hidden; overscroll-behavior: none; }
  body.ar-sheet.ar-sheet-min { --ar-sheet: 82px; }
  /* 접었을 때는 손잡이 + 단계 탭만 보이게 */
  body.ar-sheet.ar-sheet-min:not(.ar-cut-editing) #studioWorkflowColumn > .studio-card > div:first-child { display: none; }
  body.ar-sheet header,
  body.ar-sheet #mobileLiveDock,
  body.ar-sheet footer,
  body.ar-sheet #dealerQuickSelectorBar { display: none !important; }

  /* 위: 미리보기 (항상 보임) */
  body.ar-sheet:not(.ar-cut-editing) #mainMonitorColumn {
    display: flex !important; position: fixed; left: 0; right: 0; top: 0;
    bottom: calc(var(--ar-sheet) + var(--ar-msb)); z-index: 30;
    padding: max(8px, env(safe-area-inset-top)) 0 8px; box-sizing: border-box;
    align-items: center; justify-content: center; background: #0b0b0d; transition: bottom .3s ease;
  }
  body.ar-sheet:not(.ar-cut-editing) #mainMonitorColumn > .monitor-frame {
    padding: 0; border: 0; background: transparent; box-shadow: none; height: 100%; width: auto; max-width: none;
    display: flex; justify-content: center; align-items: center;
  }
  body.ar-sheet:not(.ar-cut-editing) #mainMonitorColumn > .monitor-frame > :not(#previewViewport):not(#arQuickBar) { display: none !important; }
  body.ar-sheet:not(.ar-cut-editing) #previewViewport { height: 100%; width: auto; aspect-ratio: 9 / 16; }
  body.ar-sheet:not(.ar-cut-editing) #arQuickBar {
    position: fixed; left: auto; right: 6px; top: calc((100dvh - var(--ar-sheet) - var(--ar-msb)) / 2);
    gap: 5px; transition: top .3s ease;
  }
  body.ar-sheet:not(.ar-cut-editing) #arQuickBar .aq-dot { width: 32px; height: 32px; border-radius: 16px; }
  body.ar-sheet:not(.ar-cut-editing) #arQuickBar .aq-label { font-size: 9.5px; }
  /* 모바일 바텀시트에서는 #arQuickBar의 '디자인' 버튼이 대신하므로 캔버스 위 세로 손잡이(#presetHandle) 숨김 (확대 시 겹침·스티커 가림 방지) */
  body.ar-sheet #presetHandle { display: none !important; }
  /* 시트를 접어 미리보기가 커지면, 릴스처럼 오른쪽 아래에 5개 버튼 깔끔하게 고정 */
  body.ar-sheet.ar-sheet-min:not(.ar-cut-editing) #arQuickBar {
    top: auto; bottom: calc(var(--ar-sheet) + var(--ar-msb) + 16px); transform: none; right: 10px; gap: 7px;
  }

  /* 아래: 바텀시트 */
  body.ar-sheet:not(.ar-cut-editing) #studioWorkflowColumn {
    position: fixed; left: 0; right: 0; bottom: var(--ar-msb); height: var(--ar-sheet); z-index: 35;
    overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
    scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.2) transparent;
    background: var(--card, #161618); border-radius: 18px 18px 0 0; border-top: 1px solid var(--border);
    box-shadow: 0 -8px 24px rgba(0,0,0,0.35); transition: height .3s ease;
  }
  body.ar-sheet:not(.ar-cut-editing) #studioWorkflowColumn::-webkit-scrollbar { width: 4px; }
  body.ar-sheet:not(.ar-cut-editing) #studioWorkflowColumn::-webkit-scrollbar-track { background: transparent; }
  body.ar-sheet:not(.ar-cut-editing) #studioWorkflowColumn::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.22); border-radius: 9999px; }
  body.ar-sheet.ar-sheet-min:not(.ar-cut-editing) #studioWorkflowColumn { overflow: hidden; }
  body.ar-sheet:not(.ar-cut-editing) #studioWorkflowColumn > .studio-card { border: 0; border-radius: 0; background: transparent; box-shadow: none; }
  body.ar-sheet:not(.ar-cut-editing) #previewDealerHeader { display: none; }
  body.ar-sheet:not(.ar-cut-editing) #studioWorkflowColumn > .studio-card > div:first-child { padding: 2px 12px 4px; }
  body.ar-sheet:not(.ar-cut-editing) #studioWorkflowColumn > .studio-card > div.sticky { padding-top: 8px; padding-bottom: 8px; }
  body.ar-sheet:not(.ar-cut-editing) #arSheetHandle {
    display: flex; position: sticky; top: 0; z-index: 25; width: 100%; height: 24px; align-items: center; justify-content: center;
    background: var(--card, #161618); border: 0; cursor: pointer; touch-action: none; padding: 0;
  }
  #arSheetHandle span { width: 40px; height: 4px; border-radius: 2px; background: rgba(255,255,255,0.32); display: block; }
  body.ar-sheet:not(.ar-cut-editing) div.sticky:has(> .studio-tablist) { top: 24px !important; }

  /* 컷 편집 중: 시트·하단바는 숨기고 화면 안에 미리보기 + 컷 전환바 + 편집 시트를 깔끔하게 배치 */
  body.ar-sheet.ar-cut-editing { overflow: hidden; }
  body.ar-sheet.ar-cut-editing #studioWorkflowColumn { display: none; }
  body.ar-sheet.ar-cut-editing #mobileStepBar { display: none !important; }
  body.ar-sheet.ar-cut-editing #mainMonitorColumn {
    display: flex !important; position: fixed; inset: 0; z-index: 45;
    padding: max(8px, env(safe-area-inset-top)) 8px max(8px, env(safe-area-inset-bottom));
    box-sizing: border-box; flex-direction: column; align-items: stretch; justify-content: center;
    background: #0b0b0d; overflow: hidden;
  }
  body.ar-sheet.ar-cut-editing #mainMonitorColumn > .monitor-frame {
    padding: 0; border: 0; background: transparent; box-shadow: none;
    height: 100%; width: 100%; max-width: none; min-height: 0;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  }
  body.ar-sheet.ar-cut-editing #mainMonitorColumn > .monitor-frame > :not(#previewViewport):not(#cutEditorPanel):not(:has(#previewCutPinBar)) {
    display: none !important;
  }
  body.ar-sheet.ar-cut-editing #previewViewport {
    margin-top: 0 !important; margin-bottom: 0 !important;
    flex: 1 1 0; min-height: 0; height: 100%; width: auto; max-width: 100%;
    aspect-ratio: 9 / 16; overflow: hidden;
  }
  body.ar-sheet.ar-cut-editing #igTopBar {
    top: 6px !important; bottom: auto !important; left: 6px !important; right: 6px !important;
  }
  body.ar-sheet.ar-cut-editing #igSelectedBar {
    bottom: 6px !important; top: auto !important; left: 6px !important; right: 6px !important;
  }
  body.ar-sheet.ar-cut-editing #cutEditorPanel:not(.hidden) {
    flex: 0 0 auto; width: 100%; max-height: 45dvh; overflow-y: auto; overscroll-behavior: contain; margin-top: 0;
  }
  /* 모바일 디자인 서랍 열림: 바텀시트에 가리지 않게 전체 오버레이로 올려서 카드뉴스/디자인 썸네일이 시원하게 보이도록 */
  body.ar-sheet #mainMonitorColumn:has(#presetDrawer.open) {
    z-index: 60 !important;
    bottom: 0 !important;
  }
  body.ar-sheet #presetDrawer.open {
    position: fixed;
    inset: max(8px, env(safe-area-inset-top)) 8px max(8px, env(safe-area-inset-bottom)) 8px;
    width: auto;
    height: auto;
    max-width: none;
    border-radius: 18px;
    border: 1px solid rgba(255,255,255,0.14);
    z-index: 65;
  }
  body.ar-sheet #presetDrawer.open .pd-grid {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 8px;
  }
}

/* 상품 카드도 현재 상품에 맞는 사진을 사용합니다. */
.ar-product-cover { width: 44px; height: 44px; overflow: hidden; background: #1c1c1e; }
.ar-product-photo { width: 100%; height: 100%; object-fit: cover; display: block; }

/* 대본 생성 중에는 실제 진행률 대신 움직이는 대기 표시를 사용한다. */
.studio-panel .ar-script-loading:not(.hidden) { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 270px; padding: 32px 24px; text-align: center; }
.ar-script-loading-art { position: relative; width: 90px; height: 100px; margin-bottom: 20px; }
.ar-script-loading-card { position: absolute; inset: 8px 12px; display: flex; flex-direction: column; gap: 9px; padding: 16px 13px; border: 1px solid rgba(133,184,255,.55); border-radius: 12px; background: linear-gradient(145deg, rgba(55,90,145,.55), rgba(28,40,60,.8)); box-shadow: 0 10px 28px rgba(59,130,246,.18); transform: rotate(-6deg); animation: ar-script-float 2.6s ease-in-out infinite; }
.ar-script-loading-card span { display: block; height: 10px; border-radius: 5px; background: linear-gradient(90deg, rgba(76,195,138,.85) 25%, rgba(207,221,243,.42) 25%); }
.ar-script-loading-spark { position: absolute; right: 0; top: 6px; color: #80e3b0; font-size: 23px; animation: ar-script-spark 1.8s ease-in-out infinite; }
.ar-script-loading-title { margin: 0; color: #ededed; font-size: 17px; font-weight: 700; line-height: 1.5; }
.ar-script-loading-copy { margin: 4px 0 20px; color: #a1a1a6; font-size: 13px; }
.ar-script-loading-track { width: min(100%, 350px); height: 6px; overflow: hidden; border-radius: 999px; background: #303238; }
.ar-script-loading-track span { display: block; width: 42%; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #3b82f6, #7be5b1); animation: ar-script-loading 1.6s ease-in-out infinite; }
@keyframes ar-script-loading { from { transform: translateX(-105%); } to { transform: translateX(340%); } }
@keyframes ar-script-float { 0%,100% { transform: translateY(0) rotate(-6deg); } 50% { transform: translateY(-5px) rotate(-3deg); } }
@keyframes ar-script-spark { 0%,100% { opacity: .5; transform: scale(.8); } 50% { opacity: 1; transform: scale(1.1); } }
@media (prefers-reduced-motion: reduce) { .ar-script-loading-card, .ar-script-loading-spark, .ar-script-loading-track span { animation: none; } .ar-script-loading-track span { transform: translateX(70%); } }

/* 추천 카드가 길어도 분류 버튼과 목록을 눌러 볼 수 있도록 패널 전체를 스크롤합니다. */
.preset-drawer { overflow-y: auto; overscroll-behavior: contain; }
.preset-drawer > * { flex-shrink: 0; }
.preset-drawer .pd-cats { min-height: 44px; align-items: center; overflow-y: hidden; }
.preset-drawer .pd-list { flex: 0 0 auto; overflow-y: visible; }
