/* Katchlight Media brand kit v2.1: Forest Olive, Charcoal, Cream, Copper; Playfair italic editorial, Inter body, JetBrains Mono metadata */
:root {
  --charcoal: #231f20; --charcoal-dark: #1a1718; --olive: #4e4838; --olive-dark: #3b362a; --cream: #e9e9e0; --cream-dim: #b9b8ad;
  --copper: #874b29; --copper-light: #a85d35; --line: #3a3536; --panel: #2a2526; --soft: #332d2e; --error: #c45a4d;
  --radius: 10px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--charcoal); color: var(--cream); font: 15px/1.5 Inter, -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }

.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 6px 20px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 12px; letter-spacing: .1em; }
.brand img { display: block; }
.project { display: flex; align-items: baseline; gap: 12px; }
.project h1 { margin: 0; font: italic 700 22px "Playfair Display", Georgia, serif; }
.label { font: 400 12px "JetBrains Mono", ui-monospace, monospace; letter-spacing: .02em; text-transform: uppercase; color: var(--cream-dim); }

.wrap { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; padding: 18px 20px; align-items: start; max-width: 1600px; margin: 0 auto; }
@media (max-width: 980px) { .wrap { grid-template-columns: minmax(0, 1fr); padding: 12px 12px; } .top { padding: 12px; } }
.stage { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.player { position: relative; background: #000; border-radius: var(--radius); overflow: hidden; display: flex; justify-content: center; cursor: pointer; }
.player video { width: 100%; max-height: 68vh; display: block; background: #000; }
.banner { position: absolute; left: 12px; right: 12px; bottom: 12px; padding: 10px 12px; border-radius: 8px; background: rgba(20, 18, 18, .92); font-size: 14px; }

.timeline { position: relative; height: 28px; cursor: pointer; user-select: none; touch-action: none; }
.track { position: absolute; left: 0; right: 0; top: 12px; height: 4px; border-radius: 2px; background: var(--line); }
.dots { position: absolute; inset: 0; }
.dot { position: absolute; top: 7px; width: 14px; height: 14px; margin-left: -7px; padding: 0; border-radius: 50%; border: 2px solid var(--charcoal); background: var(--copper-light); }
.dot.sel { box-shadow: 0 0 0 3px var(--cream); }
.head { position: absolute; top: 2px; bottom: 2px; width: 2px; margin-left: -1px; background: var(--cream); pointer-events: none; }
.hover { position: absolute; top: -20px; transform: translateX(-50%); padding: 1px 6px; border-radius: 4px; background: var(--cream); color: var(--charcoal); font: 11px "JetBrains Mono", monospace; pointer-events: none; white-space: nowrap; }

.clock { display: flex; align-items: center; gap: 12px; min-height: 42px; }
.clock-tc { border: none; background: transparent; padding: 0; font: 600 30px "JetBrains Mono", ui-monospace, monospace; color: var(--cream); cursor: text; }
.clock-tc:hover { color: var(--copper-light); }
.clock-in { font: 600 22px "JetBrains Mono", monospace; width: 210px; border: 2px solid var(--copper-light); border-radius: 8px; padding: 2px 10px; background: var(--panel); outline: none; }
.clock-in.bad { border-color: var(--error); }
.clock-dur { font: 15px "JetBrains Mono", monospace; color: var(--cream-dim); }
.playbtn { margin-left: auto; border: 1px solid var(--line); background: var(--panel); border-radius: 999px; padding: 6px 16px; }

.namerow { display: flex; align-items: center; gap: 10px; font-size: 14px; padding: 8px 12px; border-radius: var(--radius); background: var(--olive-dark); }
.namerow input { flex: 1; min-width: 0; border: 1px solid var(--olive); border-radius: 8px; padding: 6px 10px; background: var(--charcoal); outline: none; }
.box { display: flex; align-items: flex-end; gap: 10px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 10px 10px 10px 12px; }
.box:focus-within { border-color: var(--copper-light); }
.box textarea { flex: 1; min-width: 0; border: none; outline: none; background: transparent; resize: none; font-size: 16px; line-height: 1.4; padding: 5px 0; max-height: 160px; }
.scope { border: 1px solid var(--line); background: var(--soft); color: var(--cream-dim); border-radius: 999px; padding: 4px 11px; font-size: 13px; white-space: nowrap; margin-bottom: 3px; }
.scope.on { background: var(--olive); border-color: var(--olive); color: var(--cream); }
.send { border: none; border-radius: 10px; padding: 8px 16px; background: var(--copper); color: var(--cream); font-weight: 600; }
.send:hover { background: var(--copper-light); }
.hint { margin: 0; font-size: 12px; color: var(--cream-dim); }

.thread { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; max-height: calc(100vh - 110px); overflow: auto; position: sticky; top: 14px; }
@media (max-width: 980px) { .thread { max-height: none; position: static; } }
.thread-head { font: 400 12px "JetBrains Mono", monospace; letter-spacing: .02em; text-transform: uppercase; color: var(--cream-dim); margin-bottom: 10px; }
.empty { color: var(--cream-dim); font-size: 14px; padding: 8px 0; }
.note { position: relative; padding: 9px 11px; border-radius: 12px; background: var(--soft); margin-bottom: 8px; cursor: pointer; }
.note.sel { outline: 2px solid var(--copper-light); }
.note .meta { display: flex; gap: 8px; align-items: baseline; font-size: 12px; color: var(--cream-dim); }
.note .t { font: 600 13px "JetBrains Mono", monospace; color: var(--copper-light); }
.note .who { font-weight: 600; color: var(--cream); }
.note .txt { white-space: pre-wrap; word-wrap: break-word; margin-top: 2px; }
.note .x { position: absolute; top: 6px; right: 8px; border: none; background: transparent; color: var(--cream-dim); font-size: 16px; display: none; }
.note:hover .x { display: block; }
@media (hover: none) { .note .x { display: block; } }

.lock { max-width: 420px; margin: 12vh auto; padding: 24px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.lock .row { display: flex; gap: 10px; }
.lock input { flex: 1; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; background: var(--charcoal); outline: none; }
.err { color: var(--error); font-size: 13px; min-height: 18px; }
.foot { text-align: center; padding: 24px; font: 400 11px "JetBrains Mono", monospace; letter-spacing: .1em; text-transform: uppercase; color: var(--cream-dim); }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--cream); color: var(--charcoal); padding: 8px 14px; border-radius: 10px; font-size: 14px; z-index: 50; display: flex; gap: 10px; align-items: center; max-width: 92vw; }
.toast button { border: none; border-radius: 6px; padding: 2px 8px; background: var(--charcoal); color: var(--cream); }
@media (max-width: 600px) {
  .box { flex-wrap: wrap; }
  .box textarea { flex: 1 1 100%; order: -1; }
  .send { margin-left: auto; }
  .clock-tc { font-size: 26px; }
}
