:root {
  color-scheme: dark;
  --background: #110f17;
  --panel: #17141e;
  --raised: #1d1926;
  --input: #201c2b;
  --line: #2e2839;
  --text: #f1ecf9;
  --muted: #a49aae;
  --faint: #8a8196;
  --accent: #c6adff;
  --accent-dark: #2a2040;
  --good: #a0e8c4;
  --error: #ffacbb;
  font: 14px/1.45 "Segoe UI", system-ui, sans-serif;
  color: var(--text);
  background: var(--background);
}
* { box-sizing: border-box; }
body { margin: 0; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { opacity: .48; cursor: default; }
a { color: var(--accent); text-decoration: none; }
button, input, select, textarea { outline-offset: 3px; }
:focus-visible { outline: 2px solid var(--accent); }
h1, h2, h3, p { margin: 0; }
button, .button {
  border: 1px solid var(--line);
  background: var(--raised);
  color: var(--text);
  border-radius: 8px;
  min-height: 36px;
  padding: 7px 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-weight: 600;
  white-space: nowrap;
}
button:hover:not(:disabled), .button:hover { background: #282135; }
.primary, .primary:hover:not(:disabled) { background: var(--accent); border-color: var(--accent); color: #211333; }
.primary:hover:not(:disabled) { background: #d8c6ff; }
.ghost { border-color: transparent; background: transparent; }
.subtle { color: var(--muted); }
.small { min-height: 30px; padding: 4px 8px; font-size: 12px; }
.icon-button { width: 34px; padding: 0; min-height: 33px; }
.wide { width: 100%; }
.mark {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  color: var(--accent);
  background: #38284f;
  border: 1px solid #5f487a;
  font-size: 17px;
  box-shadow: inset 0 1px 0 #7a5a9a;
}
.opening { padding: 40px; color: var(--muted); }
.wordmark { display: flex; align-items: center; gap: 10px; font-weight: 740; font-size: 15px; letter-spacing: -.3px; }
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 8px 18px; min-height: 59px; border-bottom: 1px solid var(--line); background: #191520;
}
.top-left, .top-actions, .row { display: flex; align-items: center; gap: 9px; }
.top-path { border-left: 1px solid var(--line); margin-left: 7px; padding-left: 15px; min-width: 0; }
.top-path strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; max-width: 240px; }
.avatar { border-radius: 50%; width: 32px; min-height: 32px; padding: 0; color: var(--accent); background: var(--accent-dark); border-color: #53416c; }
.layout { display: grid; grid-template-columns: 224px minmax(300px, 1fr) 320px; min-height: calc(100dvh - 59px); }
.rail, .inspector { background: var(--panel); display: flex; flex-direction: column; min-width: 0; }
.rail { border-right: 1px solid var(--line); padding: 12px; }
.side-nav { display: grid; gap: 3px; margin-bottom: 18px; }
.side-nav button { justify-content: flex-start; }
.side-nav .active { background: var(--accent-dark); border-color: #493362; color: #e4d6ff; }
.rail-header, .inspector-head, .timeline-head, .monitor-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.rail-header { padding: 4px 4px 7px; color: var(--muted); }
.section-name { font-size: 12px; letter-spacing: .015em; font-weight: 700; }
.project-list { display: grid; gap: 5px; max-height: 62vh; overflow: auto; }
.project-link { align-items: flex-start; justify-content: flex-start; text-align: left; min-width: 0; height: 51px; gap: 9px; padding: 7px 8px; }
.project-link span:last-child { min-width: 0; }
.project-link strong { display: block; overflow: hidden; text-overflow: ellipsis; font-size: 12px; }
.project-link small { display: block; font-size: 11px; color: var(--muted); }
.project-link.selected { background: #292037; border-color: #553d71; }
.folder-icon { font-size: 15px; color: var(--accent); margin-top: 2px; }
.rail-footer { margin-top: auto; padding: 20px 4px 4px; display: grid; gap: 8px; }
.status-text { font-size: 11px; display: flex; gap: 7px; align-items: center; color: var(--muted); }
.led { width: 7px; height: 7px; background: var(--faint); border-radius: 50%; }
.led.ready { background: var(--good); box-shadow: 0 0 8px #9be8bb70; }
.led.starting { background: #f0c584; }
.center { display: flex; flex-direction: column; min-width: 0; }
.monitor { padding: 12px 17px 10px; flex: 1; min-height: 395px; display: flex; flex-direction: column; }
.monitor-head { color: var(--muted); min-height: 32px; flex-wrap: wrap; margin-bottom: 8px; }
.monitor-head b { color: var(--text); font-weight: 640; }
.video-well {
  min-height: 300px; flex: 1; display: grid; place-items: center; border-radius: 11px;
  border: 1px solid #2d2637; overflow: hidden; background: #0e0c14;
}
.video-well video { display: block; width: 100%; height: clamp(280px, 48vh, 550px); background: #0b0a10; object-fit: contain; }
.video-well.dropover { outline: 2px solid var(--accent); outline-offset: -3px; }
.empty-monitor {
  width: 100%; height: 100%; min-height: 300px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  background: radial-gradient(ellipse at 50% 43%, #271b39 0, #171121 37%, #100e17 73%);
  text-align: center; padding: 26px;
}
.frame-icon { display: grid; place-items: center; font-size: 28px; border-radius: 15px; width: 66px; height: 53px;
  color: #d9c3ff; background: #2c1d43; border: 1px solid #5e437c; margin-bottom: 6px;
}
.empty-monitor h1 { font-size: clamp(20px, 3vw, 29px); letter-spacing: -.75px; }
.empty-monitor p { font-size: 13px; margin: 1px 0 8px; color: #b5a8c1; max-width: 340px; }
.monitor-foot { min-height: 35px; padding-top: 8px; display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.timecode { font: 12px/1.4 ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .045em; color: var(--muted); }
.format-label { color: var(--muted); font-size: 12px; }
.timeline { background: #18141f; border-top: 1px solid var(--line); min-height: 225px; }
.timeline-head { padding: 11px 16px; border-bottom: 1px solid var(--line); }
.track-grid { display: grid; grid-template-columns: 79px minmax(0, 1fr); min-width: 320px; }
.track-lane { display: flex; overflow-x: auto; padding: 5px 10px; gap: 3px; align-items: stretch; border-bottom: 1px solid #272131; }
.track-lane.ruler { align-items: center; height: 27px; justify-content: space-between; color: var(--faint); gap: 14px; }
.track-label { display: flex; align-items: center; padding: 0 10px; border-right: 1px solid var(--line); border-bottom: 1px solid #272131; font-size: 11px; font-weight: 700; color: var(--muted); }
.clip-lane { min-height: 55px; background: repeating-linear-gradient(90deg, transparent 0, transparent calc(12.5% - 1px), #2a2334 calc(12.5% - 1px), #2a2334 12.5%); }
.clip { flex: var(--weight) 0 min-content; min-width: 76px; max-width: 100%; text-overflow: ellipsis; overflow: hidden; display: block; text-align: left; border-color: #513a73; background: #362650; color: #ddd0ff; }
.clip.selected { background: #594284; border-color: #b692fd; }
.clip-name { display: block; overflow: hidden; text-overflow: ellipsis; font-size: 12px; }
.clip small { font-size: 10px; color: #e1d3f9; }
.lane-block { flex: 1; border-radius: 5px; padding: 4px 8px; white-space: nowrap; min-width: 0; overflow: hidden; text-overflow: ellipsis; font-size: 11px; color: #b6d5c6; background: #233b36; border: 1px solid #38574d; }
.lane-block.titles { background: #3d3037; border-color: #644455; color: #f2c2d5; }
.lane-placeholder { color: var(--faint); font-size: 11px; padding: 4px; }
.inspector { border-left: 1px solid var(--line); }
.inspector-head { padding: 11px 13px 9px; border-bottom: 1px solid var(--line); }
.inspector-head button { flex: 1; }
.inspector-head .selected { color: var(--accent); background: var(--accent-dark); border-color: #4b3666; }
.inspector-body { padding: 14px; overflow: auto; max-height: calc(100dvh - 109px); }
.inspector-body h2 { font-size: 18px; letter-spacing: -.3px; margin-bottom: 8px; }
.stack { display: grid; gap: 10px; }
.subsection { margin: 15px 0 7px; padding-top: 13px; border-top: 1px solid var(--line); }
.description { color: var(--muted); font-size: 12px; }
.editor-form { margin-top: 11px; }
label { font-size: 12px; color: #d0c6db; font-weight: 640; display: grid; gap: 5px; min-width: 0; }
input:not([type="checkbox"]), textarea, select {
  width: 100%; min-height: 37px; padding: 8px 10px; color: var(--text); background: var(--input);
  border-radius: 8px; border: 1px solid #3b3248; font-size: 13px;
}
input[type="color"] { padding: 3px; height: 38px; }
textarea { resize: vertical; min-height: 83px; line-height: 1.5; }
input::placeholder, textarea::placeholder { color: #a096ae; }
input[type="checkbox"] { width: 15px; height: 15px; accent-color: var(--accent); }
.check { display: flex; align-items: center; gap: 6px; }
.columns { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 9px; }
.actions { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.brief { background: #211a2b; border: 1px solid #3d304b; border-radius: 9px; padding: 10px; font-size: 12px; white-space: pre-wrap; overflow-wrap: anywhere; color: #d7c8e5; max-height: 150px; overflow: auto; }
.job { padding: 9px; border: 1px solid var(--line); border-radius: 8px; display: grid; gap: 5px; font-size: 12px; overflow-wrap: anywhere; }
.job .row { justify-content: space-between; flex-wrap: wrap; }
.job p { color: var(--muted); }
.job .good { color: var(--good); }
.job .warning, .job .error { color: var(--error); }
progress { width: 100%; height: 7px; accent-color: var(--accent); }
.library { padding: clamp(20px, 4vw, 42px); }
.library h1 { font-size: 33px; letter-spacing: -1px; }
.library p { color: var(--muted); margin: 6px 0 19px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px,1fr)); gap: 12px; }
.project-card { min-height: 142px; flex-direction: column; align-items: flex-start; justify-content: space-between; padding: 14px; white-space: normal; text-align: left; }
.project-card .frame-icon { width: 47px; height: 39px; font-size: 18px; }
.project-card small { display: block; color: var(--muted); }
.login { min-height: 100dvh; display: grid; grid-template-columns: minmax(365px, 1fr) 1.15fr; }
.login-main { padding: clamp(30px, 5vw, 70px); display: flex; flex-direction: column; gap: min(12vh, 120px); }
.auth-form { display: grid; gap: 14px; width: min(100%, 380px); margin: 0 auto; }
.auth-form h1 { font-size: 36px; letter-spacing: -1.35px; }
.login-art {
  display: flex; align-items: center; justify-content: center; padding: clamp(24px, 5vw, 72px);
  background: radial-gradient(ellipse at 48% 42%, #332144, #20172d 57%, #171220 100%); border-left: 1px solid #3b2e48;
}
.deck { width: min(100%, 600px); border: 1px solid #5c4972; padding: 13px; border-radius: 19px; background: #1a1423; box-shadow: 0 30px 100px #0f091aaf; }
.deck-window { position: relative; display: grid; place-items: center; height: clamp(220px, 40vh, 420px); overflow: hidden; border-radius: 11px;
  background: radial-gradient(ellipse at 34% 72%, #ff9c8c, transparent 52%), radial-gradient(ellipse at 74% 30%, #d4adff, transparent 48%), #382054;
}
.deck-window::before, .deck-window::after { content: ""; position: absolute; inset: 30% 8% -120% -28%; border: 1px solid #efd2f5ac; border-radius: 50%; box-shadow: 0 0 0 20px #eedaff30, 0 0 0 42px #eedaff35, 0 0 0 68px #eedaff35; transform: rotate(-20deg); }
.deck-window::after { inset: -76% -65% 39% 23%; transform: rotate(-26deg); opacity: .7; }
.deck-play { display: grid; place-items: center; z-index: 1; width: 65px; height: 65px; border-radius: 50%; background: #261733c9; border: 1px solid #eed1fd88; color: white; font-size: 21px; }
.deck-track { height: 30px; display: flex; gap: 4px; padding-top: 8px; }
.deck-track i { border-radius: 4px; background: #5a4379; flex: 1; }
.deck-track i:nth-child(2) { flex: 1.8; background: #76599a; }
.deck-track i:nth-child(3) { flex: .7; }
.deck-track.audio i { background: #3c655d; height: 13px; }
dialog { border: 1px solid #574467; border-radius: 14px; background: #1c1725; color: var(--text); width: min(calc(100% - 24px), 550px); padding: 20px; max-height: calc(100dvh - 24px); }
dialog::backdrop { background: #08060bbd; }
.dialog-top { display: flex; align-items: center; gap: 12px; justify-content: space-between; margin-bottom: 16px; }
.dialog-top h2 { font-size: 23px; letter-spacing: -.6px; }
.logo-preview { width: 58px; height: 50px; object-fit: contain; border: 1px solid var(--line); border-radius: 5px; background: #100d15; }
#notice:empty { display: none; }
#notice { position: fixed; z-index: 2; bottom: 16px; left: 50%; transform: translateX(-50%); max-width: min(90vw, 550px); padding: 11px 15px; border-radius: 9px; border: 1px solid #66527e; color: #f1e6ff; background: #2c213b; box-shadow: 0 8px 30px #0008; }
.invite-code { font: 14px/1.5 ui-monospace, monospace; white-space: normal; overflow-wrap: anywhere; user-select: all; color: var(--accent); }
@media (max-width: 1160px) {
  .layout { grid-template-columns: 180px minmax(280px, 1fr) 285px; }
  .rail { padding: 9px; }
}
@media (max-width: 860px) {
  .layout { grid-template-columns: minmax(250px, 1fr) 280px; }
  .rail { display: none; }
  .monitor { padding-inline: 9px; }
  .topbar { padding-inline: 10px; }
  .top-path strong { max-width: 150px; }
}
@media (max-width: 630px) {
  .layout, .login { display: block; }
  .login-art, .top-path { display: none; }
  .login-main { min-height: 100dvh; padding: 24px; }
  .top-actions { gap: 4px; }
  .top-actions .subtle { display: none; }
  .monitor { min-height: 320px; }
  .video-well, .empty-monitor { min-height: 245px; }
  .video-well video { height: 265px; }
  .inspector { border-top: 1px solid var(--line); border-left: none; }
  .inspector-body { max-height: none; }
}
