/* Kitsch Label: a dark audio-annotation workspace. */
:root {
  --bg: #0f1013; --surface: #16181d; --surface-2: #1d2027; --surface-3: #252932; --border: #2b2f39; --border-strong: #3a3f4c;
  --ink: #e8e9ee; --ink-2: #b4b7c2; --muted: #7d8190; --accent: #ff4f8b; --accent-ink: #12060b; --accent-soft: rgba(255, 79, 139, 0.14);
  --ok: #4fd18b; --warn: #ffb547; --bad: #ff6464; --wave: #7f8597; --wave-hi: #d8dbe6; --playhead: #ffffff; --grid: #22252d;
  --radius: 8px; --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink);
  font: 14px/1.45 "Pretendard", -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
kbd { font: 11px/1 var(--mono); color: var(--ink-2); background: var(--surface-3); border: 1px solid var(--border-strong);
  border-bottom-width: 2px; border-radius: 4px; padding: 2px 5px; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* controls */
button, .btn { font: inherit; font-weight: 500; color: var(--ink); background: var(--surface-2); border: 1px solid var(--border-strong);
  border-radius: var(--radius); padding: 0 12px; height: 32px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
  white-space: nowrap; }
button:hover:not(:disabled) { background: var(--surface-3); }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
button:disabled { opacity: 0.4; cursor: default; }
button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 700; }
button.primary:hover:not(:disabled) { background: #ff6c9e; }
button.ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
button.ghost:hover:not(:disabled) { background: var(--surface-2); color: var(--ink); }
button.icon { width: 32px; padding: 0; justify-content: center; }
button.danger:hover:not(:disabled) { color: var(--bad); border-color: var(--bad); }
input[type=text], input[type=password], input[type=number], textarea, select {
  font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--border-strong); border-radius: var(--radius);
  padding: 6px 9px; width: 100%; }
textarea { min-height: 56px; resize: vertical; }
select { height: 32px; padding: 0 8px; width: auto; }

/* plain pages (login, projects, admin) */
.topbar { height: 52px; display: flex; align-items: center; gap: 12px; padding: 0 16px; background: var(--surface);
  border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10; }
.brand { font-weight: 800; letter-spacing: -0.02em; color: var(--ink); display: inline-flex; align-items: center; gap: 8px; }
.brand::before { content: ""; width: 14px; height: 14px; border-radius: 4px; background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft); }
.brand:hover { text-decoration: none; }
.spacer { flex: 1; }
.who { display: flex; align-items: center; gap: 8px; color: var(--ink-2); font-size: 13px; }
.page { max-width: 1080px; margin: 0 auto; padding: 28px 20px 60px; }
.page h1 { font-size: 22px; margin: 0 0 4px; letter-spacing: -0.01em; }
.lede { color: var(--muted); margin: 0 0 22px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 18px 20px; margin-bottom: 14px; }
.card h2 { font-size: 16px; margin: 0; }
.stats { display: flex; gap: 22px; flex-wrap: wrap; margin: 14px 0; }
.stat b { display: block; font-size: 20px; font-variant-numeric: tabular-nums; }
.stat span { color: var(--muted); font-size: 12px; }
.bar { height: 6px; background: var(--surface-3); border-radius: 99px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.mt { margin-top: 14px; }
table.grid { width: 100%; border-collapse: collapse; font-size: 13px; }
table.grid th { text-align: left; font-weight: 600; color: var(--muted); font-size: 12px; padding: 7px 10px; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: var(--surface); z-index: 1; }
table.grid td { padding: 7px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.pill { display: inline-block; padding: 1px 8px; border-radius: 99px; font-size: 12px; border: 1px solid var(--border-strong); color: var(--ink-2); }
.pill.done { color: var(--ok); border-color: rgba(79, 209, 139, 0.5); }
.pill.draft { color: var(--warn); border-color: rgba(255, 181, 71, 0.5); }
pre.instructions { white-space: pre-wrap; font: inherit; color: var(--ink-2); margin: 8px 0 0; line-height: 1.6; }
details summary { cursor: pointer; color: var(--ink-2); }
.notice { padding: 10px 12px; border-radius: var(--radius); border: 1px solid var(--warn); background: rgba(255, 181, 71, 0.08); margin-bottom: 10px; }
.notice.bad { border-color: var(--bad); background: rgba(255, 100, 100, 0.08); }
.status { font-size: 13px; color: var(--muted); }

/* login */
.login-wrap { min-height: 100%; display: grid; place-items: center; padding: 20px; }
.login { width: 100%; max-width: 360px; }
.login h1 { font-size: 20px; margin: 14px 0 4px; }
.login label { display: block; margin: 14px 0 6px; color: var(--ink-2); font-size: 13px; }
.login button { width: 100%; justify-content: center; height: 40px; margin-top: 18px; }

/* ---------- labeling workspace ---------- */
.app { display: grid; grid-template-rows: 52px minmax(0, 1fr); height: 100vh; }
.app .topbar { position: static; }
.crumbs { display: flex; align-items: center; gap: 8px; min-width: 0; color: var(--ink-2); font-size: 13px; }
.crumbs .title { color: var(--ink); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 420px; }
.crumbs .sep { color: var(--muted); }
.save-chip { font-size: 12px; padding: 3px 10px; border-radius: 99px; background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }
.save-chip.ok { color: var(--ok); } .save-chip.warn { color: var(--warn); } .save-chip.bad { color: var(--bad); border-color: var(--bad); }
.work { display: grid; grid-template-columns: 236px minmax(0, 1fr) 380px; min-height: 0; }
.pane { min-height: 0; overflow: auto; border-right: 1px solid var(--border); background: var(--surface); }
.pane.right { border-right: 0; border-left: 1px solid var(--border); }
.center { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.section { padding: 14px 14px 16px; border-bottom: 1px solid var(--border); }
.section h3 { margin: 0 0 10px; font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em;
  display: flex; align-items: center; justify-content: space-between; }
.palette { display: flex; flex-direction: column; gap: 4px; }
.palette button { justify-content: flex-start; background: transparent; border-color: transparent; height: 34px; padding: 0 8px; width: 100%; }
.palette button:hover:not(:disabled) { background: var(--surface-2); }
.palette button[aria-pressed="true"] { background: var(--surface-3); border-color: var(--border-strong); }
.palette .count { margin-left: auto; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.dot { width: 12px; height: 12px; border-radius: 3px; flex: none; }
.palette kbd { min-width: 20px; text-align: center; }

.stage { padding: 14px 16px 10px; border-bottom: 1px solid var(--border); background: var(--bg); }
.canvas-box { position: relative; border-radius: 10px; overflow: hidden; border: 1px solid var(--border); background: #0b0c0f; }
canvas { display: block; width: 100%; }
canvas#main { height: 250px; cursor: crosshair; }
canvas#overview { height: 46px; cursor: pointer; border-top: 1px solid var(--border); }
.hover-time { position: absolute; top: 24px; transform: translateX(-50%); font: 11px var(--mono); background: var(--surface-3);
  color: var(--ink); padding: 2px 6px; border-radius: 4px; pointer-events: none; white-space: nowrap; }
.transport { display: flex; align-items: center; gap: 8px; padding-top: 10px; flex-wrap: wrap; }
.transport .play { width: 44px; height: 44px; border-radius: 50%; background: var(--ink); color: var(--bg); border: 0; justify-content: center; padding: 0; }
.transport .play:hover:not(:disabled) { background: #ffffff; }
.transport .clock { font: 600 15px var(--mono); padding: 0 6px; min-width: 170px; }
.transport .clock span { color: var(--muted); font-weight: 400; }
.transport .group { display: inline-flex; align-items: center; gap: 4px; padding: 3px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; }
.transport .group button { height: 30px; }
.mark-in { color: var(--warn) !important; }
input[type=range] { accent-color: var(--accent); width: 110px; }
.toggle { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); font-size: 13px; cursor: pointer; }

.list { flex: 1; min-height: 0; overflow: auto; }
.list table.grid th { background: var(--bg); }
.list tr { cursor: pointer; }
.list tr:hover td { background: var(--surface); }
.list tr.selected td { background: var(--accent-soft); }
.list td.lbl { display: flex; align-items: center; gap: 8px; }
.warn-dot { color: var(--warn); font-weight: 700; }
.empty { padding: 28px; text-align: center; color: var(--muted); }

.fields .field { margin-bottom: 16px; }
.field .flabel { font-size: 13px; font-weight: 600; margin-bottom: 7px; display: flex; gap: 6px; align-items: baseline; }
.field .req { color: var(--accent); font-size: 11px; }
.seg { display: flex; flex-wrap: wrap; gap: 5px; }
.seg button { height: 30px; padding: 0 10px; font-size: 13px; background: var(--surface-2); border-color: var(--border); color: var(--ink-2); }
.seg button[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--ink); }
.seg button .k { font: 10px var(--mono); color: var(--muted); }
.seg.scale button { min-width: 0; flex: 1; justify-content: center; flex-direction: column; height: 44px; gap: 0; line-height: 1.1; }
.seg.scale button b { font-size: 15px; }
.seg.scale button small { font-size: 11px; color: var(--muted); }
.switch { width: 40px; height: 22px; border-radius: 99px; background: var(--surface-3); border: 1px solid var(--border-strong); position: relative; padding: 0; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--ink-2); transition: left 0.12s; }
.switch[aria-checked="true"] { background: var(--accent); border-color: var(--accent); }
.switch[aria-checked="true"]::after { left: 20px; background: #fff; }
.times { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; }
.times label { font-size: 12px; color: var(--muted); display: block; margin-bottom: 4px; }
.nudge { display: flex; gap: 4px; align-items: center; }
.nudge input { font-family: var(--mono); text-align: center; padding: 5px 4px; }
.nudge button { width: 28px; height: 30px; padding: 0; justify-content: center; flex: none; }
.region-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.region-head .dot { width: 14px; height: 14px; }
.region-head b { font-size: 15px; }
.keys { display: grid; grid-template-columns: auto 1fr; gap: 6px 10px; font-size: 12px; color: var(--ink-2); align-items: center; }
.banner-area { padding: 0 16px; }
.banner-area .notice { margin-top: 10px; }
@media (max-width: 1180px) {
  .app { height: auto; min-height: 100vh; }
  .work { grid-template-columns: 1fr; }
  .pane { border-right: 0; border-bottom: 1px solid var(--border); max-height: none; }
  .pane.right { border-left: 0; }
  .list { max-height: 360px; }
  .crumbs .title { max-width: 160px; }
}

/* video and item metadata */
.video-box { padding: 12px; }
.video-box video { display: block; width: 100%; aspect-ratio: 16 / 9; background: #000; border-radius: 8px; }
.meta { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 7px 10px; font-size: 13px; }
.meta-k { color: var(--muted); }
.meta-v { color: var(--ink); word-break: break-word; white-space: pre-line; }
.tag { display: inline-block; font-size: 11px; color: var(--ink-2); background: var(--surface-3); border-radius: 4px; padding: 1px 6px; margin: 0 4px 4px 0; white-space: nowrap; }
.desc { white-space: pre-wrap; max-height: 260px; overflow: auto; color: var(--ink-2); line-height: 1.6; padding-right: 4px; }
button.ts { display: inline; height: auto; padding: 0 4px; margin: 0 1px; font: 600 12px var(--mono); color: var(--accent);
  background: var(--accent-soft); border: 0; border-radius: 4px; }
button.ts:hover:not(:disabled) { background: var(--accent); color: var(--accent-ink); }
.chapters { display: flex; flex-direction: column; gap: 2px; max-height: 320px; overflow: auto; }
button.chapter { height: auto; min-height: 30px; padding: 5px 8px; justify-content: flex-start; align-items: baseline; background: transparent;
  border-color: transparent; text-align: left; font-size: 12px; font-weight: 400; white-space: normal; }
button.chapter:hover:not(:disabled) { background: var(--surface-2); }
button.chapter .mono { color: var(--accent); flex: none; }
button.chapter .tag { margin: 0; flex: none; }
.chapter-text { color: var(--ink-2); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

.tabs { display: flex; border-bottom: 1px solid var(--border); padding: 0 8px; gap: 2px; position: sticky; top: 0; background: var(--surface); z-index: 2; }
.tabs button { background: transparent; border: 0; border-bottom: 2px solid transparent; border-radius: 0; height: 38px; color: var(--muted); padding: 0 12px; }
.tabs button:hover:not(:disabled) { background: transparent; color: var(--ink); }
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }
button.now-chapter { display: flex; width: calc(100% - 24px); margin: 0 12px 10px; height: auto; min-height: 34px; padding: 6px 9px; gap: 6px;
  align-items: baseline; justify-content: flex-start; text-align: left; white-space: normal; font-size: 12px; font-weight: 400;
  background: var(--surface-2); border-color: var(--border); }
button.now-chapter .mono { color: var(--accent); flex: none; }
button.now-chapter .tag { margin: 0; flex: none; }
.meta { grid-template-columns: 44px minmax(0, 1fr); }
