@font-face { font-family: "Pretendard Black"; src: url(/fonts/Pretendard-Black.otf); }
@font-face { font-family: "Pretendard Bold"; src: url(/fonts/Pretendard-Bold.otf); }
@font-face { font-family: "BlackHanSans"; src: url(/fonts/BlackHanSans-Regular.ttf); }
@font-face { font-family: "Jua"; src: url(/fonts/Jua-Regular.ttf); }
@font-face { font-family: "Jalnan 2 TTF"; src: url(/fonts/Jalnan2.ttf); }

:root {
  --bg: #0f1115; --panel: #171a21; --panel2: #1e222b; --line: #2a2f3a;
  --text: #e8eaef; --muted: #8a91a0; --accent: #ffd400; --accent-ink: #1a1500;
  --good: #3ecf8e; --bad: #ff5d5d; --sel: rgba(255, 212, 0, .16); --clip: rgba(90, 160, 255, .16);
  --radius: 10px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font: 14px/1.5 "Pretendard Bold", "Malgun Gothic", sans-serif; font-weight: 500; }
button, input, select { font: inherit; color: inherit; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12px; }

button, .btn {
  background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; padding: 7px 12px;
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap;
}
button:hover, .btn:hover { border-color: #3d4452; }
button:disabled { opacity: .45; cursor: default; }
.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 700; }
.primary:hover { filter: brightness(1.05); border-color: var(--accent); }
.ghost { background: transparent; }
.sm { padding: 4px 10px; font-size: 13px; }
.wide { width: 100%; }
.grow { flex: 1; }
input, select { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; min-width: 0; }
input:focus, select:focus { outline: 2px solid rgba(255, 212, 0, .4); border-color: transparent; }
input.tiny { width: 64px; }

.top { height: 52px; display: flex; align-items: center; gap: 10px; padding: 0 16px; border-bottom: 1px solid var(--line); background: var(--panel); }
.brand { font-family: "BlackHanSans"; font-size: 20px; display: flex; align-items: center; gap: 8px; margin-right: 8px; }
.brand .dot { width: 12px; height: 20px; border-radius: 3px; background: var(--accent); }
.top select { max-width: 320px; }
.spacer { flex: 1; }
.badge { font-size: 12px; color: var(--muted); border: 1px solid var(--line); border-radius: 99px; padding: 3px 10px; }

.intake { height: calc(100% - 52px); display: grid; place-items: center; padding: 24px; }
.drop { width: min(640px, 100%); border: 2px dashed var(--line); border-radius: 16px; padding: 48px 32px; text-align: center; display: grid; gap: 14px; justify-items: center; }
.drop.over { border-color: var(--accent); background: var(--sel); }
.drop-title { font-family: "BlackHanSans"; font-size: 26px; }
.drop .or { color: var(--muted); font-size: 13px; margin-top: 10px; }
.drop .row { width: 100%; }
.row { display: flex; gap: 8px; align-items: center; }
.row input, .row select { flex: 1; }
.row.gap { margin-top: 10px; }

.editor { height: calc(100% - 52px); display: grid; grid-template-columns: 300px 1fr 380px; }
.col { min-height: 0; overflow: auto; padding: 14px; }
.left { border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; background: var(--panel); }
.right { border-left: 1px solid var(--line); background: var(--panel); }
.center { display: flex; flex-direction: column; gap: 10px; }
h2 { font-size: 15px; margin: 0; }
.col-head { display: flex; justify-content: space-between; align-items: center; }
.opts { display: flex; flex-wrap: wrap; gap: 8px; font-size: 12px; color: var(--muted); }
.opts input { width: 52px; padding: 3px 6px; }
.clip-list { flex: 1; overflow: auto; display: grid; align-content: start; gap: 8px; }
.left-foot { display: grid; gap: 6px; }

.clip-card { background: var(--panel2); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; cursor: pointer; display: grid; gap: 4px; position: relative; }
.clip-card.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.clip-card .t { font-weight: 700; }
.clip-card .meta { font-size: 12px; color: var(--muted); display: flex; gap: 8px; flex-wrap: wrap; }
.clip-card .score { color: var(--accent); }
.clip-card .done { color: var(--good); }
.clip-card .reason { font-size: 12px; color: var(--muted); }
.clip-card .del { position: absolute; right: 6px; top: 6px; padding: 0 6px; border: 0; background: none; color: var(--muted); }

#srcVideo { width: 100%; max-height: 42vh; background: #000; border-radius: var(--radius); display: block; }
.video-wrap { position: relative; }
.proxy-note { position: absolute; inset: 0; background: rgba(15, 17, 21, .92); border-radius: var(--radius); display: grid; align-content: center; justify-items: center; gap: 10px; padding: 20px; text-align: center; }
.proxy-note .bar { width: min(420px, 90%); margin: 0; }
.panel { background: var(--panel2); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.panel p { margin: 0 0 10px; }
.transcript-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.transcript { flex: 1; min-height: 200px; overflow: auto; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; line-height: 2; }
.sent { margin: 0 0 6px; }
.sent .ts { color: var(--muted); font-size: 11px; margin-right: 6px; cursor: pointer; font-variant-numeric: tabular-nums; }
.w { padding: 1px 2px; border-radius: 4px; cursor: pointer; }
.w:hover { background: #2a303c; }
.w.inclip { background: var(--clip); }
.w.sel { background: rgba(255, 212, 0, .38); box-shadow: inset 0 0 0 1px var(--accent); }
.w.now { box-shadow: inset 0 -2px 0 var(--accent); }
.w.del { text-decoration: line-through; color: var(--bad); opacity: .7; }
.w.edited { color: #7cc4ff; }
.w.filler { color: var(--muted); font-style: italic; }
.selbar { display: flex; gap: 8px; align-items: center; background: var(--panel2); border: 1px solid var(--accent); border-radius: var(--radius); padding: 8px 10px; }
.selbar span { flex: 1; font-size: 13px; }

.empty { color: var(--muted); text-align: center; margin-top: 40%; }
.phone { position: relative; width: 216px; aspect-ratio: 9 / 16; margin: 0 auto; background: #000; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); }
.phone img, .phone video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.phone-hint { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; color: var(--muted); font-size: 12px; padding: 12px; }
.bar { position: relative; height: 22px; background: var(--bg); border: 1px solid var(--line); border-radius: 99px; overflow: hidden; margin-top: 10px; }
.bar i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: var(--accent); transition: width .3s; }
.bar span { position: absolute; inset: 0; display: grid; place-items: center; font-size: 12px; color: var(--text); mix-blend-mode: difference; }

.field { display: grid; gap: 6px; margin-top: 12px; }
.field > label, .field label { font-size: 12px; color: var(--muted); }
.field.two { grid-template-columns: 1fr 1fr; gap: 10px; }
.field.two > div { display: grid; gap: 6px; }
.nudge { display: flex; }
.nudge input { width: 100%; text-align: center; border-radius: 0; }
.nudge button { border-radius: 0; padding: 4px 9px; }
.nudge button:first-child { border-radius: 8px 0 0 8px; }
.nudge button:last-child { border-radius: 0 8px 8px 0; }
#clipLen { margin-top: 6px; }

.tabs { display: flex; margin-top: 16px; border-bottom: 1px solid var(--line); }
.tabs button { flex: 1; border: 0; border-radius: 0; background: none; color: var(--muted); border-bottom: 2px solid transparent; }
.tabs button.on { color: var(--text); border-bottom-color: var(--accent); }
.tab { padding-top: 12px; display: grid; gap: 10px; }
.cards { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.card { background: var(--panel2); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px; cursor: pointer; display: grid; gap: 4px; }
.card.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.card .sample { height: 58px; border-radius: 6px; display: grid; place-items: center; background: linear-gradient(135deg, #3a4a5e, #6b5a45); overflow: hidden; text-align: center; line-height: 1.1; }
.card .name { font-size: 13px; }
.card .d { font-size: 11px; color: var(--muted); line-height: 1.35; }
.tpl .sample { height: 90px; background: none; }
.tpl-mock { width: 50px; height: 88px; border-radius: 5px; background: #111; position: relative; overflow: hidden; border: 1px solid #333; }
.tpl-mock b { position: absolute; left: 0; right: 0; }
.slider { display: grid; grid-template-columns: 1fr 120px 42px; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.slider span { text-align: right; font-variant-numeric: tabular-nums; color: var(--text); }
.slider input { padding: 0; }
.check { display: flex; gap: 8px; align-items: center; font-size: 13px; }
.subs { margin-top: 14px; background: var(--panel2); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 10px; }
.subs summary { cursor: pointer; font-size: 13px; font-weight: 700; }
.subs p { margin: 6px 0; }
.sub-list { display: grid; gap: 4px; max-height: 360px; overflow: auto; }
.sub-row { display: grid; grid-template-columns: 58px 1fr; gap: 6px; align-items: center; }
.sub-row .ts { padding: 4px 4px; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.sub-row input { padding: 5px 8px; font-size: 13px; }
.common-note { margin-top: 16px; padding: 8px 10px; border-radius: 8px; background: rgba(255, 212, 0, .1); border: 1px solid rgba(255, 212, 0, .35); font-size: 12px; text-align: center; }
.w.hidden-sub { opacity: .45; text-decoration: underline dotted; }
.tline { display: grid; grid-template-columns: 1fr 112px; gap: 6px; }
.tline select { font-size: 13px; padding: 7px 6px; }
.tline:last-child { grid-template-columns: 1fr; }
.card-slot { background: var(--panel2); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; display: grid; gap: 8px; }
.slot-head { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.slot-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 60%; }
.check input { width: 16px; height: 16px; }

.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: #2a2f3a; border: 1px solid var(--line); padding: 10px 16px; border-radius: 10px; max-width: 80vw; white-space: pre-wrap; z-index: 10; }
.toast.err { border-color: var(--bad); }

#sgFocus { width: 100%; resize: vertical; min-height: 44px; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; font: inherit; font-size: 12px; color: var(--text); }
#sgFocus:focus { outline: 2px solid rgba(255, 212, 0, .4); border-color: transparent; }
.cut-panel { padding: 10px 12px; display: grid; gap: 8px; }
.cut-head { display: flex; align-items: center; gap: 10px; }
.cut-head select { padding: 2px 6px; font-size: 12px; }
.tl-scroll { overflow-x: auto; overflow-y: hidden; border-radius: 6px; }
.tl { position: relative; height: 58px; background: #262b35; border-radius: 6px; cursor: crosshair; user-select: none; touch-action: none; min-width: 100%; }
.tl .seg { position: absolute; top: 16px; bottom: 6px; }
.tl .keep { background: rgba(90, 160, 255, .75); border-radius: 2px; }
.tl .ucut { background: repeating-linear-gradient(45deg, rgba(255, 93, 93, .85) 0 6px, rgba(255, 93, 93, .45) 6px 12px); z-index: 1; }
.tl .tsel { background: rgba(255, 212, 0, .35); border-left: 2px solid var(--accent); border-right: 2px solid var(--accent); z-index: 2; top: 12px; bottom: 2px; }
.tl .row-mark { position: absolute; top: 16px; bottom: 6px; width: 1px; background: rgba(255, 255, 255, .25); }
.tl .head { position: absolute; top: 0; bottom: 0; width: 2px; background: #fff; z-index: 3; pointer-events: none; }
.tl .tick { position: absolute; top: 0; font-size: 10px; color: var(--muted); transform: translateX(-50%); pointer-events: none; font-variant-numeric: tabular-nums; }
.cut-tools { display: flex; align-items: center; gap: 6px; }
.cut-list { display: flex; flex-wrap: wrap; gap: 6px; }
.cut-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; background: rgba(255, 93, 93, .12); border: 1px solid rgba(255, 93, 93, .5); border-radius: 99px; padding: 2px 4px 2px 10px; cursor: pointer; }
.cut-chip button { padding: 0 7px; border: 0; background: none; font-size: 12px; color: var(--text); }
.cut-help { margin: 0; }
.sub-row { grid-template-columns: 58px 1fr 30px; }
.sub-row .cut { padding: 4px 0; font-size: 12px; }
.w.cutout { text-decoration: line-through; color: var(--bad); opacity: .55; }
