/* 첫컷 테마 v2 — "자막 화면"
   쇼츠에서 제일 눈에 익은 것(굵은 자막, 노란 강조, 빨간 녹화 점)을 앱의 얼굴로.
   제목 Black Han Sans(한국 쇼츠 자막체) · 본문 IBM Plex Sans KR. 라이트=종이, 다크=영상 앱처럼 진짜 검정. */
:root {
  --bg: #F4F5F8; --paper: #FFFFFF; --ink: #121418; --ink-2: #3B4049; --mute: #6B7280; --line: #DFE2E8;
  --rec: #E8412C; --mark: #FFD23F; --mark-ink: #2A2100; --ok: #1F8A4C; --soft: #ECEEF3;
  --head: "Black Han Sans", "Apple SD Gothic Neo", sans-serif;
  --body: "IBM Plex Sans KR", "Apple SD Gothic Neo", sans-serif;
  --r: 6px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #000; --paper: #16171B; --ink: #F3F4F6; --ink-2: #C9CDD4; --mute: #8B919C; --line: #2A2C33; --soft: #1F2127; --mark-ink: #2A2100; --ok: #4CC27A; }
}

* { box-sizing: border-box }
html { -webkit-text-size-adjust: 100% }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 16px; line-height: 1.55; letter-spacing: -.005em }
main { max-width: 540px; margin: 0 auto; padding: 14px 18px calc(84px + env(safe-area-inset-bottom)) }
a { color: inherit; text-decoration: none }
button { font-family: inherit }
::selection { background: var(--mark); color: var(--mark-ink) }

/* ---- 글자 ---- */
h1 { font-family: var(--head); font-weight: 400; font-size: 34px; line-height: 1.12; letter-spacing: -.01em; margin: 2px 0 8px; word-break: keep-all }
h2 { font-family: var(--head); font-weight: 400; font-size: 20px; line-height: 1.2; margin: 34px 0 12px; word-break: keep-all }
h3 { font-size: 17px; font-weight: 600; margin: 0 0 6px; word-break: keep-all }
.eyebrow { font-size: 13px; color: var(--mute); margin: 0 }
header.top { margin: 6px 0 14px }
.lead { font-size: 16px; line-height: 1.6; margin: 6px 0 4px }
.sub, .meta { color: var(--mute); font-size: 14px; line-height: 1.6; margin: 4px 0 }
.dim { color: var(--mute) }
small, .fine { color: var(--mute); font-size: 13px; line-height: 1.5 }
.num { font-variant-numeric: tabular-nums; font-weight: 600 }
.hl { background: linear-gradient(transparent 55%, var(--mark) 55%); color: inherit; padding: 0 1px }   /* 자막 강조 = 형광펜 */
.back { display: inline-block; color: var(--mute); font-size: 14px; margin: 4px 0 10px }
.center { text-align: center }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap }
.grow { flex: 1 }
.right { margin-left: auto }
.mt { margin-top: 14px }
hr.soft { border: none; border-top: 1px solid var(--line); margin: 16px 0 }

/* ---- 묶음: 선 하나로 구분, 그림자 없음 ---- */
.box, .card, .line, .focus, .warn { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; margin: 12px 0 }
ul.cards, ul.plain { list-style: none; margin: 0; padding: 0 }
ul.cards > li { display: flex; gap: 10px; align-items: baseline; padding: 13px 0; border-bottom: 1px solid var(--line); font-size: 15px }
ul.cards > li:last-child { border-bottom: none }
ul.cards > li small { display: block; margin-top: 2px }
.focus { border: none; background: var(--ink); color: var(--bg); padding: 18px }
.focus span { display: block; color: var(--rec); font-family: var(--head); font-size: 14px; letter-spacing: .02em; margin-bottom: 6px }
.focus .btn { background: var(--paper); color: var(--ink) }
.warn { background: var(--mark); color: var(--mark-ink); border: none; font-size: 14px }
.warn a { text-decoration: underline }
.kv { display: flex; justify-content: space-between; gap: 12px; font-size: 15px; padding: 7px 0; border-bottom: 1px solid var(--line) }
.kv:last-child { border-bottom: none }
.kv span:last-child { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap }
.tm, .lid, .due { font-variant-numeric: tabular-nums; font-weight: 600; font-size: 13px; color: var(--mute); min-width: 44px; flex-shrink: 0 }
.lid { min-width: 24px }
.tag { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 7px; border-radius: 3px; background: var(--soft); color: var(--ink-2); margin-right: 6px }
.tag.warm { background: var(--rec); color: #fff }
.chip { display: inline-block; background: var(--soft); border-radius: 3px; padding: 5px 10px; margin: 8px 6px 0 0; font-size: 13px }
.chip b { color: var(--rec) }

/* ---- 버튼 ---- */
button.btn, a.btn { display: inline-block; font-size: 15px; font-weight: 600; border: 1px solid var(--ink); background: var(--ink); color: var(--bg);
  padding: 12px 18px; border-radius: var(--r); cursor: pointer; text-align: center; line-height: 1.3 }
button.btn.quiet, a.btn { background: transparent; color: var(--ink) }
button.btn.wide { width: 100%; margin-top: 12px }
button.btn.small { font-size: 13px; padding: 8px 12px }
button.btn:disabled { opacity: .4 }
button.btn.danger { border: none; background: transparent; color: var(--rec); padding-left: 6px; padding-right: 6px }
.press { -webkit-tap-highlight-color: transparent }
.press:active { opacity: .7 }

/* ---- 고르기 ---- */
.opts { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 }
.opt { font-size: 14px; color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); padding: 10px 14px; cursor: pointer; text-align: left }
.opt.on { border-color: var(--ink); background: var(--ink); color: var(--bg) }
.opt.block { display: block; width: 100%; padding: 13px 15px }
.opt.block small { display: block; color: inherit; opacity: .75; margin-top: 3px; font-size: 13px }
input.f, textarea.f, select.f { width: 100%; font-family: inherit; font-size: 16px; color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); padding: 11px 12px; outline: none }
input.f:focus, textarea.f:focus { border-color: var(--ink) }
textarea.f { resize: none; line-height: 1.55; min-height: 48px }
label.lab { display: block; font-size: 13px; color: var(--mute); margin: 14px 0 5px }
.num-in { font-variant-numeric: tabular-nums; font-weight: 600 }
.check { display: flex; align-items: center; gap: 10px; cursor: pointer }
.check input { position: absolute; opacity: 0; width: 0; height: 0 }
.check i { width: 22px; height: 22px; border: 1.5px solid var(--mute); border-radius: 4px; flex-shrink: 0 }
.check input:checked + i { background: var(--ink); border-color: var(--ink) }
.check input:focus-visible + i, .opt:focus-visible, .btn:focus-visible, input.f:focus-visible { outline: 2px solid var(--rec); outline-offset: 2px }

/* ---- 홈: 9:16 프레임 ---- */
.frame { position: relative; aspect-ratio: 9 / 16; max-height: 62vh; margin: 8px auto 4px; background: #000; color: #fff; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; cursor: pointer }
.frame .pin { font-family: var(--head); font-size: 20px; text-align: center; padding: 44px 20px 0; line-height: 1.2; text-shadow: 0 1px 2px #000 }
.frame .mid { flex: 1; display: grid; place-items: center; color: #9AA0AA; font-size: 13px; padding: 0 22px; text-align: center }
.frame .cap { font-family: var(--head); font-size: 24px; line-height: 1.25; text-align: center; padding: 0 22px 28px; text-shadow: 0 2px 3px #000; word-break: keep-all }
.frame .cap b { font-weight: 400; background: var(--mark); color: var(--mark-ink); padding: 0 5px; text-shadow: none; display: inline-block }
.frame .live { position: absolute; top: 14px; left: 14px; font-size: 12px; font-weight: 600; letter-spacing: .04em; color: #fff; display: flex; align-items: center; gap: 6px }
.frame .live::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--rec); animation: blink 1.2s steps(1) infinite }
.frame .seq { position: absolute; top: 14px; right: 14px; font-size: 12px; font-variant-numeric: tabular-nums; color: #C8CCD4 }
@keyframes blink { 50% { opacity: 0 } }

/* ---- 진행 ---- */
.path { position: relative; height: 4px; background: var(--line); margin: 16px 0 6px }
.trail { height: 100%; background: var(--rec) }
.paw { display: none }
.pathlab { display: flex; justify-content: space-between; font-size: 12px; color: var(--mute); font-variant-numeric: tabular-nums }
.pathlab span:nth-child(2) { color: var(--ink); font-weight: 600 }
.steps { display: flex; gap: 0; overflow-x: auto; margin: 4px -18px 18px; padding: 0 18px 8px; scrollbar-width: none; counter-reset: step }
.steps::-webkit-scrollbar { display: none }
.steps a { flex-shrink: 0; counter-increment: step; font-size: 13px; color: var(--mute); padding: 8px 12px 8px 0; margin-right: 12px; border-bottom: 2px solid transparent; white-space: nowrap }
.steps a::before { content: counter(step) " "; font-variant-numeric: tabular-nums; font-weight: 600 }
.steps a.done { color: var(--ink-2) }
.steps a.done::before { content: "✓ " }
.steps a.on { color: var(--ink); border-bottom-color: var(--rec); font-weight: 600 }
.dots { display: flex; gap: 4px; margin: 6px 0 18px }
.dots i { flex: 1; height: 3px; background: var(--line) }
.dots i.on { background: var(--ink) }
.q { font-family: var(--head); font-size: 26px; line-height: 1.2; margin: 6px 0 6px; word-break: keep-all }
.bar { height: 6px; background: var(--line); margin: 8px 0 4px }
.bar i { display: block; height: 100%; background: var(--ink); transition: width .4s ease }
.bar.warm i { background: var(--rec) }

/* ---- 대본 줄 ---- */
.line { padding: 14px 16px }
.line .no { font-variant-numeric: tabular-nums; font-weight: 600; font-size: 13px; color: var(--rec) }
.line textarea.say { border: none; background: transparent; padding: 4px 0 2px; font-size: 18px; line-height: 1.5; font-weight: 500 }
.line .scr { font-size: 13px; color: var(--mute); display: flex; gap: 6px; align-items: baseline; margin-top: 4px }
.line .scr input { border: none; background: transparent; font-family: inherit; font-size: 13px; color: var(--ink); flex: 1; padding: 2px 0; outline: none; border-bottom: 1px dashed var(--line) }
.line .tools { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px }
.line .tools button { font-size: 12px; border: 1px solid var(--line); background: transparent; color: var(--ink-2); padding: 5px 10px; border-radius: 3px; cursor: pointer }
.line .tools button.x { border-color: transparent; color: var(--mute) }
.line .media { margin-top: 10px }
.line .media img, .line .media video { width: 100%; max-height: 260px; object-fit: contain; border-radius: 4px; background: #000 }
.checks { list-style: none; margin: 6px 0 0; padding: 0; font-size: 14px }
.checks li { padding: 6px 0; display: flex; gap: 8px; line-height: 1.5; border-bottom: 1px solid var(--line) }
.checks li:last-child { border-bottom: none }
.checks li > b { font-weight: 600; flex-shrink: 0; width: 16px }
.checks li.ok > b { color: var(--ok) }
.checks li.no > b { color: var(--rec) }

/* ---- 녹음 ---- */
.prompter { font-family: var(--head); font-size: 26px; line-height: 1.3; padding: 12px 18px; background: #000; color: #5E626B; border: none; border-radius: 10px }
.prompter p { margin: 0 0 16px; transition: color .2s; word-break: keep-all }
.prompter p.now { color: #fff }
.prompter .hl { background: linear-gradient(transparent 55%, var(--mark) 55%); color: inherit }
.prompter p.now .hl { color: var(--mark-ink); background: var(--mark) }
.rec { width: 76px; height: 76px; border-radius: 50%; border: 4px solid var(--paper); outline: 2px solid var(--line); background: var(--rec); color: #fff; font-size: 13px; font-weight: 600; cursor: pointer }
.rec.on { border-radius: 14px; animation: blink 1.4s steps(1) infinite }
.timer { font-variant-numeric: tabular-nums; font-size: 30px; font-weight: 600 }
video.player { width: 100%; max-height: 70vh; border-radius: 10px; background: #000; display: block; margin: 10px auto }
audio { width: 100%; margin-top: 8px }

/* ---- 복사·표·기타 ---- */
.copy { position: relative; background: var(--soft); border-radius: var(--r); padding: 10px 12px; font-size: 14px; white-space: pre-wrap; margin: 6px 0 }
.copy button { position: absolute; top: 6px; right: 6px; font-size: 12px; border: none; background: var(--ink); color: var(--bg); padding: 5px 9px; border-radius: 3px; cursor: pointer }
.copy .t { padding-right: 52px; display: block }
table.mini { width: 100%; border-collapse: collapse; font-size: 14px; margin-top: 8px }
table.mini th { font-weight: 400; color: var(--mute); text-align: right; padding: 6px 4px; border-bottom: 1px solid var(--line) }
table.mini td { text-align: right; padding: 7px 4px; font-variant-numeric: tabular-nums; font-weight: 600; border-bottom: 1px solid var(--line) }
table.mini th:first-child, table.mini td:first-child { text-align: left; font-weight: 400 }
.daypick { display: flex; gap: 6px }
.daypick .opt { padding: 9px 0; width: 40px; text-align: center }
.ep { display: block; color: var(--ink) }
.empty { text-align: center; color: var(--mute); font-size: 15px; padding: 40px 20px; line-height: 1.7 }
.empty .face { display: none }
.empty::before { content: ""; display: block; width: 36px; height: 2px; background: var(--rec); margin: 0 auto 16px }

/* ---- 탭바: 글자로만 ---- */
nav.tabbar { position: fixed; left: 0; right: 0; bottom: 0; display: flex; background: var(--paper); border-top: 1px solid var(--line); padding: 0 0 env(safe-area-inset-bottom) }
nav.tabbar button { flex: 1; background: none; border: none; color: var(--mute); font-family: var(--head); font-size: 15px; padding: 14px 0 12px; cursor: pointer; border-top: 2px solid transparent; margin-top: -1px }
nav.tabbar button span { display: none }
nav.tabbar button.on { color: var(--ink); border-top-color: var(--ink) }

/* ---- 기다림·토스트 ---- */
#busy { position: fixed; inset: 0; background: color-mix(in srgb, var(--bg) 90%, transparent); display: none; place-items: center; z-index: 50 }
#busy.on { display: grid }
#busy .in { text-align: center; padding: 30px; max-width: 320px }
#busy .in::before { content: ""; display: block; width: 14px; height: 14px; border-radius: 50%; background: var(--rec); margin: 0 auto 18px; animation: blink 1s steps(1) infinite }
#busy p { margin: 6px 0; line-height: 1.6; font-weight: 600 }
#busy p.sub { font-weight: 400 }
#toast { position: fixed; left: 50%; bottom: calc(76px + env(safe-area-inset-bottom)); transform: translateX(-50%) translateY(10px); opacity: 0;
  background: var(--ink); color: var(--bg); padding: 11px 16px; border-radius: var(--r); font-size: 14px; transition: all .25s; z-index: 60; max-width: 90vw; text-align: center; pointer-events: none }
#toast.on { opacity: 1; transform: translateX(-50%) }
.rise > * { animation: none }

/* ---- 미디어킷 인쇄 ---- */
.kit h1 { font-size: 36px }
@media print {
  nav.tabbar, .noprint, #toast { display: none !important }
  body { background: #fff !important; color: #111 !important }
  main { padding: 0 }
}
@media (prefers-reduced-motion: reduce) { .frame .live::before, .rec.on, #busy .in::before { animation: none } .bar i { transition: none } }
