:root {
  color-scheme: dark;
  --page: #101114;
  --panel: #181a1f;
  --control: #22252c;
  --edge: #2d3038;
  --text: #f0f1f5;
  --muted: #a6adbb;
  --accent: #c8b9ff;
  --purple: #3b2c5b;
  --teal: #174843;
  font: 15px/1.45 Inter, system-ui, sans-serif;
  background: var(--page);
  color: var(--text);
}
* { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; }
button, .button, input, select, textarea { border: 1px solid var(--edge); border-radius: 8px; }
button, .button { background: var(--control); color: var(--text); padding: .5rem .85rem; cursor: pointer; text-decoration: none; }
button:hover:not(:disabled), .button:hover { filter: brightness(1.18); }
button:disabled { opacity: .55; cursor: default; }
input, select, textarea { background: var(--page); color: var(--text); padding: .55rem .65rem; min-width: 0; width: 100%; }
input[type=range] { accent-color: var(--accent); padding: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
a { color: var(--accent); }
h1, h2, p { margin: 0; }
h2 { font-size: 1rem; }
small, .muted, .eyebrow { color: var(--muted); }
.eyebrow { font: .75rem ui-monospace, monospace; letter-spacing: .12em; }
.primary { color: #181321; background: var(--accent); border-color: transparent; font-weight: 700; }
.danger { color: #ffb7bf; }
.topbar, .editor-heading, .panel-head, .transport, .account, .notice, .zoom { display: flex; align-items: center; gap: .75rem; }
.topbar { justify-content: space-between; padding: .7rem clamp(.8rem, 2vw, 1.5rem); background: var(--panel); border-bottom: 1px solid var(--edge); }
.brand { display: flex; align-items: center; gap: .65rem; color: var(--text); font-weight: 750; text-decoration: none; }
.brand small { display: block; font-weight: 400; }
.mark { display: grid; place-items: center; width: 2.25rem; height: 2.25rem; border-radius: 8px; color: #191421; background: var(--accent); font-size: 1.3rem; }
main { padding: .85rem; }
.panel { border: 1px solid var(--edge); border-radius: 12px; background: var(--panel); min-width: 0; }
.notice { flex-wrap: wrap; padding: .7rem; margin-bottom: .8rem; border: 1px solid #6c5d91; background: #242035; border-radius: 8px; }
.welcome, .projects { max-width: 920px; margin: clamp(1rem, 8vh, 6rem) auto; }
.welcome { padding: clamp(1.25rem, 6vw, 5rem); background: radial-gradient(ellipse at top right, #35294c, var(--panel) 66%); }
.welcome h1, .projects h1 { font-size: clamp(2rem, 6vw, 4rem); line-height: 1.08; margin: .5rem 0 1rem; }
.welcome p { max-width: 34rem; color: var(--muted); margin-bottom: 1.5rem; }
.login { display: grid; gap: .75rem; max-width: 24rem; }
.login button { justify-self: start; }
.create { display: flex; gap: .8rem; align-items: end; padding: 1rem; }
.create label { flex: 1; }
label { display: grid; gap: .3rem; color: var(--muted); font-size: .87rem; }
.project-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 235px), 1fr)); gap: .8rem; margin-top: 1rem; }
.project-card { padding: 1rem; text-decoration: none; color: var(--text); overflow-wrap: anywhere; }
.project-card:hover { border-color: var(--accent); }
.project-card small { display: block; margin-top: .3rem; }
.editor-heading { flex-wrap: wrap; margin-bottom: .7rem; }
.editor-heading h1 { font-size: 1.18rem; overflow-wrap: anywhere; }
.badge { color: var(--accent); background: #302746; padding: .25rem .6rem; border-radius: 6px; font-size: .82rem; }
#undo { margin-left: auto; }
.desk { display: grid; grid-template-columns: minmax(175px, .9fr) minmax(0, 3.1fr) minmax(210px, .95fr); gap: .65rem; }
.library, .monitor, .inspector, .timeline { padding: .75rem; }
.panel-head { justify-content: space-between; margin-bottom: .65rem; }
.asset-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 105px), 1fr)); gap: .55rem; margin-top: .65rem; max-height: 42vh; overflow-y: auto; padding: 3px; }
.asset { display: grid; gap: .25rem; text-align: left; overflow-wrap: anywhere; padding: .4rem; }
.asset img, .asset-icon { width: 100%; aspect-ratio: 16/9; object-fit: cover; border-radius: 5px; background: #302746; }
.asset-icon { display: grid; place-items: center; color: var(--accent); }
.asset span:last-child { font-size: .83rem; }
.preview { position: relative; isolation: isolate; display: grid; place-items: center; width: 100%; aspect-ratio: 16/9; max-height: 47vh; background: #0c0e10; border-radius: 7px; overflow: hidden; color: var(--muted); text-align: center; }
.preview p { padding: 1rem; }
.preview video, .preview img { position: absolute; width: 100%; height: 100%; object-fit: contain; }
.transport { margin-top: .55rem; font: .78rem ui-monospace, monospace; }
.transport button { color: var(--accent); min-width: 2.4rem; }
.transport input { flex: 1; }
#inspector { display: grid; gap: .6rem; }
#clip-name { overflow-wrap: anywhere; }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: end; gap: .5rem; }
.timeline { margin-top: .65rem; }
.agent { display: grid; gap: .7rem; margin-top: .65rem; padding: .75rem; }
.agent .panel-head { margin: 0; }
.agent form { display: grid; gap: .55rem; max-width: 44rem; }
.agent textarea { resize: vertical; }
.agent form button, #agent-check { justify-self: start; }
#agent-status:empty { display: none; }
.agent-diff { border-collapse: collapse; margin: .65rem 0; font-variant-numeric: tabular-nums; }
.agent-diff th, .agent-diff td { border-bottom: 1px solid var(--edge); padding: .4rem .65rem; text-align: left; }
.zoom input { width: 7rem; }
.timeline-scroll { overflow: auto; border-radius: 6px; background: var(--page); }
#tracks { min-width: 420px; }
.track-row { display: grid; grid-template-columns: 5.8rem minmax(0, 1fr); min-height: 3rem; border-top: 1px solid var(--edge); }
.track-label { position: sticky; left: 0; z-index: 4; display: grid; align-content: center; background: var(--panel); color: var(--muted); padding: .45rem; font-size: .83rem; }
.lane { position: relative; background-image: linear-gradient(to right, var(--edge) 1px, transparent 1px); background-size: 10% 100%; }
.ruler { min-height: 2rem; color: var(--muted); font: .72rem ui-monospace, monospace; }
.ruler button { position: absolute; inset: 0; border: 0; background: transparent; border-radius: 0; }
.tick { position: absolute; top: .55rem; pointer-events: none; }
.clip { position: absolute; top: .37rem; height: 2.25rem; min-width: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .8rem; text-align: left; background: var(--purple); padding: .35rem; }
.clip.audio { background: var(--teal); }
.clip[aria-pressed=true] { border: 2px solid var(--accent); }
.playhead { position: absolute; z-index: 3; inset-block: 0; width: 2px; background: var(--accent); pointer-events: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (max-width: 900px) {
  .desk { grid-template-columns: minmax(155px, 1fr) minmax(0, 3fr); }
  .inspector { grid-column: 1 / -1; }
  #inspector { grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: end; }
}
@media (max-width: 580px) {
  .desk, #inspector { grid-template-columns: minmax(0, 1fr); }
  .monitor { grid-row: 1; }
  .account span { display: none; }
  .create { align-items: stretch; flex-direction: column; }
  .asset-grid { max-height: 14rem; }
  .zoom input { width: 4.5rem; }
}
