[data-theme="light"]{--bg:#f5f5f2;--panel:#fff;--panel-2:#f7f7f5;--panel-hi:#f0f1f5;--line:#e2e3df;--line-soft:#ededeb;--soft:#ededeb;--text:#202124;--ink:#202124;--muted:#6e727b;--accent:#465bff;--acid:#465bff;--lime:#465bff;--acid-ink:#fff;--danger:#c63143;color-scheme:light}
[data-theme="dark"]{--bg:#111315;--panel:#17191c;--panel-2:#1d2024;--panel-hi:#24272c;--line:#30343a;--line-soft:#272b30;--soft:#272b30;--text:#f1f2f4;--ink:#f1f2f4;--muted:#9ca2ad;--accent:#8190ff;--acid:#8190ff;--lime:#8190ff;--acid-ink:#0e1013;--danger:#ff6b79;color-scheme:dark}
[data-theme="dark"] body{background:var(--bg);color:var(--text)}
.rerun-logo{display:block;width:155px;max-width:100%;height:34px;object-fit:contain;object-position:left center}
.rerun-header-logo{display:block;width:132px;height:30px;object-fit:contain;object-position:left center;flex:none}
[data-theme="light"] :is(.rerun-logo,.rerun-header-logo){filter:brightness(0)}
[data-theme="dark"] :is(input,select,textarea){background:#1d2024!important;color:var(--text)!important;border-color:var(--line)!important}
[data-theme="dark"] :is(.pf-nav,.pf-topbar,.topbar,.studio-topbar,.discover-topbar,.statusbar,.toolrail,.inspector,.pf-tracker-library,.tracker-panel,.builder-library,.builder-inspector,.builder-timeline,.builder-stagebar,.builder-caption,.design-drawer,.content-drawer,.effects-drawer,.floating-panel,.preset-panel,.ascii-shell .controls,.ascii-shell .panel-heading){background:var(--panel)!important;color:var(--text)!important;border-color:var(--line)!important}
[data-theme="dark"] :is(.discover-card,.discover-labs a,.builder-layer,.effect-edit,.macro-card,.pf-tool-panel,.layer-item,.output-panel){background:var(--panel)!important;color:var(--text)!important;border-color:var(--line)!important}
[data-theme="dark"] :is(.stage,.tracker-stage,.studio-stage,.builder-viewport,.canvas-viewport){background-color:#0d0f12!important;background-image:linear-gradient(#ffffff0a 1px,transparent 1px),linear-gradient(90deg,#ffffff0a 1px,transparent 1px)!important}
[data-theme="dark"] :is(.button,.mini-button,.pf-button,.pf-icon-button,.segments button,.chip,.stage-toolbar button,.context-bar button,.quiet-button,.icon-button){background:#202329!important;color:var(--text)!important;border-color:var(--line)!important}
[data-theme="dark"] :is(.button.primary,.pf-button.primary,.project-actions .export){background:var(--accent)!important;color:#0d0f12!important;border-color:var(--accent)!important}
[data-theme="dark"] :is(.pf-tabs,.studio-topbar nav,.compose-timeline,.timeline-shell,.timeline-panel,.compose-track,.timeline-row,.builder-range-track){background:#202329!important;border-color:var(--line)!important}
[data-theme="dark"] :is(.pf-tabs button.active,.tool.active,.segments button.active,.mini-button.active,.chip.active){background:#30374e!important;color:#b8c0ff!important;border-color:#56629a!important;box-shadow:none!important}
[data-theme="dark"] :is(.discover-card p,.discover-intro p,.discover-labs span,.pf-note,.control-note,.drawer-heading p,.tracker-heading p,.panel-heading p,.builder-caption,.control label,.field label,.field-label label){color:var(--muted)!important}
[data-theme="dark"] .discover-badge{background:#12151ae8;color:#dfe3ee;border:1px solid #ffffff18}
[data-theme="dark"] .discover-footer{border-color:var(--line)}
[data-theme="dark"] .drop-overlay{background:#17191cf2!important;color:#b8c0ff!important}
[data-theme="dark"] #previewCanvas{background:#111}
[data-theme="dark"] .pf-media-transport{background:var(--panel);border-color:var(--line)}
[data-theme="dark"] .template-thumb{background:#0d0f12;border-color:var(--line)}
[data-theme="dark"] .effect-tile{border-color:var(--line)}
[data-theme="dark"] .builder-range-block{color:#fff}
.pf-theme-toggle{width:100%;display:flex;align-items:center;justify-content:space-between;gap:8px;padding:8px 9px;border:1px solid var(--line);border-radius:7px;background:var(--panel);color:var(--text);font:11px var(--sans)}
.pf-theme-toggle span:last-child{font-family:var(--mono);color:var(--muted)}
.pf-floating-theme{position:fixed;right:16px;bottom:16px;z-index:1000;border:1px solid var(--line);border-radius:999px;background:var(--panel);color:var(--text);padding:9px 13px;font:11px system-ui;box-shadow:0 8px 28px #0002}
.pf-designed .toolrail{grid-template-columns:minmax(0,1fr)!important;min-width:0}
.pf-designed .toolrail>*{min-width:0;max-width:100%}
.pf-designed .tool{width:100%!important;min-width:0!important;overflow:visible!important}
.pf-designed .tool canvas{display:block;width:100%!important;height:auto!important;aspect-ratio:16/11;object-fit:cover}
.pf-designed .tool>span:last-child{white-space:normal;overflow-wrap:anywhere}
@media(max-width:1250px){.pf-nav-bottom{display:grid!important;padding:0;margin-top:auto}.pf-nav-bottom>a,.pf-nav-bottom>span{display:none}.pf-theme-toggle{justify-content:center;height:42px;padding:0}.pf-theme-toggle span{display:none}.pf-theme-toggle:before{content:"◐";font:18px var(--sans)}}

/* The legacy optional Scene Composer is not in primary navigation, but still follows the global appearance setting. */
[data-theme="light"] :is(.scene-app,.scene-topbar,.object-library,.scene-inspector,.environment-panel,.material-bar,.transform-panel,.ai-panel,.preview-panel,.floating-header){background:#fff!important;color:#202124!important;border-color:#e2e3df!important}
[data-theme="light"] :is(.scene-stage,.scene-canvas-wrap){background:#e9eae7!important}
[data-theme="light"] :is(.object-buttons button,.scene-list button,.scene-tools button,.scene-topbar nav a,.scene-inspector input,.scene-inspector select,.scene-inspector textarea,.ai-panel button,.ai-panel textarea){background:#f5f5f2!important;color:#202124!important;border-color:#d9dbdf!important}
[data-theme="dark"] :is(.scene-app,.scene-topbar,.object-library,.scene-inspector,.environment-panel,.material-bar,.transform-panel,.ai-panel,.preview-panel,.floating-header){background:#17191c!important;color:#f1f2f4!important;border-color:#30343a!important}

@media(max-width:700px){
  :root{--nav-width:0}
  body.pf-designed{padding-left:0;padding-bottom:64px}
  .pf-nav{inset:auto 0 0;width:100%;height:64px;padding:7px 8px;display:flex;flex-direction:row;align-items:center;border:0;border-top:1px solid var(--line)}
  .pf-wordmark{display:none}.pf-nav-links{display:grid;grid-template-columns:repeat(6,1fr);gap:2px;flex:1}.pf-nav a[data-route]{padding:10px 4px;justify-content:center}.pf-nav a[data-route] span{display:none}.pf-nav a[data-route] svg{width:20px;height:20px}
  .pf-nav-bottom{display:block!important;margin:0 0 0 3px}.pf-theme-toggle{width:44px;height:44px}.pf-nav-bottom>a,.pf-nav-bottom>span{display:none}
  .pf-designed :is(.workspace,.tracker-workspace,.studio-workspace,.ascii-shell .workspace,.builder-workspace){grid-template-columns:minmax(0,1fr)!important;overflow:visible}
  .pf-designed .toolrail{max-height:none}.pf-designed .stage,.pf-designed .tracker-stage,.pf-designed .studio-stage,.builder-stage{min-height:600px;grid-column:1!important;grid-row:auto!important}
  .pf-designed :is(.inspector,.tracker-panel,.effects-drawer,.builder-inspector){grid-column:1!important;grid-row:auto!important;max-height:none!important}
  .pf-tracker-library,.builder-library{max-height:none}.discover-main{padding-inline:15px}.discover-topbar{align-items:flex-start;flex-direction:column;padding-block:14px}.discover-topbar .pf-actions{width:100%}.discover-topbar input{width:100%;flex:1}
}
