:root {
  --bg1: #16200c; --bg2: #2c3a14; --bg3: #3b1d12;
  --card: rgba(255, 255, 255, 0.055); --card-line: rgba(214, 245, 60, 0.22);
  --lime: #d4f53c; --lime-ink: #1d2508; --text: #f2f5e8; --muted: #b5bd9f;
  --danger: #ff6b6b; --radius: 18px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", system-ui, sans-serif;
  color: var(--text); background: var(--bg1);
  background-image: radial-gradient(120% 60% at 100% 0%, rgba(120, 40, 20, .55), transparent 60%),
                    linear-gradient(170deg, var(--bg2), var(--bg1) 70%);
  background-attachment: fixed; font-size: 15px; line-height: 1.45;
}
#app { max-width: 520px; margin: 0 auto; padding: 0 14px calc(20px + env(safe-area-inset-bottom)); }
.hidden { display: none !important; }
.muted { color: var(--muted); font-size: 13px; font-weight: 400; }
.center { text-align: center; }
button { font: inherit; color: inherit; cursor: pointer; }
a { color: var(--lime); }

/* top bar */
.topbar { display: flex; align-items: center; gap: 10px; padding: 14px 2px 10px; position: sticky; top: 0; z-index: 5;
  background: linear-gradient(var(--bg2) 70%, transparent); }
.brand { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.brand-icon { width: 30px; height: 30px; }
.brand-name { font-weight: 800; font-size: 19px; white-space: nowrap; }
.brand-name b { color: var(--lime); }
.icon-btn { width: 40px; height: 40px; border: 0; border-radius: 12px; background: transparent; display: grid; place-items: center; font-size: 26px; color: var(--lime); }
.seg { display: flex; background: rgba(0, 0, 0, .3); border-radius: 999px; padding: 3px; }
.seg button { border: 0; background: transparent; padding: 6px 14px; border-radius: 999px; font-size: 13px; font-weight: 700; color: var(--muted); }
.seg button.on { background: var(--lime); color: var(--lime-ink); }

/* cards */
.card { background: var(--card); border: 1px solid var(--card-line); border-radius: var(--radius); padding: 14px; margin: 12px 0;
  backdrop-filter: blur(6px); }
.inner { background: rgba(0, 0, 0, .18); border-radius: 14px; padding: 12px; margin-top: 10px; }
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.card-head h2, .sheet-head h2 { font-size: 16px; margin: 0; }
.count { color: var(--muted); font-size: 13px; }
.row-btn { width: 100%; display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto auto; text-align: left; border: 0;
  background: transparent; padding: 2px 0; }
.row-title { font-weight: 800; font-size: 16px; }
.row-sub { color: var(--muted); font-size: 13px; grid-row: 2; }
.chev { grid-row: 1 / span 2; grid-column: 2; align-self: center; font-size: 26px; color: var(--lime); transition: transform .2s; }
.chev.rot { transform: rotate(90deg); }
.chev.rot.open { transform: rotate(-90deg); }
.lang-row { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 6px; border: 1px solid rgba(255, 255, 255, .1);
  background: rgba(255, 255, 255, .04); border-radius: 12px; padding: 10px 14px; font-weight: 700; }
.lang-row .arrow { color: var(--lime); }
.chev.small { font-size: 16px; }
.field-label { display: block; font-size: 13px; font-weight: 700; margin: 12px 0 6px; color: var(--muted); }
.input { width: 100%; border: 1px solid rgba(255, 255, 255, .12); background: rgba(0, 0, 0, .28); color: var(--text); border-radius: 12px;
  padding: 12px 14px; font: inherit; font-size: 16px; outline: none; }
.input:focus { border-color: var(--lime); }
textarea.input { resize: vertical; line-height: 1.6; }
select.input { appearance: none; }
.btn { display: block; width: 100%; border: 0; border-radius: 14px; padding: 14px; font-weight: 800; font-size: 15px; margin-top: 12px; text-align: center; text-decoration: none; }
.btn.primary { background: var(--lime); color: var(--lime-ink); }
.btn.primary:disabled { opacity: .45; }
.btn.ghost { background: rgba(255, 255, 255, .07); color: var(--text); border: 1px solid rgba(255, 255, 255, .12); }
.btn.big { padding: 17px; font-size: 16px; }
.btn-row { display: flex; gap: 8px; }
.btn-row .btn { flex: 1; }
.chip-btn { border: 1px solid var(--lime); background: transparent; color: var(--lime); border-radius: 999px; padding: 6px 12px; font-size: 13px; font-weight: 700; }
.translate-out { margin-top: 10px; color: var(--muted); font-size: 14px; }
.translate-out .main { display: flex; align-items: center; gap: 8px; color: var(--text); font-size: 18px; font-weight: 800; }
.translate-out .alts { margin: 6px 0; }
.translate-out .alts button { border: 1px solid rgba(255,255,255,.15); background: transparent; border-radius: 999px; padding: 4px 10px; margin: 2px 4px 2px 0; font-size: 13px; }
.links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.links a { font-size: 13px; padding: 5px 10px; border-radius: 999px; background: rgba(214, 245, 60, .12); text-decoration: none; }
.copy { border: 0; background: rgba(255,255,255,.1); border-radius: 8px; padding: 4px 8px; font-size: 12px; }

/* upload */
.drop { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 120px; border: 2px dashed var(--lime);
  border-radius: 16px; background: rgba(214, 245, 60, .09); color: var(--lime); cursor: pointer; }
.drop.drag { background: rgba(214, 245, 60, .2); }
.drop-title { font-weight: 800; font-size: 16px; }
.help { color: var(--muted); font-size: 13px; margin: 10px 2px 0; }
.help.small { font-size: 12px; margin-top: 6px; }
.video-list { list-style: none; margin: 10px 0 0; padding: 0; }
.video-list li { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 12px; background: rgba(0, 0, 0, .2); margin-top: 8px; }
.video-list img, .thumb-ph { width: 48px; height: 64px; object-fit: cover; border-radius: 8px; background: #000; flex: none; }
.vmeta { flex: 1; min-width: 0; }
.vname { font-weight: 700; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vsub { color: var(--muted); font-size: 12px; }
.vsub.err { color: var(--danger); }
.mini-bar { height: 4px; background: rgba(255,255,255,.12); border-radius: 4px; margin-top: 6px; overflow: hidden; }
.mini-bar div { height: 100%; background: var(--lime); width: 0; transition: width .2s; }
.vbtns { display: flex; flex-direction: column; gap: 2px; }
.vbtns button { border: 0; background: rgba(255,255,255,.08); width: 34px; height: 26px; border-radius: 7px; font-size: 13px; }
.vbtns button.del { color: var(--danger); }

/* options */
.opts { margin-top: 10px; }
.opt-block { background: rgba(0,0,0,.18); border-radius: 14px; padding: 12px; margin-top: 10px; }
.opt-title { font-weight: 800; font-size: 14px; }
.toggle-row { display: flex; align-items: center; gap: 12px; justify-content: space-between; background: rgba(0,0,0,.18); border-radius: 14px; padding: 12px; margin-top: 10px; }
.toggle-row.tight { background: transparent; padding: 8px 0; }
.switch { position: relative; width: 50px; height: 30px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: rgba(255,255,255,.2); transition: .2s; }
.switch span::after { content: ""; position: absolute; width: 24px; height: 24px; left: 3px; top: 3px; border-radius: 50%; background: #fff; transition: .2s; }
.switch input:checked + span { background: var(--lime); }
.switch input:checked + span::after { transform: translateX(20px); background: var(--lime-ink); }
.stepper { display: inline-flex; align-items: center; gap: 4px; margin-top: 8px; background: rgba(0,0,0,.25); border-radius: 12px; padding: 4px; }
.stepper button { width: 40px; height: 36px; border: 0; border-radius: 9px; background: rgba(255,255,255,.08); font-size: 20px; }
.stepper b { min-width: 36px; text-align: center; font-size: 18px; }
.chips { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 10px; }
.chips.colors { grid-template-columns: repeat(3, 1fr); }
#s-subsize { grid-template-columns: repeat(3, 1fr); }
.chips button { border: 1px solid rgba(255,255,255,.14); background: rgba(0,0,0,.25); border-radius: 12px; padding: 10px 4px; font-weight: 800; font-size: 14px; }
.chips button.on { border-color: var(--lime); background: rgba(214,245,60,.18); box-shadow: inset 0 0 0 1px var(--lime); }
.chips button.wide { grid-column: span 2; }
.custom-speed { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
.custom-speed input { flex: 1; accent-color: var(--lime); }
input[type=range] { width: 100%; accent-color: var(--lime); }
.channels { display: flex; gap: 12px; overflow-x: auto; padding: 10px 2px 2px; }
.channel { flex: none; width: 72px; border: 0; background: transparent; display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 12px; }
.channel .av { width: 56px; height: 56px; border-radius: 16px; background: rgba(255,255,255,.85); display: grid; place-items: center; overflow: hidden;
  color: var(--lime-ink); font-weight: 900; font-size: 20px; border: 3px solid transparent; }
.channel .av img { width: 100%; height: 100%; object-fit: cover; }
.channel.on .av { border-color: var(--lime); }
.channel.add .av { background: transparent; border: 2px dashed var(--muted); color: var(--muted); }
.channel span { max-width: 72px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.cta-bar { position: fixed; left: 0; right: 0; bottom: 0; padding: 10px 14px calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(transparent, rgba(16, 22, 8, .96) 35%); z-index: 6; }
.cta-bar .btn { max-width: 492px; margin: 0 auto; box-shadow: 0 8px 24px rgba(0,0,0,.4); }
.bottom-space { height: 96px; }
.banner { background: rgba(255, 200, 60, .14); border: 1px solid rgba(255, 200, 60, .4); border-radius: 14px; padding: 10px 12px; font-size: 13px; margin-top: 6px; }
.banner button { border: 0; background: transparent; color: var(--lime); font-weight: 800; padding: 0; text-decoration: underline; }

.recent { list-style: none; margin: 0; padding: 0; }
.recent li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid rgba(255,255,255,.06); cursor: pointer; }
.recent li:first-child { border-top: 0; }
.recent img, .recent .thumb-ph { width: 40px; height: 54px; }

/* progress */
#view-progress { padding-top: 26px; }
.progress-head h1 { margin: 4px 0; font-size: 22px; }
.pct { font-size: 34px; font-weight: 900; color: var(--lime); margin-top: 18px; }
.bar { height: 12px; background: rgba(255,255,255,.12); border-radius: 999px; overflow: hidden; margin-top: 6px; }
.bar div { height: 100%; background: linear-gradient(90deg, #b7dd2a, var(--lime)); width: 0; border-radius: 999px; transition: width .6s; }
.bar-labels { display: flex; justify-content: space-between; gap: 8px; margin-top: 8px; font-size: 13px; font-weight: 700; }
.stage-label { color: var(--lime); white-space: nowrap; }
.note { color: #ffd36b; }
.previews { display: flex; gap: 12px; overflow-x: auto; padding: 16px 2px 6px; scroll-snap-type: x mandatory; }
.pv { flex: none; width: 170px; scroll-snap-align: center; border-radius: 16px; overflow: hidden; position: relative; background: #000; border: 2px solid var(--card-line); aspect-ratio: 9/16; }
.pv.active { border-color: var(--lime); }
.pv img { width: 100%; height: 100%; object-fit: cover; opacity: .75; }
.pv .badge { position: absolute; top: 8px; left: 8px; background: rgba(0,0,0,.6); border-radius: 8px; padding: 3px 7px; font-size: 11px; font-weight: 800; line-height: 1.3; }
.pv .badge small { display: block; font-weight: 600; color: var(--muted); }
.pv .pv-foot { position: absolute; left: 8px; right: 8px; bottom: 8px; font-size: 12px; font-weight: 700; }
.pv .pv-foot .mini-bar { margin-top: 4px; }
.pv.err { border-color: var(--danger); }
.detail { margin-top: 12px; }
.detail .stage { display: flex; align-items: center; gap: 8px; font-weight: 800; color: var(--lime); }
.dot { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--lime); position: relative; flex: none; }
.dot::after { content: ""; position: absolute; inset: 2px; border-radius: 50%; background: var(--lime); animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity: .2; } }
.title-preview { background: #0b0b0b; border-radius: 12px; padding: 14px; margin: 12px 0; text-align: center; font-weight: 900; font-size: 20px; line-height: 1.3; }
.script-lines { margin: 0; padding: 0; list-style: none; counter-reset: n; }
.script-lines li { counter-increment: n; display: flex; gap: 10px; padding: 5px 0; font-size: 14px; }
.script-lines li::before { content: counter(n); color: var(--lime); font-weight: 900; min-width: 16px; }
.skeleton div { height: 12px; border-radius: 6px; background: rgba(255,255,255,.1); margin: 10px 0; animation: pulse 1.4s infinite; }

/* result */
.result-card { background: var(--card); border: 1px solid var(--card-line); border-radius: 22px; padding: 12px; margin: 14px 0; }
.result-card .rc-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; font-size: 13px; font-weight: 800; }
.result-card video { width: 100%; border-radius: 14px; background: #000; aspect-ratio: 9/16; display: block; }
.result-card .err { color: var(--danger); font-size: 14px; }
.meta-box { background: rgba(0,0,0,.25); border-radius: 12px; padding: 10px 12px; margin-top: 10px; font-size: 13px; }
.meta-box .desc { white-space: pre-wrap; }
.meta-box .copy { display: block; margin-top: 8px; }
.meta-box .tags { color: #9fd3ff; margin-top: 6px; }
.result-actions { margin: 6px 0 30px; }

/* sheets */
.sheet-wrap { position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 20; display: flex; align-items: center; justify-content: center;
  padding: max(14px, env(safe-area-inset-top)) 12px max(14px, env(safe-area-inset-bottom)); }
.sheet { width: 100%; max-width: 520px; max-height: 84vh; max-height: 84dvh; overflow-y: auto; overscroll-behavior: contain;
  background: linear-gradient(170deg, #2a3713, #182109); border-radius: 22px;
  padding: 16px 16px 22px; border: 1px solid var(--card-line); box-shadow: 0 18px 50px rgba(0,0,0,.28); animation: up .2s ease-out; }
@keyframes up { from { transform: translateY(16px) scale(.98); opacity: 0; } }
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.sheet h3 { margin: 22px 0 4px; font-size: 15px; color: var(--lime); }
.close { color: var(--text); font-size: 20px; }
.lib-list { list-style: none; margin: 10px 0 0; padding: 0; }
.lib-list li { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 14px; background: rgba(255,255,255,.05); margin-top: 8px; }
.lib-list img, .lib-list .thumb-ph { width: 46px; height: 60px; }
.lib-list .pick { border: 0; background: transparent; color: var(--lime); font-weight: 900; padding: 8px; }
.lib-list .rm { border: 0; background: transparent; color: var(--muted); padding: 8px; }
.empty { text-align: center; color: var(--muted); padding: 30px 0; }
.ai-status { font-size: 13px; background: rgba(0,0,0,.25); border-radius: 12px; padding: 10px 12px; }
.ai-status .ok { color: var(--lime); font-weight: 800; }
.ai-status .no { color: #ffb36b; font-weight: 800; }
.channel-admin { list-style: none; margin: 0; padding: 0; }
.channel-admin li { display: flex; align-items: center; gap: 10px; padding: 8px 0; }
.channel-admin .av { width: 40px; height: 40px; border-radius: 12px; background: rgba(255,255,255,.85); overflow: hidden; display: grid; place-items: center; color: var(--lime-ink); font-weight: 900; flex: none; }
.channel-admin .av img { width: 100%; height: 100%; object-fit: cover; }
.channel-admin .grow { flex: 1; min-width: 0; }
.channel-admin button { border: 0; background: rgba(255,255,255,.08); border-radius: 8px; padding: 6px 10px; font-size: 12px; }
.channel-form .input { margin-top: 8px; }
.file-btn { display: block; margin-top: 8px; padding: 12px; border-radius: 12px; border: 1px dashed rgba(255,255,255,.3); text-align: center; color: var(--muted); font-size: 14px; cursor: pointer; }

/* v3: 모드 탭, 번역, 소재, 버전 체크박스 */
.mode-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; background: rgba(0,0,0,.3); border-radius: 18px; padding: 5px; margin-top: 2px; }
.mode-tabs button { border: 0; background: transparent; border-radius: 14px; padding: 10px 6px; color: var(--muted); display: flex; flex-direction: column; align-items: center; line-height: 1.25; }
.mode-tabs button b { font-size: 15px; }
.mode-tabs button small { font-size: 11px; opacity: .85; }
.mode-tabs button.on { background: var(--lime); color: var(--lime-ink); box-shadow: 0 4px 14px rgba(212,245,60,.25); }
.field-label.first { margin-top: 0; }
.tr-empty { color: var(--muted); }
.tr-row { background: rgba(0,0,0,.22); border-radius: 12px; padding: 10px 12px; margin-top: 8px; }
.tr-row .tr-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tr-row .lang { font-size: 12px; color: var(--muted); font-weight: 700; }
.tr-row .main { font-size: 17px; font-weight: 800; color: var(--text); word-break: break-all; }
.source-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.source-btn { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 108px; border: 2px dashed var(--lime);
  border-radius: 16px; background: rgba(214,245,60,.08); color: var(--lime); text-align: center; cursor: pointer; font-size: 14px; line-height: 1.3; }
.source-btn:active { background: rgba(214,245,60,.2); }
.source-btn .ico { font-size: 26px; }
.video-list .order { width: 22px; height: 22px; border-radius: 50%; background: var(--lime); color: var(--lime-ink); font-size: 12px; font-weight: 900; display: grid; place-items: center; flex: none; }
.video-list .tag { font-size: 10px; padding: 1px 6px; border-radius: 6px; background: rgba(214,245,60,.15); color: var(--lime); margin-left: 4px; }
.formats { display: grid; gap: 8px; }
.fmt { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 14px; background: rgba(0,0,0,.2); border: 1px solid transparent; cursor: pointer; }
.fmt input { position: absolute; opacity: 0; pointer-events: none; }
.fmt .box { width: 26px; height: 26px; border-radius: 8px; border: 2px solid var(--muted); flex: none; display: grid; place-items: center; }
.fmt input:checked + .box { background: var(--lime); border-color: var(--lime); }
.fmt input:checked + .box::after { content: "✓"; color: var(--lime-ink); font-weight: 900; font-size: 16px; }
.fmt:has(input:checked) { border-color: var(--card-line); background: rgba(214,245,60,.08); }
.fmt b { display: block; font-size: 15px; }
.fmt small { color: var(--muted); font-size: 12px; }
.len-meter { display: flex; align-items: center; gap: 10px; margin-top: 8px; font-size: 12px; color: var(--muted); }
.len-bar { flex: 1; height: 6px; background: rgba(255,255,255,.12); border-radius: 6px; overflow: hidden; }
.len-bar div { height: 100%; width: 0; background: var(--lime); transition: width .2s; }
.len-meter.over .len-bar div { background: #ffb36b; }
.lib-section { margin-top: 16px; font-size: 13px; font-weight: 800; color: var(--lime); }
.lib-folder { font-size: 11px; color: var(--muted); word-break: break-all; margin-top: 4px; }
.lib-list .thumbs { display: flex; gap: 3px; flex: none; }
.lib-list .thumbs img { width: 34px; height: 46px; border-radius: 6px; object-fit: cover; }
.copy-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.copy-row .btn { margin-top: 0; padding: 12px 8px; font-size: 14px; }
.rc-script { margin: 8px 0 0; padding: 0; list-style: none; font-size: 13px; color: var(--muted); }
.rc-script li { padding: 2px 0; }
.cut-info { font-size: 12px; color: var(--muted); margin-top: 6px; text-align: center; }

/* v5: 폰 연결 · 보안 */
.phone-btn { border: 1px solid var(--lime); background: rgba(214,245,60,.1); color: var(--lime); border-radius: 999px; padding: 7px 12px; font-size: 13px; font-weight: 800; white-space: nowrap; }
.step { display: flex; gap: 10px; align-items: flex-start; margin-top: 14px; font-size: 14px; }
.step > b { width: 24px; height: 24px; border-radius: 50%; background: var(--lime); color: var(--lime-ink); display: grid; place-items: center; flex: none; font-size: 13px; }
.qr-box { background: #fff; border-radius: 18px; padding: 14px; margin: 14px auto 0; width: min(280px, 80vw); aspect-ratio: 1; display: grid; place-items: center; }
.qr-box svg { width: 100%; height: 100%; display: block; }
.qr-box.expired { opacity: .25; }
.url-box { background: rgba(0,0,0,.25); border-radius: 12px; padding: 12px; margin-top: 14px; font-size: 13px; line-height: 1.7; word-break: break-all; }
.url-box b { font-size: 16px; color: var(--lime); }
.howto { display: grid; gap: 10px; margin-top: 8px; }
.howto-card { background: rgba(0,0,0,.22); border-radius: 14px; padding: 12px 14px; font-size: 14px; }
.howto-card ol { margin: 6px 0 0; padding-left: 20px; color: var(--muted); }
.howto-card ol b { color: var(--text); }
.howto-card.dim { opacity: .45; }

/* 머리 부분 테마 전환 (밝게 · 어둡게 · 자동) */
.theme-seg { display: flex; flex: none; border: 1px solid var(--line); border-radius: 999px; padding: 2px; background: var(--card); }
.theme-seg button { border: 0; background: transparent; min-width: 32px; height: 30px; padding: 0 7px; border-radius: 999px; font-size: 14px; font-weight: 800; color: var(--muted); line-height: 1; }
.theme-seg button.on { background: var(--lime); color: var(--lime-ink); }
@media (max-width: 380px) { .theme-seg button { min-width: 28px; padding: 0 5px; font-size: 12px; } }

@media (max-width: 380px) {
  .phone-btn span { display: none; }
  #app { padding-left: 10px; padding-right: 10px; }
  .brand-name { font-size: 16px; }
  .brand-icon { width: 26px; height: 26px; }
  .seg button { padding: 6px 10px; }
  .chips button { font-size: 13px; padding: 9px 2px; }
}
.toast { position: fixed; left: 50%; bottom: 100px; transform: translateX(-50%); background: rgba(10, 14, 4, .95); border: 1px solid var(--lime);
  color: var(--text); padding: 10px 16px; border-radius: 12px; font-size: 14px; z-index: 40; max-width: 90vw; text-align: center; }

/* ---------- 인기 급상승 쇼츠 리서치 · 45초 대본 ---------- */
.research-entry { display: flex; flex-direction: column; align-items: center; gap: 2px; margin: 4px 0 12px; border-color: var(--card-line); }
.research-entry small { font-size: 12px; font-weight: 500; color: var(--muted); }
.chips.rs-days { grid-template-columns: repeat(3, 1fr); }
.rs-list { list-style: none; padding: 0; margin: 0; }
.rs-item { background: var(--card); border: 1px solid var(--card-line); border-radius: var(--radius); padding: 12px; margin: 10px 0; }
.rs-item.on { border-color: var(--lime); box-shadow: inset 0 0 0 1px var(--lime); }
.rs-top { display: flex; gap: 10px; }
.rs-thumb { position: relative; flex: 0 0 96px; height: 128px; border-radius: 10px; overflow: hidden; background: #000; display: block; }
.rs-thumb img { width: 100%; height: 100%; object-fit: cover; }
.rs-rank { position: absolute; left: 4px; top: 4px; background: var(--lime); color: var(--lime-ink); font-weight: 900; font-size: 12px; border-radius: 6px; padding: 1px 6px; }
.rs-dur { position: absolute; right: 4px; bottom: 4px; background: rgba(0,0,0,.7); color: #fff; font-size: 11px; border-radius: 4px; padding: 0 4px; }
.rs-body { flex: 1; min-width: 0; }
.rs-title { font-weight: 800; font-size: 14px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rs-stats { display: flex; flex-wrap: wrap; gap: 4px 6px; margin-top: 6px; font-size: 12px; }
.rs-stats span { background: rgba(0,0,0,.3); border-radius: 6px; padding: 2px 6px; }
.rs-stats .rs-score { background: rgba(214,245,60,.18); color: var(--lime); font-weight: 800; }
.rs-row { display: flex; gap: 8px; font-size: 13px; margin-top: 8px; line-height: 1.4; }
.rs-row > b { flex: 0 0 auto; color: var(--lime); }
.rs-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.rs-tags span { font-size: 12px; border: 1px solid rgba(214,245,60,.35); border-radius: 999px; padding: 2px 8px; }
.rs-pick { margin-top: 10px; padding: 10px; }
.rs-hooks { display: grid; gap: 6px; margin: 8px 0 4px; }
.rs-hooks button { text-align: left; border: 1px solid rgba(255,255,255,.14); background: rgba(0,0,0,.25); border-radius: 12px; padding: 10px; font-size: 14px; font-weight: 700; color: var(--text); }
.rs-hooks button.on { border-color: var(--lime); background: rgba(214,245,60,.15); }
.rs-scenes { list-style: none; padding: 0; margin: 10px 0 0; }
.rs-scenes li { border-left: 3px solid var(--lime); padding: 6px 0 8px 10px; margin-bottom: 8px; font-size: 14px; }
.rs-sc-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.rs-sub { margin-left: auto; background: #fff; color: #111; font-weight: 900; font-size: 12px; border-radius: 6px; padding: 1px 6px; }
.rs-nar { line-height: 1.45; }
.rs-vp { font-size: 12px; color: #9fd3ff; margin-top: 4px; line-height: 1.4; }
.rs-json { background: rgba(0,0,0,.35); border-radius: 12px; padding: 10px; font-size: 11px; max-height: 260px; overflow: auto; white-space: pre-wrap; word-break: break-all; margin-top: 10px; }

/* =====================================================================
   v7: 밝은 테마 (위의 어두운 테마 규칙을 덮어쓴다)
   - 배경: 밝은 회청색 / 카드: 흰색
   - 버튼·강조: 진한 파랑(대비색) / 인기 급상승 쇼츠 찾기: 주황→빨강
   ===================================================================== */
:root {
  --bg1: #eef2f9; --bg2: #f7f9fd;
  --card: #ffffff; --card-line: #dbe3f1;
  --lime: #2f5bea; --lime-ink: #ffffff;      /* 이름은 그대로 두고 강조색만 파랑으로 */
  --text: #1c2130; --muted: #5d6475;
  --danger: #e03131;
  --soft: #f2f5fb; --line: #d5ddec; --tint: rgba(47, 91, 234, .09);
  --hot1: #ff7a00; --hot2: #ff2d55;
}
body { background: var(--bg1); background-image: linear-gradient(180deg, #f7f9fd, var(--bg1) 60%); }
.topbar { background: linear-gradient(var(--bg2) 70%, rgba(247, 249, 253, 0)); }
.card, .result-card, .rs-item { box-shadow: 0 2px 10px rgba(28, 33, 48, .06); backdrop-filter: none; }

/* 안쪽 회색 박스 */
.inner, .opt-block, .toggle-row, .video-list li, .meta-box, .ai-status, .tr-row, .fmt, .url-box,
.howto-card, .rs-stats span, .rs-json, .lib-list li, .lang-row { background: var(--soft); }
.toggle-row.tight { background: transparent; }
.lang-row { border-color: var(--line); }
.recent li { border-top-color: var(--line); }

/* 입력칸 */
.input { background: #fff; border: 1px solid var(--line); color: var(--text); }
.input:focus { border-color: var(--lime); box-shadow: 0 0 0 3px var(--tint); }

/* 버튼: 대비색 */
.btn.primary { background: var(--lime); color: #fff; box-shadow: 0 4px 14px rgba(47, 91, 234, .28); }
.btn.primary:active { background: #2349c9; }
.btn.ghost { background: #fff; color: var(--lime); border: 1.5px solid var(--lime); }
.btn.ghost:active { background: var(--tint); }
.cta-bar { background: linear-gradient(rgba(238, 242, 249, 0), rgba(238, 242, 249, .97) 35%); }
.cta-bar .btn { box-shadow: 0 8px 22px rgba(47, 91, 234, .35); }
.chip-btn, .phone-btn { background: #fff; }
.copy { background: var(--tint); color: var(--lime); font-weight: 700; }
.translate-out .alts button { border-color: var(--line); background: #fff; }
.links a { background: var(--tint); }
.vbtns button, .stepper button, .channel-admin button { background: #fff; border: 1px solid var(--line); }
.stepper { background: var(--soft); }
.chips button { background: #fff; border-color: var(--line); color: var(--text); }
.chips button.on { background: var(--tint); border-color: var(--lime); color: var(--lime); }
.seg, .mode-tabs { background: #e1e7f2; }
.mode-tabs button.on { background: var(--lime); color: #fff; box-shadow: 0 4px 14px rgba(47, 91, 234, .3); }
.switch span { background: #cfd7e6; }
.switch input:checked + span::after { background: #fff; }
.source-btn, .drop { background: var(--tint); }
.source-btn:active, .drop.drag { background: rgba(47, 91, 234, .18); }
.fmt:has(input:checked) { background: var(--tint); border-color: rgba(47, 91, 234, .35); }
.video-list .tag { background: var(--tint); }
.file-btn { border-color: var(--line); background: #fff; }

/* 진행 막대 · 기타 */
.mini-bar, .bar, .len-bar { background: #e1e7f2; }
.bar div { background: linear-gradient(90deg, #5b7cff, var(--lime)); }
.skeleton div { background: #e1e7f2; }
.note { color: #b25e00; }
.ai-status .no { color: #d9480f; }
.banner { background: #fff6e0; border-color: #ffd98a; }
.meta-box .tags, .rs-vp { color: #1f6fb2; }
.channel .av, .channel-admin .av { background: #fff; color: var(--lime); border: 2px solid var(--line); }
.channel.on .av { border-color: var(--lime); }
.channel.add .av { border: 2px dashed var(--muted); }

/* 영상 위에 겹치는 요소는 어두운 바탕 + 흰 글자 유지 */
.title-preview { color: #fff; }
.pv .badge, .pv .pv-foot { color: #fff; }
.pv .badge small { color: #d5dbe6; }

/* 팝업 · 알림 */
.sheet-wrap { background: rgba(20, 28, 48, .45); }
.sheet { background: #fff; border-color: var(--line); }
.toast { background: #1c2130; border-color: #1c2130; color: #fff; }

/* 인기 급상승 쇼츠 결과 */
.rs-stats .rs-score { background: rgba(255, 45, 85, .1); color: var(--hot2); }
.rs-tags span { border-color: rgba(47, 91, 234, .35); color: var(--lime); }
.rs-hooks button { background: #fff; border-color: var(--line); }
.rs-hooks button.on { background: var(--tint); border-color: var(--lime); }
.rs-sub { background: #1c2130; color: #fff; }

/* 🔥 인기 급상승 쇼츠 찾기: 가장 눈에 띄는 버튼 */
.btn.research-entry {
  background: linear-gradient(135deg, var(--hot1), var(--hot2)); color: #fff; border: 0;
  font-size: 18px; font-weight: 900; padding: 18px 14px; letter-spacing: -.2px;
  box-shadow: 0 8px 22px rgba(255, 45, 85, .35);
}
.btn.research-entry small { color: rgba(255, 255, 255, .92); font-weight: 600; }
.btn.research-entry:active { transform: scale(.98); box-shadow: 0 4px 12px rgba(255, 45, 85, .35); }

/* 로그인 화면 숫자 패드 */
.pad button { background: #fff !important; border: 1px solid var(--line) !important; color: var(--text) !important; }
.pad .fn { background: transparent !important; border: 0 !important; color: var(--muted) !important; }
.pad .go { background: var(--lime) !important; border: 0 !important; color: #fff !important; }
.pad button:active { background: var(--tint) !important; }
.msg { color: #d9480f !important; }

/* =====================================================================
   v9: 설정 화면 새 기능
   ===================================================================== */
.chips.two { grid-template-columns: repeat(2, 1fr); }
.chips.three { grid-template-columns: repeat(3, 1fr); }
.chips.five { grid-template-columns: repeat(5, 1fr); }
.chips.five button { padding: 10px 2px; font-size: 13px; }
.voice-row { display: flex; gap: 8px; align-items: center; }
.voice-row .input { flex: 1; }
.play-btn { flex: none; width: 48px; height: 48px; border-radius: 12px; border: 1.5px solid var(--lime); background: var(--card);
  color: var(--lime); font-size: 18px; font-weight: 900; }
.play-btn.playing { background: var(--lime); color: #fff; }
.play-btn:disabled { opacity: .6; }
.sub-preview { height: 150px; margin-top: 10px; border-radius: 14px; padding: 14px 12px; display: flex; flex-direction: column;
  align-items: center; justify-content: flex-end; text-align: center;
  background: linear-gradient(160deg, #6d7f99, #39475e 55%, #1e2635); }
.sub-preview span { font-weight: 900; line-height: 1.3; color: #fff; word-break: keep-all;
  -webkit-text-stroke: 0; text-shadow: -2px -2px 0 #000, 2px -2px 0 #000, -2px 2px 0 #000, 2px 2px 0 #000, 0 3px 0 #000, 0 -3px 0 #000, 3px 0 0 #000, -3px 0 0 #000; }
.sub-preview span.boxed { text-shadow: none; background: rgba(0, 0, 0, .7); border-radius: 10px; padding: 4px 12px; }
.corner-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 4px; }
.corner-pick button { border: 1px solid var(--line); background: var(--card); color: var(--text); border-radius: 12px; padding: 12px 4px; font-weight: 800; font-size: 14px; }
.corner-pick button:nth-child(even) { text-align: right; padding-right: 12px; }
.corner-pick button:nth-child(odd) { text-align: left; padding-left: 12px; }
.corner-pick button.on { background: var(--tint); border-color: var(--lime); color: var(--lime); box-shadow: inset 0 0 0 1px var(--lime); }
.dim-block { opacity: .4; pointer-events: none; }
.sheet h3 .muted { font-size: 12px; font-weight: 600; }
#defaults-status { line-height: 1.7; }
#defaults-status b { color: var(--text); }

/* 글자 크기 (이 기기 설정) */
html[data-fs="large"] body { zoom: 1.1; }
html[data-fs="xlarge"] body { zoom: 1.22; }

/* =====================================================================
   v9: 어두운 테마 (html[data-theme=dark])
   ===================================================================== */
html[data-theme="dark"] {
  --bg1: #10151f; --bg2: #161d2b;
  --card: #1b2333; --card-line: #2a3549;
  --lime: #6f93ff; --lime-ink: #ffffff;
  --text: #e8ecf5; --muted: #9aa4b8;
  --danger: #ff6b6b;
  --soft: #222c3f; --line: #334058; --tint: rgba(111, 147, 255, .14);
}
html[data-theme="dark"] body { background: var(--bg1); background-image: linear-gradient(180deg, #161d2b, var(--bg1) 60%); }
html[data-theme="dark"] .topbar { background: linear-gradient(var(--bg2) 70%, rgba(22, 29, 43, 0)); }
html[data-theme="dark"] .card, html[data-theme="dark"] .result-card, html[data-theme="dark"] .rs-item { box-shadow: 0 2px 12px rgba(0, 0, 0, .35); }
html[data-theme="dark"] .input { background: #121926; border-color: var(--line); color: var(--text); }
html[data-theme="dark"] .btn.ghost, html[data-theme="dark"] .chip-btn, html[data-theme="dark"] .phone-btn,
html[data-theme="dark"] .translate-out .alts button, html[data-theme="dark"] .vbtns button, html[data-theme="dark"] .stepper button,
html[data-theme="dark"] .channel-admin button, html[data-theme="dark"] .chips button, html[data-theme="dark"] .file-btn,
html[data-theme="dark"] .rs-hooks button, html[data-theme="dark"] .play-btn, html[data-theme="dark"] .corner-pick button { background: var(--card); }
html[data-theme="dark"] .chips button.on, html[data-theme="dark"] .corner-pick button.on, html[data-theme="dark"] .rs-hooks button.on { background: var(--tint); }
html[data-theme="dark"] .play-btn.playing { background: var(--lime); }
html[data-theme="dark"] .btn.primary { box-shadow: 0 4px 14px rgba(111, 147, 255, .25); }
html[data-theme="dark"] .btn.primary:active { background: #5a7ef0; }
html[data-theme="dark"] .seg, html[data-theme="dark"] .mode-tabs { background: #0d121b; }
html[data-theme="dark"] .switch span { background: #3a465c; }
html[data-theme="dark"] .mini-bar, html[data-theme="dark"] .bar, html[data-theme="dark"] .len-bar,
html[data-theme="dark"] .skeleton div { background: #2a3549; }
html[data-theme="dark"] .cta-bar { background: linear-gradient(rgba(16, 21, 31, 0), rgba(16, 21, 31, .97) 35%); }
html[data-theme="dark"] .banner { background: rgba(255, 190, 60, .12); border-color: rgba(255, 190, 60, .4); }
html[data-theme="dark"] .note { color: #ffc266; }
html[data-theme="dark"] .ai-status .no { color: #ff9a5c; }
html[data-theme="dark"] .meta-box .tags, html[data-theme="dark"] .rs-vp { color: #8cc4ff; }
html[data-theme="dark"] .channel .av, html[data-theme="dark"] .channel-admin .av { background: var(--card); }
html[data-theme="dark"] .sheet-wrap { background: rgba(0, 0, 0, .6); }
html[data-theme="dark"] .sheet { background: #161d2b; }
html[data-theme="dark"] .toast { background: #e8ecf5; border-color: #e8ecf5; color: #10151f; }
html[data-theme="dark"] .rs-sub { background: #e8ecf5; color: #10151f; }
html[data-theme="dark"] .pad button { background: var(--card) !important; }
html[data-theme="dark"] .pad .fn { background: transparent !important; }
html[data-theme="dark"] .pad .go { background: var(--lime) !important; }
html[data-theme="dark"] .msg { color: #ff9a5c !important; }

/* =====================================================================
   v10: 밝은 테마 파스텔 메뉴 구분 + 언어별 색
   - 카드마다 파스텔 바탕·테두리·제목 막대 색을 다르게 (tone-*)
   - 언어마다 고유 색 (lc-* / lp-*): 한국어 파랑 · 영어 보라 · 일본어 분홍 · 스페인어 주황 · 중국어 빨강
   ===================================================================== */
.tone-sky   { --tc: #3b82f6; --tbg: #eef6ff; --tline: #cfe2fb; }
.tone-mint  { --tc: #10a36b; --tbg: #ebf9f2; --tline: #c3ebd7; }
.tone-lilac { --tc: #7c5ce6; --tbg: #f3efff; --tline: #ddd3fc; }
.tone-peach { --tc: #e8742f; --tbg: #fff3ea; --tline: #fbd9c2; }
.tone-lemon { --tc: #c48a00; --tbg: #fffaea; --tline: #f2e2a8; }
.tone-rose  { --tc: #e0457b; --tbg: #fff1f5; --tline: #f8d2de; }
.lc-ko, .lp-ko { --lc: #2f5bea; --lbg: #edf2ff; }
.lc-en, .lp-en { --lc: #6d4fd8; --lbg: #f2eeff; }
.lc-ja, .lp-ja { --lc: #e0457b; --lbg: #fff0f5; }
.lc-es, .lp-es { --lc: #e8742f; --lbg: #fff2e8; }
.lc-zh, .lp-zh { --lc: #d63a3a; --lbg: #ffeeee; }
.lp-all        { --lc: #0f9d8a; --lbg: #e8f8f5; }

/* 카드 제목 앞 색 막대 */
[class*="tone-"] .card-head h2 { display: flex; align-items: center; gap: 8px; }
[class*="tone-"] .card-head h2::before { content: ""; width: 5px; height: 18px; border-radius: 3px; background: var(--tc); flex: none; }

html:not([data-theme="dark"]) .card[class*="tone-"] { background: var(--tbg); border-color: var(--tline); }
html:not([data-theme="dark"]) .card[class*="tone-"] .card-head h2 { color: color-mix(in srgb, var(--tc) 70%, #1c2130); }
/* 파스텔 카드 안의 회색 상자는 흰색으로 띄워서 구분 */
html:not([data-theme="dark"]) .card[class*="tone-"] :is(.opt-block, .video-list li, .tr-row, .fmt, .stepper) { background: rgba(255, 255, 255, .82); }
html:not([data-theme="dark"]) .card[class*="tone-"] .source-btn { background: rgba(255, 255, 255, .7); border-color: var(--tc); color: var(--tc); }
html:not([data-theme="dark"]) .card[class*="tone-"] .count { color: var(--tc); font-weight: 700; }
html:not([data-theme="dark"]) .card.tone-sky .btn.primary { background: var(--tc); box-shadow: 0 4px 14px rgba(59, 130, 246, .28); }
html[data-theme="dark"] .card[class*="tone-"] { border-color: color-mix(in srgb, var(--tc) 35%, transparent); }

/* 모드 탭 · 홈 상단 파스텔 */
html:not([data-theme="dark"]) .mode-tabs { background: #e9e6fb; }
html:not([data-theme="dark"]) .mode-tabs button { color: #5b5683; }
html:not([data-theme="dark"]) .mode-tabs button.on { background: linear-gradient(135deg, #6f7cf6, #8b5cf6); box-shadow: 0 4px 14px rgba(111, 124, 246, .35); color: #fff; }

/* 번역할 언어 고르기 */
.tr-pick-title { margin-top: 12px; }
.lang-pick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 8px; }
.lang-pick button { border: 1.5px solid var(--line); background: var(--card); color: var(--text); border-radius: 12px; padding: 10px 2px;
  font-weight: 800; font-size: 13px; cursor: pointer; }
.lang-pick button.lp-all { grid-column: 1 / -1; padding: 8px 2px; }
.lang-pick button.on { border-color: var(--lc); background: var(--lbg); color: var(--lc); box-shadow: inset 0 0 0 1px var(--lc); }
html[data-theme="dark"] .lang-pick button.on { background: color-mix(in srgb, var(--lc) 20%, transparent); color: #fff; }

/* 번역 결과 · 만들 버전: 언어마다 색 막대 */
.tr-row[class*="lc-"], .fmt[class*="lc-"] { border-left: 5px solid var(--lc); }
.tr-row[class*="lc-"] .lang { color: var(--lc); font-size: 13px; }
.tr-row[class*="lc-"] .links a { background: var(--lbg); color: var(--lc); font-weight: 700; }
html:not([data-theme="dark"]) .fmt[class*="lc-"]:has(input:checked) { background: var(--lbg); border-color: color-mix(in srgb, var(--lc) 45%, transparent);
  border-left-color: var(--lc); }
.fmt[class*="lc-"] input:checked + .box { background: var(--lc); border-color: var(--lc); }
.fmt[class*="lc-"] input:checked + .box::after { color: #fff; }
.fmt[class*="lc-"] b { color: var(--text); }
html[data-theme="dark"] .fmt[class*="lc-"]:has(input:checked) { background: color-mix(in srgb, var(--lc) 16%, transparent); }
html[data-theme="dark"] .tr-row[class*="lc-"] .links a { background: color-mix(in srgb, var(--lc) 18%, transparent); color: #e8ecf5; }
.fmt-group { font-size: 13px; font-weight: 800; color: var(--muted); margin: 10px 2px 0; }
.fmt-group.first { margin-top: 0; }
.fmt-group .muted { font-weight: 600; font-size: 12px; }

/* 설정 화면: 섹션 제목을 파스텔 띠로 구분 (6색 순환) */
.sheet h3 { --hc: #3b82f6; --hbg: #eef6ff; padding: 9px 12px; border-radius: 12px; border-left: 5px solid var(--hc);
  color: color-mix(in srgb, var(--hc) 75%, #1c2130); background: var(--hbg); margin-top: 26px; }
.sheet h3:nth-of-type(6n+2) { --hc: #10a36b; --hbg: #ebf9f2; }
.sheet h3:nth-of-type(6n+3) { --hc: #7c5ce6; --hbg: #f3efff; }
.sheet h3:nth-of-type(6n+4) { --hc: #e8742f; --hbg: #fff3ea; }
.sheet h3:nth-of-type(6n+5) { --hc: #c48a00; --hbg: #fffaea; }
.sheet h3:nth-of-type(6n)   { --hc: #e0457b; --hbg: #fff1f5; }
html[data-theme="dark"] .sheet h3 { background: color-mix(in srgb, var(--hc) 14%, transparent); color: #e8ecf5; }

/* v11: 리서치 결과의 'AI · 사용량' 표시 */
.rs-meta { display: flex; flex-wrap: wrap; gap: 6px; margin: -2px 0 10px; }
.rs-meta .pill { font-size: 12px; font-weight: 700; padding: 5px 10px; border-radius: 999px; background: var(--tint); color: var(--lime); }
.rs-meta .pill.warn { background: #fff3e0; color: #b25e00; }
html[data-theme="dark"] .rs-meta .pill.warn { background: rgba(255, 190, 60, .14); color: #ffc266; }

/* v12: 장면 자막 두 줄 표시 */
.rs-sub { white-space: pre-line; text-align: center; line-height: 1.35; padding: 3px 8px; }

/* v13: 리서치 대본 길이 선택 */
.rs-len-title { margin-top: 12px; }
#rs-len { margin-top: 6px; }
#rs-len-help { margin: 6px 0 0; }

/* v14: 대본 검토·수정 + 쇼츠 자동 완성 */
.rs-step { margin-top: 12px; }
.rs-title-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.rs-scenes textarea.rs-e { width: 100%; margin-top: 6px; resize: vertical; font-size: 15px; line-height: 1.5; }
.rs-total { margin-top: 8px; text-align: right; font-size: 13px; color: var(--muted, #888); }
.rs-thumbs { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0 8px; }
.rs-thumbs img { width: 54px; height: 96px; object-fit: cover; border-radius: 8px; }
.rs-fmts { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px; margin: 6px 0 12px; font-size: 14px; }
.rs-fmts label { display: flex; align-items: center; gap: 6px; }
label.btn[for="rs-file"] { cursor: pointer; text-align: center; }

/* v15: 한국어 포함 5개 언어 + 전체 선택 = 3칸 x 2줄, 검색 버튼 */
.lang-pick { grid-template-columns: repeat(3, 1fr); }
.lang-pick button.lp-all { grid-column: auto; padding: 10px 2px; }
label.opt-title[for="product"] { display: block; margin: 12px 0 6px; }
.tr-btns { display: flex; gap: 8px; margin-top: 10px; }
.tr-btns .btn { flex: 1; margin: 0; }
.tr-btns #search-btn:not(.hidden) + #translate-btn { background: var(--card); color: var(--tc, #2f5bea); border: 1.5px solid var(--tc, #2f5bea); box-shadow: none; }
#search-help { margin-top: 6px; }
#rs-product-wrap .lang-pick { margin-bottom: 4px; }
.rs-flag { font-size: 15px; }

/* v18: 사진 소재 · AI 영상 */
.tag.photo { background: #fff3e0; color: #c26a00; }
.tag.ai { background: #efe9ff; color: #6d4fd8; }
.ai-box { margin-top: 10px; padding: 12px; border-radius: 14px; border: 1.5px dashed #b9a6f5; background: rgba(239, 233, 255, .55); }
.ai-box-head { font-weight: 800; display: flex; align-items: center; gap: 6px; }
.ai-box .btn { width: 100%; margin-top: 6px; }
html[data-theme="dark"] .ai-box { background: rgba(109, 79, 216, .15); }
.rs-th { position: relative; }
.rs-th span { position: absolute; right: 2px; bottom: 2px; font-size: 13px; background: rgba(0,0,0,.55); color: #fff; border-radius: 6px; padding: 0 3px; }

/* v19: AI 영상 공급자 고르기 */
.aivp-list { display: grid; gap: 6px; margin: 8px 0; }
.aivp { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--card); cursor: pointer; }
.aivp input { margin-top: 3px; accent-color: #6d4fd8; }
.aivp b { font-size: 15px; }
.aivp small { display: block; color: var(--muted, #888); margin-top: 2px; }
.aivp small em { color: #d63a3a; font-style: normal; font-weight: 700; }
.aivp.on { border-color: #6d4fd8; background: #f4f0ff; box-shadow: inset 0 0 0 1px #6d4fd8; }
html[data-theme="dark"] .aivp.on { background: rgba(109, 79, 216, .2); }
.warn-text { color: #c2410c; }

/* v20: 전부 지우기 버튼 */
.btn.ghost.danger { color: #d63a3a; border-color: #f3b4b4; }

/* v21: 설정 섹션 제목 — 아이콘 타일 + 얇은 구분선 (트렌디한 섹션 헤더) */
.sheet h3.sec { --hc: #3b82f6; --hc2: #60a5fa;
  display: flex; align-items: center; gap: 10px; margin: 30px 0 12px; padding: 0;
  background: none; border: 0; border-radius: 0; box-shadow: none;
  font-size: 16px; font-weight: 800; letter-spacing: -0.02em; color: var(--text); }
.sheet h3.sec::after { content: ""; flex: 1; height: 1px; margin-left: 2px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--hc) 35%, transparent), transparent); }
.sheet h3.sec:first-of-type { margin-top: 14px; }
.sec-ic { flex: none; width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; font-size: 17px; line-height: 1;
  background: linear-gradient(135deg, color-mix(in srgb, var(--hc) 16%, #fff), color-mix(in srgb, var(--hc2) 30%, #fff));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--hc) 22%, transparent), 0 4px 12px -4px color-mix(in srgb, var(--hc) 45%, transparent); }
.sec-t { white-space: nowrap; }
.sec-sub { flex: none; font-size: 11px; font-weight: 700; letter-spacing: 0; padding: 3px 8px; border-radius: 999px;
  color: color-mix(in srgb, var(--hc) 80%, #1c2130); background: color-mix(in srgb, var(--hc) 11%, transparent); }
.sheet h3.sec.t-sun    { --hc: #f59e0b; --hc2: #fcd34d; }
.sheet h3.sec.t-blue   { --hc: #3b82f6; --hc2: #93c5fd; }
.sheet h3.sec.t-violet { --hc: #8b5cf6; --hc2: #c4b5fd; }
.sheet h3.sec.t-pink   { --hc: #ec4899; --hc2: #f9a8d4; }
.sheet h3.sec.t-sky    { --hc: #0ea5e9; --hc2: #7dd3fc; }
.sheet h3.sec.t-mint   { --hc: #10b981; --hc2: #6ee7b7; }
.sheet h3.sec.t-orange { --hc: #f97316; --hc2: #fdba74; }
.sheet h3.sec.t-rose   { --hc: #f43f5e; --hc2: #fda4af; }
.sheet h3.sec.t-slate  { --hc: #64748b; --hc2: #cbd5e1; }
html[data-theme="dark"] .sheet h3.sec { background: none; color: #eef1f8; }
html[data-theme="dark"] .sec-ic { background: linear-gradient(135deg, color-mix(in srgb, var(--hc) 30%, #141824), color-mix(in srgb, var(--hc2) 22%, #141824)); }
html[data-theme="dark"] .sec-sub { color: color-mix(in srgb, var(--hc2) 85%, #fff); background: color-mix(in srgb, var(--hc) 22%, transparent); }

/* v22: 템플릿 · 대본 저장 · 장면 AI 영상 */
.source-btns { grid-template-columns: repeat(2, 1fr); }
.rs-src-btns { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 8px 0; }
.rs-src-btns .btn { margin: 0; padding: 10px 4px; font-size: 13px; text-align: center; cursor: pointer; }
.tpl-current:empty { display: none; }
.tpl-chip { width: 100%; display: flex; align-items: center; gap: 12px; margin: 8px 0 4px; padding: 8px 12px 8px 8px; border-radius: 14px;
  border: 1.5px solid color-mix(in srgb, #8b5cf6 35%, var(--line)); background: color-mix(in srgb, #8b5cf6 6%, var(--card)); color: var(--text); cursor: pointer; text-align: left; }
.tpl-chip img { width: 40px; height: 71px; object-fit: cover; border-radius: 8px; flex: none; box-shadow: 0 2px 8px rgba(0,0,0,.15); }
.tpl-chip span { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.tpl-chip small { color: var(--muted, #888); font-size: 11px; }
.tpl-chip b { font-size: 15px; }
.tpl-chip em { font-style: normal; font-size: 11px; color: #b7791f; font-weight: 700; }
.tpl-chip .tpl-chip-go { flex: none; color: #7c5ce6; font-weight: 700; font-size: 13px; }
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin: 10px 0 14px; }
.tpl-card { position: relative; border-radius: 16px; border: 2px solid var(--line); background: var(--card); padding: 6px 6px 10px; cursor: pointer; transition: transform .12s, border-color .12s; }
.tpl-card:hover { transform: translateY(-2px); }
.tpl-card.on { border-color: #7c5ce6; box-shadow: 0 0 0 3px color-mix(in srgb, #7c5ce6 25%, transparent); }
.tpl-card img { width: 100%; aspect-ratio: 9 / 16; object-fit: cover; border-radius: 11px; display: block; }
.tpl-name { font-weight: 800; font-size: 14px; margin: 7px 2px 2px; }
.tpl-desc { font-size: 11.5px; color: var(--muted, #888); line-height: 1.35; margin: 0 2px; }
.tpl-star, .tpl-del { position: absolute; top: 10px; width: 32px; height: 32px; border-radius: 50%; border: 0; cursor: pointer;
  background: rgba(255,255,255,.92); box-shadow: 0 2px 8px rgba(0,0,0,.2); font-size: 16px; line-height: 32px; padding: 0; }
.tpl-star { right: 10px; color: #b7791f; }
.tpl-star.on { background: #fff4c2; }
.tpl-del { left: 10px; color: #d63a3a; font-size: 14px; }
.tpl-export { display: inline-block; margin: 6px 2px 0; font-size: 12px; }
.tpl-upload { border: 1.5px dashed var(--line); border-radius: 14px; padding: 10px 12px; margin-bottom: 10px; }
.tpl-upload summary { cursor: pointer; font-weight: 800; }
.tpl-upload .btn { width: 100%; margin-top: 8px; }
.tpl-file-btn { display: block; text-align: center; cursor: pointer; }
.tpl-check { display: flex; align-items: center; gap: 8px; margin: 10px 0 4px; font-size: 14px; }
.rs-save-row { display: flex; align-items: center; gap: 12px; margin-top: 12px; flex-wrap: wrap; }
.rs-save-row .btn { margin: 0; }
.rs-save-state { font-size: 13px; color: var(--muted, #888); }
.rs-save-state.dirty { color: #c2410c; font-weight: 700; }
.rs-vp-label { display: block; font-size: 12px; font-weight: 700; color: var(--muted, #888); margin: 8px 0 2px; }
.rs-vp-edit { font-size: 12.5px !important; line-height: 1.45; color: var(--muted, #666); width: 100%; resize: vertical; }
.scene-box { border-color: #f0abfc; background: rgba(253, 244, 255, .6); }
html[data-theme="dark"] .scene-box { background: rgba(192, 38, 211, .12); }
.scene-box .btn { width: 100%; margin-top: 8px; }
.scene-bar { height: 8px; border-radius: 6px; background: var(--line); overflow: hidden; margin: 8px 0; }
.scene-bar > div { height: 100%; background: linear-gradient(90deg, #c026d3, #7c3aed); transition: width .4s; }

/* ===================== v24: 고급스러운 메인 버튼 · 소재 카드 · 버전 타일 ===================== */
/* 인기 급상승 쇼츠 찾기: 딥 인디고 + 골드 포인트 */
.btn.research-entry { position: relative; overflow: hidden; border: 1px solid rgba(255, 215, 140, .35);
  background: radial-gradient(120% 140% at 0% 0%, #3b2f7a 0%, #1e1b4b 45%, #0f0d2e 100%);
  color: #fff; box-shadow: 0 10px 28px -10px rgba(30, 27, 75, .7), inset 0 1px 0 rgba(255, 255, 255, .12);
  padding: 16px 18px; letter-spacing: -0.01em; }
.btn.research-entry::before { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(115deg, transparent 30%, rgba(255, 223, 150, .18) 48%, transparent 62%);
  transform: translateX(-100%); animation: re-shine 4.5s ease-in-out infinite; }
@keyframes re-shine { 0%, 55% { transform: translateX(-100%); } 85%, 100% { transform: translateX(100%); } }
.btn.research-entry::after { content: ""; position: absolute; right: -30px; top: -40px; width: 140px; height: 140px; border-radius: 50%;
  background: radial-gradient(circle, rgba(251, 191, 36, .28), transparent 70%); pointer-events: none; }
.btn.research-entry small { color: #f6dca0; font-weight: 600; letter-spacing: .02em; }
.btn.research-entry:active { transform: scale(.985); box-shadow: 0 6px 16px -8px rgba(30, 27, 75, .7); }
@media (prefers-reduced-motion: reduce) { .btn.research-entry::before { animation: none; } }

/* 소재 선택 버튼: 점선 상자 → 부드러운 카드 + 그라데이션 아이콘 타일 */
.source-btns { gap: 10px; }
.source-btn, html:not([data-theme="dark"]) .card[class*="tone-"] .source-btn {
  position: relative; min-height: 118px; gap: 10px; padding: 14px 8px; border: 1px solid rgba(15, 23, 42, .07); border-radius: 18px;
  background: #fff; color: #1f2937; box-shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 8px 20px -12px rgba(15, 23, 42, .25);
  transition: transform .15s ease, box-shadow .15s ease; }
.source-btn:hover { transform: translateY(-2px); box-shadow: 0 2px 4px rgba(15, 23, 42, .06), 0 14px 26px -12px rgba(15, 23, 42, .3); }
.source-btn:active { transform: scale(.98); }
.source-btn .ico { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; font-size: 23px;
  background: linear-gradient(135deg, #e0f2fe, #c7d2fe); box-shadow: inset 0 0 0 1px rgba(99, 102, 241, .15); }
.source-btns > :nth-child(2) .ico { background: linear-gradient(135deg, #dcfce7, #a7f3d0); box-shadow: inset 0 0 0 1px rgba(16, 185, 129, .18); }
.source-btns > :nth-child(3) .ico { background: linear-gradient(135deg, #fae8ff, #fbcfe8); box-shadow: inset 0 0 0 1px rgba(219, 39, 119, .15); }
.source-btn b { font-size: 13.5px; font-weight: 700; line-height: 1.35; color: #1f2937; }
html[data-theme="dark"] .source-btn { background: rgba(255, 255, 255, .05); border-color: rgba(255, 255, 255, .08); color: #e8ecf5; box-shadow: none; }
html[data-theme="dark"] .source-btn b { color: #e8ecf5; }
html[data-theme="dark"] .source-btn .ico { background: rgba(255, 255, 255, .08); box-shadow: none; }

/* 동시에 만들 버전: 2열 선택 타일 */
.formats.fmt2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.fmt2 .fmt-group { grid-column: 1 / -1; display: flex; align-items: baseline; gap: 8px; margin: 10px 2px 0;
  font-size: 12px; font-weight: 800; letter-spacing: .06em; color: #64748b; text-transform: uppercase; }
.fmt2 .fmt-group.first { margin-top: 0; }
.fmt2 .fmt-group em { font-style: normal; font-weight: 600; letter-spacing: 0; text-transform: none; color: #94a3b8; }
.fmt2-tile { position: relative; display: flex; align-items: center; gap: 10px; padding: 12px 12px; border-radius: 16px; cursor: pointer;
  background: #fff; border: 1.5px solid rgba(15, 23, 42, .08); box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
  transition: border-color .15s, box-shadow .15s, transform .12s; }
.fmt2-tile:active { transform: scale(.985); }
.fmt2-tile input { position: absolute; opacity: 0; pointer-events: none; }
.fmt2-tile:has(input:checked) { border-color: #6366f1; background: linear-gradient(180deg, #fff, #f5f5ff);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, .14), 0 8px 18px -12px rgba(79, 70, 229, .5); }
.fmt2-tile:has(input:focus-visible) { outline: 2px solid #6366f1; outline-offset: 2px; }
.fmt2-txt { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.fmt2-txt b { font-size: 14px; font-weight: 800; color: #111827; }
.fmt2-txt small { font-size: 11.5px; color: #6b7280; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fmt2-flag { position: absolute; top: 6px; right: 34px; font-size: 13px; line-height: 1; }
.fmt2-check { position: absolute; top: 8px; right: 9px; width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid #cbd5e1; background: #fff; }
.fmt2-tile:has(input:checked) .fmt2-check { border-color: #6366f1; background: #6366f1; }
.fmt2-tile:has(input:checked) .fmt2-check::after { content: ""; position: absolute; left: 6px; top: 2.5px; width: 5px; height: 10px;
  border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
/* 플랫폼 마크 (그림 파일 없이 CSS로) */
.pf { flex: none; width: 34px; height: 34px; border-radius: 10px; position: relative; }
.pf-yt { background: linear-gradient(135deg, #ff3b3b, #d90000); box-shadow: 0 4px 10px -4px rgba(217, 0, 0, .6); }
.pf-yt::after { content: ""; position: absolute; left: 13px; top: 10px; border-style: solid; border-width: 7px 0 7px 11px;
  border-color: transparent transparent transparent #fff; }
.pf-ig { background: radial-gradient(circle at 30% 110%, #ffd776 0%, #f77737 25%, #e1306c 55%, #833ab4 85%);
  box-shadow: 0 4px 10px -4px rgba(225, 48, 108, .6); }
.pf-ig::before { content: ""; position: absolute; inset: 8px; border: 2.5px solid #fff; border-radius: 8px; }
.pf-ig::after { content: ""; position: absolute; left: 12px; top: 12px; width: 10px; height: 10px; border: 2.5px solid #fff; border-radius: 50%; box-sizing: border-box; }
html[data-theme="dark"] .fmt2-tile { background: rgba(255, 255, 255, .04); border-color: rgba(255, 255, 255, .1); }
html[data-theme="dark"] .fmt2-tile:has(input:checked) { background: rgba(99, 102, 241, .16); border-color: #818cf8; }
html[data-theme="dark"] .fmt2-txt b { color: #eef1f8; }
html[data-theme="dark"] .fmt2-txt small { color: #9aa3b5; }
html[data-theme="dark"] .fmt2-check { background: transparent; border-color: #475569; }
@media (max-width: 360px) { .formats.fmt2 { grid-template-columns: 1fr; } }
.fmt2-flag { top: 9px; right: 36px; font-size: 9.5px; font-weight: 800; letter-spacing: .04em; color: #64748b; background: #f1f5f9; border-radius: 6px; padding: 2px 5px; }
/* v39: 좁은 폰에서 카드가 화면 밖으로 밀리거나 배지가 제목을 덮던 문제 */
.formats.fmt2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.fmt2-tile { gap: 8px; padding: 12px 10px; }
.fmt2-txt { padding-right: 22px; }
.fmt2-txt b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: -.02em; }
.fmt2-flag { top: auto; bottom: 9px; right: 9px; }
/* 구매 링크 · 스티커 카드 */
.chips.link-st { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.chips.link-st button { line-height: 1.25; padding: 9px 4px; font-size: 14px; word-break: keep-all; }
.chips.link-st button small { font-size: 11px; font-weight: 600; color: var(--muted); }
.link-st-title { margin-top: 12px; }
.link-help { line-height: 1.55; }
.kit-box { margin-top: 10px; border-radius: 14px; padding: 12px; background: rgba(255, 224, 58, .14); border: 1px solid rgba(234, 179, 8, .35); }
.kit-box h4 { margin: 0 0 8px; font-size: 14px; }
.kit-box .copy-row { margin-top: 6px; }
.kit-box ol { margin: 8px 0 0; padding-left: 18px; font-size: 12.5px; line-height: 1.55; color: var(--muted); }
.kit-box .kit-url { font-size: 12px; word-break: break-all; color: var(--muted); }
/* 최근 만든 영상: 항목별 삭제 버튼 */
.recent .rec-del { flex: none; width: 40px; height: 40px; border-radius: 12px; border: 1px solid rgba(239, 68, 68, .25);
  background: rgba(239, 68, 68, .07); color: #dc2626; font-size: 17px; display: grid; place-items: center; cursor: pointer; }
.recent .rec-del:active { background: rgba(239, 68, 68, .2); }
.recent .rec-del:disabled { opacity: .5; }
.recent .rec-del.busy { border-color: transparent; background: transparent; cursor: default; font-size: 15px; }
html[data-theme="dark"] .recent .rec-del:not(.busy) { background: rgba(239, 68, 68, .14); border-color: rgba(239, 68, 68, .35); color: #fca5a5; }
/* 흰색 제목 색 버튼이 흰 바탕에서 안 보이던 문제 */
.colors button[data-c="white"] { background: #1f2937; border-color: #1f2937; }
.colors button[data-c="white"].on { box-shadow: inset 0 0 0 2px #6366f1; }
.colors button.color-auto { display: flex; align-items: center; justify-content: center; gap: 6px; color: var(--text); }
/* '라이브러리에서'가 단어 중간에서 줄바꿈되던 문제 */
.source-btn b { word-break: keep-all; }
.fmt2-tile:has(input:checked) .fmt2-flag { color: #4f46e5; background: #e0e7ff; }
html[data-theme="dark"] .fmt2-flag { background: rgba(255,255,255,.08); color: #cbd5e1; }

/* v26: 단계 흐름 정리 — 바로 완성 · 3단계 세부 순서 · AI 장면 고르기 */
.rs-quick { margin-top: 14px; padding: 12px 14px; border-radius: 16px; background: linear-gradient(135deg, #eef2ff, #f5f3ff);
  border: 1px solid rgba(99, 102, 241, .22); }
.rs-quick-head { font-weight: 800; font-size: 15px; }
.rs-quick-btns { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-top: 8px; }
.rs-quick-btns .btn { margin: 0; }
html[data-theme="dark"] .rs-quick { background: rgba(99, 102, 241, .12); }
.sub-step { display: flex; align-items: center; gap: 8px; margin: 18px 0 6px; font-size: 15px; }
.sub-step:first-of-type { margin-top: 6px; }
.sub-no { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; flex: none; font-size: 13px; font-weight: 800; color: #fff;
  background: linear-gradient(135deg, #6366f1, #8b5cf6); box-shadow: 0 3px 8px -3px rgba(99, 102, 241, .7); }
.rs-src-btns.two { grid-template-columns: 1fr 1fr; }
.tpl-open-wide { width: 100%; margin: 4px 0 0; }
.scene-chips { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 6px; margin: 6px 0 2px; }
.scene-chip { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; padding: 8px 9px; border-radius: 12px; cursor: pointer; text-align: left;
  border: 1.5px solid var(--line); background: var(--card); color: var(--text); }
.scene-chip b { font-size: 13px; }
.scene-chip span { font-size: 11px; color: var(--muted, #888); }
.scene-chip small { font-size: 11px; color: var(--muted, #888); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; max-width: 100%; }
.scene-chip.on { border-color: #c026d3; background: #fdf4ff; box-shadow: inset 0 0 0 1px #c026d3; }
html[data-theme="dark"] .scene-chip.on { background: rgba(192, 38, 211, .18); }
.scene-sel { margin-top: 4px; }
/* Flow 장면 영상 상자 */
.link-btn { background: none; border: 0; padding: 0 2px; color: #7c3aed; font-weight: 700; font-size: inherit; text-decoration: underline; cursor: pointer; }
html[data-theme="dark"] .link-btn { color: #c4b5fd; }
.flow-box { border-color: rgba(16, 185, 129, .45); }
.flow-box .scene-chip.on { border-color: #059669; background: #ecfdf5; box-shadow: inset 0 0 0 1px #059669; }
html[data-theme="dark"] .flow-box .scene-chip.on { background: rgba(16, 185, 129, .16); }

/* v27: 자동/수동 토글 스위치 · 자동 완성 진행 */
.mode-switch-row { margin: 4px 0 12px; }
.mode-switch { position: relative; display: grid; grid-template-columns: 1fr 1fr; padding: 5px; border-radius: 999px;
  background: #e9e7fb; box-shadow: inset 0 1px 3px rgba(30, 27, 75, .12); }
.mode-switch button { position: relative; z-index: 1; border: 0; background: none; padding: 11px 0; border-radius: 999px; cursor: pointer;
  font-size: 15px; color: #5b5683; transition: color .2s; }
.mode-switch button.on { color: #fff; }
.mode-knob { position: absolute; z-index: 0; top: 5px; bottom: 5px; left: 5px; width: calc(50% - 5px); border-radius: 999px;
  background: linear-gradient(135deg, #1e1b4b, #4338ca); box-shadow: 0 6px 16px -6px rgba(67, 56, 202, .7);
  transition: transform .28s cubic-bezier(.4, 1.3, .5, 1), background .28s; }
.mode-switch.is-manual .mode-knob { transform: translateX(100%); background: linear-gradient(135deg, #0f766e, #0ea5a4); box-shadow: 0 6px 16px -6px rgba(14, 165, 164, .7); }
.mode-desc { margin: 8px 6px 0; font-size: 12.5px; line-height: 1.5; color: var(--muted, #6b7280); }
html[data-theme="dark"] .mode-switch { background: rgba(255, 255, 255, .07); }
html[data-theme="dark"] .mode-switch button { color: #aab0c4; }
html[data-theme="dark"] .mode-switch button.on { color: #fff; }
.auto-len-title { margin-top: 12px; }
#auto-len { margin-top: 6px; }
.auto-steps { list-style: none; margin: 6px 0 12px; padding: 0; display: grid; gap: 8px; }
.auto-step { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); color: var(--muted, #888); font-weight: 600; }
.auto-step.now { color: var(--text); border-color: #6366f1; box-shadow: 0 0 0 3px rgba(99, 102, 241, .12); }
.auto-step.done { color: var(--text); }
.auto-step.err { color: #d63a3a; border-color: #f3b4b4; }
.auto-dot { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 800; flex: none; background: var(--line); color: #fff; }
.auto-step.now .auto-dot { background: #6366f1; }
.auto-step.done .auto-dot { background: #10b981; }
.auto-step.err .auto-dot { background: #d63a3a; }
.auto-spin { margin-left: auto; width: 16px; height: 16px; border-radius: 50%; border: 2.5px solid rgba(99, 102, 241, .25); border-top-color: #6366f1; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.auto-ref { display: flex; gap: 10px; align-items: center; padding: 10px; border-radius: 14px; background: color-mix(in srgb, #6366f1 7%, var(--card)); margin-bottom: 8px; }
.auto-ref img { width: 54px; height: 96px; object-fit: cover; border-radius: 8px; flex: none; }
.auto-ref div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.auto-ref small { font-size: 11px; color: var(--muted, #888); }
.auto-ref b { font-size: 14px; line-height: 1.35; }
.auto-ref .muted { font-size: 12px; }
#sheet-auto .btn { width: 100%; margin-top: 8px; }

/* v28: Flow로 직접 만들기 도구 */
.vp-tools { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.vp-btn { display: inline-flex; align-items: center; gap: 4px; padding: 6px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; cursor: pointer;
  border: 1px solid var(--line); background: var(--card); color: var(--text); text-decoration: none; }
.vp-btn.flow { border-color: rgba(66, 133, 244, .45); color: #1a56db; background: rgba(66, 133, 244, .07); }
html[data-theme="dark"] .vp-btn.flow { color: #8ab4f8; }
.flow-tip { margin-top: 10px; padding: 10px 12px; border-radius: 12px; background: rgba(66, 133, 244, .07); border: 1px solid rgba(66, 133, 244, .25); font-size: 12.5px; }
.flow-tip ol { margin: 6px 0 0 18px; padding: 0; line-height: 1.6; }

/* v29: 자동 모드 — 대본 완성 후 소재 기다리기 */
.auto-step.wait { color: #b45309; border-color: #fcd34d; background: #fffbeb; }
.auto-step.wait .auto-dot { background: #f59e0b; }
.auto-need { padding: 12px; border-radius: 14px; border: 1.5px solid #fcd34d; background: #fffdf5; margin-top: 4px; }
html[data-theme="dark"] .auto-need, html[data-theme="dark"] .auto-step.wait { background: rgba(245, 158, 11, .1); }
.auto-need-head { font-weight: 800; margin-bottom: 8px; }
.auto-title { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px; border-radius: 10px; background: #111; color: #fff; font-size: 16px; }
.auto-title .hl { color: #FFE03A; }
.auto-lines { margin: 8px 0 8px 18px; padding: 0; font-size: 13px; line-height: 1.55; max-height: 180px; overflow: auto; }

/* v31: 레퍼런스 유튜브 보기 */
.auto-ref-thumb { position: relative; flex: none; display: block; }
.auto-ref-play { position: absolute; inset: 0; margin: auto; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(255, 0, 0, .9); color: #fff; font-size: 12px; padding-left: 2px; box-shadow: 0 2px 8px rgba(0,0,0,.35); }
.yt-link { align-self: flex-start; margin-top: 6px; padding: 5px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; text-decoration: none;
  color: #c00; background: rgba(255, 0, 0, .08); border: 1px solid rgba(255, 0, 0, .25); }
html[data-theme="dark"] .yt-link { color: #ff8a8a; }

/* v32: 자동 모드 추천 목록 (10개 이상) */
.auto-pick-head { font-size: 14px; margin: 4px 0 8px; }
.auto-pick { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.pick-card { display: flex; gap: 12px; padding: 10px; border-radius: 16px; background: var(--card); border: 1px solid var(--line);
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04); }
.pick-thumb { position: relative; flex: none; width: 84px; height: 149px; border-radius: 12px; overflow: hidden; display: block; background: #000; }
.pick-thumb img { width: 100%; height: 100%; object-fit: cover; }
.pick-rank { position: absolute; top: 6px; left: 6px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; display: grid; place-items: center;
  background: linear-gradient(135deg, #1e1b4b, #4338ca); color: #fff; font-size: 12px; font-weight: 800; }
.pick-dur { position: absolute; right: 5px; bottom: 5px; font-size: 11px; color: #fff; background: rgba(0,0,0,.65); border-radius: 6px; padding: 1px 5px; }
.pick-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1; }
.pick-title { font-size: 14px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pick-meta { font-size: 12px; }
.pick-stats { display: flex; flex-wrap: wrap; gap: 8px; font-size: 12px; color: var(--muted, #6b7280); }
.pick-score { color: #4338ca; font-weight: 800; }
.pick-hook { font-size: 12px; color: var(--text); background: color-mix(in srgb, #f59e0b 10%, transparent); border-radius: 8px; padding: 4px 7px; }
.pick-warn { font-size: 11px; color: #b45309; }
.pick-btns { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: auto; }
.pick-btns .yt-link { margin-top: 0; }
.pick-go { margin: 0 !important; width: auto !important; padding: 8px 12px; font-size: 13px; }

/* v34: 대본 AI 고르기 (Gemini / OpenAI) */
.aip-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 6px 0 4px; }
.aip { display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--card); cursor: pointer; }
.aip input { margin-top: 3px; accent-color: #4338ca; }
.aip b { display: block; font-size: 14px; }
.aip small { display: block; font-size: 11.5px; color: var(--muted, #888); margin-top: 2px; line-height: 1.35; }
.aip.on { border-color: #4338ca; background: color-mix(in srgb, #4338ca 7%, var(--card)); box-shadow: inset 0 0 0 1px #4338ca; }
@media (max-width: 380px) { .aip-pick { grid-template-columns: 1fr; } }

/* v35: 대본 길이 5개 (20초 추가) */
#rs-len, #auto-len { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
#rs-len button, #auto-len button { padding-left: 0; padding-right: 0; }

/* v36: 관리자 승인 · 기기 관리 · Tailscale 안내 */
.dev-list, .approve-list { list-style: none; margin: 6px 0 10px; padding: 0; display: grid; gap: 8px; }
.dev-list li, .approve-list li { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); }
.dev-list .grow, .approve-list .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.dev-list small, .approve-list small { font-size: 11.5px; color: var(--muted, #888); }
.dev-ic { font-size: 22px; flex: none; }
.dev-list .btn, .approve-list .btn { margin: 0; width: auto; padding: 7px 12px; font-size: 13px; }
.approve-btns { display: flex; flex-direction: column; gap: 6px; flex: none; }
.approve-list li { border-color: #fcd34d; background: #fffdf5; }
html[data-theme="dark"] .approve-list li { background: rgba(245, 158, 11, .1); }
.ts-guide { padding: 10px 12px; border-radius: 14px; background: color-mix(in srgb, #8b5cf6 6%, var(--card)); border: 1px solid color-mix(in srgb, #8b5cf6 25%, transparent); }
.ts-guide ol { margin: 6px 0 6px 18px; padding: 0; line-height: 1.7; font-size: 13px; }
/* 로그인 화면: 승인 대기 */
.wait-box { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; padding: 8px 4px; line-height: 1.5; }
.wait-box span, .wait-box small { font-size: 13px; color: var(--muted, #6b7280); }
.wait-warn { color: #c2410c !important; font-weight: 700; }
.wait-spin { width: 36px; height: 36px; border-radius: 50%; border: 3.5px solid rgba(99, 102, 241, .2); border-top-color: #6366f1; animation: spin .9s linear infinite; }

/* ===================== v37: 설정 화면 — 카테고리별 박스 + 바로가기 ===================== */
#sheet-settings .sheet { background: #f4f5fa; }
html[data-theme="dark"] #sheet-settings .sheet { background: #0f1220; }
.set-nav { position: sticky; top: -1px; z-index: 5; display: flex; gap: 6px; overflow-x: auto; padding: 8px 2px 10px; margin: 0 -2px 4px;
  background: linear-gradient(#f4f5fa 80%, rgba(244, 245, 250, 0)); scrollbar-width: none; }
.set-nav::-webkit-scrollbar { display: none; }
html[data-theme="dark"] .set-nav { background: linear-gradient(#0f1220 80%, rgba(15, 18, 32, 0)); }
.set-nav-item { --hc: #3b82f6; flex: none; display: inline-flex; align-items: center; gap: 5px; padding: 7px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 700;
  text-decoration: none; white-space: nowrap; color: color-mix(in srgb, var(--hc) 80%, #1c2130); background: #fff;
  border: 1px solid color-mix(in srgb, var(--hc) 25%, transparent); box-shadow: 0 1px 2px rgba(15, 23, 42, .05); }
.set-nav-item.on { background: var(--hc); color: #fff; border-color: var(--hc); }
html[data-theme="dark"] .set-nav-item { background: rgba(255, 255, 255, .05); color: #dfe3ee; }
.set-nav-item.t-sun { --hc: #d97706; } .set-nav-item.t-blue { --hc: #3b82f6; } .set-nav-item.t-violet { --hc: #8b5cf6; }
.set-nav-item.t-pink { --hc: #db2777; } .set-nav-item.t-sky { --hc: #0284c7; } .set-nav-item.t-mint { --hc: #059669; }
.set-nav-item.t-orange { --hc: #ea580c; } .set-nav-item.t-rose { --hc: #e11d48; } .set-nav-item.t-slate { --hc: #475569; }

.set-card { --hc: #3b82f6; position: relative; margin: 0 0 14px; padding: 4px 16px 16px; border-radius: 20px; background: #fff;
  border: 1px solid rgba(15, 23, 42, .06); box-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 10px 24px -18px rgba(15, 23, 42, .35);
  scroll-margin-top: 60px; overflow: hidden; }
.set-card::before { content: ""; position: absolute; left: 0; top: 0; right: 0; height: 4px; background: linear-gradient(90deg, var(--hc), color-mix(in srgb, var(--hc) 30%, #fff)); }
.set-card.t-sun { --hc: #f59e0b; } .set-card.t-blue { --hc: #3b82f6; } .set-card.t-violet { --hc: #8b5cf6; } .set-card.t-pink { --hc: #ec4899; }
.set-card.t-sky { --hc: #0ea5e9; } .set-card.t-mint { --hc: #10b981; } .set-card.t-orange { --hc: #f97316; } .set-card.t-rose { --hc: #f43f5e; }
.set-card.t-slate { --hc: #64748b; }
.set-card > h3.sec { margin: 14px 0 10px !important; padding-bottom: 10px; border-bottom: 1px dashed color-mix(in srgb, var(--hc) 25%, transparent); }
.set-card > h3.sec::after { display: none; }
html[data-theme="dark"] .set-card { background: #171b2b; border-color: rgba(255, 255, 255, .07); box-shadow: none; }
/* 카드 안의 회색 상자들은 은은한 색으로 */
.set-card .ai-status { background: color-mix(in srgb, var(--hc) 6%, #fff); border: 1px solid color-mix(in srgb, var(--hc) 15%, transparent); border-radius: 12px; }
html[data-theme="dark"] .set-card .ai-status { background: rgba(255, 255, 255, .04); }
/* ⭐ 내 기본값: 항목별 칸으로 한눈에 */
.dv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; margin: 4px 0 12px; }
.dv-tile { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 8px; align-items: center;
  padding: 10px 12px; border-radius: 14px; background: color-mix(in srgb, var(--hc) 8%, #fff);
  border: 1px solid color-mix(in srgb, var(--hc) 22%, transparent); }
.dv-tile.wide { grid-column: 1 / -1; }
.dv-ic { grid-row: 1 / 3; font-size: 20px; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px;
  background: color-mix(in srgb, var(--hc) 18%, #fff); }
.dv-label { font-size: 11.5px; font-weight: 700; color: color-mix(in srgb, var(--hc) 70%, #333); letter-spacing: .02em; }
.dv-val { font-size: 15px; font-weight: 800; display: flex; flex-wrap: wrap; align-items: center; gap: 5px; min-width: 0; overflow-wrap: anywhere; }
.dv-swatch { display: inline-block; width: 14px; height: 14px; border-radius: 50%; border: 1px solid rgba(0, 0, 0, .25); }
#set-1 .opt-title { margin-top: 12px; }
#set-1 .chips button small { font-size: 11px; font-weight: 600; color: var(--muted); }
.chips.d-colors { grid-template-columns: repeat(3, 1fr); }
.chips.d-colors button { display: flex; align-items: center; justify-content: center; gap: 6px; }
.d-count-row { display: flex; align-items: flex-start; gap: 12px; margin-top: 8px; }
.d-count-row .stepper { flex: none; }
.d-count-row .help { margin: 0; }
.dv-chip { font-size: 12.5px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: #fff;
  border: 1px solid color-mix(in srgb, var(--hc) 35%, transparent); }
html[data-theme="dark"] .dv-tile { background: rgba(255, 255, 255, .05); border-color: color-mix(in srgb, var(--hc) 35%, transparent); }
html[data-theme="dark"] .dv-ic { background: color-mix(in srgb, var(--hc) 25%, transparent); }
html[data-theme="dark"] .dv-label { color: color-mix(in srgb, var(--hc) 75%, #fff); }
html[data-theme="dark"] .dv-chip { background: rgba(255, 255, 255, .06); }
#s-save { position: sticky; bottom: 8px; z-index: 5; box-shadow: 0 10px 24px -8px rgba(47, 91, 234, .6); }
/* 바로가기 줄 위로 내용이 비치지 않게: 시트 위쪽 여백(16px)까지 덮는다 */
.set-nav { top: -16px; padding-top: 22px; margin-top: -10px; }

/* 자동 올리기 (설정 · 결과 카드) */
.pub-box { border: 1px solid var(--line, #e3e6ef); border-radius: 14px; padding: 12px; margin: 10px 0; }
.pub-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.pub-state { font-size: 12.5px; color: #64748b; text-align: right; }
.pub-state.ok { color: #059669; font-weight: 700; }
.pub-steps { margin: 6px 0 10px; padding-left: 20px; font-size: 13px; line-height: 1.55; }
.pub-steps li { margin-bottom: 4px; word-break: keep-all; }
.pub-steps code, .pub-uri code { font-size: 11.5px; background: rgba(100, 116, 139, .12); padding: 1px 5px; border-radius: 6px; word-break: break-all; }
.pub-uri { display: flex; align-items: center; gap: 6px; margin-top: 4px; }
.btn.disabled { opacity: .45; }
.pub-row { display: grid; gap: 8px; margin-top: 10px; }
.pub-item { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 9px 12px; border-radius: 12px; font-size: 13px; background: rgba(100, 116, 139, .1); }
.pub-item span { flex: 1; min-width: 0; word-break: keep-all; }
.pub-item .mini-bar { flex-basis: 100%; }
.pub-item.ok { background: rgba(16, 185, 129, .12); }
.pub-item.err { background: rgba(244, 63, 94, .1); color: #be123c; }
.pub-item .btn { padding: 6px 12px; font-size: 12.5px; }

/* 배경음악 고르기 */
.bgm-tools { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin: 6px 0; }
.bgm-tools .btn { padding: 9px 6px; font-size: 13px; white-space: nowrap; }
.bgm-list { list-style: none; margin: 6px 0 0; padding: 0; max-height: 340px; overflow-y: auto; border: 1px solid var(--line, #e3e6ef); border-radius: 12px; }
.bgm-list li { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-bottom: 1px solid var(--line, #eef0f5); }
.bgm-list li:last-child { border-bottom: 0; }
.bgm-list li.on { background: rgba(59, 130, 246, .07); }
.bgm-play { flex: none; width: 34px; height: 34px; border-radius: 50%; border: 1px solid #c7d2fe; background: #eef2ff; color: #3b5bdb; font-size: 13px; }
.bgm-play.playing { background: #3b82f6; color: #fff; border-color: #3b82f6; }
.bgm-name { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.bgm-name input { width: 18px; height: 18px; flex: none; }
.bgm-name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bgm-mine { font-size: 11px; color: #7c3aed; background: rgba(124, 58, 237, .1); padding: 1px 6px; border-radius: 999px; }
.bgm-del { flex: none; background: none; border: 0; font-size: 16px; }
html[data-theme="dark"] .bgm-play { background: rgba(99, 102, 241, .15); border-color: rgba(99, 102, 241, .4); color: #c7d2fe; }

/* 카드 색 추가: 주변의 하늘색 카드와 어울리는 은은한 색 (2026-11-27) */
.tone-indigo { --tc: #5b5bd6; --tbg: #f1f3ff; --tline: #d9defb; }
.tone-slate  { --tc: #4b6584; --tbg: #f2f6fa; --tline: #d8e2ec; }

/* 폰 화면: '동시에 만들 버전' 아이콘을 줄이고 설명 글자가 잘리지 않게 */
@media (max-width: 480px) {
  .fmt2-tile { gap: 8px; padding: 11px 9px; align-items: flex-start; }
  .fmt2-tile .pf { width: 24px; height: 24px; border-radius: 7px; margin-top: 1px; box-shadow: 0 3px 8px -4px rgba(0, 0, 0, .35); }
  .fmt2-tile .pf-yt::after { left: 9px; top: 7px; border-width: 5px 0 5px 8px; }
  .fmt2-tile .pf-ig::before { inset: 5px; border-width: 2px; border-radius: 6px; }
  .fmt2-tile .pf-ig::after { left: 8.5px; top: 8.5px; width: 7px; height: 7px; border-width: 2px; }
  .fmt2-flag { display: none; }               /* 언어는 '한국어/해외' 묶음 제목과 버전 이름에 이미 있어요 */
  .fmt2-txt { padding-right: 0; gap: 2px; }
  .fmt2-txt b { font-size: 13.5px; padding-right: 20px; }
  .fmt2-txt small { white-space: normal; overflow: visible; text-overflow: clip; word-break: keep-all; line-height: 1.35; font-size: 11px; }
  .fmt2-check { width: 18px; height: 18px; top: 9px; right: 8px; }
  .fmt2-tile:has(input:checked) .fmt2-check::after { left: 5px; top: 2px; width: 4.5px; height: 9px; }
}

/* 관리자 / 일반 사용자 화면 구분 (서버에서도 막고, 화면에서는 안 보이게) */
.user-only { display: none; }
body.role-user .user-only { display: block; }
body.role-user .admin-only,
body.role-user .recent .rec-del:not(.busy),
body.role-user .pub-row,
body.role-user .channel.add,
body.role-user .tpl-upload,
body.role-user .tpl-star,
body.role-user [data-tpl-del],
body.role-user #ai-box-main,
body.role-user #ai-box-rs,
body.role-user #scene-box-wrap { display: none !important; }
.role-banner { margin: 2px 0 10px; padding: 11px 13px; border-radius: 12px; font-size: 13px; line-height: 1.55; word-break: keep-all;
  background: #eef2ff; border: 1px solid #c7d2fe; color: #3730a3; }
html[data-theme="dark"] .role-banner { background: rgba(99, 102, 241, .15); border-color: rgba(129, 140, 248, .4); color: #c7d2fe; }
.dev-role { flex: none; font-size: 12px; padding: 6px 10px; }
.dev-role.on { background: #eef2ff; border-color: #6366f1; color: #4338ca; }
.dev-badge { display: inline-block; margin-left: 6px; font-size: 11px; font-weight: 700; color: #4338ca; background: #e0e7ff; border-radius: 999px; padding: 1px 7px; vertical-align: middle; }

/* 🔑 AI 연결: 온라인 · 오프라인 · 유튜브 구역 */
.aip-pick.three { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 420px) { .aip-pick.three { grid-template-columns: 1fr; } }
.aip-tag { display: inline-block; font-style: normal; font-size: 10.5px; font-weight: 800; padding: 1px 7px; border-radius: 999px; margin-bottom: 3px; }
.aip-tag.on { background: #dbeafe; color: #1d4ed8; }
.aip-tag.off { background: #d1fae5; color: #047857; }
.ai-sum { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px; }
.ai-sum .sum-chip { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 700; padding: 5px 10px;
  border-radius: 999px; background: #fff; border: 1px solid var(--line, #d5ddec); }
.ai-sum .sum-chip i { width: 8px; height: 8px; border-radius: 50%; background: #cbd5e1; }
.ai-sum .sum-chip.ok i { background: #10b981; } .ai-sum .sum-chip.first { border-color: #4338ca; color: #4338ca; }
.ai-group { --gc: #3b82f6; margin-top: 14px; border-radius: 16px; border: 1px solid color-mix(in srgb, var(--gc) 25%, transparent);
  background: color-mix(in srgb, var(--gc) 5%, #fff); padding: 10px 10px 12px; }
.ai-group.g-online { --gc: #3b82f6; } .ai-group.g-offline { --gc: #10b981; } .ai-group.g-yt { --gc: #ef4444; }
.ai-group-h { display: flex; align-items: center; gap: 8px; padding: 2px 4px 8px; }
.ai-group-h b { font-size: 15px; color: color-mix(in srgb, var(--gc) 75%, #111); }
.ai-group-h small { margin-left: auto; font-size: 11.5px; font-weight: 700; color: var(--muted); }
.ai-group-ic { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 10px; font-size: 16px;
  background: color-mix(in srgb, var(--gc) 16%, #fff); }
.ai-sub { background: #fff; border-radius: 12px; padding: 10px 12px 12px; border: 1px solid rgba(15, 23, 42, .06); }
.ai-sub + .ai-sub { margin-top: 8px; }
.ai-sub-h { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ai-sub-h b { font-size: 14px; }
.ai-sub-h a { margin-left: auto; font-size: 12px; font-weight: 700; }
.ai-sub .field-label { margin-top: 8px; }
.ai-sub .btn-row { margin-top: 8px; }
.ai-sub .help { margin: 8px 0 0; }
.btn.sm { padding: 8px 10px; font-size: 13px; margin: 0; }
.ai-badge { font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 999px; background: #f1f5f9; color: #64748b; }
.ai-badge.ok { background: #d1fae5; color: #047857; }
.ai-badge.warn { background: #ffedd5; color: #c2410c; }
.local-found { display: grid; gap: 6px; margin-top: 8px; font-size: 13px; }
.local-eng { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px; background: #f8fafc; }
.local-eng b { font-size: 13.5px; } .local-eng .muted { margin-left: auto; font-size: 12px; }
.ai-test-row { margin-top: 14px; }
html[data-theme="dark"] .ai-group { background: rgba(255, 255, 255, .03); }
html[data-theme="dark"] .ai-sub, html[data-theme="dark"] .ai-sum .sum-chip { background: #1f2537; border-color: rgba(255, 255, 255, .07); }
html[data-theme="dark"] .ai-group-ic { background: rgba(255, 255, 255, .08); }
html[data-theme="dark"] .ai-group-h b { color: #e8ecf5; }
html[data-theme="dark"] .local-eng { background: rgba(255, 255, 255, .05); }
html[data-theme="dark"] .ai-badge { background: rgba(255, 255, 255, .08); color: #9aa4b8; }
html[data-theme="dark"] .ai-badge.ok { background: rgba(16, 185, 129, .18); color: #6ee7b7; }
html[data-theme="dark"] .ai-badge.warn { background: rgba(249, 115, 22, .18); color: #fdba74; }

/* ⭐ 그 밖의 기본값: 채널(왼쪽) · 만들 버전(오른쪽) */
.dv-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 10px; margin: 6px 0 4px; align-items: start; }
.dv-col { padding: 10px; border-radius: 14px; background: color-mix(in srgb, var(--hc) 7%, #fff);
  border: 1px solid color-mix(in srgb, var(--hc) 22%, transparent); min-width: 0; }
.dv-col-h { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 800; margin-bottom: 8px; flex-wrap: wrap; }
.dv-col-h .dv-ic { width: 26px; height: 26px; font-size: 15px; border-radius: 8px; }
.dv-col-h .muted { font-size: 11px; font-weight: 600; }
.dv-fmts { display: grid; gap: 6px; }
.dv-fmts button { display: flex; align-items: center; gap: 7px; width: 100%; padding: 8px 9px; border-radius: 10px; text-align: left;
  border: 1.5px solid var(--line, #d5ddec); background: #fff; color: var(--text); font: inherit; cursor: pointer; }
.dv-fmts button b { font-size: 13.5px; } .dv-fmts button small { font-size: 11px; color: var(--muted); margin-left: auto; }
.dv-fmts button.on { border-color: var(--hc); background: color-mix(in srgb, var(--hc) 14%, #fff); box-shadow: inset 0 0 0 1px var(--hc); }
.dv-fmts button.on::after { content: "✓"; font-weight: 900; color: color-mix(in srgb, var(--hc) 80%, #000); }
.lang-badge { flex: none; font-size: 10.5px; font-weight: 900; padding: 2px 5px; border-radius: 6px; background: #eef2f7; color: #475569; letter-spacing: .03em; }
.dv-fmts button.on .lang-badge { background: var(--hc); color: #fff; }
.set-actions { margin-top: 14px; padding-top: 12px; border-top: 1px dashed color-mix(in srgb, var(--hc) 25%, transparent); }
.set-actions .btn { margin: 0; }
.ai-test-row .btn { margin: 0; }
@media (max-width: 360px) { .dv-fmts button small { display: none; } }
html[data-theme="dark"] .dv-col { background: rgba(255, 255, 255, .04); }
html[data-theme="dark"] .dv-fmts button { background: #1f2537; border-color: rgba(255, 255, 255, .1); }
html[data-theme="dark"] .dv-fmts button.on { background: color-mix(in srgb, var(--hc) 22%, #1f2537); }
html[data-theme="dark"] .lang-badge { background: rgba(255, 255, 255, .1); color: #cbd5e1; }

/* 설정 카드의 드롭다운에 ▾ 화살표 */
.set-card select.input { padding-right: 34px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; }
/* 🤖 AI 영상: Gemini 모델 드롭다운 · 참고 설명 */
.vid-sub { margin-top: 10px; border: 1px solid color-mix(in srgb, var(--hc) 22%, transparent); background: color-mix(in srgb, var(--hc) 4%, #fff); }
.vid-sub select.input { margin-top: 8px; }
.gvm-notes { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; }
.gvm-notes li { font-size: 12.5px; line-height: 1.5; padding: 8px 10px; border-radius: 10px; background: #fff; border: 1px solid rgba(15, 23, 42, .07); color: var(--muted); }
.gvm-notes li b { color: var(--text); font-size: 13px; }
.gvm-notes li.on { border-color: var(--hc); box-shadow: inset 0 0 0 1px var(--hc); }
.gvm-tier { font-size: 10.5px; font-weight: 800; padding: 1px 7px; border-radius: 999px; margin-left: 4px; background: color-mix(in srgb, var(--hc) 14%, #fff); color: color-mix(in srgb, var(--hc) 80%, #000); }
html[data-theme="dark"] .vid-sub { background: rgba(255, 255, 255, .03); }
html[data-theme="dark"] .gvm-notes li { background: #1f2537; border-color: rgba(255, 255, 255, .07); }
html[data-theme="dark"] .gvm-tier { background: rgba(255, 255, 255, .1); color: #d8ccff; }
/* Flow 화질·길이 버튼 옆 '장면당 자동 소비 크레딧' */
.chips button .cr-tag { display: block; margin-top: 3px; font-size: 11px; font-weight: 600; color: var(--muted); line-height: 1.2; word-break: keep-all; }
.chips button.on .cr-tag { color: inherit; opacity: .85; }


/* 세부 설정 (선택사항) 표시 */
.card-head h2 .opt-note { font-size: 13px; font-weight: 600; }
.opts-help { margin: -4px 0 10px; }
