/* Genver Video — 목업의 디자인 시스템.
 * 토큰은 Genver Docs/PPT에서 물려받았고, 우리 것은 액센트뿐이다. */

:root {
  /* Surfaces */
  --bg-app: #fbfbfc;
  --bg-panel: #ffffff;
  --bg-sidebar: #f8f8fa;
  --bg-subtle: #f3f3f6;
  --bg-hover: #eeeef2;
  --bg-active: #e7e7ed;
  --bg-sunken: #eaeaec;

  /* Text */
  --text-1: #18181b;
  --text-2: #5b5b66;
  --text-3: #8a8a95;
  --text-inv: #ffffff;

  /* Borders */
  --border-1: #ededf1;
  --border-2: #e0e0e6;
  --border-3: #c9c9d2;

  /* Accent — 녹화등 빨강 */
  --accent: #dc2626;
  --accent-hover: #c81e1e;
  --accent-press: #b01818;
  --accent-subtle: #fef2f2;
  --accent-border: #f6c9c9;
  --accent-text: #b91c1c;

  /* Semantic */
  --success: #167c3c;
  --success-subtle: #e9f6ed;
  --warning: #9a5700;
  --warning-subtle: #fdf2e4;
  --danger: #c22b2b;
  --danger-subtle: #fdecec;
  --danger-border: #f5c9c9;

  /* Type scale */
  --fs-11: 11px;
  --fs-12: 12px;
  --fs-13: 13px;
  --fs-14: 14px;
  --fs-15: 15px;
  --fs-17: 17px;

  /* Radius */
  --r-4: 4px;
  --r-6: 6px;
  --r-8: 8px;
  --r-10: 10px;
  --r-14: 14px;

  /* Elevation */
  --sh-1: 0 1px 2px rgba(20, 20, 35, 0.05);
  --sh-2: 0 4px 12px rgba(20, 20, 35, 0.07), 0 0 0 1px rgba(20, 20, 35, 0.04);
  --sh-3: 0 16px 48px rgba(20, 20, 35, 0.16), 0 0 0 1px rgba(20, 20, 35, 0.06);
  --sh-paper: 0 1px 2px rgba(20, 20, 35, 0.06), 0 10px 30px rgba(20, 20, 35, 0.07);

  --ring: 0 0 0 3px rgba(220, 38, 38, 0.16);

  /* Layout */
  --menu-w: 216px;
  --detail-w: 288px;
  --chat-w: 400px;
  --split-w: 1px;
  --hit: 9px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: var(--fs-13);
  line-height: 1.5;
  color: var(--text-1);
  background: var(--bg-app);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection {
  background: rgba(220, 38, 38, 0.16);
}

* {
  scrollbar-width: thin;
  scrollbar-color: var(--border-3) transparent;
}
*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
*::-webkit-scrollbar-track {
  background: transparent;
}
*::-webkit-scrollbar-thumb {
  background: transparent;
  border: 3px solid transparent;
  border-radius: 8px;
  background-clip: padding-box;
}
*:hover::-webkit-scrollbar-thumb {
  background: var(--border-3);
  background-clip: padding-box;
}

/* ============================================================
   셸 — 네 칸, 형제앱과 같은 골격
   ============================================================ */

.app {
  display: grid;
  grid-template-columns:
    var(--menu-w) var(--split-w)
    var(--detail-w) var(--split-w)
    var(--chat-w) var(--split-w)
    minmax(340px, 1fr);
  height: 100dvh;
  max-height: 100dvh;
  min-height: 0;
  overflow: hidden;
}
.app.resizing {
  cursor: col-resize;
  user-select: none;
}

.splitter {
  position: relative;
  z-index: 20;
  width: var(--split-w);
  background: var(--border-1);
  cursor: col-resize;
  touch-action: none;
}
.splitter::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: calc(var(--hit) * -1);
  right: calc(var(--hit) * -1);
}
.splitter::before {
  content: "";
  position: absolute;
  inset: 0;
  transition: background 0.12s ease;
}
.splitter:hover::before,
.splitter:focus-visible::before,
.app.resizing .splitter.active::before {
  background: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}
.splitter:focus-visible {
  outline: none;
}

/* ============================================================
   버튼
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 28px;
  padding: 0 10px;
  border: 1px solid var(--border-2);
  border-radius: var(--r-6);
  background: var(--bg-panel);
  color: var(--text-1);
  font: inherit;
  font-size: var(--fs-12);
  font-weight: 500;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition:
    background 0.12s ease,
    border-color 0.12s ease,
    color 0.12s ease;
}
.btn:hover {
  background: var(--bg-subtle);
  border-color: var(--border-3);
}
.btn:active {
  background: var(--bg-active);
}
.btn:focus-visible {
  outline: none;
  box-shadow: var(--ring);
}
.btn:disabled {
  cursor: not-allowed;
  color: var(--text-3);
}
.btn:disabled:hover {
  background: var(--bg-panel);
  border-color: var(--border-2);
  color: var(--text-3);
}

.btn.primary {
  background: var(--accent);
  border-color: transparent;
  color: var(--text-inv);
  box-shadow: var(--sh-1);
}
.btn.primary:hover {
  background: var(--accent-hover);
  border-color: transparent;
}
.btn.primary:active {
  background: var(--accent-press);
}
.btn.primary:disabled,
.btn.primary:disabled:hover {
  background: var(--bg-subtle);
  border-color: var(--border-2);
  color: var(--text-3);
  box-shadow: none;
}
.btn.ghost {
  background: transparent;
  border-color: transparent;
  color: var(--text-2);
}
.btn.ghost:hover {
  background: var(--bg-hover);
  color: var(--text-1);
}
.btn.small {
  height: 24px;
  padding: 0 8px;
  font-size: var(--fs-11);
}
.btn.block {
  display: flex;
  width: 100%;
  height: 32px;
  font-size: var(--fs-13);
}
.btn.icon {
  width: 28px;
  padding: 0;
  flex-shrink: 0;
}
.btn svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.spinner {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  opacity: 0.65;
  animation: spin 0.7s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ============================================================
   1. 메뉴
   ============================================================ */

.menu {
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 12px 10px;
  background: var(--bg-sidebar);
  overflow: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 4px 6px 14px;
}
.brand .logo {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  border-radius: 7px;
  background: linear-gradient(150deg, var(--accent), #f97316);
  color: #fff;
  font-size: var(--fs-13);
  font-weight: 700;
  letter-spacing: -0.02em;
  box-shadow: var(--sh-1);
}
.brand .txt {
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.brand .mark {
  font-size: var(--fs-13);
  font-weight: 650;
  letter-spacing: -0.01em;
  line-height: 1.25;
}
.brand .sub {
  font-size: var(--fs-11);
  color: var(--text-3);
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-label {
  padding: 12px 8px 4px;
  font-size: var(--fs-11);
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--text-3);
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  height: 30px;
  padding: 0 8px;
  border: 0;
  border-radius: var(--r-6);
  background: transparent;
  color: var(--text-2);
  font: inherit;
  font-size: var(--fs-13);
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition:
    background 0.12s ease,
    color 0.12s ease;
}
.nav-item:hover {
  background: var(--bg-hover);
  color: var(--text-1);
}
.nav-item.active {
  background: var(--accent-subtle);
  color: var(--accent-text);
  font-weight: 600;
}
.nav-item:focus-visible {
  outline: none;
  box-shadow: var(--ring);
}
.nav-item .ico {
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  opacity: 0.85;
}
.nav-item .ico svg {
  width: 16px;
  height: 16px;
}

.menu-foot {
  margin-top: auto;
  padding: 10px 8px 2px;
  border-top: 1px solid var(--border-1);
}
.model-chip {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 8px;
  border-radius: var(--r-6);
  background: var(--bg-panel);
  border: 1px solid var(--border-1);
}
.model-chip .dot {
  width: 6px;
  height: 6px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--text-3);
  box-shadow: 0 0 0 3px var(--bg-subtle);
}
.model-chip strong {
  min-width: 0;
  font-size: var(--fs-11);
  font-weight: 600;
  color: var(--text-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.model-chip[data-state="on"] .dot {
  background: var(--success);
  box-shadow: 0 0 0 3px var(--success-subtle);
}
.model-chip[data-state="on"] strong {
  color: var(--text-1);
}
.model-chip[data-state="off"] .dot {
  background: var(--text-3);
  box-shadow: 0 0 0 3px var(--bg-subtle);
}
.model-chip[data-state="down"] .dot {
  background: var(--danger);
  box-shadow: 0 0 0 3px var(--danger-subtle);
}

/* ============================================================
   패널 공통
   ============================================================ */

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-shrink: 0;
  height: 44px;
  padding: 0 12px 0 14px;
  border-bottom: 1px solid var(--border-1);
}
.panel-head h2 {
  font-size: var(--fs-12);
  font-weight: 600;
  color: var(--text-2);
}

.badge {
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--bg-subtle);
  color: var(--text-2);
  font-size: var(--fs-11);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.35;
    transform: scale(0.8);
  }
}

/* 공용 빈 상태 */
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 36px 20px;
  text-align: center;
}
.empty .icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  margin-bottom: 2px;
  border-radius: var(--r-8);
  background: var(--bg-subtle);
  color: var(--text-3);
}
.empty strong {
  font-size: var(--fs-13);
  font-weight: 600;
  color: var(--text-2);
}
.empty span {
  font-size: var(--fs-12);
  color: var(--text-3);
  line-height: 1.5;
  word-break: keep-all;
}
.empty .btn {
  margin-top: 8px;
}

/* ============================================================
   2. 영상 내용 (detail)
   ============================================================ */

.detail {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: var(--bg-panel);
}

.detail-progress {
  flex-shrink: 0;
  height: 2px;
  background: var(--border-1);
}
.detail-progress .bar {
  height: 100%;
  width: 0;
  background: var(--accent);
  transition: width 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.detail-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 8px 8px 20px;
  overflow-x: hidden;
  overflow-y: auto;
}
.detail-body > .empty {
  margin: auto 0;
}
.detail-body > .detail-summary,
.detail-body > .detail-group,
.detail-body > .dt-list {
  flex: none;
}

.detail-summary {
  padding: 10px 10px 11px;
  margin-bottom: 6px;
  border: 1px solid var(--border-1);
  border-radius: var(--r-8);
  background: var(--bg-sidebar);
}
.detail-summary .ds-title {
  font-size: var(--fs-13);
  font-weight: 650;
  letter-spacing: -0.01em;
  word-break: keep-all;
}
.detail-summary .ds-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}
.detail-summary .ds-meta span {
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--bg-panel);
  border: 1px solid var(--border-1);
  color: var(--text-2);
  font-size: 10px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.detail-summary .ds-desc {
  margin-top: 7px;
  font-size: var(--fs-11);
  color: var(--text-3);
  line-height: 1.55;
  word-break: keep-all;
}

.detail-group {
  padding: 12px 6px 5px;
  font-size: var(--fs-11);
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--text-3);
}

.dt-list {
  list-style: none;
}
.dt-item + .dt-item {
  margin-top: 1px;
}

.dt-row {
  display: grid;
  grid-template-columns: 22px 1fr 14px;
  align-items: start;
  gap: 8px;
  width: 100%;
  padding: 7px 8px;
  border: 0;
  border-radius: var(--r-6);
  background: transparent;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 0.12s ease;
}
.dt-row:hover {
  background: var(--bg-hover);
}
.dt-row.active {
  background: var(--accent-subtle);
}
.dt-row:focus-visible {
  outline: none;
  box-shadow: var(--ring);
}

.dt-row .dt-idx {
  display: grid;
  place-items: center;
  height: 17px;
  padding-top: 1px;
  font-size: var(--fs-11);
  font-weight: 600;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}
.dt-row .dt-idx svg {
  width: 13px;
  height: 13px;
}
.dt-row.active .dt-idx {
  color: var(--accent-text);
}

.dt-row .dt-body {
  min-width: 0;
}
.dt-row .dt-label {
  display: block;
  font-size: var(--fs-11);
  font-weight: 600;
  color: var(--text-3);
  line-height: 1.35;
}
.dt-row.active .dt-label {
  color: var(--accent-text);
}
.dt-row .dt-label .req {
  color: var(--accent);
}
.dt-row .dt-value {
  display: block;
  margin-top: 1px;
  font-size: var(--fs-12);
  color: var(--text-1);
  line-height: 1.45;
  word-break: break-word;
  overflow-wrap: anywhere;
}
.dt-row .dt-value.muted {
  color: var(--text-3);
}
.dt-row .dt-value .dt-swatch {
  display: inline-block;
  width: 22px;
  height: 12px;
  margin-right: 6px;
  vertical-align: -2px;
  border: 1px solid var(--border-2);
  border-radius: 3px;
}
.dt-row .dt-value .dt-hex {
  font-size: var(--fs-11);
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
}

.dt-row .dt-status {
  display: grid;
  place-items: center;
  width: 14px;
  height: 18px;
  flex-shrink: 0;
}
.dt-row .dt-status::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--border-3);
}
.dt-row.filled .dt-status::before {
  background: var(--success);
}
.dt-row.missing .dt-status::before {
  background: var(--warning);
}

/* ============================================================
   3. 대화
   ============================================================ */

.chat {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: var(--bg-panel);
  border-left: 1px solid var(--border-1);
  border-right: 1px solid var(--border-1);
}

.chat-head {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: 44px;
  padding: 0 14px;
  border-bottom: 1px solid var(--border-1);
}
.chat-head .title-wrap {
  min-width: 0;
}
.chat-head h1 {
  font-size: var(--fs-13);
  font-weight: 650;
  letter-spacing: -0.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chat-head .meta {
  font-size: var(--fs-11);
  color: var(--text-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--bg-subtle);
  color: var(--text-2);
  font-size: var(--fs-11);
  font-weight: 600;
}
.status-pill::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--text-3);
}
.status-pill[data-status="picking"] {
  background: var(--accent-subtle);
  color: var(--accent-text);
}
.status-pill[data-status="picking"]::before {
  background: var(--accent);
}
.status-pill[data-status="working"] {
  background: var(--warning-subtle);
  color: var(--warning);
}
.status-pill[data-status="working"]::before {
  background: var(--warning);
  animation: pulse 1.4s ease-in-out infinite;
}
.status-pill[data-status="complete"] {
  background: var(--success-subtle);
  color: var(--success);
}
.status-pill[data-status="complete"]::before {
  background: var(--success);
}

.messages {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 18px 16px 8px;
  overflow-x: hidden;
  overflow-y: auto;
  scroll-behavior: smooth;
}

.msg {
  animation: rise 0.24s ease;
}
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.msg.user {
  align-self: flex-end;
  max-width: 86%;
}
.msg.user .bubble {
  padding: 9px 12px;
  border-radius: var(--r-14);
  border-bottom-right-radius: var(--r-4);
  background: var(--accent);
  color: var(--text-inv);
  font-size: var(--fs-13);
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.msg.assistant {
  max-width: 100%;
}
.msg.assistant .role {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 5px;
  font-size: var(--fs-11);
  font-weight: 600;
  color: var(--text-3);
}
.msg.assistant .role::before {
  content: "";
  width: 15px;
  height: 15px;
  border-radius: 5px;
  background: linear-gradient(150deg, var(--accent), #f97316);
}
.msg.assistant .bubble {
  font-size: var(--fs-13);
  line-height: 1.65;
  word-break: keep-all;
}
/* 줄바꿈 보존은 본문 텍스트에만. 버블에 걸면 아래 카드 마크업의
   들여쓰기까지 그려진다. */
.msg.assistant .bubble > .text {
  display: block;
  white-space: pre-wrap;
}
.msg .msg-sub {
  margin-top: 6px;
  font-size: var(--fs-11);
  color: var(--text-3);
  white-space: normal;
}

/* 추천 양식 카드 */
.rec-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}
.rec-card {
  display: grid;
  grid-template-columns: 104px 1fr;
  gap: 10px;
  width: 100%;
  padding: 8px;
  border: 1px solid var(--border-2);
  border-radius: var(--r-10);
  background: var(--bg-panel);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition:
    border-color 0.12s ease,
    box-shadow 0.12s ease;
}
.rec-card:hover {
  border-color: var(--border-3);
}
.rec-card.picked {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}
.rec-card:focus-visible {
  outline: none;
  box-shadow: var(--ring);
}
.rec-thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  align-self: start;
  border: 1px solid var(--border-1);
  border-radius: var(--r-6);
  overflow: hidden;
  background: #0b0f1c;
}
.rec-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.rec-body {
  min-width: 0;
}
.rec-title {
  display: block;
  font-size: var(--fs-13);
  font-weight: 650;
  word-break: keep-all;
}
.rec-meta {
  display: block;
  margin-top: 1px;
  font-size: 10px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}
.rec-desc {
  display: -webkit-box;
  margin-top: 4px;
  font-size: var(--fs-12);
  color: var(--text-2);
  line-height: 1.5;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: keep-all;
}

/* 렌더 진행 막대 (대화 안) */
.chat-progress {
  margin-top: 10px;
  border: 1px solid var(--accent-border);
  border-radius: var(--r-8);
  background: var(--accent-subtle);
  overflow: hidden;
}
.chat-progress-bar {
  height: 2px;
  background: rgba(220, 38, 38, 0.14);
}
.chat-progress-fill {
  height: 100%;
  width: 0;
  background: var(--accent);
  transition: width 0.25s linear;
}
.chat-progress-text {
  padding: 7px 10px;
  font-size: var(--fs-11);
  font-weight: 600;
  color: var(--accent-text);
  font-variant-numeric: tabular-nums;
}

/* 결과 카드 */
.result-card {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid var(--success-subtle);
  border-radius: var(--r-10);
  background: var(--success-subtle);
}
.result-card .rc-ico {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--success);
  color: #fff;
}
.result-card .rc-ico svg {
  width: 14px;
  height: 14px;
}
.result-card .rc-txt {
  min-width: 0;
  flex: 1;
}
.result-card strong {
  display: block;
  font-size: var(--fs-12);
  color: var(--success);
}
.result-card span {
  font-size: var(--fs-11);
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
}

/* 첫 화면 */
.chat-empty {
  margin: auto 0;
  padding: 8px 2px 20px;
}
.chat-empty h2 {
  font-size: var(--fs-17);
  font-weight: 650;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}
.chat-empty p {
  font-size: var(--fs-13);
  color: var(--text-2);
  line-height: 1.6;
  margin-bottom: 14px;
  word-break: keep-all;
}
.chat-empty p b {
  color: var(--text-1);
  font-weight: 600;
}
.chat-steps {
  display: inline-block;
  padding: 5px 10px;
  border: 1px solid var(--border-2);
  border-radius: 999px;
  font-size: var(--fs-11) !important;
  color: var(--text-3) !important;
  background: var(--bg-sunken);
}
.suggestions {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.suggestion {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--border-1);
  border-radius: var(--r-8);
  background: var(--bg-panel);
  color: var(--text-1);
  font: inherit;
  font-size: var(--fs-12);
  line-height: 1.45;
  text-align: left;
  cursor: pointer;
  transition:
    border-color 0.12s ease,
    background 0.12s ease;
}
.suggestion:hover {
  border-color: var(--accent-border);
  background: var(--accent-subtle);
}
.suggestion:focus-visible {
  outline: none;
  box-shadow: var(--ring);
}
.suggestion .s-ico {
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--accent);
}
.suggestion .s-ico svg {
  width: 15px;
  height: 15px;
}
.suggestion .arrow {
  margin-left: auto;
  color: var(--text-3);
  flex-shrink: 0;
}

/* 컴포저 */
.composer {
  flex-shrink: 0;
  padding: 10px 14px 12px;
  border-top: 1px solid var(--border-1);
}
.composer-box {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 8px;
  padding: 8px 8px 8px 12px;
  border: 1px solid var(--border-2);
  border-radius: var(--r-10);
  background: var(--bg-panel);
  box-shadow: var(--sh-1);
  transition:
    border-color 0.12s ease,
    box-shadow 0.12s ease;
}
.composer-box:focus-within {
  border-color: var(--accent-border);
  box-shadow: var(--ring);
}
.composer textarea {
  width: 100%;
  min-height: 40px;
  max-height: 168px;
  padding: 4px 0;
  border: 0;
  outline: none;
  resize: none;
  background: transparent;
  font: inherit;
  font-size: var(--fs-13);
  line-height: 1.6;
  color: var(--text-1);
}
.composer textarea::placeholder {
  color: var(--text-3);
}
.composer .send-btn {
  height: 30px;
  padding: 0 12px;
}
.composer .hint {
  margin-top: 7px;
  padding: 0 2px;
  font-size: var(--fs-11);
  line-height: 1.9;
  color: var(--text-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.composer .hint kbd {
  padding: 1px 5px;
  border: 1px solid var(--border-2);
  border-bottom-width: 2px;
  border-radius: var(--r-4);
  background: var(--bg-subtle);
  font-family: inherit;
  font-size: 10px;
  color: var(--text-2);
}

/* ============================================================
   4. 미리보기 + 슬롯
   ============================================================ */

.preview {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: var(--bg-sunken);
}

.preview-toolbar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 44px;
  padding: 7px 12px;
  border-bottom: 1px solid var(--border-2);
  background: var(--bg-panel);
  flex-wrap: wrap;
}
.seg {
  display: inline-flex;
  gap: 2px;
  padding: 2px;
  border-radius: var(--r-8);
  background: var(--bg-subtle);
}
.seg button {
  height: 26px;
  padding: 0 10px;
  border: 0;
  border-radius: var(--r-6);
  background: transparent;
  color: var(--text-2);
  font: inherit;
  font-size: var(--fs-12);
  font-weight: 500;
  cursor: pointer;
  transition:
    background 0.12s ease,
    color 0.12s ease;
}
.seg button:hover {
  color: var(--text-1);
}
.seg button.active {
  background: var(--bg-panel);
  color: var(--text-1);
  font-weight: 600;
  box-shadow: var(--sh-1);
}
.seg button:focus-visible {
  outline: none;
  box-shadow: var(--ring);
}

.preview-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}
.preview-meta {
  flex-basis: 100%;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 2px;
  font-size: var(--fs-11);
  color: var(--text-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.preview-meta .sep {
  opacity: 0.5;
}
.preview-meta b {
  font-weight: 600;
  color: var(--text-2);
}

.preview-stage {
  flex-shrink: 0;
  padding: 12px 14px;
}
.frame-169 {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--r-6);
  overflow: hidden;
  background: #000;
  box-shadow: var(--sh-paper);
}
.frame-169 video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.pv-empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #64748b;
  font-size: var(--fs-12);
  line-height: 1.7;
  background:
    repeating-linear-gradient(-45deg, transparent 0 7px, rgba(148, 163, 184, 0.05) 7px 8px),
    #0b0f1c;
}

.pv-progress {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 0 12%;
  background: rgba(8, 8, 14, 0.62);
  backdrop-filter: blur(2px);
  color: #fff;
}
.pv-pct {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.pv-progress-bar {
  width: min(180px, 70%);
  height: 3px;
  margin-top: 6px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.22);
  overflow: hidden;
}
#pvProgressFill {
  display: block;
  height: 100%;
  width: 0;
  background: #fff;
  transition: width 0.25s linear;
}
.pv-progress-text {
  margin-top: 6px;
  font-size: var(--fs-11);
  opacity: 0.85;
  text-align: center;
}

.slot-panel {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--border-2);
  background: var(--bg-panel);
}
.slot-panel-head {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  height: 36px;
  padding: 0 12px 0 14px;
  border-bottom: 1px solid var(--border-1);
  font-size: var(--fs-12);
  font-weight: 600;
  color: var(--text-2);
}
.slot-panel-head #slotTitle {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.slot-scroll {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  overflow-y: auto;
}

.slot-form {
  flex: none;
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 10px 14px 12px;
}
.slot-form.is-empty {
  flex: 1;
  justify-content: center;
}

.sf-row {
  display: grid;
  grid-template-columns: 84px 1fr;
  gap: 8px;
  align-items: center;
}
.sf-row label {
  font-size: var(--fs-11);
  font-weight: 600;
  color: var(--text-2);
  line-height: 1.3;
  word-break: keep-all;
}
.sf-row label .req {
  color: var(--accent);
}
.sf-row .in-wrap {
  position: relative;
  min-width: 0;
}
.sf-row input[type="text"] {
  width: 100%;
  height: 28px;
  padding: 0 46px 0 8px;
  border: 1px solid var(--border-2);
  border-radius: var(--r-6);
  background: var(--bg-panel);
  font: inherit;
  font-size: var(--fs-12);
  color: var(--text-1);
  transition:
    border-color 0.12s ease,
    box-shadow 0.12s ease;
}
.sf-row input[type="text"]:focus {
  outline: none;
  border-color: var(--accent-border);
  box-shadow: var(--ring);
}
.sf-row .cnt {
  position: absolute;
  right: 7px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 10px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}
.sf-row.over input[type="text"] {
  border-color: var(--danger);
  background: var(--danger-subtle);
}
.sf-row.over .cnt {
  color: var(--danger);
  font-weight: 700;
}
.sf-row.color-row .in-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}
.sf-row input[type="color"] {
  width: 34px;
  height: 26px;
  flex-shrink: 0;
  padding: 2px;
  border: 1px solid var(--border-2);
  border-radius: var(--r-6);
  background: var(--bg-panel);
  cursor: pointer;
}
.sf-row.color-row input[type="text"] {
  padding-right: 8px;
  font-size: var(--fs-11);
  font-variant-numeric: tabular-nums;
}

/* 배경 음악 */
.bgm {
  margin: 0 14px 12px;
  padding: 10px;
  border: 1px solid var(--border-1);
  border-radius: var(--r-8);
  background: var(--bg-sidebar);
}
.bgm-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.bgm-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-11);
  font-weight: 600;
  color: var(--text-2);
}
.bgm-title svg {
  width: 13px;
  height: 13px;
  color: var(--accent);
}
.bgm-pick {
  display: flex;
  align-items: center;
  gap: 6px;
}
.bgm-pick select {
  flex: 1;
  min-width: 0;
  height: 28px;
  padding: 0 8px;
  border: 1px solid var(--border-2);
  border-radius: var(--r-6);
  background: var(--bg-panel);
  font: inherit;
  font-size: var(--fs-12);
  color: var(--text-1);
  cursor: pointer;
}
.bgm-pick select:focus {
  outline: none;
  border-color: var(--accent-border);
  box-shadow: var(--ring);
}
.bgm-pick select:disabled {
  color: var(--text-3);
  cursor: not-allowed;
}

.bgm-vol {
  display: grid;
  grid-template-columns: auto 1fr 34px;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}
.bgm-vol label {
  font-size: var(--fs-11);
  font-weight: 600;
  color: var(--text-3);
}
.bgm-vol-num {
  font-size: var(--fs-11);
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.bgm-vol input[type="range"] {
  width: 100%;
  height: 16px;
  margin: 0;
  accent-color: var(--accent);
  cursor: pointer;
}
.bgm-vol input[type="range"]:disabled {
  accent-color: var(--border-3);
  cursor: not-allowed;
}
.bgm.silent .bgm-vol label,
.bgm.silent .bgm-vol-num {
  color: var(--text-3);
  opacity: 0.6;
}
.bgm-mood {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}
.bgm-mood label {
  font-size: var(--fs-11);
  font-weight: 600;
  color: var(--text-3);
}
.bgm-mood select {
  width: 100%;
  min-width: 0;
}

.bgm-note {
  margin: 7px 0 0;
  font-size: 10px;
  color: var(--text-3);
  line-height: 1.5;
  word-break: keep-all;
}

.slot-problems {
  flex-shrink: 0;
}
.slot-problems:not(:empty) {
  margin: 0 14px 8px;
  padding: 8px 10px;
  border: 1px solid var(--danger-border);
  border-radius: var(--r-8);
  background: var(--danger-subtle);
  color: var(--danger);
  font-size: var(--fs-11);
  line-height: 1.6;
}

.make-row {
  flex-shrink: 0;
  padding: 10px 14px 12px;
  border-top: 1px solid var(--border-1);
  background: var(--bg-panel);
}
/* 만들기가 꺼져 있을 때는 왜 꺼져 있는지를, 켜져 있을 때는 무엇이 예시로
   채워지는지를 버튼 바로 위에서 말한다. */
.make-hint {
  margin: 0 0 7px;
  font-size: var(--fs-11);
  line-height: 1.5;
  word-break: keep-all;
}
.make-hint[data-kind="block"] {
  color: var(--warning);
}
.make-hint[data-kind="warn"] {
  color: var(--text-3);
}

/* ============================================================
   모달
   ============================================================ */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(20, 20, 28, 0.32);
}
.modal {
  width: min(480px, 100%);
  max-height: min(560px, calc(100dvh - 64px));
  display: flex;
  flex-direction: column;
  border-radius: var(--r-14);
  background: var(--bg-panel);
  box-shadow: var(--sh-3);
  overflow: hidden;
  animation: rise 0.18s ease;
}
.modal.wide {
  width: min(940px, 100%);
  max-height: min(760px, calc(100dvh - 64px));
}
.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  flex-shrink: 0;
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--border-1);
}
.modal-head h3 {
  font-size: var(--fs-14);
  font-weight: 650;
}
.modal-head .sub {
  display: block;
  margin-top: 2px;
  font-size: var(--fs-11);
  color: var(--text-3);
  line-height: 1.5;
  word-break: keep-all;
}
.modal-head-side {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.modal-progress {
  flex-shrink: 0;
  height: 2px;
  background: var(--border-1);
}
.modal-progress .bar {
  height: 100%;
  width: 0;
  background: var(--accent);
  transition: width 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
.modal-body {
  padding: 8px;
  overflow-y: auto;
}

/* 갤러리 모달 */
.gallery-grid {
  padding: 4px;
}
.gallery-grid .group-label {
  padding: 12px 4px 6px;
  font-size: var(--fs-11);
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--text-3);
}
.gallery-grid .group-items {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(196px, 1fr));
  gap: 8px;
}

.tpl-btn {
  display: block;
  width: 100%;
  padding: 6px;
  border: 0;
  border-radius: var(--r-8);
  background: transparent;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 0.12s ease;
}
.tpl-btn:hover {
  background: var(--bg-hover);
}
.tpl-btn.active {
  background: var(--accent-subtle);
}
.tpl-btn:focus-visible {
  outline: none;
  box-shadow: var(--ring);
}
.tpl-btn .thumb-wrap {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--border-2);
  border-radius: var(--r-6);
  overflow: hidden;
  background: #0b0f1c;
  transition: border-color 0.12s ease;
}
.tpl-btn.active .thumb-wrap {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}
.tpl-btn .thumb-wrap video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.thumb-planned {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  background:
    repeating-linear-gradient(-45deg, transparent 0 7px, rgba(138, 138, 149, 0.06) 7px 8px),
    var(--bg-subtle);
  color: var(--text-3);
}
.thumb-planned .pl-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border: 1px dashed var(--border-3);
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
}
.thumb-planned svg {
  width: 15px;
  height: 15px;
  opacity: 0.7;
}
.tpl-btn .t-foot {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0 6px;
  padding: 6px 2px 1px;
}
.tpl-btn .t-title {
  grid-column: 1;
  grid-row: 1;
  min-width: 0;
  font-size: var(--fs-12);
  font-weight: 500;
  color: var(--text-1);
  line-height: 1.35;
  word-break: keep-all;
}
.tpl-btn.active .t-title {
  color: var(--accent-text);
  font-weight: 600;
}
.tpl-btn.planned .t-title {
  color: var(--text-3);
}
.tpl-btn .status {
  grid-column: 2;
  grid-row: 1;
  align-self: center;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--border-3);
}
.tpl-btn.ready .status {
  background: var(--success);
}
.tpl-btn .t-meta {
  grid-column: 1 / 3;
  font-size: 10px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}

/* 영상 목록 모달 */
.vid-list {
  list-style: none;
  padding: 4px;
}
.vid-row {
  display: grid;
  grid-template-columns: 30px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--r-8);
}
.vid-row:hover {
  background: var(--bg-hover);
}
.vid-row .v-ico {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: var(--r-8);
  background: var(--accent-subtle);
  color: var(--accent);
}
.vid-row .v-ico svg {
  width: 15px;
  height: 15px;
}
.vid-row[data-status="done"] .v-ico {
  background: var(--success-subtle);
  color: var(--success);
}
.vid-row[data-status="error"] .v-ico {
  background: var(--danger-subtle);
  color: var(--danger);
}
.vid-row .v-body {
  min-width: 0;
}
.vid-row .v-name {
  font-size: var(--fs-12);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.vid-row .v-meta {
  font-size: var(--fs-11);
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 연결 상태 모달 */
.conn-list {
  list-style: none;
  padding: 4px;
}
.conn-row {
  display: grid;
  grid-template-columns: 10px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--r-8);
}
.conn-row:hover {
  background: var(--bg-hover);
}
.conn-row .cdot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 3px var(--success-subtle);
}
.conn-row[data-state="off"] .cdot {
  background: var(--text-3);
  box-shadow: 0 0 0 3px var(--bg-subtle);
}
.conn-row[data-state="bad"] .cdot {
  background: var(--danger);
  box-shadow: 0 0 0 3px var(--danger-subtle);
}
.conn-row .cname {
  min-width: 0;
  font-size: var(--fs-12);
  font-weight: 600;
}
.conn-row .cname span {
  display: block;
  font-size: var(--fs-11);
  font-weight: 400;
  color: var(--text-3);
  word-break: keep-all;
}
.conn-row .cval {
  font-size: var(--fs-11);
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}

/* ============================================================
   토스트
   ============================================================ */

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 200;
  transform: translate(-50%, 12px);
  padding: 8px 14px;
  border-radius: var(--r-8);
  background: #1d1d24;
  color: #fff;
  font-size: var(--fs-12);
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.18s ease,
    transform 0.18s ease;
}
.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ============================================================
   좁은 화면 — 미리보기 칸이 먼저 좁아지므로 앞 칸들을 줄인다
   ============================================================ */

@media (max-width: 1340px) {
  .app {
    grid-template-columns:
      var(--menu-w) var(--split-w)
      var(--detail-w) var(--split-w)
      minmax(320px, var(--chat-w)) var(--split-w)
      minmax(330px, 1fr);
  }
}
