* { box-sizing: border-box; }
:root {
  color-scheme: dark;
  --bg: #111216;
  --panel: #17191f;
  --field: #1d2028;
  --line: #292d37;
  --text: #f2f3f6;
  --muted: #a2a9bb;
  --accent: #b4a2ff;
  --accent-strong: #b19afd;
  font: 14px/1.5 system-ui, sans-serif;
}
body { margin: 0; background: var(--bg); color: var(--text); }
a { color: var(--accent); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button, .button {
  display: inline-flex; justify-content: center; align-items: center; gap: .45em;
  cursor: pointer; border: 1px solid var(--line); border-radius: 8px;
  padding: 8px 12px; background: var(--field); color: var(--text); white-space: nowrap;
}
button:hover, .button:hover { background: #2a2e3b; }
button:disabled { opacity: .5; cursor: default; }
.primary { background: var(--accent-strong); color: #171126; border-color: transparent; font-weight: 700; }
.primary:hover { background: #c6b5ff; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
input:not([type=range]):not([type=checkbox]), textarea, select {
  width: 100%; min-width: 0; border: 1px solid var(--line); background: var(--field); border-radius: 8px; padding: 9px 11px;
}
textarea { resize: vertical; min-height: 70px; }
label { display: grid; gap: 5px; color: var(--muted); }
label.check { display: flex; align-items: center; }
[hidden] { display: none !important; }
.bar {
  min-height: 62px; display: flex; align-items: center; gap: 18px;
  padding: 0 24px; border-bottom: 1px solid var(--line); background: #14151b;
}
.brand { display: flex; align-items: center; gap: 9px; font-weight: 750; letter-spacing: -.025em; color: var(--text); font-size: 17px; white-space: nowrap; }
.brand-icon { display: grid; place-items: center; width: 29px; height: 29px; border-radius: 8px; background: var(--accent); color: #161025; font-size: 20px; font-weight: 850; line-height: 1; }
.brand-media { color: #c2c5d1; font-weight: 520; }
.context { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.context:not(:empty) { border-left: 1px solid var(--line); padding-left: 18px; }
.top-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.notice { color: var(--muted); padding: 2rem; }
h1, h2, h3, p { margin: 0; }
h1 { letter-spacing: -.04em; font-size: clamp(22px, 3vw, 32px); line-height: 1.15; overflow-wrap: anywhere; }
h2 { font-size: 16px; font-weight: 690; }
.small { font-size: 12px; color: var(--muted); }
.subtle { color: var(--muted); }
.row { display: flex; align-items: center; gap: 9px; }
.spread { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.stack { display: grid; gap: 12px; }
.tag { display: inline-flex; padding: 2px 7px; border: 1px solid #47405d; border-radius: 5px; color: var(--accent); font-size: 11px; font-weight: 730; letter-spacing: .04em; white-space: nowrap; }
.error { color: #ffa6af; }
.empty { color: var(--muted); padding: 24px 0; }
.login { max-width: 400px; margin: 10vh auto; padding: 26px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); }
.library { max-width: 1280px; margin: auto; padding: 28px 24px; }
.library-head { margin-bottom: 22px; }
.library-grid { display: grid; grid-template-columns: 235px minmax(0, 1fr); gap: 16px; }
.card { border: 1px solid var(--line); border-radius: 12px; background: var(--panel); padding: 16px; min-width: 0; }
.project { display: flex; align-items: center; justify-content: flex-start; width: 100%; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: normal; overflow-wrap: anywhere; }
.project.active { border-color: #69608a; background: #2b2441; }
.cut-row { padding: 12px 0; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.review { display: grid; grid-template-columns: minmax(0, 1fr) clamp(305px, 31vw, 410px); min-height: calc(100vh - 62px); }
.screen { min-width: 0; padding: clamp(14px, 2.4vw, 30px); }
.screen-header { margin-bottom: 18px; }
.screen-header .small { margin-top: 5px; }
.player { border: 1px solid var(--line); border-radius: 12px; background: #0c0d11; }
.stage { border-radius: 11px 11px 0 0; overflow: hidden; }
.stage { min-height: 130px; display: grid; place-items: center; background: #07080a; }
.frame { position: relative; width: 100%; max-height: 68vh; display: grid; place-items: center; }
video { display: block; width: 100%; max-height: 68vh; object-fit: contain; }
canvas.ink { position: absolute; pointer-events: none; touch-action: none; }
canvas.ink.drawing { pointer-events: auto; cursor: crosshair; }
.stage:has(canvas.drawing) { box-shadow: inset 0 0 0 2px var(--accent); }
.transport { display: grid; gap: 8px; padding: 12px 14px 13px; background: #17191f; border-radius: 0 0 11px 11px; }
.timeline { position: relative; padding-top: 19px; }
#hover { position: absolute; z-index: 3; bottom: 40px; transform: translateX(-50%); pointer-events: none;
  background: #13141a; text-align: center; padding: 3px; border: 1px solid #4a435c; border-radius: 6px; }
#hover-image { width: 160px; height: 90px; background-repeat: no-repeat; }
.seek { display: block; width: 100%; margin: 0; height: 14px; cursor: pointer; accent-color: var(--accent); }
.marker-strip { position: absolute; left: 7px; right: 7px; top: 0; height: 19px; pointer-events: none; }
.marker {
  position: absolute; transform: translateX(-50%); top: 1px; width: 10px; height: 13px;
  border-radius: 4px 4px 4px 4px; padding: 0; border: 1px solid #6e5f96; background: #7763a4; pointer-events: auto;
}
.marker:hover, .marker.active { background: var(--accent); border-color: var(--accent); z-index: 1; }
.tc { font: 12px/1.4 ui-monospace, Consolas, monospace; font-variant-numeric: tabular-nums; color: #d2d4df; }
.icon-button { min-width: 35px; min-height: 33px; padding: 5px 9px; }
.icon-button[aria-pressed=true] { border-color: var(--accent); color: var(--accent); }
.comments { border-left: 1px solid var(--line); background: var(--panel); min-width: 0; display: flex; flex-direction: column; }
.comments-header { padding: 17px 17px 13px; border-bottom: 1px solid var(--line); }
.comment-list { overflow-y: auto; max-height: 60vh; min-height: 140px; padding: 8px 13px; flex: 1; }
.comment-list .empty { padding: 18px 7px; }
.note {
  width: 100%; text-align: left; display: grid; gap: 7px; white-space: normal;
  background: transparent; border: 1px solid transparent; border-bottom-color: var(--line); border-radius: 8px;
  padding: 11px 8px; justify-content: stretch; overflow-wrap: anywhere;
}
.note.active { background: #262035; border-color: #51446c; }
.note-body { white-space: pre-wrap; }
.avatar { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: #3b3152; color: #d8ccff; font-size: 11px; font-weight: 750; flex-shrink: 0; }
.composer { padding: 14px 16px 17px; border-top: 1px solid var(--line); }
.composer textarea { display: block; }
.hint { margin-top: 12px; }
dialog { width: min(92vw, 560px); border: 1px solid var(--line); border-radius: 12px; background: var(--panel); color: var(--text); padding: 19px; }
dialog::backdrop { background: #07070bcc; }
.toast { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; color: var(--text); background: #2a2538; z-index: 5; }
@media (max-width: 800px) {
  .review, .library-grid { grid-template-columns: minmax(0, 1fr); }
  .comments { border-left: 0; border-top: 1px solid var(--line); }
  .comment-list { max-height: 330px; }
  .bar { padding: 0 12px; gap: 10px; }
  .context:not(:empty) { padding-left: 10px; }
  .library { padding: 18px 13px; }
  .login { margin: 7vh 12px; }
}

