:root {
  color-scheme: dark;
  --bg: #090b0c;
  --panel: #111416;
  --field: #191d20;
  --stage: #080a0b;
  --ink: #ecefea;
  --muted: #a1aaa7;
  --faint: #727e79;
  --line: #2a3033;
  --accent: #d8ff56;
  --accent-ink: #121808;
  --blue: var(--accent);
  --lime: var(--accent);
  --purple: #c084fc;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --site-footer-height: 36px;
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  font-size: 12px;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
body { min-height: 100dvh; margin: 0; background: var(--bg); }
button, input, select, textarea { font: inherit; }
button, a, input, select, summary { -webkit-tap-highlight-color: transparent; }
button {
  min-height: 32px;
  padding: 6px 10px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color .12s, border-color .12s, color .12s;
}
button:hover { background: #252b2d; }
button:active { background: #303735; }
button:disabled, input:disabled, select:disabled { opacity: .4; cursor: not-allowed; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
  font-weight: 650;
}
button.primary:hover { background: #e5ff93; border-color: #e5ff93; }
button.primary:active { background: #c4ec43; }
svg {
  height: 17px;
  width: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}
.svg-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
select, input[type=number], input[type=text], textarea {
  min-height: 34px;
  max-width: 100%;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--field);
  color: var(--ink);
}
select { padding-right: 24px; cursor: pointer; }
select:hover, input[type=number]:hover, input[type=text]:hover { border-color: #46504b; }
input::placeholder { color: var(--faint); }
input[type=checkbox] { accent-color: var(--accent); width: 15px; height: 15px; margin: 0; flex: none; }
input[type=range] {
  -webkit-appearance: none;
  appearance: none;
  height: 24px;
  background: transparent;
  accent-color: var(--accent);
  cursor: pointer;
  min-width: 0;
}
input[type=range]::-webkit-slider-runnable-track { height: 3px; border-radius: 2px; background: #3c443f; }
input[type=range]::-moz-range-track { height: 3px; border-radius: 2px; background: #3c443f; }
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  margin-top: -4.5px;
  border: 2px solid var(--accent);
  border-radius: 3px;
  background: var(--accent);
}
input[type=range]::-moz-range-thumb { width: 10px; height: 10px; border: 1px solid var(--accent); border-radius: 3px; background: var(--accent); }
input[type=range]:hover::-webkit-slider-thumb { background: #eeffbe; border-color: #eeffbe; }
input[type=color] { width: 28px; height: 28px; padding: 0; border: 1px solid #4b544d; background: none; border-radius: 5px; cursor: pointer; flex: none; }
input[type=color]::-webkit-color-swatch-wrapper { padding: 3px; }
input[type=color]::-webkit-color-swatch { border: 0; border-radius: 2px; }
input[type=color]::-moz-color-swatch { border: 3px solid var(--field); border-radius: 4px; }
a { color: var(--accent); text-underline-offset: 3px; }
[hidden], .param-section[hidden] { display: none !important; }

/* The canvas is the primary surface; all three columns share one viewport. */
.topbar {
  height: 56px;
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}
.brand { display: flex; align-items: center; gap: 10px; flex: none; color: var(--ink); white-space: nowrap; }
.brand-logo { display: block; width: 40px; height: 40px; flex: none; object-fit: contain; border-radius: 50%; }
.brand-wordmark { font-size: 16px; font-weight: 750; letter-spacing: -.45px; }
.beta { padding: 3px 5px; margin-left: 5px; border: 1px solid #38432d; border-radius: 3px; color: #b2c88c; font: 11px var(--mono); letter-spacing: 0; }
.project-title { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; color: var(--muted); font-size: 12px; }
.project-title > span:nth-child(2) { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status-dot { display: inline-block; height: 5px; width: 5px; border-radius: 50%; background: #a4c077; flex: none; }
.local-badge { padding: 3px 6px; border: 1px solid var(--line); border-radius: 4px; color: var(--faint); font-size: 11px; white-space: nowrap; }
.top-actions { display: flex; align-items: center; gap: 5px; }
.top-actions button { font-size: 12px; }
.top-actions > .primary { min-height: 34px; padding: 7px 15px; margin-left: 5px; }
.workspace { height: calc(100dvh - 56px - var(--site-footer-height)); min-height: 500px; display: grid; grid-template-columns: 216px minmax(0, 1fr) 312px; grid-template-rows: minmax(0, 1fr); }
.site-footer { position: relative; z-index: 18; min-height: var(--site-footer-height); display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 0 18px; border-top: 1px solid var(--line); background: #0d1011; color: var(--muted); font: 10px/1 var(--mono); letter-spacing: .02em; }
.footer-provenance, .author-network, .author-trigger, .author-bubble-head { display: flex; align-items: center; }
.footer-provenance { min-width: 0; gap: 8px; white-space: nowrap; }
.footer-provenance strong { color: var(--muted); font-weight: 600; }
.footer-mark { display: grid; place-items: center; width: 18px; height: 18px; border: 1px solid #3d4842; border-radius: 3px; color: #b5c38b; font-size: 8px; letter-spacing: -.08em; }
.footer-provenance i { width: 1px; height: 10px; background: #3a403e; }
.author-network { justify-content: flex-end; gap: 2px; }
.author-network-label { margin-right: 5px; color: #69736e; letter-spacing: .08em; }
.author-channel { position: relative; display: flex; align-items: center; }
.author-trigger { min-height: 28px; gap: 5px; padding: 4px 7px; border-radius: 4px; color: var(--muted); font: inherit; }
.author-trigger:hover, .author-channel[data-open=true] .author-trigger { color: var(--ink); background: #1a201e; }
.author-platform-mark { display: grid; place-items: center; width: 16px; height: 16px; border: 1px solid #4a554d; border-radius: 50%; color: #d9e3da; line-height: 1; }
.author-platform-mark svg { display: block; width: 10px; height: 10px; overflow: visible; fill: currentColor; }
.author-platform-douyin { border-color: #54645e; color: #f4f5f3; }
.author-platform-douyin svg { width: 11px; height: 11px; }
.author-platform-douyin .social-accent-cyan { fill: #4de6df; }
.author-platform-douyin .social-accent-red { fill: #ed6075; }
.author-platform-x { border-color: #5e6680; color: #dfe3ea; }
.author-platform-x svg { width: 10px; height: 10px; }
.author-platform-wechat { border-color: #55725f; color: #d8ead9; }
.author-platform-wechat svg { width: 12px; height: 12px; }
.author-platform-wechat .social-dot-cut { fill: #111615; }
.author-bubble { position: absolute; right: 0; bottom: calc(100% + 8px); z-index: 22; width: 252px; padding: 12px; border: 1px solid #3b4540; border-radius: 8px; background: linear-gradient(150deg, #1a211e, #101415 72%); box-shadow: 0 14px 32px rgba(0,0,0,.42); color: var(--ink); opacity: 0; visibility: hidden; pointer-events: none; transform: translateY(8px); transform-origin: right bottom; transition: opacity .14s ease, transform .14s ease, visibility 0s linear .14s; }
.author-bubble::before { position: absolute; right: 0; bottom: -8px; left: 0; height: 8px; content: ""; }
.author-channel[data-open=true] .author-bubble { opacity: 1; visibility: visible; pointer-events: auto; transform: translateY(0); transition-delay: 0s; }
.author-bubble-head { gap: 10px; min-width: 0; }
.author-avatar { display: block; width: 44px; height: 44px; flex: none; border: 1px solid #59644b; border-radius: 50%; object-fit: cover; background: #f1f1eb; }
.author-bubble-head > div { display: grid; min-width: 0; gap: 3px; }
.author-bubble strong { overflow: hidden; color: #f4f6f1; font: 650 13px/1.1 -apple-system, BlinkMacSystemFont, "Helvetica Neue", "PingFang SC", "Microsoft YaHei", sans-serif; text-overflow: ellipsis; white-space: nowrap; }
.author-bubble-head > div > span:last-child { overflow: hidden; color: #aeb8b3; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.author-platform-label { color: #a8bf73; font-size: 8px; letter-spacing: .14em; }
.author-bubble-wechat { width: 220px; }
.author-bubble-wechat .author-bubble-head { margin-bottom: 10px; }
.wechat-qr-frame { padding: 12px; border: 1px solid #d8ddd4; border-radius: 3px; background: #fff; }
.wechat-qr-frame img { display: block; width: 100%; height: auto; image-rendering: auto; }
.author-bubble-wechat small { display: block; margin-top: 8px; color: #acb5b0; font-size: 10px; text-align: center; }
.left-panel, .right-panel { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--panel); }
.left-panel { padding: 0 14px; border-right: 1px solid var(--line); overflow: auto; }
.right-panel { border-left: 1px solid var(--line); }
.left-panel, .parameters, dialog { scrollbar-width: thin; scrollbar-color: #38413b transparent; }
.panel-title { height: 48px; display: flex; justify-content: space-between; align-items: center; flex: none; font-size: 12px; font-weight: 650; }
.panel-title > span { font: 11px var(--mono); color: var(--faint); }
.right-panel > .panel-title { padding: 0 18px; border-bottom: 1px solid var(--line); }
.import-card { width: 100%; min-height: 110px; flex: none; flex-direction: column; gap: 8px; border: 1px dashed #3b453d; border-radius: 8px; background: #141a16; padding: 13px 7px; }
.import-card:hover { border-color: #99b852; background: #1a2219; }
.import-icon { display: grid; place-items: center; width: 28px; height: 28px; border: 1px solid #394830; border-radius: 6px; color: var(--accent); }
.import-card strong { font-size: 12px; font-weight: 600; }
.import-card small { max-width: 100%; font: 11px/1.4 var(--mono); color: var(--faint); letter-spacing: -.35px; white-space: normal; }
.asset-card { display: flex; align-items: center; gap: 9px; padding: 11px 0 6px; margin-top: 6px; }
.asset-thumb { flex: none; width: 38px; height: 42px; border: 1px solid var(--line); border-radius: 5px; background: #232a25 center/cover; }
.asset-info { min-width: 0; flex: 1; }
.asset-info strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; font-weight: 550; }
.asset-info span { display: block; margin-top: 5px; color: var(--faint); font: 11px/1.5 var(--mono); overflow-wrap: anywhere; }
.asset-check { color: var(--accent); font-size: 12px; }
.source-note { margin: 2px 0 22px; color: var(--faint); font-size: 11px; line-height: 1.65; overflow-wrap: anywhere; }
.source-note a { color: var(--muted); font-size: 11px; text-decoration-color: #4a554e; }
.section-label { display: flex; align-items: center; justify-content: space-between; margin: 0 0 10px; color: var(--muted); font-size: 12px; font-weight: 500; }
.section-label > span { font: 11px var(--mono); color: var(--faint); letter-spacing: .5px; }
.presets { display: flex; flex-direction: column; gap: 8px; }
.preset { justify-content: start; gap: 10px; padding: 8px; border: 1px solid var(--line); border-radius: 8px; text-align: left; min-width: 0; background: #141819; }
.preset:hover { background: #1c2220; border-color: #46513c; }
.preset.selected { border-color: #758b42; background: #20271a; }
.preset > div:nth-child(2) { min-width: 0; }
.preset strong { display: block; font-size: 12px; font-weight: 600; }
.preset small { display: block; margin-top: 5px; color: var(--muted); font-size: 11px; line-height: 1.45; white-space: normal; }
.preset-num { display: none; }
.preset-art { width: 42px; height: 46px; position: relative; overflow: hidden; flex: none; border: 1px solid #394030; border-radius: 4px; background: #0f1410; }
.preset-art::before, .preset-art::after { content: ""; position: absolute; }
.tiles-art::before { width: 8px; height: 8px; left: 6px; top: 8px; background: var(--accent); box-shadow: 10px 0 #536134, 20px 0 #9aaf55, 0 10px #3c472a, 10px 10px var(--accent), 20px 10px #556334, 0 20px #687c3b, 10px 20px #424c2e; }
.tiles-art::after { width: 8px; height: 8px; left: 28px; top: 30px; background: var(--accent); }
.tiles-art span { position: absolute; width: 29px; height: 1px; left: 6px; top: 24px; background: #bec895; }
.strips-art::before { top: 8px; left: 8px; height: 5px; width: 24px; background: #657b37; box-shadow: -4px 8px var(--accent), 5px 16px #8a9e4f, -3px 24px #586b32; }
.strips-art::after { top: 6px; right: 6px; height: 8px; width: 8px; border-top: 1px solid #c084fc; border-right: 1px solid #c084fc; }
.strips-art i { position: absolute; left: 4px; top: 25px; width: 34px; height: 2px; background: #c084fc; }
.signal-art::before { inset: 7px 8px; border: 1px solid #687e3a; }
.signal-art::after { left: 20px; top: 7px; height: 31px; width: 1px; background: #66744e; transform: rotate(35deg); }
.signal-art span { position: absolute; left: 7px; top: 14px; width: 4px; height: 4px; background: var(--accent); box-shadow: 14px 10px var(--accent), 21px -5px #c084fc, 3px 22px #dce5c8; }
.signal-art i { position: absolute; left: 9px; top: 22px; width: 24px; height: 1px; background: #a0b773; transform: rotate(32deg); }
.signal-art b { position: absolute; left: 16px; top: 10px; width: 6px; height: 6px; border: 1px solid var(--accent); border-radius: 50%; }
.left-bottom { margin-top: auto; padding: 20px 0 14px; color: var(--muted); }
.left-bottom > .little-cross, .left-bottom > p { display: none; }
.left-bottom button { width: 100%; justify-content: space-between; min-height: 34px; padding: 6px 0; border-top: 1px solid var(--line); border-radius: 0; font-size: 11px; color: var(--muted); }
.left-bottom button:hover { color: var(--accent); background: transparent; }
.layer-list, .workspace-cues { display: grid; gap: 8px; padding-bottom: 14px; font-size: 11px; line-height: 1.6; color: var(--muted); }
.layer-list > div, .workspace-cues > div { display: flex; justify-content: space-between; gap: 8px; }
.layer-list strong { color: var(--ink); font-weight: 500; }

/* Preview and time controls */
.center-panel { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.canvas-toolbar { display: flex; align-items: center; justify-content: space-between; flex: none; height: 48px; padding: 0 16px; gap: 10px; border-bottom: 1px solid var(--line); background: #111415; }
.canvas-toolbar > div { display: flex; align-items: center; gap: 10px; min-width: 0; }
.canvas-toolbar strong { font-size: 12px; font-weight: 550; }
.canvas-toolbar .muted { color: var(--faint); font: 11px var(--mono); white-space: nowrap; }
.muted { color: var(--muted); }
.small-square { flex: none; width: 9px; height: 9px; border: 1px solid #93a184; }
.canvas-toolbar select { max-width: 126px; min-height: 30px; padding: 5px 20px 5px 7px; border-color: transparent; background: transparent; font-size: 11px; }
.canvas-toolbar button { min-height: 30px; padding: 5px 8px; border-color: var(--line); font-size: 11px; background: var(--field); }
.canvas-toolbar button:hover { background: #293126; border-color: #5b6946; }
.canvas-toolbar button[aria-pressed=true] { border-color: #667e39; background: #2a361b; color: var(--accent); }
.canvas-toolbar #compareBtn { min-width: 66px; }
.canvas-toolbar .icon-only { width: 30px; padding: 5px; }
.stage { position: relative; flex: 1; min-height: 180px; display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 28px 22px; overflow: hidden; background: var(--stage); }
.stage-label, .stage-footer { position: absolute; left: 18px; right: 18px; display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--faint); font: 11px/1.4 var(--mono); white-space: nowrap; pointer-events: none; }
.stage-label { top: 9px; letter-spacing: .5px; }
.stage-label > span:last-child { color: #93a28d; letter-spacing: 0; }
.stage-footer { bottom: 8px; letter-spacing: 0; }
.stage-footer > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; font-family: inherit; }
.stage-footer > span:last-child { flex: none; }
.fit-dot { color: var(--accent); margin: 0 3px; }
.canvas-wrap { position: relative; max-width: 100%; max-height: 100%; aspect-ratio: 1; line-height: 0; background: #171d1b; isolation: isolate; outline: 1px solid #303730; outline-offset: 0; }
.canvas-wrap canvas { display: block; width: 100%; height: 100%; }
.canvas-loading { position: absolute; inset: 0; display: flex; justify-content: center; align-items: center; gap: 10px; background: #171d1b; color: var(--muted); font-size: 12px; line-height: 1.6; }
.spinner { width: 16px; height: 16px; border: 2px solid #3d4735; border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.stage.dragover { outline: 2px dashed var(--accent); outline-offset: -10px; background: #172013; }
.timeline { height: 144px; flex: none; padding: 0 16px 12px; background: #111516; border-top: 1px solid var(--line); }
.transport { height: 45px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.transport > div { display: flex; align-items: center; gap: 8px; }
.play-button { width: 29px; height: 29px; min-height: 0; padding: 5px; background: #27311d; border-color: #475635; border-radius: 6px; color: var(--accent); }
.play-button:hover { background: #39482a; }
.play-button svg { width: 13px; height: 13px; }
.icon-only { min-height: 30px; width: 30px; padding: 4px; font-size: 18px; }
.time-display { display: flex; align-items: center; gap: 8px; font: 11px var(--mono); color: var(--faint); white-space: nowrap; font-variant-numeric: tabular-nums; }
.time-display b { color: var(--ink); font-weight: 500; }
.transport-right { color: var(--muted); font-size: 11px; }
.transport-right > span:first-child { color: var(--faint); font-family: var(--mono); }
.transport-right select { font-size: 11px; border-color: transparent; background: transparent; min-height: 30px; padding: 4px 2px; }
.transport-right label { display: flex; align-items: center; gap: 4px; }
.loop-tag { padding-left: 9px; border-left: 1px solid var(--line); white-space: nowrap; }
.track-layout { display: flex; gap: 12px; }
.track-names { display: grid; grid-template-rows: 22px 32px 25px; align-items: center; width: 38px; flex: none; color: var(--faint); font-size: 11px; }
.track-names span { display: flex; align-items: center; gap: 5px; }
.track-dot { width: 5px; height: 5px; flex: none; display: inline-block; border-radius: 1px; }
.blue { background: #829d81; }
.lime { background: var(--accent); }
.tracks { position: relative; flex: 1; min-width: 0; }
.ruler { height: 22px; display: flex; justify-content: space-between; padding-top: 5px; border-top: 1px solid #353d37; color: var(--faint); font: 11px var(--mono); background: repeating-linear-gradient(90deg, #40493f 0 1px, transparent 1px 10%) top/100% 3px no-repeat; }
.filmstrip { display: flex; height: 32px; overflow: hidden; border: 1px solid #54634a; border-radius: 4px; background: #263522; }
.filmstrip > img { flex: 1; min-width: 0; width: 12.5%; object-fit: cover; border-right: 1px solid #ffffff12; opacity: .74; }
.marker-track { position: relative; height: 22px; display: flex; align-items: center; justify-content: space-between; padding: 0 5px; margin-top: 6px; overflow: hidden; border: 1px solid #34432b; border-radius: 3px; background: #202c1d; }
.marker-track > span { z-index: 1; max-width: 100%; padding: 1px 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; background: #1c2818eb; color: #c0dca1; font-size: 11px; }
.marker-track.lost { border-color: #7a6030; }
.marker-track.lost > span { color: #edc27f; background: #3a2d19ef; }
.marker-track #trackSegments { position: absolute; inset: 0; display: flex; pointer-events: none; opacity: .5; }
.track-valid { flex: 1; background: #91af5a; }
.track-lost { flex: 1; background: #dca453; }
.track-seed { flex: 1; min-width: 2px; background: #e5ff9c; }
.tracks > input { position: absolute; inset: 0; z-index: 4; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize; }
.tracks:focus-within { outline: 2px solid var(--accent); outline-offset: 4px; }
.playhead { position: absolute; top: -1px; left: 0; z-index: 3; height: 84px; width: 1px; background: var(--accent); pointer-events: none; }
.playhead::before { content: ""; position: absolute; left: -3px; top: -3px; width: 7px; height: 8px; background: var(--accent); clip-path: polygon(0 0, 100% 0, 100% 65%, 50% 100%, 0 65%); }

/* Inspector tabs keep the working controls close to the composition. */
.inspector-tabs { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0; padding: 0 10px; flex: none; border-bottom: 1px solid var(--line); background: #111516; }
.inspector-tabs [role=tab], .inspector-tabs button { position: relative; min-height: 43px; padding: 8px 4px; border: 0; border-radius: 0; color: var(--muted); font-size: 12px; }
.inspector-tabs [role=tab]:hover { background: #1b221c; color: var(--ink); }
.inspector-tabs [role=tab][aria-selected=true], .inspector-tabs .active { color: var(--accent); background: transparent; }
.inspector-tabs [role=tab][aria-selected=true]::after, .inspector-tabs .active::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 2px; background: var(--accent); }
.inspector-tabs [role=tab]:focus-visible { outline-offset: -4px; }
.inspector-description { margin: 0; padding: 13px 18px; color: var(--muted); font-size: 11px; line-height: 1.65; border-bottom: 1px solid var(--line); }
.parameters { min-height: 0; flex: 1; overflow: auto; padding: 0 18px; }
.param-section { padding: 18px 0; border-bottom: 1px solid var(--line); }
.param-section:last-child { border-bottom: 0; }
.param-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 15px; }
.param-heading h2 { font-size: 13px; font-weight: 600; margin: 0; }
.param-heading > span { color: var(--faint); font: 11px var(--mono); letter-spacing: .4px; }
.segmented { display: flex; gap: 3px; padding: 3px; margin-bottom: 16px; border: 1px solid #30372f; border-radius: 6px; background: #0e1210; }
.segmented button { flex: 1; min-height: 29px; padding: 4px; border-radius: 4px; color: var(--muted); font-size: 12px; }
.segmented .active { color: var(--accent); background: #2a3420; }
.range-field { display: block; margin-top: 14px; }
.range-field > span { display: flex; justify-content: space-between; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; }
.range-field output { min-width: 45px; color: var(--ink); font: 11px var(--mono); text-align: right; font-variant-numeric: tabular-nums; }
.range-field input { display: block; width: 100%; margin: 5px 0 0; }
.field-note { margin: 10px 0 0; color: var(--muted); font-size: 11px; line-height: 1.7; }
.param-section .field-note { line-height: 1.7; }
.inline-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 14px; color: var(--muted); font-size: 12px; }
.inline-row code { padding-left: 6px; color: var(--ink); font: 11px var(--mono); }
.inline-row button { min-height: 29px; padding: 5px 8px; border-color: var(--line); font-size: 11px; }
.switch { position: relative; display: flex; align-items: center; width: 32px; height: 24px; flex: none; }
.switch input { position: absolute; inset: 0; z-index: 2; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.switch span { position: relative; width: 32px; height: 18px; border: 1px solid #485047; border-radius: 12px; background: #303730; }
.switch span::after { content: ""; position: absolute; left: 2px; top: 2px; width: 12px; height: 12px; border-radius: 50%; background: #b2bcb0; transition: transform .12s; }
.switch input:checked + span { border-color: var(--accent); background: var(--accent); }
.switch input:checked + span::after { transform: translateX(14px); background: #233016; }
.switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 4px; }
.switch input:disabled + span { opacity: .4; }
.colors-row { display: flex; flex-wrap: wrap; gap: 12px 20px; }
.colors-row label { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 11px; }
.full-button { width: 100%; min-height: 35px; padding: 8px 10px; margin-top: 12px; justify-content: space-between; border-color: var(--line); font-size: 12px; }
.full-select { width: 100%; font-size: 12px; }
.select-field { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; color: var(--muted); font-size: 12px; }
.select-field select { max-width: 165px; font-size: 12px; }
.check-field { display: flex; align-items: center; gap: 8px; margin-top: 12px; color: var(--muted); font-size: 12px; }
.advanced { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); }
.advanced summary { min-height: 24px; color: var(--muted); font-size: 12px; line-height: 24px; cursor: pointer; }
.advanced summary:hover, .advanced[open] summary { color: var(--ink); }
.advanced summary::marker { color: var(--faint); font-size: 10px; }
.glyph-toggles { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 13px; }
.glyph-toggles .check-field, .glyph-toggles label { min-height: 31px; margin: 0; padding: 6px 4px; display: flex; flex: 1; justify-content: center; align-items: center; gap: 4px; border: 1px solid var(--line); border-radius: 5px; background: #151a17; color: var(--muted); font-size: 11px; cursor: pointer; }
.glyph-toggles label:has(input:checked) { color: #d5e6b6; border-color: #445234; background: #20291b; }
.glyph-toggles input { width: 12px; height: 12px; }
.burst-section input[type=text] { width: 100%; margin-top: 7px; font-size: 12px; }
.panel-foot, .workspace-footer { display: flex; align-items: center; gap: 7px; min-height: 34px; padding: 9px 18px; flex: none; border-top: 1px solid var(--line); color: var(--faint); font-size: 11px; }

/* Analysis and point correction retain distinct ready / lost states. */
.tracking-intro { margin-top: -4px; }
.track-cta { min-height: 38px; color: var(--accent); border-color: #506534; background: #202a19; font-size: 12px; }
.track-cta:hover, .track-cta[aria-pressed=true] { background: #303f22; border-color: #8baa4c; }
.tracking-status { margin-top: 10px; padding: 10px; border: 1px solid #354035; border-radius: 6px; background: #1a211a; color: #c1ceb7; font-size: 11px; line-height: 1.7; }
.tracking-status.good { color: #c4dfa7; background: #1c291b; border-color: #384d2c; }
.tracking-status.lost { color: #e3bd7a; background: #302719; border-color: #69502b; }
.marker-editor { margin-top: 12px; padding: 12px 10px; border: 1px solid #333e33; border-radius: 6px; background: #171d18; color: var(--muted); font-size: 12px; }
.marker-editor p { margin: 0 0 10px; font-size: 11px; line-height: 1.7; }
.marker-editor label { display: flex; align-items: center; gap: 7px; margin: 9px 0; font-size: 11px; }
.marker-editor label select { flex: 1; }
.marker-editor select { min-width: 0; width: 100%; padding: 7px; font-size: 11px; }
.marker-editor input[type=number] { min-width: 0; width: 100%; padding: 7px; font: 11px var(--mono); }
.two-columns { display: flex; gap: 7px; }
.two-columns > * { flex: 1; min-width: 0; }
.marker-editor button { min-height: 34px; padding: 6px; border-color: var(--line); font-size: 11px; background: #212922; }
.marker-editor .primary { min-height: 38px; justify-content: center; font-size: 12px; background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.marker-editor small { display: block; margin-top: 10px; font-size: 11px; line-height: 1.65; color: var(--muted); }
#removeMarker { color: #e2b6a2; }
#removeMarker:hover { background: #3c2822; border-color: #6d4d3e; }
#visionStatus, #landmarkStatus { color: #acc095; font-size: 11px; }
.marker-handles { position: absolute; inset: 0; pointer-events: none; }
.marker-handle { position: absolute; width: 28px; height: 28px; min-height: 0; padding: 0; transform: translate(-50%, -50%); border: 1px solid #eff9dc; border-radius: 50%; background: #293b1bac; color: #fff; font: 11px var(--mono); pointer-events: auto; touch-action: none; cursor: move; }
.marker-handle.selected, .marker-handle:hover { background: #688b24e6; outline: 2px solid var(--accent); outline-offset: 2px; }
.marker-handle.lost { background: #916627d9; border-style: dashed; border-color: #ffe0a8; }
.marker-handle:focus-visible { outline: 2px solid white; outline-offset: 2px; box-shadow: 0 0 0 5px #68822d; }
.canvas-wrap.selecting { cursor: crosshair; outline: 2px solid var(--accent); outline-offset: 3px; }
.preview-status { font-family: var(--mono); }

/* Render settings and output are a single, explicit workflow. */
.notice { position: fixed; bottom: 20px; left: 50%; z-index: 30; display: flex; align-items: center; gap: 20px; max-width: min(580px, calc(100vw - 28px)); padding: 12px 14px; transform: translateX(-50%); border: 1px solid #526342; border-radius: 8px; background: #20291d; color: #e2efce; box-shadow: 0 8px 32px #0006; font-size: 12px; line-height: 1.7; }
.notice.error { background: #38231e; border-color: #94614b; color: #f5d1c2; }
.notice button { width: 28px; min-height: 28px; padding: 0; color: inherit; font-size: 20px; flex: none; }
dialog { width: min(500px, calc(100vw - 28px)); max-height: calc(100dvh - 40px); padding: 24px; overflow: auto; border: 1px solid #3c453d; border-radius: 12px; background: #14191a; color: var(--ink); box-shadow: 0 24px 100px #0009; }
dialog::backdrop { background: #020404bb; backdrop-filter: blur(4px); }
.dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.dialog-head h2 { margin: 6px 0 12px; font-size: 23px; line-height: 1.3; letter-spacing: -.6px; font-weight: 600; }
.eyebrow { color: #a3b889; font: 11px var(--mono); letter-spacing: 1.2px; }
.close-dialog { width: 34px; min-height: 34px; padding: 0; margin: -7px -7px 0 0; font-size: 23px; color: var(--muted); flex: none; }
.dialog-desc { margin: 0 0 20px; color: var(--muted); font-size: 12px; line-height: 1.7; }
.dialog-field { display: block; margin: 16px 0; color: var(--muted); font-size: 12px; line-height: 1.5; min-width: 0; }
.dialog-field select, .dialog-field input { display: block; width: 100%; min-height: 39px; margin-top: 7px; padding: 9px 10px; font-size: 12px; }
.dialog-field input[type=number] { font: 12px var(--mono); }
.export-grid, .render-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 14px; }
.export-grid .dialog-field, .render-grid .dialog-field { margin: 8px 0; }
.export-grid > .full-width, .render-grid > .full-width { grid-column: 1 / -1; }
.export-video-fields { min-width: 0; }
.export-summary, .render-summary { padding: 13px 14px; margin: 16px 0 8px; border: 1px solid #435232; border-radius: 6px; background: #20291b; color: #d8e8bd; font: 11px/1.8 var(--mono); overflow-wrap: anywhere; }
.export-summary strong, .render-summary strong { display: block; margin-bottom: 3px; color: var(--accent); font-weight: 500; }
.dialog-preview { display: block; width: 100%; max-height: 220px; margin-top: 12px; object-fit: contain; border: 1px solid var(--line); border-radius: 6px; background: var(--stage); }
#exportNote { margin-top: 13px; }
#exportDialog > .full-button, #busyDialog > .full-button { min-height: 42px; justify-content: center; margin-top: 20px; font-size: 13px; }
.export-success { padding: 13px; margin-top: 17px; border: 1px solid #435b35; border-radius: 6px; background: #202c1d; color: #d6e9bc; font-size: 12px; line-height: 1.8; overflow-wrap: anywhere; }
.export-success a { display: inline-block; margin-left: 7px; color: var(--accent); }
.export-success video { border: 1px solid #3d4c34; }
progress { width: 100%; height: 6px; margin: 16px 0; overflow: hidden; border: 0; border-radius: 3px; background: #313a2d; accent-color: var(--accent); }
progress::-webkit-progress-bar { background: #313a2d; border-radius: 3px; }
progress::-webkit-progress-value { background: var(--accent); border-radius: 3px; }
progress::-moz-progress-bar { background: var(--accent); }
#busyText { color: var(--muted); font-size: 12px; line-height: 1.8; }

@media (min-width: 1600px) {
  .workspace { grid-template-columns: 232px minmax(0, 1fr) 320px; }
  .left-panel { padding: 0 18px; }
  .parameters { padding: 0 20px; }
  .topbar { gap: 32px; padding: 0 20px; }
}
@media (max-width: 1180px) {
  .workspace { grid-template-columns: 194px minmax(0, 1fr) 292px; }
  .topbar { padding: 0 14px; gap: 20px; }
  .project-title .local-badge { display: none; }
  .project-title > span:nth-child(2) { max-width: 160px; }
  .top-actions { gap: 1px; }
  .top-actions button { padding: 6px 8px; }
  .left-panel { padding: 0 11px; }
  .preset { gap: 8px; padding: 7px; }
  .preset-art { width: 35px; }
  .canvas-toolbar { padding: 0 12px; }
  .canvas-toolbar .muted { display: none; }
  .transport-right > span:first-child { display: none; }
  .parameters { padding: 0 16px; }
}
@media (max-width: 960px) and (min-width: 741px) {
  .workspace { height: auto; min-height: calc(100dvh - 56px - var(--site-footer-height)); grid-template-columns: minmax(0, 1fr) 290px; grid-template-rows: auto auto; }
  .center-panel, .right-panel { height: calc(100dvh - 56px - var(--site-footer-height)); min-height: 540px; }
  .left-panel { grid-column: 1 / -1; grid-row: 2; display: grid; grid-template-columns: 182px minmax(0, 1fr); gap: 12px 18px; padding: 16px 18px; border-top: 1px solid var(--line); border-right: 0; overflow: visible; }
  .left-panel > .panel-title, .left-panel > .source-note, .left-panel > .section-label { display: none; }
  .import-card { grid-row: 1 / 3; min-height: 110px; }
  .asset-card { margin: 0; padding: 0; }
  .presets { grid-column: 2; flex-direction: row; align-items: stretch; }
  .preset { flex: 1; padding: 7px; gap: 7px; }
  .preset small { display: none; }
  .preset-art { width: 34px; height: 42px; }
  .left-bottom { grid-column: 1 / -1; padding: 0; margin: 0; }
  .left-bottom .layer-list, .left-bottom .workspace-cues { display: none; }
  .left-bottom button { width: auto; border: 0; padding: 5px 0; }
  .project-title { display: none; }
  .top-actions { margin-left: auto; }
  .canvas-toolbar > div { gap: 7px; }
  .timeline { padding-left: 12px; padding-right: 12px; }
  .transport > div { gap: 5px; }
  .time-display { gap: 5px; }
  .loop-tag { display: none; }
  .stage-footer > span:last-child { display: none; }
}
@media (max-width: 740px) {
  :root { --site-footer-height: 76px; }
  .topbar { height: 104px; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: 38px 44px; gap: 5px; padding: 8px 14px; }
  .brand { gap: 9px; }
  .brand-logo { width: 36px; height: 36px; }
  .brand-wordmark { font-size: 16px; }
  .brand .beta { margin-left: 2px; }
  .project-title { display: none; }
  .top-actions { display: grid; grid-template-columns: 1fr 1fr 1.2fr; gap: 6px; margin: 0; }
  .top-actions button { min-height: 44px; font-size: 12px; padding: 8px; border-color: var(--line); background: var(--field); }
  .top-actions > .primary { min-height: 44px; margin: 0; padding: 8px; background: var(--accent); border-color: var(--accent); }
  .workspace { display: flex; flex-direction: column; height: auto; min-height: 0; }
  .center-panel { order: 0; height: auto; min-height: 0; }
  .canvas-toolbar { height: 54px; padding: 0 12px; }
  .canvas-toolbar > div { gap: 6px; }
  .canvas-toolbar .small-square, .canvas-toolbar .muted { display: none; }
  .canvas-toolbar button, .canvas-toolbar select { min-height: 44px; font-size: 11px; }
  .canvas-toolbar .icon-only { width: 44px; }
  .stage { flex: none; min-height: 290px; height: min(calc(100vw + 44px), 560px); padding: 30px 14px; }
  .stage-label, .stage-footer { left: 14px; right: 14px; font-size: 11px; }
  .stage-label { top: 9px; }
  .stage-footer { bottom: 8px; }
  .stage-footer > span:last-child { display: none; }
  .timeline { height: 154px; padding: 0 12px 12px; }
  .transport { height: 55px; gap: 6px; }
  .transport > div { gap: 3px; }
  .play-button, .transport .icon-only { min-height: 44px; width: 44px; height: 44px; }
  .time-display { gap: 5px; font-size: 11px; }
  .transport-right > span:first-child, .loop-tag { display: none; }
  .transport-right label { gap: 0; }
  .transport-right select { min-height: 44px; min-width: 49px; font-size: 11px; }
  .track-names { width: 34px; }
  .track-layout { gap: 9px; }
  .ruler { font-size: 11px; }
  .right-panel { order: 1; height: auto; min-height: 0; border-left: 0; border-top: 1px solid var(--line); }
  .right-panel > .panel-title { height: 49px; padding: 0 16px; }
  .right-panel .panel-title button { min-height: 44px; width: 44px; }
  .inspector-tabs { padding: 0 10px; position: sticky; top: 0; z-index: 8; }
  .inspector-tabs [role=tab], .inspector-tabs button { min-height: 48px; font-size: 13px; }
  .parameters { overflow: visible; padding: 0 18px; }
  .param-section { padding: 19px 0; }
  .param-heading h2 { font-size: 13px; }
  .range-field { margin-top: 15px; }
  .range-field > span { font-size: 13px; }
  .range-field input { height: 44px; margin-top: 2px; }
  .range-field output { font-size: 12px; }
  .range-field input::-webkit-slider-thumb { width: 16px; height: 16px; margin-top: -6.5px; }
  .switch { width: 44px; height: 44px; justify-content: center; margin: -10px -6px -10px 0; }
  .check-field { min-height: 44px; margin-top: 5px; font-size: 12px; }
  .glyph-toggles .check-field, .glyph-toggles label { min-height: 44px; padding: 8px 10px; font-size: 12px; }
  .glyph-toggles input { width: 15px; height: 15px; }
  .segmented button, .full-button, .marker-editor button, .marker-editor .primary, .inline-row button, .select-field select, .full-select { min-height: 44px; }
  .marker-editor select, .marker-editor input[type=number], .burst-section input[type=text] { min-height: 44px; }
  .marker-editor p, .marker-editor small, .field-note { font-size: 12px; }
  .marker-handle { width: 44px; height: 44px; }
  .colors-row { gap: 12px 22px; }
  .colors-row label { min-height: 44px; font-size: 12px; }
  input[type=color] { width: 44px; height: 44px; }
  .advanced summary { min-height: 44px; line-height: 44px; }
  .panel-foot { min-height: 38px; padding: 9px 18px; }
  .left-panel { order: 2; overflow: visible; display: flex; flex-direction: column; padding: 8px 18px 18px; border-right: 0; border-top: 1px solid var(--line); }
  .left-panel > .panel-title { height: 40px; }
  .import-card { min-height: 104px; }
  .asset-card { margin-top: 8px; }
  .source-note { margin-bottom: 20px; }
  .presets { flex-direction: row; gap: 8px; }
  .preset { flex: 1; flex-direction: column; gap: 9px; padding: 10px 5px; text-align: center; }
  .preset-art { width: 42px; height: 46px; }
  .preset small { display: none; }
  .preset strong { font-size: 12px; }
  .left-bottom { padding: 18px 0 0; }
  .left-bottom button { min-height: 44px; }
  .notice { bottom: 12px; gap: 10px; padding: 10px 12px; font-size: 12px; }
  .notice button { min-height: 44px; width: 44px; }
  dialog { width: calc(100vw - 24px); max-height: calc(100dvh - 24px); padding: 20px; }
  .close-dialog { min-height: 44px; width: 44px; margin: -10px -10px 0 0; }
  .dialog-head h2 { font-size: 22px; }
  .dialog-field select, .dialog-field input { min-height: 44px; }
  #exportDialog > .full-button, #busyDialog > .full-button { min-height: 46px; }
  .export-grid, .render-grid { column-gap: 10px; }
  .export-summary, .render-summary { line-height: 1.9; }
  .site-footer { min-height: var(--site-footer-height); align-content: center; flex-wrap: wrap; gap: 0 12px; padding: 7px 14px; }
  .footer-provenance { width: 100%; height: 18px; }
  .author-network { width: 100%; min-height: 38px; justify-content: flex-end; }
  .author-trigger { min-height: 44px; padding: 6px 8px; }
  .author-bubble, .author-network .author-channel:first-of-type .author-bubble { position: fixed; right: 14px; bottom: calc(var(--site-footer-height) + 8px); left: auto; width: min(252px, calc(100vw - 28px)); transform-origin: right bottom; }
  .author-bubble-wechat { width: min(252px, calc(100vw - 28px)); }
}
@media (max-width: 360px) {
  .canvas-toolbar { padding: 0 8px; }
  .canvas-toolbar strong { display: none; }
  .canvas-toolbar > div { gap: 4px; }
  .canvas-toolbar > div:last-child { width: 100%; justify-content: space-between; }
  .transport-right label { font-size: 0; }
  .time-display { font-size: 11px; gap: 3px; }
  .transport .icon-only { width: 34px; }
  .top-actions button { padding: 6px; }
  .top-actions svg { display: none; }
  .preset strong { font-size: 11px; }
  .author-network-label, .author-trigger-label { display: none; }
  .author-trigger { min-width: 44px; min-height: 44px; padding: 6px; }
  .author-network { min-height: 44px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition: none !important; scroll-behavior: auto !important; }
}

.typography-section textarea { width:100%; resize:vertical; min-height:96px; padding:10px; border:1px solid var(--line); border-radius:6px; background:var(--field,#191d20); color:var(--ink,#ecefea); font-family:inherit; font-size:13px; line-height:1.6; }
.typography-section textarea:focus-visible { outline:2px solid var(--accent); outline-offset:2px; }

/* Regional normal layer: compact inspector controls, inherited dark palette. */
.normal-controls { min-width:0; border:0; padding:0; margin:0; }
.normal-controls:disabled { opacity:.58; }
.normal-controls:disabled input, .normal-controls:disabled select, .normal-controls:disabled button { opacity:1; }
.normal-reference { justify-content:flex-start; gap:10px; }
.normal-reference > span:last-child { margin-left:auto; }
.normal-swatch { width:26px; height:20px; flex:none; border:1px solid #ffffff55; border-radius:3px; background:linear-gradient(130deg,#eb8edd,#a5a3f2 48%,#78e0d2); }
.normal-region-actions { display:flex; gap:6px; margin-top:14px; }
.normal-region-actions select { flex:1; min-width:0; }
.normal-region-actions button { width:34px; flex:none; border:1px solid var(--line); }
#normalRegionForm { padding-top:12px; }
#normalAssetStatus { overflow-wrap:anywhere; }
.normal-section .two-columns { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; margin-top:12px; }

.sequence-legend { display:flex; align-items:center; gap:4px; margin-top:14px; padding:10px 0; }
.sequence-legend span { color:var(--muted); font-size:10px; white-space:nowrap; }
.sequence-legend span:first-child { margin-right:5px; }
.sequence-legend span:last-child { margin-left:5px; }
.sequence-legend i { flex:1; height:13px; background:var(--accent); opacity:.85; }
.sequence-legend i:nth-of-type(2) { opacity:.65; }.sequence-legend i:nth-of-type(3) { opacity:.45; }.sequence-legend i:nth-of-type(4) { opacity:.3; }.sequence-legend i:nth-of-type(5) { opacity:.17; }

/* Export blockers are actionable inside the dialog, never a dead header button. */
.export-readiness { margin: 0 0 18px; padding: 14px; border: 1px solid #697744; background: #d8ff5608; border-radius: 8px; }
.export-readiness h3 { margin: 0 0 8px; font-size: 13px; color: var(--ink); }
.export-readiness p, .export-readiness li { margin: 0 0 9px; font-size: 12px; line-height: 1.65; color: var(--muted); overflow-wrap: anywhere; }
.export-readiness ul { margin: 0; padding-left: 17px; }
.export-readiness .full-button { margin: 8px 0; min-height: 42px; }
.export-preview-choice { display: flex; align-items: flex-start; gap: 9px; padding: 10px 0 2px; font-size: 12px; line-height: 1.7; cursor: pointer; }
.export-preview-choice input { flex: none; margin: 4px 0 0; accent-color: var(--accent); }

#exportDialog #doExport { position: sticky; bottom: -1px; z-index: 2; box-shadow: 0 0 0 8px var(--panel); }
#exportDialog #doExport:disabled { opacity: 1; background: #404933; color: #b3bca4; border-color: #404933; }
.export-save-actions { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin: 10px 0; }
.export-save-actions button { min-height: 44px; padding: 10px 14px; border-radius: 5px; }
.export-save-status, .export-success p { overflow-wrap: anywhere; font-size: 12px; line-height: 1.7; }
