/* SNS 오토파일럿 — UI 스타일
   다크/라이트 테마, 1440px 데스크톱과 390px 모바일을 모두 지원합니다. */

:root {
  --font: "Pretendard", "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", system-ui, -apple-system, sans-serif;
  --radius: 18px;
  --radius-sm: 12px;
  --radius-xs: 9px;
  --maxw: 1320px;
  --accent: #7c8cff;
  --accent-2: #35d6b0;
  --accent-3: #f472b6;
  --danger: #fb7185;
  --warn: #fbbf24;
  --ok: #34d399;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #080b14;
  --bg-grad-a: rgba(124, 140, 255, 0.16);
  --bg-grad-b: rgba(53, 214, 176, 0.08);
  --surface: #10141f;
  --surface-2: #151a27;
  --surface-3: #1c2233;
  --border: rgba(148, 163, 184, 0.16);
  --border-strong: rgba(148, 163, 184, 0.28);
  --text: #eef2ff;
  --text-soft: #aab4cc;
  --text-mute: #7d879f;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  --shadow-sm: 0 6px 18px rgba(0, 0, 0, 0.3);
  --input-bg: #0d1220;
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f6fc;
  --bg-grad-a: rgba(124, 140, 255, 0.18);
  --bg-grad-b: rgba(53, 214, 176, 0.12);
  --surface: #ffffff;
  --surface-2: #f7f9ff;
  --surface-3: #eef2fd;
  --border: rgba(15, 23, 42, 0.09);
  --border-strong: rgba(15, 23, 42, 0.18);
  --text: #0f172a;
  --text-soft: #4a5573;
  --text-mute: #6b7691;
  --shadow: 0 18px 44px rgba(38, 53, 92, 0.1);
  --shadow-sm: 0 6px 16px rgba(38, 53, 92, 0.08);
  --input-bg: #ffffff;
  --accent: #4f5bd5;
  --accent-2: #0d9488;
  --accent-3: #db2777;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body { margin: 0; padding: 0; }

body {
  font-family: var(--font);
  background:
    radial-gradient(1000px 520px at 84% -8%, var(--bg-grad-a), transparent 62%),
    radial-gradient(760px 420px at -6% 18%, var(--bg-grad-b), transparent 60%),
    var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  line-height: 1.55;
}

h1, h2, h3, h4 { margin: 0; line-height: 1.25; letter-spacing: -0.015em; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ------------------------------- shell ------------------------------- */
.app-shell {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  min-height: 100vh;
  max-width: 1680px;
  margin: 0 auto;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  border-right: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(16, 20, 31, 0.55), transparent 55%);
  backdrop-filter: blur(12px);
}

html[data-theme="light"] .sidebar { background: linear-gradient(180deg, rgba(255,255,255,0.7), transparent 60%); }

.brand { display: flex; align-items: center; gap: 11px; padding: 4px 6px; color: inherit; }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 40px; height: 40px; border-radius: 12px;
  display: grid; place-items: center;
  font-size: 19px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 8px 20px rgba(124, 140, 255, 0.35);
}
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-text strong { font-size: 15.5px; letter-spacing: -0.02em; }
.brand-text small { color: var(--text-mute); font-size: 11.5px; }

.side-nav { display: flex; flex-direction: column; gap: 3px; }
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: var(--radius-xs);
  background: none;
  color: var(--text-soft);
  font-size: 14px;
  text-align: left;
  transition: background 0.16s, color 0.16s, border-color 0.16s;
}
.nav-item span { width: 18px; text-align: center; color: var(--text-mute); font-size: 15px; }
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active {
  background: linear-gradient(90deg, rgba(124,140,255,0.18), rgba(124,140,255,0.04));
  border-color: rgba(124, 140, 255, 0.3);
  color: var(--text);
  font-weight: 600;
}
.nav-item.active span { color: var(--accent); }
.nav-badge {
  margin-left: auto; min-width: 22px; height: 20px; padding: 0 6px;
  border-radius: 999px; background: var(--surface-3); color: var(--text-soft);
  font-size: 11px; font-weight: 600; display: inline-grid; place-items: center;
}

.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.mode-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  background: var(--surface-2);
  display: flex; flex-direction: column; gap: 7px;
}
.mode-line { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--text-mute); }
.mode-line strong { color: var(--text); font-weight: 600; }
.side-note { font-size: 11px; color: var(--text-mute); padding: 0 4px; }

/* ------------------------------- main ------------------------------- */
.main { padding: 22px clamp(16px, 2.4vw, 34px) 96px; min-width: 0; }

.topbar {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
  margin-bottom: 20px; flex-wrap: wrap;
}
.topbar-title h1 { font-size: clamp(21px, 2.1vw, 26px); }
.topbar-title p { color: var(--text-mute); font-size: 13px; margin-top: 4px; }
.topbar-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 999px;
  font-size: 12px; font-weight: 600;
  border: 1px solid rgba(124, 140, 255, 0.36);
  background: rgba(124, 140, 255, 0.13);
  color: var(--text);
  white-space: nowrap;
}
.pill.is-live { border-color: rgba(52, 211, 153, 0.46); background: rgba(52, 211, 153, 0.14); color: var(--ok); }
.pill-soft { border-color: var(--border); background: var(--surface-2); color: var(--text-soft); font-weight: 500; }

.icon-btn {
  width: 38px; height: 38px; border-radius: 11px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  display: grid; place-items: center;
  font-size: 16px; color: var(--text-soft);
  transition: background 0.15s, color 0.15s, transform 0.15s;
}
.icon-btn:hover { background: var(--surface-3); color: var(--text); }

/* ------------------------------- toast ------------------------------- */
.toast-stack {
  position: fixed; right: 20px; bottom: 22px; z-index: 80;
  display: flex; flex-direction: column; gap: 8px;
  max-width: min(340px, calc(100vw - 32px));
  pointer-events: none;
}
.toast {
  background: var(--surface-3);
  border: 1px solid var(--border-strong);
  border-left: 3px solid var(--accent);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 12.5px;
  box-shadow: var(--shadow);
  animation: toastIn 0.22s ease-out;
  overflow-wrap: anywhere;
}
.toast.ok { border-left-color: var(--ok); }
.toast.warn { border-left-color: var(--warn); }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ------------------------------- views ------------------------------- */
.view { display: none; animation: fade 0.22s ease-out; min-width: 0; }
.view.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: clamp(14px, 1.6vw, 20px);
  box-shadow: var(--shadow-sm);
  min-width: 0;
}
.panel + .panel { margin-top: 14px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.panel-head h3 { font-size: 15px; }
.panel-head p { font-size: 12px; margin-top: 3px; }
.muted { color: var(--text-mute); font-size: 12px; }
.hint { color: var(--text-mute); font-size: 12px; margin-top: 8px; overflow-wrap: anywhere; }
.empty { color: var(--text-mute); font-size: 13px; padding: 18px 0; text-align: center; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 10px 16px; border-radius: 11px;
  border: 1px solid transparent;
  background: var(--surface-3); color: var(--text);
  font-size: 13.5px; font-weight: 600;
  transition: transform 0.14s, background 0.16s, border-color 0.16s, opacity 0.16s;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: none; }
.btn-primary {
  background: linear-gradient(135deg, var(--accent), #9d7bff 55%, var(--accent-2));
  color: #fff;
  box-shadow: 0 10px 24px rgba(124, 140, 255, 0.28);
}
.btn-ghost { background: var(--surface-2); border-color: var(--border); color: var(--text-soft); }
.btn-ghost:hover { background: var(--surface-3); color: var(--text); }
.btn-sm { padding: 7px 11px; font-size: 12px; border-radius: 9px; }
.btn.danger { color: var(--danger); border-color: rgba(251, 113, 133, 0.3); }
.link-btn { background: none; border: 0; color: var(--accent); font-size: 12px; font-weight: 600; }

/* ------------------------------- hero ------------------------------- */
.hero-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 22px;
  padding: clamp(20px, 2.6vw, 30px);
  border-radius: 22px;
  border: 1px solid rgba(124, 140, 255, 0.28);
  background:
    radial-gradient(600px 240px at 88% 0%, rgba(53, 214, 176, 0.18), transparent 60%),
    linear-gradient(135deg, rgba(124, 140, 255, 0.17), rgba(16, 20, 31, 0.4) 62%),
    var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}
html[data-theme="light"] .hero-card {
  background:
    radial-gradient(600px 240px at 88% 0%, rgba(13, 148, 136, 0.12), transparent 60%),
    linear-gradient(135deg, rgba(124, 140, 255, 0.14), rgba(255, 255, 255, 0.6) 62%),
    var(--surface);
}
.eyebrow { font-size: 11.5px; letter-spacing: 0.14em; color: var(--accent-2); font-weight: 700; }
.hero-copy h2 { font-size: clamp(23px, 2.9vw, 34px); margin: 10px 0 10px; letter-spacing: -0.03em; }
.hero-copy p { color: var(--text-soft); font-size: 13.5px; max-width: 46ch; }
.hero-actions { display: flex; gap: 8px; margin-top: 18px; flex-wrap: wrap; }
.hero-side { display: flex; flex-direction: column; gap: 14px; justify-content: center; min-width: 0; }
.control-block { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.control-label { font-size: 11.5px; color: var(--text-mute); font-weight: 600; letter-spacing: 0.04em; }

.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  padding: 7px 11px; border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-soft);
  font-size: 12px; font-weight: 600;
  transition: all 0.15s;
}
.chip:hover { border-color: var(--border-strong); color: var(--text); }
.chip.active { background: rgba(124, 140, 255, 0.18); border-color: rgba(124, 140, 255, 0.55); color: var(--text); }
.chip small { font-weight: 500; opacity: 0.65; }

.segmented {
  display: inline-flex; padding: 3px; gap: 3px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 11px;
  flex-wrap: wrap;
}
.segmented button {
  border: 0; background: none; color: var(--text-mute);
  padding: 7px 12px; border-radius: 8px; font-size: 12px; font-weight: 600;
}
.segmented button.active { background: var(--surface-3); color: var(--text); box-shadow: var(--shadow-sm); }

/* ------------------------------- kpi ------------------------------- */
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 14px 0; }
.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  display: flex; flex-direction: column; gap: 3px;
  min-width: 0;
  position: relative; overflow: hidden;
}
.kpi-card::after {
  content: ""; position: absolute; inset: auto 0 0 0; height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  opacity: 0.6;
}
.kpi-label { font-size: 11.5px; color: var(--text-mute); }
.kpi-value { font-size: clamp(22px, 2.4vw, 28px); font-weight: 800; letter-spacing: -0.03em; }
.kpi-unit { font-size: 13px; color: var(--text-mute); font-weight: 600; }
.kpi-foot { font-size: 11px; color: var(--text-mute); }

/* ------------------------------- split ------------------------------- */
.split-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.split-2-1 { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
.split-grid .panel + .panel { margin-top: 0; }

/* ------------------------------- timeline ------------------------------- */
.timeline { display: flex; flex-direction: column; gap: 2px; }
.tl-item {
  display: grid; grid-template-columns: 52px 8px minmax(0, 1fr) auto;
  align-items: center; gap: 10px;
  padding: 9px 4px;
  border-bottom: 1px dashed var(--border);
}
.tl-item:last-child { border-bottom: 0; }
.tl-time { font-size: 12px; font-weight: 700; color: var(--text-soft); font-variant-numeric: tabular-nums; }
.tl-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px rgba(124, 140, 255, 0.16); }
.tl-main { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.tl-title { font-size: 12.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-sub { font-size: 11px; color: var(--text-mute); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-status { font-size: 10.5px; padding: 3px 8px; border-radius: 999px; background: var(--surface-3); color: var(--text-mute); white-space: nowrap; }
.tl-status.published { background: rgba(52, 211, 153, 0.14); color: var(--ok); }
.tl-status.approved { background: rgba(124, 140, 255, 0.16); color: var(--accent); }
.tl-status.skipped { opacity: 0.6; }

/* ------------------------------- mix ------------------------------- */
.mix-list { display: flex; flex-direction: column; gap: 9px; }
.mix-row { display: grid; grid-template-columns: 118px minmax(0, 1fr) 38px; align-items: center; gap: 9px; font-size: 12px; }
.mix-name { color: var(--text-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mix-bar { height: 7px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.mix-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.mix-val { text-align: right; font-weight: 700; font-size: 11.5px; color: var(--text-soft); }

/* ------------------------------- preview ------------------------------- */
.preview-line { display: flex; flex-direction: column; gap: 8px; }
.preview-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  background: var(--surface-2);
  display: flex; flex-direction: column; gap: 6px;
}
.preview-card strong { font-size: 13px; }
.preview-card span { font-size: 12px; color: var(--text-mute); }
.channel-mini { display: flex; flex-direction: column; gap: 4px; }
.channel-mini li { display: flex; align-items: center; gap: 8px; font-size: 12px; padding: 5px 0; border-bottom: 1px dashed var(--border); }
.channel-mini li:last-child { border-bottom: 0; }
.channel-mini .cm-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--text-mute); flex: 0 0 auto; }
.dot.on { background: var(--ok); box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.16); }
.small-tag { font-size: 10px; color: var(--text-mute); border: 1px solid var(--border); border-radius: 999px; padding: 2px 7px; }

/* ------------------------------- studio ------------------------------- */
.studio-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 14px; align-items: start; }
.studio-controls { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.step { display: flex; flex-direction: column; gap: 12px; }
.step-head { display: flex; gap: 11px; align-items: flex-start; }
.step-no {
  flex: 0 0 auto; width: 26px; height: 26px; border-radius: 8px;
  display: grid; place-items: center;
  background: rgba(124, 140, 255, 0.16); color: var(--accent);
  font-size: 12px; font-weight: 800;
}
.step-head h3 { font-size: 14.5px; }
.step-head p { font-size: 11.5px; color: var(--text-mute); margin-top: 2px; }

.source-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: 7px; }
.source-btn, .goal-btn, .channel-btn, .format-btn {
  display: flex; align-items: center; gap: 9px;
  padding: 10px 11px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  background: var(--surface-2);
  text-align: left; color: var(--text-soft);
  transition: all 0.15s;
  min-width: 0;
}
.source-btn:hover, .goal-btn:hover, .channel-btn:hover, .format-btn:hover { border-color: var(--border-strong); color: var(--text); }
.source-btn.active, .goal-btn.active, .channel-btn.active, .format-btn.active {
  border-color: rgba(124, 140, 255, 0.6);
  background: rgba(124, 140, 255, 0.13);
  color: var(--text);
}
.source-btn .ico, .goal-btn .ico, .channel-btn .ico, .format-btn .ico { font-size: 16px; flex: 0 0 auto; }
.source-btn .txt, .goal-btn .txt, .channel-btn .txt, .format-btn .txt { display: flex; flex-direction: column; min-width: 0; }
.source-btn strong, .goal-btn strong, .channel-btn strong, .format-btn strong { font-size: 12.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.source-btn small, .goal-btn small, .channel-btn small, .format-btn small { font-size: 10.5px; color: var(--text-mute); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.goal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 7px; }
.goal-btn { flex-direction: column; align-items: flex-start; gap: 4px; padding: 10px 11px; }
.goal-btn .top { display: flex; align-items: center; gap: 6px; width: 100%; }
.goal-btn small { white-space: normal; line-height: 1.35; }

.channel-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.channel-btn { padding: 8px 10px; }
.channel-btn.bad { opacity: 0.5; }
.format-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.format-btn { flex: 1 1 120px; }

.field { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--text-mute); min-width: 0; }
.field input, .field select, .field textarea {
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13px; color: var(--text);
  min-width: 0; width: 100%;
}
.field input:focus, .field select:focus { border-color: rgba(124, 140, 255, 0.6); outline: none; box-shadow: 0 0 0 3px rgba(124,140,255,0.12); }

.check-line { display: flex; align-items: flex-start; gap: 8px; font-size: 12.5px; color: var(--text-soft); }
.check-line input { width: 16px; height: 16px; margin-top: 1px; accent-color: var(--accent); }
.check-line small { color: var(--text-mute); }

.tone-row { display: flex; gap: 6px; flex-wrap: wrap; }
.tone-btn { padding: 8px 12px; border-radius: 9px; border: 1px solid var(--border); background: var(--surface-2); font-size: 12px; color: var(--text-soft); display: flex; flex-direction: column; gap: 2px; text-align: left; }
.tone-btn small { font-size: 10.5px; color: var(--text-mute); }
.tone-btn.active { border-color: rgba(124, 140, 255, 0.6); background: rgba(124, 140, 255, 0.13); color: var(--text); }

.gen-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.gen-actions .btn { flex: 1 1 150px; }

/* ------------------------------- result ------------------------------- */
.result-panel { position: sticky; top: 22px; }
.result-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 46px 18px; text-align: center; }
.empty-illustration {
  width: 62px; height: 62px; border-radius: 18px; display: grid; place-items: center;
  font-size: 26px;
  background: linear-gradient(135deg, rgba(124,140,255,0.22), rgba(53,214,176,0.16));
  border: 1px solid rgba(124, 140, 255, 0.3);
}
.result-empty h4 { font-size: 14.5px; }
.result-empty p { font-size: 12px; color: var(--text-mute); max-width: 34ch; }

.result-body { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.result-headline h4 { font-size: 16px; letter-spacing: -0.02em; }
.result-headline p { font-size: 12.5px; color: var(--text-soft); margin-top: 5px; }
.tag-row { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 9px; }
.tag { font-size: 10.5px; padding: 3px 8px; border-radius: 999px; background: var(--surface-3); color: var(--text-mute); }
.tag.hot { background: rgba(124, 140, 255, 0.16); color: var(--accent); }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  border: 0; background: none; color: var(--text-mute);
  padding: 9px 3px; margin-right: 14px; font-size: 12.5px; font-weight: 600;
  border-bottom: 2px solid transparent; white-space: nowrap;
}
.tab.active { color: var(--text); border-bottom-color: var(--accent); }
.tab-panels { min-height: 240px; }

.script-block { display: flex; flex-direction: column; gap: 8px; }
.scene {
  display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 10px;
  padding: 9px 11px; border-radius: 10px; background: var(--surface-2);
  border: 1px solid var(--border);
}
.scene-time { font-size: 10.5px; color: var(--accent); font-weight: 700; }
.scene-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.scene-body strong { font-size: 12.5px; }
.scene-body p { font-size: 12px; color: var(--text-soft); overflow-wrap: anywhere; }
.scene-body small { font-size: 10.5px; color: var(--text-mute); }

.copy-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 4px; }
.copy-area {
  font-size: 12px; color: var(--text-soft); white-space: pre-wrap; overflow-wrap: anywhere;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 10px; padding: 12px; max-height: 260px; overflow: auto;
  line-height: 1.65;
}
.mini-list { display: flex; flex-direction: column; gap: 5px; }
.mini-list li { font-size: 12px; color: var(--text-soft); display: flex; gap: 7px; }
.mini-list li::before { content: "·"; color: var(--accent); }
.result-actions { display: flex; gap: 7px; flex-wrap: wrap; }
.disclosure-note { font-size: 11px; color: var(--text-mute); background: var(--surface-2); border: 1px dashed var(--border); border-radius: 8px; padding: 8px 10px; }

/* ------------------------------- cardnews ------------------------------- */
.head-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: 12px; }
.card-cell { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.card-canvas { width: 100%; aspect-ratio: 1 / 1; border-radius: 14px; display: block; border: 1px solid var(--border); background: #0b1020; }
.card-cell .card-meta { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.card-cell .card-meta span { font-size: 11px; color: var(--text-mute); }

/* ------------------------------- queue ------------------------------- */
.queue-head-panel { margin-bottom: 0; }
.queue-head-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 0.8fr) auto; gap: 18px; align-items: start; }
.queue-cta { display: flex; flex-direction: column; gap: 8px; align-items: stretch; }
.queue-io { display: flex; gap: 6px; flex-wrap: wrap; }
.file-btn { position: relative; overflow: hidden; }
.queue-toolbar { gap: 10px; }
.filter-tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.queue-list { display: flex; flex-direction: column; }
.q-item {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr) auto;
  gap: 12px; align-items: center;
  padding: 11px 4px;
  border-bottom: 1px solid var(--border);
}
.q-item:last-child { border-bottom: 0; }
.q-when { display: flex; flex-direction: column; gap: 2px; }
.q-time { font-size: 12.5px; font-weight: 700; font-variant-numeric: tabular-nums; }
.q-date { font-size: 10.5px; color: var(--text-mute); }
.q-main { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.q-title { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.q-meta { display: flex; gap: 5px; flex-wrap: wrap; align-items: center; }
.q-actions { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.status-badge { font-size: 10px; padding: 2px 7px; border-radius: 999px; background: var(--surface-3); color: var(--text-mute); }
.status-badge.pending { background: rgba(251, 191, 36, 0.14); color: var(--warn); }
.status-badge.approved { background: rgba(124, 140, 255, 0.16); color: var(--accent); }
.status-badge.published { background: rgba(52, 211, 153, 0.15); color: var(--ok); }
.status-badge.skipped { opacity: 0.6; }

/* ------------------------------- channels ------------------------------- */
.intro-panel { margin-bottom: 14px; }
.channel-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: 12px; margin-bottom: 14px; }
.channel-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 15px;
  display: flex; flex-direction: column; gap: 10px;
  min-width: 0;
  position: relative; overflow: hidden;
}
.channel-card::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 3px;
  background: var(--ch-color, var(--accent)); opacity: 0.8;
}
.channel-card.on { border-color: rgba(52, 211, 153, 0.35); }
.cc-head { display: flex; align-items: center; gap: 9px; }
.cc-icon { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-3); font-size: 16px; }
.cc-name { display: flex; flex-direction: column; min-width: 0; }
.cc-name strong { font-size: 13.5px; }
.cc-name small { font-size: 10.5px; color: var(--text-mute); }
.cc-formats { display: flex; gap: 4px; flex-wrap: wrap; }
.cc-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; }
.switch { position: relative; display: inline-flex; align-items: center; gap: 7px; font-size: 11px; color: var(--text-mute); }
.switch input { appearance: none; width: 34px; height: 19px; border-radius: 999px; background: var(--surface-3); border: 1px solid var(--border); position: relative; transition: background 0.16s; }
.switch input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 13px; height: 13px; border-radius: 50%; background: var(--text-mute); transition: transform 0.16s, background 0.16s; }
.switch input:checked { background: rgba(52, 211, 153, 0.24); border-color: rgba(52, 211, 153, 0.5); }
.switch input:checked::after { transform: translateX(15px); background: var(--ok); }
.badge {
  font-size: 10px; padding: 2px 7px; border-radius: 999px;
  background: rgba(251, 191, 36, 0.14); color: var(--warn);
  border: 1px solid rgba(251, 191, 36, 0.24);
  white-space: nowrap;
}
.badge.api { background: rgba(52, 211, 153, 0.12); color: var(--ok); border-color: rgba(52, 211, 153, 0.25); }
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 12px; min-width: 640px; }
.data-table th { text-align: left; color: var(--text-mute); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.data-table td { padding: 9px 10px; border-bottom: 1px solid var(--border); color: var(--text-soft); vertical-align: top; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table td strong { color: var(--text); }

/* ------------------------------- goals ------------------------------- */
.focus-banner {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-top: 12px; padding: 11px 13px;
  border-radius: 11px; background: var(--surface-2); border: 1px solid var(--border);
  font-size: 12px; color: var(--text-mute);
}
.focus-banner strong { font-size: 14px; color: var(--text); }
.goal-card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 12px; margin-bottom: 14px; }
.goal-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px; display: flex; flex-direction: column; gap: 9px; min-width: 0;
  position: relative; overflow: hidden;
}
.goal-card.focus { border-color: rgba(124, 140, 255, 0.52); box-shadow: 0 0 0 1px rgba(124,140,255,0.2) inset; }
.gc-head { display: flex; align-items: center; gap: 8px; }
.gc-icon { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--surface-3); }
.gc-name { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.gc-name strong { font-size: 13px; }
.gc-name small { font-size: 10.5px; color: var(--text-mute); }
.gc-kpi { font-size: 11px; color: var(--text-mute); }
.slider-row { display: flex; align-items: center; gap: 9px; }
.slider-row input[type="range"] { flex: 1; accent-color: var(--accent); min-width: 0; }
.slider-val { font-size: 11.5px; font-weight: 700; width: 34px; text-align: right; color: var(--text-soft); }
.gc-foot { display: flex; gap: 5px; flex-wrap: wrap; }

/* ------------------------------- dialog ------------------------------- */
.sheet {
  border: 1px solid var(--border-strong);
  border-radius: 20px;
  background: var(--surface);
  color: var(--text);
  padding: 0;
  width: min(880px, calc(100vw - 28px));
  max-height: min(88vh, 860px);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.5);
}
.sheet::backdrop { background: rgba(4, 7, 14, 0.66); backdrop-filter: blur(3px); }
.sheet-inner { display: flex; flex-direction: column; gap: 0; max-height: min(88vh, 860px); }
.sheet-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--border); }
.sheet-head h3 { font-size: 16px; }
.sheet-head p { font-size: 11.5px; color: var(--text-mute); margin-top: 4px; max-width: 50ch; }
.sheet-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 18px; padding: 18px 20px; overflow-y: auto; }
.sheet-section { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.sheet-section h4 { font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent-2); }
.inline-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.stack-lines { display: flex; flex-direction: column; gap: 5px; }
.sheet-foot { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; }

/* ------------------------------- mobile nav ------------------------------- */
.mobile-nav { display: none; }

/* ------------------------------- responsive ------------------------------- */
@media (max-width: 1180px) {
  .studio-grid { grid-template-columns: minmax(0, 1fr); }
  .result-panel { position: static; }
}

@media (max-width: 1024px) {
  .app-shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { display: none; }
  .main { padding: 18px 16px 92px; }
  .hero-card { grid-template-columns: minmax(0, 1fr); }
  .queue-head-grid { grid-template-columns: minmax(0, 1fr); }
  .split-grid, .split-2-1 { grid-template-columns: minmax(0, 1fr); }
  .mobile-nav {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 60;
    padding: 7px 6px calc(7px + env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--surface) 88%, transparent);
    backdrop-filter: blur(16px);
    border-top: 1px solid var(--border);
  }
  .mnav {
    display: flex; flex-direction: column; align-items: center; gap: 2px;
    border: 0; background: none; color: var(--text-mute); font-size: 10.5px;
    padding: 5px 0; border-radius: 9px;
  }
  .mnav span { font-size: 16px; }
  .mnav.active { color: var(--accent); background: rgba(124, 140, 255, 0.1); }
  .toast-stack { bottom: 84px; }
}

@media (max-width: 720px) {
  .kpi-grid, .kpi-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .topbar { gap: 10px; }
  .topbar-title p { font-size: 12px; }
  .panel { border-radius: 15px; }
  .hero-copy h2 { font-size: 24px; }
  .goal-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .source-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .q-item { grid-template-columns: 58px minmax(0, 1fr); grid-template-areas: "when main" "actions actions"; row-gap: 6px; }
  .q-when { grid-area: when; }
  .q-main { grid-area: main; }
  .q-actions { grid-area: actions; justify-content: flex-start; }
  .tl-item { grid-template-columns: 44px 8px minmax(0, 1fr); }
  .tl-status { display: none; }
  .sheet-grid { padding: 14px; }
  .sheet-head, .sheet-foot { padding: 14px; }
  .studio-controls .step { padding: 14px; }
  .mix-row { grid-template-columns: 84px minmax(0, 1fr) 34px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* 발행 가이드 */
.guide-panel { margin-top: 14px; }
.guide-steps { display: flex; flex-direction: column; gap: 8px; counter-reset: step; }
.guide-steps li { display: flex; gap: 9px; font-size: 12.5px; color: var(--text-soft); align-items: flex-start; }
.guide-steps li::before {
  counter-increment: step; content: counter(step);
  flex: 0 0 auto; width: 19px; height: 19px; border-radius: 6px;
  display: grid; place-items: center; font-size: 10.5px; font-weight: 700;
  background: rgba(124, 140, 255, 0.16); color: var(--accent);
}
.guide-steps li strong { color: var(--text); font-weight: 600; }
