:root {
  color-scheme: dark;
  --bg: #111317;
  --panel: #191c22;
  --line: #333842;
  --text: #f2f4f7;
  --muted: #aeb6c5;
  --accent: #c8f76e;
  --mono: "Cascadia Mono", Consolas, monospace;
  font: 16px/1.5 "Segoe UI", system-ui, sans-serif;
  color: var(--text);
  background: var(--bg);
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
[hidden] { display: none !important; }
.top {
  display: flex; justify-content: space-between; align-items: center;
  min-height: 72px; padding: 12px clamp(16px, 4vw, 64px);
  border-bottom: 1px solid var(--line); background: #17191e;
}
.brand { display: flex; align-items: center; gap: 7px; font-size: 1.2rem; font-weight: 720; }
.brand-soft { color: var(--muted); font-weight: 500; }
.brand-icon {
  display: grid; place-items: center; width: 30px; height: 30px;
  margin-right: 5px; background: var(--accent); color: #17200d;
  border-radius: 6px; font-size: .75rem; letter-spacing: 1px;
}
main { max-width: 1540px; margin: auto; padding: clamp(16px, 3.6vw, 56px); }
.workspace { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 390px); gap: 22px; align-items: start; }
.player-panel, .notes-panel { min-width: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.source-form { padding: 16px; }
.source-form > label { display: block; font-size: .875rem; font-weight: 650; margin-bottom: 8px; }
.source-actions { display: flex; gap: 8px; flex-wrap: wrap; }
input, textarea, button { font: inherit; }
input:not([type=file]), textarea {
  width: 100%; min-width: 0; background: #121419; color: var(--text);
  border: 1px solid var(--line); border-radius: 7px; padding: 9px 11px;
}
input:not([type=file]) { flex: 1 1 240px; }
input::placeholder, textarea::placeholder { color: #9da6b6; opacity: 1; }
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 40px; padding: 7px 12px; border: 1px solid var(--line);
  border-radius: 7px; color: var(--text); font-size: .875rem; font-weight: 650;
  cursor: pointer; white-space: nowrap; background: transparent;
}
.secondary { background: #252933; }
.primary { background: var(--accent); color: #17200d; border-color: var(--accent); }
.button:hover:not(:disabled), .timestamp:hover:not(:disabled) { filter: brightness(1.17); }
.button:disabled { opacity: .46; cursor: default; }
:focus-visible, #file:focus-visible ~ * { outline: 2px solid var(--accent); outline-offset: 3px; }
.source-actions:has(#file:focus-visible) .file-button { outline: 2px solid var(--accent); outline-offset: 3px; }
.screen {
  display: grid; place-items: center; position: relative; aspect-ratio: 16 / 9;
  width: 100%; overflow: hidden; background: #0a0c10;
}
.screen.twitch { min-height: 300px; }
.screen > .mount, .screen iframe, .screen video, .screen .mount > div { width: 100%; height: 100%; border: 0; }
.screen > .mount, .screen > iframe, .screen > video { position: absolute; inset: 0; }
.screen video { object-fit: contain; }
.screen audio { width: min(85%, 620px); }
.player-empty { display: grid; justify-items: center; gap: 6px; padding: 18px; text-align: center; color: var(--muted); }
.player-empty strong { color: var(--text); font-size: 1.1rem; }
.player-empty span:last-child { font-size: .875rem; }
.play-icon { display: grid; place-items: center; width: 62px; height: 62px; border-radius: 22px; background: #191f26; margin-bottom: 12px; }
.play-icon::after { content: ""; margin-left: 4px; border-left: 16px solid var(--accent); border-block: 10px solid transparent; }
.player-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 66px; padding: 11px 16px; border-top: 1px solid var(--line);
}
.media-details { display: grid; min-width: 0; }
.source-kind { color: var(--muted); font-size: .875rem; }
.source-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#clock { font: 1.5rem/1.2 var(--mono); color: var(--accent); }
.player-message, .player-hint { margin: 0; padding: 0 16px 12px; font-size: .875rem; color: var(--muted); }
.player-message:empty { display: none; }
.notes-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
h1 { margin: 0; font-size: 1.15rem; }
.count { font: .875rem/1.5 var(--mono); border-radius: 6px; background: #292e37; padding: 0 7px; }
.note-form { display: grid; gap: 10px; padding: 16px; border-bottom: 1px solid var(--line); }
.capture-row, .save-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.save-row { justify-content: space-between; }
kbd { border: 1px solid currentColor; border-radius: 4px; padding: 0 4px; font-size: .75rem; }
textarea { resize: vertical; }
.pending { font: .8125rem var(--mono); color: var(--accent); }
.key-label { font-size: .8125rem; color: var(--muted); }
.notes-list { min-height: 168px; max-height: 54vh; overflow-y: auto; }
.empty-note { color: var(--muted); margin: 24px 16px; font-size: .875rem; }
ol { list-style: none; margin: 0; padding: 0; }
li { padding: 13px 16px; border-bottom: 1px solid var(--line); }
li:last-child { border-bottom: 0; }
li p { margin: 7px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.timestamp { border: 0; padding: 0; background: transparent; color: var(--accent); font: .875rem var(--mono); cursor: pointer; }
.timestamp:disabled { cursor: default; }
.estimated { margin-left: 8px; color: #ffd18a; font-size: .8125rem; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (max-width: 900px) { .workspace { grid-template-columns: minmax(0, 1fr); } .notes-list { max-height: none; } }
@media (max-width: 460px) { main { padding: 10px; } .source-actions .button { flex: 1; } .screen.twitch { min-width: 400px; } .player-panel:has(.screen.twitch) { overflow-x: auto; } }
.top { gap: 12px; flex-wrap: wrap; }
.exports { display: flex; flex-wrap: wrap; gap: 8px; }
.snapshot-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; padding: 0 16px 14px; }
#snapshot-message { color: var(--muted); font-size: .875rem; }
.note-frame { display: block; width: min(100%, 260px); height: auto; margin-top: 10px; border-radius: 6px; }
