:root {
  color-scheme: dark;
  --bg: #111215; --panel: #1b1c20; --control: #24252b; --text: #f2f0ed;
  --subtle: #a9a9b3; --mute: #8b8b97; --line: #32333a; --accent: #ff8248;
  --accent-ink: #27170e; --radius: 14px;
  font: 15px/1.45 "Inter", "Segoe UI", system-ui, sans-serif;
}
*, *::before, *::after { box-sizing: border-box }
body { margin: 0; min-height: 100vh; color: var(--text); background: var(--bg) }
[hidden] { display: none !important }
button, select, input { font: inherit }
button, select { color: inherit }
button { cursor: pointer }
button:disabled, input:disabled, select:disabled { opacity: .43; cursor: default }
button:focus-visible, select:focus-visible, input:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px }
a { color: inherit; text-decoration: none }
svg { flex: 0 0 auto; vertical-align: middle }
[data-icon] { display: inline-flex; align-items: center; justify-content: center; line-height: 1 }
.topbar { min-height: 73px; display: flex; padding: 14px max(24px, 3vw); align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid #2a2a31; background: #17181b }
.brand, .top-actions, .local, .heading, .heading-actions, .button, .editor-bar, .toolbar, .section-title, .statusbar, .status-text, .playbar, .shape-field, .interval { display: flex; align-items: center }
.brand { gap: 11px; font-size: 15px; font-weight: 850; letter-spacing: .15em; white-space: nowrap }
.brand small { color: var(--mute); margin-left: 4px; font-size: 10px; letter-spacing: .15em }
.top-actions { gap: 9px }
.local { gap: 7px; color: #b7c8be; font-size: 13px; margin-right: 12px; white-space: nowrap }
.local i, #state-dot { display: inline-block; height: 7px; width: 7px; background: #77d7a4; border-radius: 50%; flex: 0 0 auto }
#state-dot[data-level=error] { background: #ff736d }
#state-dot[data-level=work] { background: var(--accent) }
main { max-width: 1730px; margin: auto; padding: 30px max(24px, 3vw) 20px }
.heading { justify-content: space-between; gap: 16px; margin-bottom: 25px; align-items: end }
.eyebrow { color: var(--accent); font-size: 11px; letter-spacing: .2em; font-weight: 800; margin: 0 0 6px }
h1 { margin: 0; font-size: clamp(29px, 4vw, 49px); font-weight: 720; line-height: 1.08; letter-spacing: -.055em }
.heading-actions { gap: 8px }
.button { display: inline-flex; justify-content: center; gap: 8px; border: 1px solid transparent; border-radius: 8px; min-height: 38px; padding: 7px 12px; font-size: 13px; font-weight: 670; white-space: nowrap; background: transparent }
.button:hover:not(:disabled), .icon-button:hover:not(:disabled) { filter: brightness(1.19); background-color: #34353d }
.button.primary { background: var(--accent); color: var(--accent-ink) }
.button.primary:hover:not(:disabled) { background: #ff935f }
.button.secondary, .button.quiet { color: #dedde3; background: #222328; border-color: #34353d }
.button.subtle { width: 100%; color: #c9c8d0; border-color: #383943; margin-top: 14px }
.workspace { display: grid; grid-template-columns: minmax(195px, 232px) minmax(0, 1fr) minmax(228px, 273px); gap: 14px; align-items: stretch }
.panel { background: var(--panel); border: 1px solid #303138; border-radius: var(--radius); min-width: 0 }
.library, .inspector { padding: 16px }
h2 { font-size: 14px; margin: 0; font-weight: 710; display: flex; align-items: center; gap: 8px }
h2 [data-icon] { color: var(--accent) }
.media { display: flex; align-items: center; gap: 10px; padding: 10px; background: #222329; border: 1px solid #2f3037; border-radius: 8px; margin-top: 12px }
.media-icon { width: 35px; height: 35px; background: #35281f; border-radius: 6px; color: var(--accent); flex: 0 0 auto }
.file-info { min-width: 0 }
.file-info strong, .file-info small { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis }
.file-info strong { font-size: 13px; font-weight: 650 }
.file-info small, small#track-time { color: var(--subtle); font-size: 11px }
.divider { height: 1px; background: #303138; margin: 17px 0 }
.scan-options { margin-top: 12px }
label, .shape-field { color: #dad9df; font-size: 13px; font-weight: 570 }
label[for] { display: flex; justify-content: space-between; align-items: center; gap: 8px }
label.stack { display: grid; align-items: stretch; justify-content: stretch; gap: 5px; margin-top: 10px }
output { color: #ffad86; font-size: 12px; font-variant-numeric: tabular-nums }
input[type=range] { width: 100%; height: 19px; accent-color: var(--accent); margin: 5px 0 10px }
select { width: 100%; padding: 7px 25px 7px 8px; appearance: none; font-size: 13px; border: 1px solid #3a3b44; border-radius: 7px; min-height: 35px; background: #24252b url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='9'%3E%3Cpath fill='none' stroke='%23aeabb8' stroke-width='1.5' d='m2 3 4 4 4-4'/%3E%3C/svg%3E") right 8px center no-repeat }
.scan { width: 100%; border-color: #7e4c34; background: #38281f; color: #ffac83; margin-top: 7px }
#cancel { width: 100%; margin-top: 6px }
.section-title { justify-content: space-between; gap: 6px }
.count { font: 650 11px/1.5 system-ui; padding: 0 6px; border-radius: 7px; color: #d3d2db; background: #33343e }
.icon-button { border: 1px solid transparent; background: transparent; border-radius: 7px; min-width: 31px; min-height: 31px; padding: 5px; color: #c1c0cc; display: inline-grid; place-items: center }
.icon-button.active { color: #ffad86; border-color: #74442e; background: #38271e }
.tracks { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; max-height: 270px; overflow: auto }
.tracks li { min-width: 0 }
.tracks .no-masks { color: var(--mute); font-size: 12px; padding: 6px 0 }
.track { width: 100%; display: flex; align-items: center; border: 1px solid #303139; background: #23242a; border-radius: 8px; padding: 7px; gap: 7px; min-height: 47px; font-size: 12px }
.track.selected { border-color: #9c5736; background: #35271f }
.track .name { flex: 1; text-align: left; min-width: 0; padding: 0; border: 0; background: transparent }
.track .name strong, .track .name small { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis }
.track small { color: var(--subtle); font-size: 10px }
.track .icon-button { min-width: 24px; min-height: 28px; padding: 3px }
.track > [data-icon] { color: var(--accent) }
.editor { display: grid; grid-template-rows: auto minmax(365px, 1fr) auto; overflow: hidden }
.editor-bar { justify-content: space-between; gap: 5px; padding: 8px 12px; min-height: 52px; border-bottom: 1px solid #303138 }
.toolbar { gap: 4px }
.bar-separator { height: 20px; width: 1px; background: #3a3b43; margin: 0 4px }
.segments { display: inline-flex; border: 1px solid #373841; border-radius: 8px; padding: 2px; background: #15161a; white-space: nowrap }
.segments button { display: grid; place-items: center; padding: 4px 10px; min-height: 26px; font-size: 12px; font-weight: 650; color: var(--subtle); background: transparent; border: 0; border-radius: 5px }
.segments button.active { background: #32333b; color: #fff }
.stage { position: relative; display: flex; flex-direction: column; min-height: 365px; overflow: auto; background-color: #111215; background-image: radial-gradient(#303139 1px, transparent 1px); background-size: 18px 18px }
.stage:fullscreen { min-height: 100vh }
.stage-caption, .stage-tools, .zoom { position: sticky; z-index: 3; align-self: flex-start }
.stage-caption { top: 10px; left: 10px; margin: 10px 0 -35px 10px; border: 1px solid #34353e; background: #17181d; color: #c8c8d0; padding: 5px 7px; border-radius: 6px; font-size: 11px; display: inline-flex; align-items: center; gap: 5px; pointer-events: none }
.stage-caption [data-icon] { color: var(--accent) }
.artboard { position: relative; background: #111; box-shadow: 0 8px 30px #000b; flex: 0 0 auto; margin: auto; }
.artboard canvas { width: 100%; height: 100%; display: block }
.overlay { position: absolute; inset: 0; touch-action: none; cursor: default }
.overlay.drawing { cursor: crosshair }
.box { position: absolute; border: 1.5px solid #ff8248b8; color: #21150f; pointer-events: none }
.box.selected { border: 2px solid var(--accent) }
.box > span { position: absolute; left: -1px; bottom: 100%; background: var(--accent); border-radius: 3px 3px 0 0; padding: 1px 5px; font-size: 10px; font-weight: 750; white-space: nowrap }
.box.selected::after { content: ""; position: absolute; right: -5px; bottom: -5px; width: 9px; height: 9px; background: #fff3e8; border: 1px solid #c55d30 }
.box.draft { border-style: dashed }
.stage-tools { display: flex; position: sticky; bottom: 10px; left: 10px; margin: -38px 0 10px 10px; border: 1px solid #34353e; border-radius: 7px; background: #18191e }
.zoom { width: auto; position: sticky; bottom: 10px; left: calc(100% - 104px); margin: -44px 10px 10px auto; font-size: 11px; min-height: 31px; background-color: #18191e }
.empty { flex: 1; display: grid; place-content: center; justify-items: center; gap: 8px; min-height: 285px; color: var(--subtle); text-align: center; padding: 16px }
.empty [data-icon] { background: #38281f; color: var(--accent); padding: 13px; border-radius: 10px; margin-bottom: 3px }
.empty strong { color: var(--text); font-size: 16px }
.workspace.dragging { outline: 2px dashed var(--accent); outline-offset: 4px; border-radius: 12px }
.transport { border-top: 1px solid #303138; padding: 8px 11px; min-height: 44px }
.image-tools { display: flex; gap: 8px; align-items: center; font-size: 12px; color: var(--subtle); min-height: 27px }
.image-tools [data-icon] { color: var(--accent) }
.playbar { gap: 4px }
#timecode { color: #ceccd7; margin-left: 4px; font-variant-numeric: tabular-nums; font-size: 11px }
#keyframe { margin-left: auto; font-size: 11px; min-height: 29px; padding: 3px 6px }
.timeline { position: relative; padding-top: 12px; margin: 0 3px; }
#timeline-marks { position: absolute; top: 6px; left: 7px; right: 7px; height: 8px; pointer-events: none }
#timeline-marks .span { position: absolute; height: 5px; top: 1px; background: #75472e; border-radius: 3px }
#timeline-marks b { display: block; position: absolute; width: 6px; height: 6px; background: #ff9a66; transform: translateX(-50%) rotate(45deg) }
.timeline input { margin-bottom: 0 }
.panel-hint { color: var(--subtle); margin: 5px 0 11px; font-size: 12px }
.effects { display: grid; gap: 6px; margin: 0 0 14px }
.effect { width: 100%; min-height: 39px; display: flex; align-items: center; text-align: left; gap: 8px; padding: 6px 8px; border-radius: 7px; color: #dcdae3; border: 1px solid #383943; background: #24252b; font-size: 12px }
.effect.active { border-color: #a65c38; background: #39291f; color: #ffb595 }
.swatch { height: 21px; width: 21px; flex: 0 0 auto; border-radius: 4px; border: 1px solid #ffffff27 }
.pixels { background: conic-gradient(#7a4b37 25%, #f4a27a 0 50%, #db7650 0 75%, #503026 0) 0 0 / 11px 11px }
.blurry { background: radial-gradient(ellipse at 38% 38%, #e69b88, #653a35 64%, #27232f) }
.solid { background: #101015 }
.shape-field { gap: 8px; margin-top: 3px }
.shape-field > span:first-child { margin-right: auto }
.shape-field button { min-width: 33px; padding: 3px 7px }
input[type=color] { width: 29px; height: 26px; padding: 2px; border: 1px solid #4b4c56; border-radius: 5px; background: #24252b }
#quality-field { margin-top: 11px }
.check { display: flex; align-items: center; gap: 8px; margin-top: 12px }
input[type=checkbox] { accent-color: var(--accent) }
.interval { gap: 5px; margin-top: 10px }
.interval .button { font-size: 11px; min-height: 29px; padding: 3px 6px }
.statusbar { justify-content: space-between; gap: 15px; flex-wrap: wrap; font-size: 12px; color: var(--subtle); padding: 13px 3px }
.status-text { gap: 8px; min-height: 20px; min-width: 0 }
progress { accent-color: var(--accent); flex: 0 0 70px; width: 70px; height: 7px }
.privacy { display: inline-flex; gap: 5px; align-items: center }
dialog { background: #202127; color: var(--text); border: 1px solid #494a53; border-radius: 14px; padding: 25px; max-width: min(91vw, 575px) }
dialog::backdrop { background: #060609b9 }
dialog h2 { font-size: 20px }
dialog li { margin-bottom: 8px }
dialog p:last-child { color: var(--mute); font-size: 12px }
.dialog-close { float: right }
kbd { border: 1px solid #4f505a; border-radius: 4px; padding: 2px 4px }
@media (max-width: 1080px) {
  .workspace { grid-template-columns: minmax(165px, 190px) minmax(0,1fr) minmax(195px,215px); gap: 9px }
  .library, .inspector { padding: 12px }
}
@media (max-width: 800px) {
  main { padding: 20px 14px 12px }
  .topbar { padding: 10px 14px }
  .workspace { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px }
  .editor { grid-row: 1; grid-column: 1 / -1; grid-template-rows: auto minmax(330px,1fr) auto }
  .stage { min-height: 330px }
  .local { display: none }
}
@media (max-width: 480px) {
  .brand { letter-spacing: .09em; font-size: 12px; gap: 6px }
  .brand small { display: none }
  .brand img { width: 27px; height: 27px }
  .top-actions { gap: 5px }
  .top-actions .button { font-size: 11px; min-height: 33px; padding: 5px 7px; gap: 5px }
  .heading { margin-bottom: 15px }
  .heading-actions #demo { font-size: 11px; min-height: 33px; padding: 5px 6px }
  .heading-actions #help { padding: 5px; min-height: 33px }
  .workspace { grid-template-columns: minmax(0,1fr) }
  .editor { grid-template-rows: auto minmax(300px,1fr) auto }
  .stage { min-height: 300px }
  .editor-bar { padding-inline: 5px }
  .toolbar { gap: 0 }
}
.stage[data-zoom="fit"] .stage-caption, .stage[data-zoom="fit"] .stage-tools, .stage[data-zoom="fit"] .zoom { position: absolute; margin: 0 }
.stage[data-zoom="fit"] .zoom { right: 10px; left: auto }
#examples { position: absolute; inset: auto max(62px, calc(3vw + 42px)) auto auto; top: clamp(110px, 13.5vw, 182px); padding: 8px; border: 1px solid #494a53; border-radius: 9px; background: #222329; color: var(--text); box-shadow: 0 8px 26px #000a }
#examples:popover-open { display: grid; gap: 5px }
#examples .button { justify-content: flex-start }
@media (max-width: 800px) { #examples { top: 126px; right: 49px } }
