/* ------------------------------------------------------------------
   CUTPILOT — Cobalt (Business Presentation Design System) 스타일
   코발트 블루 + 얇은 괘선 + 넘버링 섹션 + 대문자 아이브로우
------------------------------------------------------------------- */

:root {
  --cobalt: #0047ab;
  --cobalt-deep: #003580;
  --cobalt-bright: #1f6ff2;
  --cobalt-wash: #eef3fc;
  --ink: #101623;
  --ink-soft: #4a5568;
  --ink-faint: #8a94a6;
  --paper: #f7f8fa;
  --card: #ffffff;
  --rule: #d9dee8;
  --rule-strong: #b9c2d4;

  --amber: #d97706;
  --rose: #d64550;
  --teal: #0e8f7e;
  --violet: #6d5bd0;

  --serif: "Georgia", "Times New Roman", serif;
  --sans: "Segoe UI", "Malgun Gothic", "Apple SD Gothic Neo", sans-serif;
  --mono: "Cascadia Code", "Consolas", monospace;

  --shadow: 0 10px 30px rgba(16, 34, 68, 0.08);
}

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

html, body { height: 100%; }

body {
  font-family: var(--sans);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

button { font-family: inherit; cursor: pointer; }

.eyebrow {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--cobalt);
}

/* ---------------------------------------------------------------- 레이아웃 */

.shell {
  display: grid;
  grid-template-columns: 264px 1fr;
  min-height: 100vh;
}

.rail {
  background: linear-gradient(180deg, var(--cobalt-deep) 0%, var(--cobalt) 100%);
  color: #fff;
  padding: 2.2rem 1.6rem;
  display: flex;
  flex-direction: column;
  gap: 2.4rem;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand { display: flex; align-items: center; gap: 0.8rem; }

.brand-mark {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  background: #fff;
  color: var(--cobalt);
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: 0.05em;
  border-radius: 4px;
}

.brand-text { display: flex; flex-direction: column; }
.brand-text strong { letter-spacing: 0.28em; font-size: 0.95rem; }
.brand-text span { font-size: 0.72rem; opacity: 0.75; letter-spacing: 0.06em; }

.steps { display: flex; flex-direction: column; gap: 2px; }

.step {
  display: flex; align-items: center; gap: 0.9rem;
  padding: 0.85rem 0.9rem;
  background: transparent;
  border: 0;
  border-left: 2px solid rgba(255, 255, 255, 0.25);
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.88rem;
  text-align: left;
  transition: all 0.15s ease;
}

.step i {
  font-style: normal;
  font-family: var(--mono);
  font-size: 0.72rem;
  opacity: 0.75;
}

.step:hover { color: #fff; }
.step.is-active {
  border-left-color: #fff;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-weight: 600;
}
.step.is-done { color: rgba(255, 255, 255, 0.92); }
.step.is-done i::after { content: " ✓"; }
.step:disabled { opacity: 0.4; cursor: default; }

.rail-foot { margin-top: auto; }
.rail-foot .eyebrow { color: rgba(255, 255, 255, 0.65); margin-bottom: 0.6rem; }

.health { list-style: none; display: flex; flex-direction: column; gap: 0.4rem; font-size: 0.78rem; }
.health li { display: flex; align-items: center; gap: 0.5rem; opacity: 0.9; }

.dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; }
.dot-ok { background: #7ef2c0; }
.dot-bad { background: #ff9b9b; }
.dot-wait { background: rgba(255, 255, 255, 0.5); }

/* ---------------------------------------------------------------- 본문 */

.stage {
  padding: 3rem 3.4rem 5rem;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
}

.masthead { border-bottom: 2px solid var(--ink); padding-bottom: 1.8rem; margin-bottom: 2.6rem; }

.masthead h1 {
  font-family: var(--serif);
  font-size: clamp(1.7rem, 3vw, 2.5rem);
  font-weight: 600;
  line-height: 1.22;
  margin: 0.55rem 0 0.8rem;
  max-width: 30ch;
}

.masthead h1 em { color: var(--cobalt); font-style: normal; }

.lede { color: var(--ink-soft); max-width: 62ch; font-size: 0.95rem; }

.panel { margin-bottom: 3.2rem; }

.panel-head {
  display: flex; align-items: baseline; gap: 1rem;
  border-bottom: 1px solid var(--rule-strong);
  padding-bottom: 0.7rem;
  margin-bottom: 1.6rem;
}

.panel-head .num {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--cobalt);
  font-weight: 700;
}

.panel-head h2 {
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 600;
}

.panel-note { font-size: 0.8rem; color: var(--ink-faint); margin-left: auto; }

/* ---------------------------------------------------------------- 업로드 */

.drop {
  display: block;
  border: 1.5px dashed var(--rule-strong);
  border-radius: 6px;
  background: var(--card);
  padding: 3.2rem 2rem;
  text-align: center;
  transition: all 0.15s ease;
}

.drop:hover, .drop.is-over {
  border-color: var(--cobalt);
  background: var(--cobalt-wash);
}

.drop-icon {
  width: 52px; height: 52px;
  margin: 0 auto 1rem;
  display: grid; place-items: center;
  border: 1.5px solid var(--cobalt);
  border-radius: 50%;
  color: var(--cobalt);
  font-size: 1.1rem;
}

.drop-title { font-weight: 600; font-size: 1.02rem; }
.drop-sub { color: var(--ink-faint); font-size: 0.82rem; margin-top: 0.3rem; }

.factsheet {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0;
  margin-top: 1.4rem;
  border: 1px solid var(--rule);
  border-radius: 6px;
  overflow: hidden;
  background: var(--card);
}

.factsheet > div { padding: 0.9rem 1.1rem; border-right: 1px solid var(--rule); }
.factsheet > div:last-child { border-right: 0; }
.factsheet dt { font-size: 0.68rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-faint); }
.factsheet dd { font-size: 1.05rem; font-weight: 600; margin-top: 0.15rem; font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- 설정 */

.settings {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.2rem;
}

.card {
  background: var(--card);
  border: 1px solid var(--rule);
  border-top: 3px solid var(--cobalt);
  border-radius: 6px;
  padding: 1.3rem 1.4rem 1.5rem;
  box-shadow: var(--shadow);
}

.card legend {
  float: left;
  width: 100%;
  font-weight: 700;
  font-size: 0.92rem;
  margin-bottom: 1rem;
}

.check {
  display: flex; align-items: flex-start; gap: 0.7rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--rule);
  font-size: 0.88rem;
}
.check:last-of-type { border-bottom: 0; }
.check input { margin-top: 0.25rem; accent-color: var(--cobalt); width: 15px; height: 15px; }
.check strong { display: block; font-weight: 600; }
.check small { color: var(--ink-faint); font-size: 0.76rem; }

.field { margin-bottom: 1.05rem; }
.field:last-child { margin-bottom: 0; }

.field > label {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 0.84rem; font-weight: 600;
  margin-bottom: 0.35rem;
}

.field b { font-family: var(--mono); font-size: 0.78rem; color: var(--cobalt); font-weight: 600; }
.field small { display: block; color: var(--ink-faint); font-size: 0.74rem; margin-top: 0.25rem; }

.field input[type="range"] { width: 100%; accent-color: var(--cobalt); }

.field select, .field textarea {
  width: 100%;
  font-family: inherit;
  font-size: 0.85rem;
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--rule-strong);
  border-radius: 4px;
  background: #fff;
  color: var(--ink);
  resize: vertical;
}

.field select:focus, .field textarea:focus { outline: 2px solid var(--cobalt-bright); outline-offset: 1px; }

/* ---------------------------------------------------------------- 버튼 */

.actions { display: flex; gap: 0.8rem; margin-top: 1.6rem; }

.btn {
  border: 0;
  border-radius: 4px;
  font-size: 0.88rem;
  font-weight: 700;
  padding: 0.75rem 1.7rem;
  letter-spacing: 0.02em;
  transition: all 0.15s ease;
}

.btn-primary { background: var(--cobalt); color: #fff; }
.btn-primary:hover { background: var(--cobalt-deep); }
.btn-primary:disabled { background: var(--rule-strong); cursor: default; }

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--cobalt);
  color: var(--cobalt);
}
.btn-outline:hover { background: var(--cobalt-wash); }

.btn-ghost { background: transparent; color: var(--ink-soft); }
.btn-ghost:hover { color: var(--cobalt); }

.link { background: none; border: 0; color: var(--cobalt); font-size: 0.78rem; font-weight: 600; text-decoration: underline; }

/* ---------------------------------------------------------------- 진행률 */

.progress-block { margin-top: 1.4rem; }

.bar {
  height: 6px;
  background: var(--rule);
  border-radius: 3px;
  overflow: hidden;
}

.bar span {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--cobalt) 0%, var(--cobalt-bright) 100%);
  transition: width 0.25s ease;
}

.progress-label { font-size: 0.8rem; color: var(--ink-soft); margin-top: 0.45rem; font-variant-numeric: tabular-nums; }

.error {
  margin-top: 1rem;
  padding: 0.8rem 1rem;
  background: #fdf0f0;
  border-left: 3px solid var(--rose);
  color: #8c2f36;
  font-size: 0.84rem;
  border-radius: 0 4px 4px 0;
  white-space: pre-wrap;
}

/* ---------------------------------------------------------------- 스코어보드 */

.scoreboard {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: var(--card);
  overflow: hidden;
  margin-bottom: 1.4rem;
}

.score { padding: 1rem 1.2rem; border-right: 1px solid var(--rule); }
.score:last-child { border-right: 0; }
.score .k { font-size: 0.66rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-faint); }
.score .v { font-size: 1.45rem; font-weight: 700; font-family: var(--serif); margin-top: 0.1rem; font-variant-numeric: tabular-nums; }
.score .v em { font-style: normal; color: var(--cobalt); }
.score .s { font-size: 0.72rem; color: var(--ink-soft); }

/* ---------------------------------------------------------------- 검토 화면 */

.review {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(300px, 4fr);
  gap: 1.4rem;
  align-items: start;
}

.viewer { min-width: 0; }

.video-frame {
  background: #000;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--rule-strong);
}

.video-frame video { display: block; width: 100%; max-height: 420px; }

.viewer-bar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.6rem 0.2rem;
  font-size: 0.82rem;
}

.switch { display: flex; align-items: center; gap: 0.5rem; color: var(--ink-soft); }
.switch input { accent-color: var(--cobalt); width: 15px; height: 15px; }

.timecode { font-family: var(--mono); font-size: 0.8rem; color: var(--cobalt); }

.timeline {
  position: relative;
  height: 96px;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 6px;
  overflow: hidden;
  cursor: crosshair;
}

.timeline canvas { position: absolute; inset: 0; width: 100%; height: 100%; }

.cut-layer { position: absolute; inset: 0; }

.cutmark {
  position: absolute;
  top: 0; bottom: 0;
  opacity: 0.5;
  border-left: 1px solid rgba(0, 0, 0, 0.18);
  border-right: 1px solid rgba(0, 0, 0, 0.18);
}
.cutmark.k-filler { background: var(--amber); }
.cutmark.k-stutter { background: var(--rose); }
.cutmark.k-pause { background: var(--violet); }
.cutmark.k-head, .cutmark.k-tail { background: var(--ink-faint); }
.cutmark.is-off { opacity: 0.12; }

.playhead {
  position: absolute;
  top: 0; bottom: 0;
  width: 2px;
  background: var(--cobalt-bright);
  pointer-events: none;
}

.legend { display: flex; gap: 1.1rem; font-size: 0.74rem; color: var(--ink-soft); margin-top: 0.5rem; }
.legend span { display: flex; align-items: center; gap: 0.35rem; }
.sw { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.sw-filler { background: var(--amber); }
.sw-stutter { background: var(--rose); }
.sw-pause { background: var(--violet); }
.sw-head { background: var(--ink-faint); }

/* 컷 리스트 */

.cutlist {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  max-height: 620px;
}

.cutlist-head {
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--rule);
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  justify-content: space-between;
  align-items: center;
}

.filters { display: flex; gap: 0.35rem; }

.chip {
  border: 1px solid var(--rule-strong);
  background: #fff;
  border-radius: 99px;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.28rem 0.75rem;
  color: var(--ink-soft);
}
.chip.is-on { background: var(--cobalt); border-color: var(--cobalt); color: #fff; }

.bulk { display: flex; gap: 0.7rem; }

.cuts { list-style: none; overflow-y: auto; flex: 1; }

.cut-item {
  display: flex; align-items: center; gap: 0.7rem;
  padding: 0.62rem 1rem;
  border-bottom: 1px solid var(--rule);
  font-size: 0.83rem;
}
.cut-item:hover { background: var(--cobalt-wash); }
.cut-item.is-off { opacity: 0.45; }

.cut-item input { accent-color: var(--cobalt); width: 15px; height: 15px; flex: 0 0 auto; }

.cut-tag {
  flex: 0 0 auto;
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 0.14rem 0.5rem;
  border-radius: 3px;
  color: #fff;
}
.cut-tag.k-filler { background: var(--amber); }
.cut-tag.k-stutter { background: var(--rose); }
.cut-tag.k-pause { background: var(--violet); }
.cut-tag.k-head, .cut-tag.k-tail { background: var(--ink-faint); }

.cut-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cut-time { font-family: var(--mono); font-size: 0.72rem; color: var(--ink-faint); flex: 0 0 auto; }

.cut-play { border: 0; background: none; color: var(--cobalt); font-size: 0.9rem; flex: 0 0 auto; }

/* 전사 */

.transcript-block { margin-top: 1.6rem; border-top: 1px solid var(--rule-strong); padding-top: 1.2rem; }

.transcript {
  margin-top: 0.6rem;
  font-size: 0.9rem;
  line-height: 2;
  color: var(--ink-soft);
  max-height: 220px;
  overflow-y: auto;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 1rem 1.2rem;
}

.transcript .w { cursor: pointer; border-radius: 3px; padding: 0.05rem 0.1rem; }
.transcript .w:hover { background: var(--cobalt-wash); }
.transcript .w.cut { background: #fbe9e7; color: #b3423c; text-decoration: line-through; }
.transcript .w.cut.k-filler { background: #fdf3e3; color: #a05a00; }
.transcript .w.cut.k-pause { background: #efeafc; color: #5a48b5; }

/* ---------------------------------------------------------------- 블러 */

.btn-sm { padding: 0.4rem 0.9rem; font-size: 0.76rem; }

.video-frame { position: relative; }

.blur-preview { position: absolute; inset: 0; pointer-events: none; }

.blur-box {
  position: absolute;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px dashed rgba(255, 255, 255, 0.55);
  border-radius: 4px;
}

.draw-layer {
  position: absolute;
  inset: 0;
  cursor: crosshair;
  background: rgba(0, 20, 60, 0.35);
  z-index: 5;
}

.draw-hint {
  position: absolute;
  top: 10px; left: 50%;
  transform: translateX(-50%);
  background: var(--cobalt);
  color: #fff;
  font-size: 0.74rem;
  font-weight: 600;
  padding: 0.3rem 0.9rem;
  border-radius: 99px;
  pointer-events: none;
}

.draw-rect {
  position: absolute;
  border: 2px solid #fff;
  background: rgba(31, 111, 242, 0.25);
  pointer-events: none;
}

.blur-block { margin-top: 0.9rem; }

.blur-list { list-style: none; margin-top: 0.5rem; display: flex; flex-direction: column; gap: 0.35rem; }

.blur-item {
  display: flex; align-items: center; gap: 0.7rem;
  background: var(--card);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--cobalt);
  border-radius: 4px;
  padding: 0.5rem 0.8rem;
  font-size: 0.8rem;
}

.blur-tools { display: flex; align-items: center; gap: 0.6rem; }

.shape-toggle { display: inline-flex; gap: 0.25rem; }
.shape-toggle .chip { white-space: nowrap; }
.blur-tools { flex-wrap: wrap; }

.draw-rect.is-ellipse { border-radius: 50%; }
.blur-box.is-ellipse { border-radius: 50%; }

/* 추적 중 표시: 점선 박스 + 진행률 라벨 */
.blur-box.is-pending {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border: 2px dashed var(--cobalt-bright);
  background: rgba(31, 111, 242, 0.18);
}
.blur-box.is-pending::after {
  content: attr(data-label);
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  white-space: nowrap;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
}

.blur-item .b-shape { color: var(--cobalt); font-size: 0.8rem; }
.blur-item .b-time { font-family: var(--mono); font-size: 0.72rem; color: var(--cobalt); }
.blur-item .b-msg { flex: 1; color: var(--ink-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.blur-item .b-del {
  border: 1.5px solid var(--rose);
  border-radius: 999px;
  background: none;
  color: var(--rose);
  font-weight: 700;
  font-size: 0.75rem;
  padding: 0.2rem 0.65rem;
  white-space: nowrap;
  cursor: pointer;
}
.blur-item .b-del:hover { background: var(--rose); color: #fff; }

.blur-item .mini-bar { width: 90px; height: 4px; background: var(--rule); border-radius: 2px; overflow: hidden; }
.blur-item .mini-bar span { display: block; height: 100%; background: var(--cobalt-bright); }

/* ---------------------------------------------------------------- 목소리 변형 */

.voice-block { margin-bottom: 1.8rem; }

.voice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.7rem;
}

.voice-card {
  position: relative;
  background: var(--card);
  border: 1.5px solid var(--rule);
  border-radius: 6px;
  padding: 0.85rem 1rem;
  cursor: pointer;
  transition: all 0.12s ease;
}

.voice-card:hover { border-color: var(--cobalt-bright); }
.voice-card.is-selected {
  border-color: var(--cobalt);
  background: var(--cobalt-wash);
  box-shadow: 0 0 0 1px var(--cobalt);
}

.voice-card strong { display: block; font-size: 0.9rem; }
.voice-card small { color: var(--ink-faint); font-size: 0.73rem; display: block; margin-top: 0.15rem; }

.voice-play {
  position: absolute;
  top: 0.7rem; right: 0.7rem;
  width: 28px; height: 28px;
  display: grid; place-items: center;
  border: 1.5px solid var(--cobalt);
  border-radius: 50%;
  background: #fff;
  color: var(--cobalt);
  font-size: 0.7rem;
}
.voice-play.is-loading { opacity: 0.5; }
.voice-play.is-playing { background: var(--cobalt); color: #fff; }

/* ---------------------------------------------------------------- 내보내기 */

.export-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; }

.export-card {
  background: var(--card);
  border: 1px solid var(--rule);
  border-top: 3px solid var(--cobalt);
  border-radius: 6px;
  padding: 1.5rem 1.6rem;
  box-shadow: var(--shadow);
}

.export-card h3 { font-family: var(--serif); font-size: 1.15rem; margin: 0.35rem 0 0.5rem; }
.export-card p { font-size: 0.85rem; color: var(--ink-soft); margin-bottom: 1.1rem; }
.export-card .hint { font-size: 0.74rem; color: var(--ink-faint); margin: 0.7rem 0 0; }

.done {
  margin-top: 1.2rem;
  padding: 1rem 1.2rem;
  background: #eefaf4;
  border-left: 3px solid var(--teal);
  border-radius: 0 4px 4px 0;
  font-size: 0.88rem;
}
.done a { color: var(--cobalt); font-weight: 700; }

/* ---------------------------------------------------------------- 반응형 */

@media (max-width: 960px) {
  .shell { grid-template-columns: 1fr; }
  .rail { position: static; height: auto; flex-direction: row; align-items: center; flex-wrap: wrap; gap: 1rem; padding: 1.2rem 1.4rem; }
  .steps { flex-direction: row; flex-wrap: wrap; }
  .step { border-left: 0; border-bottom: 2px solid rgba(255,255,255,0.25); }
  .step.is-active { border-bottom-color: #fff; }
  .rail-foot { display: none; }
  .stage { padding: 2rem 1.4rem 4rem; }
  .review { grid-template-columns: 1fr; }
  .export-grid { grid-template-columns: 1fr; }
}

/* ------------------------------------------------------------------
   04 대본 · 자막 · 음성
------------------------------------------------------------------- */

.rail-settings {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin: 0;
  padding: 0.75rem 0.9rem;
  border: 1.5px solid rgba(255, 255, 255, 0.8);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  text-align: left;
  transition: background 0.15s ease, color 0.15s ease;
}
.rail-settings:hover { background: #fff; color: var(--cobalt); }

.key-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
}
.key-badge i { width: 8px; height: 8px; border-radius: 50%; background: #ffb4b4; }
.key-badge b { font-weight: 600; }
.rail-settings.has-key .key-badge i { background: #7ef2c0; }

.script-toolbar {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  flex-wrap: wrap;
  padding-bottom: 1rem;
  margin-bottom: 1.2rem;
  border-bottom: 1px solid var(--rule);
}
.script-stats { font-size: 0.82rem; color: var(--ink-soft); }
.script-stats b { font-family: var(--mono); color: var(--cobalt); font-weight: 600; }

.script-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.1rem;
  margin-bottom: 1.4rem;
}
.script-grid .card { margin: 0; }
.script-grid .card > small { display: block; color: var(--ink-faint); font-size: 0.74rem; margin-top: 0.5rem; }
.script-grid .btn { width: 100%; justify-content: center; }

.field-row { display: flex; gap: 1rem; }
.field-row span { flex: 1; }
.field-row input[type="color"] {
  width: 100%; height: 34px; padding: 2px;
  border: 1px solid var(--rule); border-radius: 5px; background: var(--card);
}

.voice-row { display: flex; gap: 0.4rem; align-items: stretch; }
.voice-row select { flex: 1; }
.voice-row .btn { width: auto; padding: 0 0.75rem; }

.script-grid .my-voice-open { margin: -0.3rem 0 1rem; }

/* ⚙ AI 설정 창 안의 '내 목소리 등록' */
.my-voice-section { margin-top: 1.4rem; border-top: 1px solid var(--rule); padding-top: 1rem; }
.my-voice-section h4 { font-size: 0.95rem; margin-bottom: 0.3rem; }
.modal .my-voice-section .field input[type="text"] { font-family: var(--sans); }
.my-voice-section .field input[type="file"] { width: 100%; font-size: 0.82rem; }
.my-voice-section .inline-actions { margin-top: 0.9rem; }
.my-voice-list { list-style: none; margin-top: 0.7rem; border: 1px solid var(--rule); border-radius: 6px; }
.my-voice-list li { display: flex; align-items: center; gap: 0.6rem; padding: 0.45rem 0.7rem; }
.my-voice-list li + li { border-top: 1px solid var(--rule); }
.my-voice-list span { font-weight: 600; font-size: 0.86rem; }
.my-voice-list small { flex: 1; color: var(--ink-faint); font-size: 0.74rem; }
.my-voice-status { display: block; margin-top: 0.5rem; font-size: 0.76rem; color: var(--ink-soft); }
.my-voice-status.is-ok { color: var(--teal); }
.my-voice-status.is-warn { color: var(--amber); }
.my-voice-status.is-bad { color: var(--rose); }

.sub-preview {
  margin-top: 0.9rem;
  height: 78px;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: #2a3f5f;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0.5rem;
  overflow: hidden;
}
.sub-preview span {
  color: #fff;
  font-weight: 700;
  line-height: 1.25;
  text-align: center;
  text-shadow: -1.5px -1.5px 0 #000, 1.5px -1.5px 0 #000, -1.5px 1.5px 0 #000, 1.5px 1.5px 0 #000;
}

.ai-lock {
  border: 1px solid var(--amber);
  border-left-width: 3px;
  border-radius: 6px;
  background: #fffbf3;
  padding: 0.9rem 1.1rem;
  margin-bottom: 1.3rem;
}
.ai-lock p { color: var(--ink-soft); font-size: 0.84rem; margin: 0.25rem 0 0.7rem; }

.comment-block {
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 1rem 1.1rem;
  background: var(--cobalt-wash);
  margin-bottom: 1.4rem;
}
.comment-row { display: flex; gap: 0.5rem; }
.comment-row input {
  flex: 1;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--rule-strong);
  border-radius: 5px;
  font-family: inherit;
  font-size: 0.88rem;
  background: var(--card);
}
.comment-row input:focus { outline: 2px solid var(--cobalt-bright); outline-offset: 1px; }
.comment-row .btn { white-space: nowrap; }

.inline-actions { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.8rem; }
.inline-actions .hint { margin: 0; color: var(--teal); font-size: 0.76rem; }

/* --- 대본 목록 --- */
.script-list { list-style: none; counter-reset: seg; }

.seg {
  display: grid;
  grid-template-columns: auto 62px 1fr auto;
  gap: 0.7rem;
  align-items: start;
  padding: 0.75rem 0.5rem;
  border-bottom: 1px solid var(--rule);
}
.seg.is-off { opacity: 0.45; }
.seg.is-comment { background: var(--cobalt-wash); }

.seg input[type="checkbox"] { margin-top: 0.45rem; accent-color: var(--cobalt); width: 15px; height: 15px; }
.seg-time { font-family: var(--mono); font-size: 0.72rem; color: var(--cobalt); padding-top: 0.5rem; }
.seg-body { min-width: 0; }
.seg-text {
  width: 100%;
  border: 1px solid transparent;
  border-radius: 5px;
  padding: 0.4rem 0.5rem;
  font-family: inherit;
  font-size: 0.92rem;
  line-height: 1.5;
  resize: vertical;
  background: transparent;
  color: var(--ink);
}
.seg-text:hover { border-color: var(--rule); background: var(--card); }
.seg-text:focus { outline: none; border-color: var(--cobalt-bright); background: var(--card); }
.seg-original {
  font-size: 0.76rem;
  color: var(--ink-faint);
  padding: 0.2rem 0.5rem 0;
  font-style: italic;
}
.seg-note {
  display: inline-block;
  font-size: 0.7rem;
  color: var(--amber);
  padding: 0.1rem 0.4rem;
  border: 1px solid currentColor;
  border-radius: 999px;
  margin: 0.3rem 0 0 0.5rem;
}
.seg-tag {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--violet);
  border: 1px solid currentColor;
  border-radius: 999px;
  padding: 0.1rem 0.45rem;
  margin: 0.3rem 0 0 0.5rem;
}
.seg-actions { display: flex; flex-direction: column; gap: 0.3rem; padding-top: 0.35rem; }
.seg-btn {
  border: 1px solid var(--rule);
  background: var(--card);
  border-radius: 5px;
  font-size: 0.72rem;
  padding: 0.22rem 0.45rem;
  color: var(--ink-soft);
  white-space: nowrap;
}
.seg-btn:hover { border-color: var(--cobalt); color: var(--cobalt); }
.seg-btn.is-del:hover { border-color: var(--rose); color: var(--rose); }
.seg-btn:disabled { opacity: 0.4; cursor: default; }

/* --- 설정 모달 --- */
/* [hidden] 보다 아래 규칙의 우선순위가 높아서 명시적으로 꺼줘야 한다. */
.modal[hidden] { display: none; }

.modal {
  position: fixed;
  inset: 0;
  background: rgba(16, 34, 68, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  z-index: 50;
}
.modal-card {
  background: var(--card);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 1.5rem 1.7rem 1.7rem;
  width: min(520px, 100%);
  max-height: 90vh;
  overflow-y: auto;
}
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.6rem; }
.modal-head h3 { font-family: var(--serif); font-size: 1.25rem; }
.modal-close { border: 0; background: none; font-size: 1.1rem; color: var(--ink-faint); padding: 0.2rem 0.4rem; }
.modal-close:hover { color: var(--ink); }
.modal .field { margin-top: 1rem; }
.modal .field input[type="password"], .modal .field input[type="text"] {
  width: 100%;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--rule-strong);
  border-radius: 5px;
  font-family: var(--mono);
  font-size: 0.85rem;
}
.key-result { margin-top: 0.8rem; font-size: 0.84rem; padding: 0.5rem 0.7rem; border-radius: 5px; }
.key-result.is-ok { color: var(--teal); background: #e9f7f4; }
.key-result.is-bad { color: var(--rose); background: #fdeef0; }
.how-to { margin-top: 1.2rem; border-top: 1px solid var(--rule); padding-top: 0.9rem; }
.how-to summary { cursor: pointer; font-size: 0.85rem; font-weight: 600; color: var(--cobalt); }
.how-to ol { margin: 0.7rem 0 0 1.1rem; font-size: 0.83rem; color: var(--ink-soft); line-height: 1.8; }

/* 좁은 화면에서 표가 넘치지 않게 */
@media (max-width: 720px) {
  .settings, .script-grid { grid-template-columns: 1fr; }
  .seg { grid-template-columns: auto 1fr; grid-template-areas: "chk body" ". meta"; }
  .seg-time { grid-column: 1 / -1; padding-top: 0; }
  .seg-actions { grid-column: 1 / -1; flex-direction: row; }
  .comment-row { flex-direction: column; align-items: stretch; }
  .rail-settings { margin: 0; }
  .field-row { flex-direction: column; gap: 0.6rem; }
}

.replace-warn {
  font-size: 0.74rem;
  color: var(--amber);
  background: #fffbf3;
  border-left: 2px solid var(--amber);
  padding: 0.4rem 0.6rem;
  margin: 0.5rem 0 0.9rem;
  border-radius: 3px;
}

.apply-list {
  list-style: none;
  border: 1px solid var(--rule);
  border-left: 3px solid var(--cobalt);
  border-radius: 6px;
  background: var(--card);
  padding: 0.9rem 1.2rem;
  margin-bottom: 1.4rem;
  font-size: 0.86rem;
  color: var(--ink-soft);
}
.apply-list li { padding: 0.22rem 0; }
.apply-list li b { color: var(--ink); }
.apply-list li.is-warn { color: var(--amber); }

.done-warn { list-style: none; margin-top: 0.7rem; font-size: 0.8rem; color: var(--amber); }
.done-warn li { padding: 0.15rem 0; }
.done-warn li::before { content: "· "; }

/* 자막 미리보기는 16:9 화면을 그대로 줄인 것 — 실제 렌더와 같은 비율 */
.sub-preview { height: auto; aspect-ratio: 16 / 9; padding: 0 4%; }
.sub-preview span { line-height: 1.2; }

.seg-note.is-review { color: var(--amber); background: #fff7e8; }
.seg-note.is-bad { color: var(--rose); }
.seg-note.is-edited { color: var(--cobalt); }
.seg-text[readonly] { background: var(--paper); color: var(--ink-soft); cursor: not-allowed; }

.script-notice {
  font-size: 0.8rem;
  color: var(--teal);
  background: #e9f7f4;
  border-radius: 5px;
  padding: 0.45rem 0.7rem;
  margin: -0.4rem 0 1rem;
}

/* 컷 들어보기 · 잘라낸 결과 미리보기 */
.play-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin-top: 0.5rem;
  padding: 0.45rem 0.7rem;
  border-radius: 5px;
  background: var(--cobalt-wash);
  color: var(--cobalt-deep);
  font-size: 0.8rem;
}
.play-status .link { white-space: nowrap; }

.listen-mark {
  position: absolute;
  top: 0;
  bottom: 0;
  background: rgba(214, 69, 80, 0.28);
  border-left: 2px solid var(--rose);
  border-right: 2px solid var(--rose);
  pointer-events: none;
  z-index: 2;
}

.cut-play { font-size: 0.74rem; white-space: nowrap; }
.cut-after {
  border: 0;
  background: none;
  color: var(--ink-soft);
  font-size: 0.74rem;
  white-space: nowrap;
  flex: 0 0 auto;
}
.cut-after:hover { color: var(--cobalt); }
.cut-item.is-skipped { background: #fff6d8; transition: background 0.3s; }

/* 음성 완료 표시 · 내보내기 전 미리보기 */
.tts-done {
  margin-top: 0.6rem;
  padding: 0.45rem 0.6rem;
  border-radius: 5px;
  background: #e9f7f4;
  color: var(--teal);
  font-size: 0.8rem;
}
.tts-done b { font-weight: 700; }

.preview-block {
  border: 1px solid var(--rule);
  border-top: 3px solid var(--teal);
  border-radius: 6px;
  background: var(--card);
  padding: 1rem 1.2rem;
  margin-bottom: 1.4rem;
  box-shadow: var(--shadow);
}
.preview-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.preview-desc { font-size: 0.82rem; color: var(--ink-soft); margin-top: 0.25rem; max-width: 62ch; }
.preview-player { margin-top: 1rem; }
.preview-player video { width: 100%; max-height: 440px; background: #000; border-radius: 6px; }
.btn.is-pulse { box-shadow: 0 0 0 5px rgba(14, 143, 126, 0.35); }

.apply-list .apply-act { margin-left: 0.5rem; vertical-align: middle; }

/* 하던 작업 이어서 하기 */
.recent { margin-top: 1.4rem; }
.recent-list { list-style: none; margin: 0.5rem 0 0; padding: 0; display: grid; gap: 0.5rem; }
.recent-item {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  text-align: left;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--rule);
  border-left: 3px solid var(--cobalt);
  border-radius: 6px;
  background: var(--card);
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}
.recent-item:hover { border-color: var(--cobalt); background: var(--cobalt-wash); }
.recent-item strong { font-size: 0.9rem; }
.recent-item span { font-size: 0.78rem; color: var(--ink-soft); }

/* 자막 색 · 바탕색 */
.swatches { display: flex; flex-wrap: wrap; align-items: center; gap: 0.45rem; }
.swatch {
  width: 28px;
  height: 28px;
  padding: 0;
  border: 2px solid var(--card);
  border-radius: 50%;
  background: var(--c, #fff);
  box-shadow: 0 0 0 1px var(--rule-strong);
  cursor: pointer;
}
.swatch:hover { box-shadow: 0 0 0 1px var(--cobalt); }
.swatch.is-on { box-shadow: 0 0 0 2.5px var(--cobalt); }
.swatch-custom {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-left: 0.15rem;
  font-size: 0.74rem;
  color: var(--ink-soft);
  cursor: pointer;
}
.swatch-custom input[type="color"] {
  width: 32px;
  height: 28px;
  padding: 1px;
  border: 1px solid var(--rule-strong);
  border-radius: 6px;
  background: var(--card);
  cursor: pointer;
}
.swatch-custom.is-on input[type="color"] { outline: 2.5px solid var(--cobalt); outline-offset: 1px; }

.sub-presets { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 0.4rem; }
.sub-preset {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.45rem;
  border: 1px solid var(--rule);
  border-radius: 5px;
  background: var(--card);
  color: var(--ink);
  font: inherit;
  font-size: 0.76rem;
  text-align: left;
  cursor: pointer;
}
.sub-preset:hover, .sub-preset.is-on { border-color: var(--cobalt); background: var(--cobalt-wash); }
.pv {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 22px;
  border-radius: 3px;
  font-style: normal;
  font-weight: 700;
  font-size: 0.8rem;
}
.pv-classic, .pv-yellow { background: #2a3f5f; text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000; }
.pv-classic { color: #fff; }
.pv-yellow { color: #ffe14d; }
.pv-darkbox { background: rgba(0, 0, 0, 0.72); color: #fff; }
.pv-lightbox { background: #fff; color: #111; box-shadow: inset 0 0 0 1px var(--rule-strong); }
.pv-cobalt { background: var(--cobalt); color: #fff; }

.sub-box-fields { padding-top: 0.7rem; }
.sub-box-fields.is-off, #sub-outline-field.is-off { opacity: 0.45; }
.inline-note { font-weight: 400; font-size: 0.72rem; color: var(--ink-faint); }
.sub-preview span { -webkit-box-decoration-break: clone; box-decoration-break: clone; border-radius: 2px; }
.sub-save { display: flex; align-items: center; flex-wrap: wrap; gap: 0.6rem; margin-top: 0.8rem; }
.sub-save small { font-size: 0.76rem; color: var(--teal); }
.sub-save small.is-bad { color: var(--rose); }

/* ==================================================================
   웹 서비스 — 계정 · 결제 · 공개 페이지 (같은 Cobalt 변수를 그대로 쓴다)
================================================================== */

/* display 를 지정한 클래스가 있어도 hidden 이면 확실히 숨긴다. */
[hidden] { display: none !important; }

a.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem; text-decoration: none; }
.btn-lg { padding: 0.95rem 1.9rem; font-size: 1.02rem; border-radius: 6px; }
.btn-block { width: 100%; }
.btn-outline:disabled, .btn-ghost:disabled { opacity: 0.5; cursor: default; }
.btn-danger { background: transparent; border: 1.5px solid var(--rose); color: var(--rose); }
.btn-danger:hover { background: #fdeef0; }
.btn-on-dark { background: #fff; color: var(--cobalt); }
.btn-on-dark:hover { background: var(--cobalt-wash); }
.btn-outline-light { background: transparent; border: 1.5px solid rgba(255, 255, 255, 0.85); color: #fff; }
.btn-outline-light:hover { background: rgba(255, 255, 255, 0.14); }

.fine { font-size: 0.85rem; color: var(--ink-faint); margin-top: 0.6rem; }
.notice {
  background: var(--cobalt-wash);
  border-left: 3px solid var(--cobalt);
  border-radius: 0 5px 5px 0;
  padding: 0.7rem 0.9rem;
  font-size: 0.95rem;
  color: var(--cobalt-deep);
  margin-top: 0.8rem;
}
.notice.is-warn { background: #fffbf3; border-left-color: var(--amber); color: #8a4b00; }

.check-list { list-style: none; margin: 0.9rem 0 1rem; display: grid; gap: 0.45rem; font-size: 1rem; color: var(--ink); }
.check-list li::before { content: "✓"; color: var(--teal); font-weight: 700; margin-right: 0.55rem; }

/* ---------------------------------------------------------------- 편집기: 계정 · 이용 안내 */

.rail { overflow-y: auto; }

.rail-account {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.85rem 0.9rem;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
}
.rail-account ~ .rail-foot { margin-top: 0; }
.rail-account .eyebrow { color: rgba(255, 255, 255, 0.65); }
.acct-name { font-size: 0.95rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-credits { font-size: 0.84rem; opacity: 0.92; }
.acct-credits b { font-family: var(--mono); font-size: 0.98rem; }
.acct-links { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.5rem; }
.acct-links a {
  color: #fff;
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 4px;
  padding: 0.3rem 0.6rem;
}
.acct-links a:hover { background: #fff; color: var(--cobalt); }

.my-voice-section.is-solo { margin-top: 0.4rem; border-top: 0; padding-top: 0; }
.consent {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  margin-top: 1rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--amber);
  border-left-width: 3px;
  border-radius: 6px;
  background: #fffbf3;
  font-size: 0.86rem;
  line-height: 1.6;
  color: var(--ink);
  cursor: pointer;
}
.consent input { width: 20px; height: 20px; margin-top: 0.15rem; accent-color: var(--cobalt); flex: 0 0 auto; }

.cost-hint { display: block; color: var(--ink-faint); font-size: 0.74rem; margin-top: 0.4rem; }

.export-grid.is-single { grid-template-columns: 1fr; }

.recent-row { display: flex; gap: 0.4rem; align-items: stretch; }
.recent-row .recent-item { flex: 1; min-width: 0; }
.recent-del {
  flex: 0 0 auto;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: var(--card);
  color: var(--ink-soft);
  font-size: 0.78rem;
  padding: 0 0.8rem;
}
.recent-del:hover { border-color: var(--rose); color: var(--rose); }

.access-overlay {
  position: fixed;
  inset: 0;
  z-index: 45;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(16, 34, 68, 0.6);
  backdrop-filter: blur(3px);
}
.access-card {
  width: min(540px, 100%);
  max-height: 92vh;
  overflow-y: auto;
  background: var(--card);
  border-top: 4px solid var(--cobalt);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 2rem 2.2rem;
}
.access-card h2 { font-family: var(--serif); font-size: 1.65rem; font-weight: 600; margin: 0.4rem 0 0.6rem; }
.access-card > p { color: var(--ink-soft); font-size: 1rem; }
.access-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 1.2rem; }
.access-foot { display: flex; justify-content: flex-end; margin-top: 1rem; }
.access-foot .link { font-size: 0.88rem; }

/* ---------------------------------------------------------------- 공용 안내 창 · 알림 */

.cp-modal { z-index: 70; }
.cp-modal .modal-card { width: min(480px, 100%); }
.cp-modal-body { font-size: 1rem; color: var(--ink-soft); line-height: 1.7; }
.cp-modal-body b { color: var(--ink); }
.cp-modal-sub { margin-top: 1rem; font-weight: 700; color: var(--ink); }
.cp-modal-actions { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 1.3rem; }

.pack-list { display: grid; gap: 0.5rem; margin-top: 0.6rem; }
.pack-btn {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.8rem;
  width: 100%;
  padding: 0.9rem 1rem;
  border: 1.5px solid var(--cobalt);
  border-radius: 6px;
  background: var(--card);
  color: var(--ink);
  font-size: 1rem;
  font-weight: 700;
  text-align: left;
}
.pack-btn:hover { background: var(--cobalt-wash); }
.pack-btn .pack-go { color: var(--cobalt); font-size: 0.9rem; white-space: nowrap; }

.cp-toast {
  position: fixed;
  left: 50%;
  bottom: 1.6rem;
  transform: translateX(-50%);
  z-index: 80;
  max-width: calc(100% - 2rem);
  padding: 0.85rem 1.2rem;
  border-radius: 6px;
  background: var(--ink);
  color: #fff;
  font-size: 0.98rem;
  box-shadow: var(--shadow);
}
.cp-toast.is-ok { background: var(--teal); }
.cp-toast.is-bad { background: var(--rose); }

/* ---------------------------------------------------------------- 공개 페이지 뼈대 */

.site { min-height: 100vh; display: flex; flex-direction: column; font-size: 1.02rem; }
.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 1.5rem; }

.topbar { background: linear-gradient(90deg, var(--cobalt-deep) 0%, var(--cobalt) 100%); color: #fff; }
.topbar-inner { max-width: 1120px; margin: 0 auto; padding: 0.9rem 1.5rem; display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.topbar .brand { color: #fff; text-decoration: none; }
.topbar-nav { margin-left: auto; display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.topbar-nav .plain { color: #fff; text-decoration: none; font-weight: 600; font-size: 0.95rem; padding: 0.5rem 0.7rem; }
.topbar-nav .plain:hover { text-decoration: underline; }
.topbar-nav .btn { padding: 0.6rem 1.2rem; font-size: 0.95rem; }

.site-foot { margin-top: auto; border-top: 2px solid var(--ink); padding: 1.6rem 0 2.4rem; font-size: 0.9rem; color: var(--ink-soft); background: var(--paper); }
.site-foot nav { display: flex; flex-wrap: wrap; gap: 0.3rem 1.2rem; margin-bottom: 0.6rem; }
.site-foot a { color: var(--ink); font-weight: 700; }
.site-foot a:hover { color: var(--cobalt); }
.site-foot p { margin-top: 0.25rem; }
.stage .site-foot { margin-top: 3rem; padding-bottom: 0; background: transparent; }

/* ---------------------------------------------------------------- 첫 화면(랜딩) */

.hero { background: linear-gradient(180deg, var(--cobalt) 0%, var(--cobalt-deep) 100%); color: #fff; padding: 4.5rem 0 4rem; }
.hero .eyebrow { color: rgba(255, 255, 255, 0.78); }
.hero h1 { font-family: var(--serif); font-size: clamp(2rem, 4.4vw, 3.1rem); font-weight: 600; line-height: 1.22; margin: 0.8rem 0 1rem; max-width: 22ch; }
.hero h1 em { font-style: normal; color: #bcd3ff; }
.hero-lede { font-size: 1.15rem; max-width: 52ch; opacity: 0.93; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.8rem; margin-top: 2rem; }
.hero-points { list-style: none; display: flex; flex-wrap: wrap; gap: 0.6rem 1.4rem; margin-top: 1.6rem; font-size: 0.98rem; opacity: 0.92; }
.hero-points li::before { content: "✓ "; color: #7ef2c0; font-weight: 700; }

.section { padding: 4rem 0; border-bottom: 1px solid var(--rule); }
.section-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0.4rem 1rem; border-bottom: 1px solid var(--rule-strong); padding-bottom: 0.7rem; margin-bottom: 2rem; }
.section-head .num { font-family: var(--mono); font-size: 0.85rem; font-weight: 700; color: var(--cobalt); }
.section-head h2 { font-family: var(--serif); font-size: 1.75rem; font-weight: 600; }
.section-head p { margin-left: auto; color: var(--ink-faint); font-size: 0.95rem; }

.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 1.1rem; }
.feature { background: var(--card); border: 1px solid var(--rule); border-top: 3px solid var(--cobalt); border-radius: 6px; padding: 1.4rem 1.4rem 1.5rem; box-shadow: var(--shadow); }
.feature-num { font-family: var(--mono); font-size: 0.8rem; font-weight: 700; color: var(--cobalt); }
.feature h3 { font-size: 1.12rem; margin: 0.35rem 0 0.45rem; }
.feature p { color: var(--ink-soft); font-size: 0.98rem; }
.feature .tag { display: inline-block; margin-left: 0.35rem; padding: 0.02rem 0.5rem; border: 1px solid currentColor; border-radius: 999px; font-size: 0.72rem; font-weight: 700; color: var(--violet); vertical-align: middle; }

.flow { list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); background: var(--card); border: 1px solid var(--rule); border-radius: 6px; overflow: hidden; }
.flow li { padding: 1.1rem 1.2rem; border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.flow b { display: block; font-family: var(--mono); font-size: 0.8rem; color: var(--cobalt); }
.flow strong { display: block; font-size: 1.02rem; margin: 0.2rem 0; }
.flow span { font-size: 0.92rem; color: var(--ink-soft); }

.price-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.2rem; }
.price-card { background: var(--card); border: 1px solid var(--rule); border-top: 4px solid var(--cobalt); border-radius: 8px; padding: 1.8rem; box-shadow: var(--shadow); }
.price-card.is-alt { border-top-color: var(--teal); }
.price-card h3 { font-size: 1.2rem; }
.price { font-family: var(--serif); font-size: 2.4rem; font-weight: 700; margin: 0.35rem 0 0.2rem; font-variant-numeric: tabular-nums; }
.price small { font-family: var(--sans); font-size: 1rem; font-weight: 600; color: var(--ink-soft); }
.price-card > p { color: var(--ink-soft); }
.price-table { width: 100%; border-collapse: collapse; margin: 0.9rem 0 0.4rem; font-size: 0.97rem; }
.price-table th, .price-table td { text-align: left; padding: 0.6rem 0.2rem; border-bottom: 1px solid var(--rule); font-weight: 400; }
.price-table td { text-align: right; font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.price-table .ex { display: inline-block; margin-left: 0.3rem; font-size: 0.72rem; font-weight: 700; color: var(--amber); }

.faq details { background: var(--card); border: 1px solid var(--rule); border-radius: 6px; margin-bottom: 0.6rem; }
.faq summary { cursor: pointer; list-style: none; padding: 1rem 1.2rem; font-size: 1.04rem; font-weight: 700; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::before { content: "Q"; font-family: var(--mono); color: var(--cobalt); margin-right: 0.75rem; }
.faq details[open] summary { border-bottom: 1px solid var(--rule); }
.faq details p { padding: 0.9rem 1.2rem 1.1rem; color: var(--ink-soft); }
.faq details a { color: var(--cobalt); font-weight: 700; }

.cta-band { background: var(--cobalt-wash); padding: 3.4rem 0; text-align: center; }
.cta-band h2 { font-family: var(--serif); font-size: 1.75rem; font-weight: 600; margin-bottom: 0.5rem; }
.cta-band p { color: var(--ink-soft); }
.cta-band .hero-actions { justify-content: center; }

/* ---------------------------------------------------------------- 로그인 · 비밀번호 */

.auth-main { flex: 1; display: flex; justify-content: center; align-items: flex-start; padding: 3rem 1.2rem; }
.auth-card { width: min(470px, 100%); background: var(--card); border: 1px solid var(--rule); border-top: 4px solid var(--cobalt); border-radius: 10px; box-shadow: var(--shadow); padding: 1.8rem 1.8rem 2rem; }
.auth-card h1 { font-family: var(--serif); font-size: 1.65rem; font-weight: 600; margin-top: 0.3rem; }
.auth-card .lead { color: var(--ink-soft); margin-top: 0.3rem; }

.tabs { display: grid; grid-template-columns: 1fr 1fr; margin: 1.2rem 0 1.3rem; border: 1px solid var(--rule-strong); border-radius: 6px; overflow: hidden; }
.tab { border: 0; background: var(--card); color: var(--ink-soft); padding: 0.85rem; font-size: 1.04rem; font-weight: 700; }
.tab.is-on { background: var(--cobalt); color: #fff; }

.social { display: grid; gap: 0.6rem; }
.social-btn { display: flex; align-items: center; justify-content: center; gap: 0.7rem; padding: 0.85rem 1rem; border-radius: 6px; font-size: 1.04rem; font-weight: 700; text-decoration: none; }
.social-btn svg { width: 20px; height: 20px; flex: 0 0 auto; }
.social-btn.google { background: #fff; color: #1f1f1f; border: 1px solid #dadce0; }
.social-btn.google:hover { background: #f8f9fa; }
.social-btn.kakao { background: #fee500; color: rgba(0, 0, 0, 0.85); border: 1px solid #fee500; }
.social-btn.kakao:hover { background: #f5dc00; }

.divider { display: flex; align-items: center; gap: 0.8rem; margin: 1.3rem 0; color: var(--ink-faint); font-size: 0.9rem; }
.divider::before, .divider::after { content: ""; flex: 1; border-top: 1px solid var(--rule); }

.form-field { margin-bottom: 1rem; }
.form-field label { display: block; font-size: 0.97rem; font-weight: 700; margin-bottom: 0.35rem; }
.form-field input[type="text"], .form-field input[type="email"], .form-field input[type="password"],
.form-field input[type="number"], .form-field input[type="search"] {
  width: 100%;
  padding: 0.8rem 0.9rem;
  border: 1px solid var(--rule-strong);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font-family: inherit;
  font-size: 1.04rem;
}
.form-field input:focus { outline: 2px solid var(--cobalt-bright); outline-offset: 1px; }
.form-field small { display: block; color: var(--ink-faint); font-size: 0.86rem; margin-top: 0.3rem; }

.agree { display: flex; align-items: flex-start; gap: 0.6rem; margin: 0.3rem 0 1.2rem; font-size: 0.97rem; line-height: 1.6; cursor: pointer; }
.agree input { width: 20px; height: 20px; margin-top: 0.2rem; accent-color: var(--cobalt); flex: 0 0 auto; }
.agree a { color: var(--cobalt); font-weight: 700; }

.form-msg { margin: 0 0 1rem; padding: 0.75rem 0.9rem; border-left: 3px solid var(--rose); border-radius: 0 5px 5px 0; background: #fdf0f0; color: #8c2f36; font-size: 0.97rem; white-space: pre-wrap; }
.form-msg.is-ok { border-left-color: var(--teal); background: #e9f7f4; color: #0a6b5e; }
.auth-help { margin-top: 1.2rem; font-size: 0.92rem; color: var(--ink-soft); }
.auth-help a { color: var(--cobalt); font-weight: 700; }

/* ---------------------------------------------------------------- 내 계정 · 관리자 */

.page-main { flex: 1; padding: 2.6rem 0 3rem; }
.page-title { border-bottom: 2px solid var(--ink); padding-bottom: 1.2rem; margin-bottom: 2rem; display: flex; align-items: flex-end; flex-wrap: wrap; gap: 1rem; }
.page-title h1 { font-family: var(--serif); font-size: clamp(1.7rem, 3vw, 2.3rem); font-weight: 600; margin-top: 0.3rem; }
.page-title .page-actions { margin-left: auto; display: flex; flex-wrap: wrap; gap: 0.5rem; }

.acct-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1.2rem; margin-bottom: 1.2rem; }
.box { background: var(--card); border: 1px solid var(--rule); border-top: 3px solid var(--cobalt); border-radius: 6px; padding: 1.4rem 1.5rem 1.6rem; box-shadow: var(--shadow); margin-bottom: 1.2rem; }
.acct-grid .box { margin-bottom: 0; }
.box h2 { font-size: 1.18rem; margin-bottom: 1rem; }
.box-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0.5rem 1rem; margin-bottom: 1rem; }
.box-head h2 { margin-bottom: 0; }
.box-head p { color: var(--ink-faint); font-size: 0.9rem; }
.box-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 1.2rem; }

.kv { display: grid; grid-template-columns: 7.5rem 1fr; gap: 0.6rem 1rem; font-size: 1rem; }
.kv dt { color: var(--ink-faint); }
.kv dd { font-weight: 600; word-break: break-all; }

.pill { display: inline-block; padding: 0.2rem 0.75rem; border-radius: 999px; background: var(--rule); color: var(--ink-soft); font-size: 0.9rem; font-weight: 700; }
.pill.is-ok { background: #e2f5ef; color: var(--teal); }
.pill.is-warn { background: #fff1dc; color: #a05a00; }
.pill.is-info { background: var(--cobalt-wash); color: var(--cobalt); }
.status-detail { margin-top: 0.6rem; font-size: 1.02rem; }

.big-number { font-family: var(--serif); font-size: 2.4rem; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; }
.big-number small { margin-left: 0.3rem; font-family: var(--sans); font-size: 1rem; font-weight: 600; color: var(--ink-soft); }
.price-list { list-style: none; margin-top: 0.6rem; font-size: 0.95rem; color: var(--ink-soft); }
.price-list li { display: flex; justify-content: space-between; gap: 1rem; padding: 0.35rem 0; border-bottom: 1px dashed var(--rule); }
.price-list li b { color: var(--ink); white-space: nowrap; font-variant-numeric: tabular-nums; }

.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.data-table th { text-align: left; white-space: nowrap; padding: 0.6rem; border-bottom: 1px solid var(--rule-strong); color: var(--ink-faint); font-size: 0.8rem; font-weight: 700; letter-spacing: 0.06em; }
.data-table td { padding: 0.65rem 0.6rem; border-bottom: 1px solid var(--rule); vertical-align: top; }
.data-table .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.data-table small { display: block; color: var(--ink-faint); font-size: 0.8rem; }
.data-table .empty { color: var(--ink-faint); padding: 1.2rem 0.6rem; }
.plus { color: var(--teal); font-weight: 700; }
.minus { color: var(--rose); font-weight: 700; }

.search-row { display: flex; gap: 0.6rem; margin-bottom: 1rem; }
.search-row .form-field { flex: 1; margin: 0; }
.admin-detail > td { background: var(--cobalt-wash); }
.admin-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 0.8rem; padding: 0.4rem 0; }
.admin-action { background: var(--card); border: 1px solid var(--rule); border-radius: 6px; padding: 0.85rem 0.95rem; }
.admin-action h4 { font-size: 0.92rem; margin-bottom: 0.5rem; }
.admin-action input { width: 100%; margin-bottom: 0.45rem; padding: 0.5rem 0.6rem; border: 1px solid var(--rule-strong); border-radius: 4px; font: inherit; font-size: 0.9rem; }
.admin-action .row { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.admin-action .row .btn { flex: 1; }
.admin-action small { display: block; color: var(--ink-faint); font-size: 0.78rem; margin-top: 0.3rem; }
.tag-admin { display: inline-block; margin-left: 0.35rem; padding: 0 0.45rem; border-radius: 3px; background: var(--cobalt); color: #fff; font-size: 0.7rem; font-weight: 700; vertical-align: middle; }
.tag-off { display: inline-block; margin-left: 0.35rem; padding: 0 0.45rem; border-radius: 3px; background: var(--rose); color: #fff; font-size: 0.7rem; font-weight: 700; vertical-align: middle; }

/* 결제 전 고지 (구독하기 · 크레딧 충전 버튼 바로 위) */
.prepay {
  margin-top: 1rem;
  padding: 0.85rem 0.95rem;
  border: 1px solid var(--rule-strong);
  border-left: 3px solid var(--cobalt);
  border-radius: 6px;
  background: var(--cobalt-wash);
  color: var(--ink);
  font-size: 0.95rem;
  line-height: 1.65;
  text-align: left;
}
.prepay-links { margin-top: 0.35rem; font-size: 0.88rem; color: var(--ink-soft); }
.prepay-links a { color: var(--cobalt); font-weight: 700; }
.prepay .prepay-check { margin: 0.6rem 0 0; font-weight: 700; }
.pack-area .pack-list { margin-top: 0.8rem; }
.pack-btn:disabled { opacity: 0.55; cursor: not-allowed; background: var(--card); }
#access-prepay .prepay, .cp-modal .prepay { margin-bottom: 0.2rem; }

/* 생성형 AI 사용 고지 */
.ai-notice {
  display: block;
  margin-top: 0.5rem;
  padding: 0.35rem 0.55rem;
  border-radius: 4px;
  background: #f3f0fd;
  color: #4b3d9e;
  font-size: 0.74rem;
  line-height: 1.5;
}
.ai-notice::before {
  content: "AI";
  margin-right: 0.4rem;
  padding: 0 0.3rem;
  border-radius: 3px;
  background: var(--violet);
  color: #fff;
  font-size: 0.66rem;
  font-weight: 800;
}
.script-grid .card > small.ai-notice { color: #4b3d9e; margin-top: 0.5rem; }

/* 편집기 왼쪽 아래 약관 링크 */
.rail-legal { display: flex; flex-wrap: wrap; gap: 0.2rem 0.7rem; margin-top: 0.9rem; }
.rail-legal a { color: rgba(255, 255, 255, 0.82); font-size: 0.74rem; }
.rail-legal a:hover { color: #fff; }

/* 내 계정 — 상태 옆 구독 관리 · 회원 탈퇴 */
.status-row { display: flex; align-items: center; flex-wrap: wrap; gap: 0.6rem 0.9rem; }
.box.is-quiet { border-top-color: var(--rule-strong); background: transparent; box-shadow: none; }
.box.is-quiet h2 { color: var(--ink-soft); }
.plain-list { margin: 0.6rem 0 1rem 1.2rem; color: var(--ink-soft); font-size: 0.95rem; line-height: 1.8; }
.plain-list a { color: var(--cobalt); font-weight: 700; }

/* 아주 좁은 화면에서도 칸 최소 폭이 화면을 넘지 않게 (가로 스크롤 방지) */
.acct-grid { grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); }
.price-grid { grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); }
.feature-grid { grid-template-columns: repeat(auto-fit, minmax(min(250px, 100%), 1fr)); }
.admin-actions { grid-template-columns: repeat(auto-fit, minmax(min(230px, 100%), 1fr)); }

.box h3 { font-size: 1rem; margin: 1.2rem 0 0.5rem; }
.box h3:first-child { margin-top: 0; }
.narrow { max-width: 440px; }

@media (max-width: 960px) {
  .rail-account { margin-top: 0; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.8rem; }
  .rail-account .acct-links { margin-top: 0; }
}

@media (max-width: 720px) {
  .hero { padding: 3rem 0 2.6rem; }
  .section { padding: 2.8rem 0; }
  .section-head p { margin-left: 0; }
  .kv { grid-template-columns: 1fr; gap: 0.1rem; }
  .kv dd { margin-bottom: 0.5rem; }
  .access-card { padding: 1.5rem 1.3rem; }
  .search-row { flex-direction: column; }
}

/* ---------------------------------------------------------------- 도구 모음 (첫 화면 · 소개 · 준비 중) */

.muted { color: var(--ink-faint); }
.wrap-narrow { max-width: 720px; }
.section-tight { padding: 2.2rem 0; border-bottom: 0; }

.home-hero { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1.2rem 2rem; padding-bottom: 1.6rem; border-bottom: 2px solid var(--ink); }
.home-hero h1 { font-family: var(--serif); font-size: clamp(1.6rem, 3.2vw, 2.3rem); font-weight: 600; line-height: 1.25; margin: 0.4rem 0 0.5rem; }
.home-hero .lede { font-size: 1.02rem; }
.home-status { display: flex; flex-direction: column; align-items: flex-start; gap: 0.35rem; min-width: 240px; padding: 1rem 1.2rem; background: var(--card); border: 1px solid var(--rule); border-left: 3px solid var(--cobalt); border-radius: 6px; font-size: 0.92rem; color: var(--ink-soft); }
.home-status .status-credits b { color: var(--ink); font-variant-numeric: tabular-nums; }
.home-status .status-credits a { color: var(--cobalt); font-weight: 700; }
.home-status .btn-sm { margin-left: 0.3rem; vertical-align: middle; }

.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1.1rem; }
.tool-card { display: flex; flex-direction: column; gap: 0.3rem; background: var(--card); border: 1px solid var(--rule); border-top: 3px solid var(--cobalt); border-radius: 6px; padding: 1.3rem 1.4rem 1.4rem; box-shadow: var(--shadow); color: var(--ink); text-decoration: none; transition: transform 0.12s ease, border-color 0.12s ease; }
a.tool-card:hover { transform: translateY(-2px); border-color: var(--cobalt-bright); }
.tool-card.is-soon { border-top-color: var(--rule-strong); background: var(--paper); box-shadow: none; }
.tool-card.is-soon h3, .tool-card.is-soon .tool-tagline { color: var(--ink-soft); }
.tool-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.4rem; }
.tool-icon { font-size: 1.7rem; line-height: 1; }
.tool-badge { display: inline-block; padding: 0.08rem 0.6rem; border-radius: 999px; font-size: 0.72rem; font-weight: 700; border: 1px solid currentColor; }
.tool-badge.is-ai { color: var(--violet); }
.tool-badge.is-soon { color: var(--amber); }
.tool-card h3 { font-size: 1.15rem; margin: 0; }
.tool-tagline { font-weight: 600; font-size: 0.95rem; color: var(--cobalt-deep); }
.tool-desc { font-size: 0.92rem; color: var(--ink-soft); flex: 1; }
.tool-action { margin-top: 0.8rem; font-weight: 700; font-size: 0.92rem; color: var(--cobalt); }
.tool-card.is-soon .tool-action { color: var(--ink-faint); }

.coming-card { text-align: center; }
.coming-icon { font-size: 3rem; line-height: 1; margin: 0.6rem 0 0.8rem; }
.coming-card h1 { font-family: var(--serif); font-size: 1.7rem; font-weight: 600; margin-bottom: 0.6rem; }
.coming-card .lede { margin: 0 auto 0.6rem; }
.coming-card .hero-actions { justify-content: center; margin-top: 1.4rem; }

.rail-back { display: inline-block; margin: -0.4rem 0 1rem; color: rgba(255,255,255,0.85); font-size: 0.82rem; font-weight: 700; text-decoration: none; }
.rail-back:hover { color: #fff; text-decoration: underline; }

@media (max-width: 720px) {
  .home-hero { align-items: stretch; }
  .home-status { min-width: 0; width: 100%; }
  .tool-grid { grid-template-columns: 1fr; }
}

/* ---------------------------------------------------------------- 무료 구간 */

.acct-free { display: block; font-size: 0.8rem; line-height: 1.45; opacity: 0.92; }
.acct-free b { color: #fff; }
.acct-free .link { background: none; border: 0; padding: 0; color: #bcd3ff; font-weight: 700; font-size: 0.8rem; text-decoration: underline; cursor: pointer; }
.is-locked { position: relative; opacity: 0.62; }
.is-locked::after { content: "🔒 구독"; position: absolute; right: 0.5rem; bottom: 0.4rem; font-size: 0.66rem; font-weight: 700; color: var(--amber); }
.btn.is-locked::after { position: static; margin-left: 0.4rem; }
.voice-card.is-locked .voice-play { display: none; }
.price-card.is-free { border-top-color: var(--amber); }
