/* External Live Clipping: near-black ground, brand accents, neutral buttons, Plus Jakarta Sans 200-600. */
:root {
  --bg: #0a0a0a;
  --surface: #1a1a1a;
  --raised: #202020;
  --hover: #2a2a2a;
  --line: rgba(255, 255, 255, 0.1);
  --ink: #eef2fb;
  --muted: #a2aaad;
  --sky: #336cd2;
  --teal: #92cecf;
  --red: #f20605;
  --amber: #f2a30a;
  --btn: #3a3f47;
  --btn-hover: #4a505a;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-weight: 400;
  font-style: normal;
  font-synthesis: none;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
h1, h2 { font-weight: 600; margin: 0; }
[hidden] { display: none !important; }

.bar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 10px 20px; background: var(--surface); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 12px; }
.mark { width: 30px; height: 30px; flex: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.kicker { font-size: 11px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.appname { font-size: 16px; font-weight: 600; }
.bar-right { font-size: 13px; color: var(--muted); text-align: right; }
.bar-right b { color: var(--ink); font-weight: 500; }

.gate { flex: 1; display: grid; place-items: center; padding: 24px; }
.gate-card { max-width: 520px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 32px; }
.gate-card h1 { font-size: 22px; margin-bottom: 10px; }
.gate-card p { margin: 0 0 8px; color: var(--ink); line-height: 1.55; }
.gate-sub { color: var(--muted) !important; font-size: 13px; }

.app {
  flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px;
  padding: 16px 20px; align-items: start;
}
@media (max-width: 980px) { .app { grid-template-columns: minmax(0, 1fr); padding: 12px 16px; } }

.player { position: relative; background: #000; border-radius: 10px; overflow: hidden; aspect-ratio: 16 / 9; border: 1px solid var(--line); }
.player video { width: 100%; height: 100%; display: block; background: #000; }
.overlay {
  position: absolute; inset: 0; display: grid; place-items: center; text-align: center;
  background: rgba(10, 10, 10, 0.82); padding: 24px; font-size: 16px; font-weight: 500;
}

.scrub { margin-top: 12px; }
.scrub-track { position: relative; height: 28px; }
.scrub-track input[type=range] {
  -webkit-appearance: none; appearance: none; position: absolute; inset: 0; width: 100%; height: 28px;
  background: transparent; margin: 0; z-index: 3; cursor: pointer;
}
.scrub-track::before { content: ""; position: absolute; left: 0; right: 0; top: 11px; height: 6px; border-radius: 3px; background: var(--hover); z-index: 1; }
.scrub-track input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 24px; border-radius: 4px; background: var(--ink); border: 0; }
.scrub-track input[type=range]::-moz-range-thumb { width: 14px; height: 24px; border-radius: 4px; background: var(--ink); border: 0; }
.scrub-track input[type=range]::-webkit-slider-runnable-track { background: transparent; }
.scrub-track input[type=range]::-moz-range-track { background: transparent; }
.scrub-mark { position: absolute; top: 4px; width: 3px; height: 20px; border-radius: 2px; z-index: 2; }
.mark-in { background: var(--teal); }
.mark-out { background: var(--red); }
.scrub-range { position: absolute; top: 11px; height: 6px; background: rgba(51, 108, 210, 0.7); z-index: 2; border-radius: 3px; }
.scrub-labels { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-top: 2px; }

.row { display: flex; align-items: center; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.spacer { flex: 1; }
.clock { font-variant-numeric: tabular-nums; font-size: 18px; font-weight: 500; }

.btn {
  font: inherit; font-size: 14px; font-weight: 500; color: var(--ink); background: var(--btn);
  border: 1px solid var(--line); border-radius: 8px; padding: 9px 14px; cursor: pointer; min-height: 38px;
}
.btn:hover:not(:disabled) { background: var(--btn-hover); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.live { border-color: var(--red); color: #fff; }
.btn.primary { min-width: 110px; }
.btn.cta { background: var(--sky); border-color: var(--sky); font-weight: 600; }
.btn.cta:hover:not(:disabled) { background: #2d5fb8; }
.link { font: inherit; font-size: 12px; background: none; border: 0; color: var(--teal); cursor: pointer; padding: 0; text-decoration: underline; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; margin-top: 12px; }
.panel:first-child { margin-top: 0; }
.panel h2 { font-size: 15px; }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 10px; }
.count { font-size: 12px; color: var(--muted); }

.marks-grid { display: grid; grid-template-columns: 1fr 1fr 120px; gap: 12px; align-items: center; }
@media (max-width: 640px) { .marks-grid { grid-template-columns: 1fr; } }
.mk { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.mk-time { font-variant-numeric: tabular-nums; font-size: 14px; color: var(--ink); }
.mk .lbl { font-size: 12px; color: var(--muted); }
.mk.len { flex-direction: column; align-items: flex-start; gap: 2px; }
.create { display: flex; gap: 8px; margin-top: 12px; }
.create input {
  flex: 1; min-width: 0; font: inherit; font-size: 14px; color: var(--ink); background: var(--raised);
  border: 1px solid var(--line); border-radius: 8px; padding: 9px 12px;
}
.create input:focus { outline: 1px solid var(--sky); }
.hint { margin: 10px 0 0; font-size: 12px; color: var(--muted); line-height: 1.5; }
.hint.warn { color: var(--amber); }

.clips { display: flex; flex-direction: column; gap: 8px; max-height: 60vh; overflow-y: auto; }
.empty { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.5; }
.clip { background: var(--raised); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: center; }
.clip .nm { font-weight: 500; font-size: 14px; overflow-wrap: anywhere; }
.clip .meta { font-size: 12px; color: var(--muted); grid-column: 1 / 2; }
.clip .act { grid-column: 2 / 3; grid-row: 1 / 3; }
.chip { display: inline-block; font-size: 11px; font-weight: 500; padding: 2px 8px; border-radius: 10px; margin-left: 6px; border: 1px solid var(--line); }
.chip.working { color: var(--amber); }
.chip.ready { color: var(--teal); }
.chip.failed { color: var(--red); }

.keys p { margin: 8px 0 0; font-size: 13px; color: var(--muted); line-height: 1.9; }
kbd { font: inherit; font-size: 12px; background: var(--raised); border: 1px solid var(--line); border-radius: 4px; padding: 1px 6px; color: var(--ink); }

.foot { display: flex; justify-content: space-between; padding: 10px 20px; font-size: 12px; color: var(--muted); border-top: 1px solid var(--line); }
