@font-face {
  font-family: StudioDisplay;
  src: url('/assets/fonts/instrument-sans.woff2') format('woff2');
  font-weight: 400 700;
  font-display: swap;
}
@font-face {
  font-family: StudioBody;
  src: url('/assets/fonts/dm-sans.woff2') format('woff2');
  font-weight: 400 800;
  font-display: swap;
}
#prism-studio-chrome {
  --rail-bg: #fff;
  color-scheme: light;
  --rail-line: #c7ccbf;
  --rail-ink: #1b201b;
  --rail-muted: #505a4c;
  --rail-surface: #e7ecdf;
  --rail-focus: #526a36;
  color: var(--rail-ink);
  font: 500 14px/1.4 StudioBody, system-ui, sans-serif;
  text-align: left;
}
#prism-studio-chrome * {
  box-sizing: border-box;
}
#prism-studio-chrome a {
  text-decoration: none;
  color: inherit;
}
#prism-studio-chrome button {
  border: 0;
  cursor: pointer;
  color: inherit;
  background: transparent;
  font: inherit;
}
#prism-studio-chrome :focus-visible {
  outline: 2px solid var(--rail-focus);
  outline-offset: -2px;
}
#prism-studio-chrome [hidden] {
  display: none !important;
}
#prism-studio-chrome .ws-rail {
  display: none;
  position: fixed;
  inset: 0 auto 0 0;
  width: 220px;
  height: 100dvh;
  z-index: 1402;
  flex-direction: column;
  align-items: stretch;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--rail-bg);
  color: var(--rail-ink);
  border-right: 1px solid var(--rail-line);
  padding: 0;
  margin: 0;
}
#prism-studio-chrome[data-open] .ws-rail {
  display: flex;
}
#prism-studio-chrome .ws-brand-row {
  position: static;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: transparent;
  color: inherit;
  height: 58px;
  min-height: 58px;
  padding: 0 11px 0 17px;
  border: 0;
  border-bottom: 1px solid var(--rail-line);
  margin: 0;
}
#prism-studio-chrome .ws-brand {
  display: flex;
  gap: 8px;
  align-items: center;
  font: 660 21px/1 StudioDisplay, sans-serif;
  letter-spacing: -0.055em;
  white-space: nowrap;
}
#prism-studio-chrome .ws-brand-labs {
  font-weight: 500;
}
#prism-studio-chrome .ws-symbol {
  width: 28px;
  height: 28px;
  background: currentColor;
  mask: url('/assets/prism-symbol.svg') center/contain no-repeat;
}
#prism-studio-chrome .ws-icon-button {
  min-width: 34px;
  min-height: 38px;
  display: grid;
  place-items: center;
  border-radius: 5px;
  padding: 0;
}
#prism-studio-chrome .ws-phone-close {
  display: none;
}
#prism-studio-chrome .ws-rail-main {
  display: block;
  flex: 1 0 auto;
  padding: 18px 10px;
  margin: 0;
}
#prism-studio-chrome .ws-rail-group + .ws-rail-group {
  margin-top: 22px;
}
#prism-studio-chrome .ws-rail-group h2 {
  color: var(--rail-muted);
  font: 580 10px/1.5 "Geist Mono", StudioMono, ui-monospace, monospace;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  margin: 0 10px 7px;
}
#prism-studio-chrome .ws-rail-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 9px;
  margin: 2px 0;
  min-height: 36px;
  border: 0;
  border-radius: 5px;
  color: var(--rail-muted);
  font: 500 14px/1.35 StudioBody, sans-serif;
  letter-spacing: normal;
}
#prism-studio-chrome :is(.ws-rail-link:hover, .ws-rail-link[aria-current], .ws-icon-button:hover) {
  background: var(--rail-surface);
  color: var(--rail-ink);
}
#prism-studio-chrome .ws-iconbox {
  display: grid;
  place-items: center;
  height: 24px;
  width: 24px;
  border-radius: 4px;
}
#prism-studio-chrome .ws-iconbox svg {
  width: 17px;
  height: 17px;
}
#prism-studio-chrome .ws-product-icon,
#prism-studio-chrome .ws-iconbox:has(.ws-product-icon) {
  width: 28px; height: 28px; flex: none; object-fit: contain; max-width: none;
}
#prism-studio-chrome .ws-rail-end {
  padding: 8px 10px 12px;
}
#prism-studio-chrome .ws-rail-bottom {
  padding-top: 9px;
  margin-top: 9px;
  border-top: 1px solid var(--rail-line);
}
#prism-studio-chrome .studio-edge,
#prism-studio-chrome .studio-nojs {
  display: flex;
  align-items: center;
  gap: 5px;
  position: fixed;
  top: 50%;
  left: 0;
  transform: translateY(-50%);
  writing-mode: vertical-rl;
  z-index: 1400;
  color: var(--rail-ink);
  background: var(--rail-bg);
  border: 1px solid #727b6d;
  border-left: 0;
  border-radius: 0 7px 7px 0;
  padding: 10px 5px;
  min-width: 30px;
  min-height: 74px;
  font: 610 13px/1.2 StudioDisplay, sans-serif;
  box-shadow: 0 1px 6px #0003;
  letter-spacing: 0.02em;
}
#prism-studio-chrome .studio-nojs-save { margin-top: 104px; }
@media (max-width: 700px) {
  #prism-studio-chrome :is(.studio-edge, .studio-nojs) { min-width: 44px; }
}
#prism-studio-chrome .studio-edge svg {
  width: 16px;
  height: 16px;
}
#prism-studio-chrome[data-open] .studio-edge {
  display: none;
}
#prism-studio-chrome .studio-backdrop {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100dvh;
  border-radius: 0;
  background: rgb(243 242 237 / 86%);
  z-index: 1401;
}
#prism-studio-chrome[data-frame='instrument'] .ws-rail-size {
  display: none;
}
#prism-studio-chrome[data-frame='instrument'] .ws-phone-close {
  display: grid;
}
#prism-studio-strip {
  box-sizing: border-box;
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  height: 38px;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 0 14px;
  background: var(--rail-bg);
  color: var(--rail-ink);
  border-bottom: 1px solid var(--rail-line);
  font: 540 13px/1.2 StudioBody, system-ui, sans-serif;
}
#prism-studio-strip strong {
  font-weight: 550;
  color: var(--rail-ink);
  border-left: 1px solid #62685b;
  padding-left: 15px;
}
#prism-studio-strip a {
  display: flex;
  align-items: center;
  min-height: 34px;
}
#prism-studio-strip a:hover {
  text-decoration: underline;
}
#prism-studio-strip .connected-gis {
  margin-left: auto;
  color: #364e28;
}
html[data-studio-gis] #root {
  position: absolute;
  inset: 38px 0 0;
  min-height: 0;
  height: calc(100dvh - 38px);
  width: auto;
}
html[data-studio-gis] #root #startup-placeholder {
  top: 38px;
}
@media (min-width: 1180px) {
  html[data-studio-gis][data-studio-rail] #root,
  html[data-studio-gis][data-studio-rail] #prism-studio-strip {
    left: 220px;
  }
  html[data-studio-gis]:not([data-studio-rail]) #prism-studio-strip {
    padding-left: 84px;
  }
  #prism-studio-chrome[data-frame='gis'] .studio-edge {
    top: 2px;
    transform: none;
    writing-mode: horizontal-tb;
    border-radius: 5px;
    left: 3px;
    min-height: 33px;
    padding: 5px 7px;
  }
}
@media (max-width: 1179px) {
  #prism-studio-chrome[data-frame='gis'] .ws-phone-close {
    display: grid;
  }
  #prism-studio-chrome[data-frame='gis'] .ws-rail-size {
    display: none;
  }
  #prism-studio-chrome[data-frame='gis'] .studio-edge {
    top: 2px;
    transform: none;
    writing-mode: horizontal-tb;
    border-radius: 5px;
    left: 3px;
    min-height: 33px;
    padding: 5px 7px;
  }
  #prism-studio-strip {
    padding: 0 7px 0 80px;
    gap: 5px;
    font-size: 12px;
  }
  #prism-studio-strip .studio-return {
    display: none;
  }
  #prism-studio-strip strong {
    border: 0;
    padding: 0;
  }
}

@media (max-width: 670px) {
  body.interior:has(#prism-studio-chrome) main {
    padding-inline-start: 34px;
  }
}

#prism-studio-strip .connected-gis {
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 1px;
  line-height: 1.05;
}
#prism-studio-strip .connected-gis small {
  font: 450 10px/1.1 StudioBody, system-ui, sans-serif;
  color: #505a4c;
}

#prism-simulator-surface {
  position: relative;
  height: 100dvh;
  width: 100%;
  overflow: hidden;
  transform: translateZ(0);
}
@media (min-width: 1180px) {
  html[data-instrument-rail] body {
    margin-inline-start: 220px;
    width: calc(100% - 220px);
  }
  html[data-instrument-rail] body > :is(.site-header, .topbar) {
    left: 220px;
    width: calc(100% - 220px);
  }
  #prism-studio-chrome[data-application][data-frame='instrument'] .ws-rail-size {
    display: grid;
  }
  #prism-studio-chrome[data-application][data-frame='instrument'] .ws-phone-close {
    display: none;
  }
}
#prism-studio-chrome .studio-snapshot {
  position: fixed; z-index: 5000; top: 45px; left: max(12px, 24%); right: 12px;
  margin: 0 auto; width: max-content; max-width: calc(76% - 12px); padding: 10px 13px;
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font: 14px/1.4 StudioBody, sans-serif;
  background: #fff; color: #202819; border: 1px solid #69795a; border-radius: 7px;
}
.studio-snapshot span { overflow-wrap: anywhere; }
.studio-snapshot button { background: #dbeaab; color: #202819; border: 0; border-radius: 4px; padding: 6px 9px; cursor: pointer; }

/* The instrument's imagery and map keep their own colors. All operator panels
   use the Studio light palette, including the first frame before JS is ready. */
html[data-studio-gis] #startup-placeholder { background: #fff; color: #1b201b; }
html[data-studio-gis] #startup-placeholder a { color: #39592e; }
html:has(#prism-simulator-surface) { color-scheme: light; }
#prism-simulator-surface {
  --panel: #fff; --panel-solid: #fff; --ink: #1c261c; --muted: #4a5848;
  --line: #c5cdbf; --accent: #436037; --accent-ink: #fff; --warn: #775510;
  color: var(--ink);
}
#prism-simulator-surface :is(.hud,.panel,#report,#loading) { background-color: #fff; color: var(--ink); }
#prism-simulator-surface .chip.warn { color: #79500c; }
#prism-simulator-surface .chip.bad { color: #952d36; }
#prism-simulator-surface :is(input,select,textarea) { color-scheme: light; background-color: #fff; color: var(--ink); }

html:has(#prism-studio-chrome[data-instrument='leaf-study'][data-application]) {
  color-scheme: light; --bg: #f7f8f5; --ink: #202620; --soft: #424e40; --muted: #576353; --line: #ccd2c8; --panel: #fff;
}
body:has(#prism-studio-chrome[data-instrument='leaf-study'][data-application]) :is(.page-hero,.hero) {
  background: var(--bg);
}
body:has(#prism-studio-chrome[data-instrument='leaf-study'][data-application]) dialog::backdrop,
body:has(#prism-studio-chrome[data-instrument='sim'][data-application]) #viewer::backdrop,
#prism-simulator-surface #report::backdrop {
  background: rgb(243 242 237 / 86%);
}
body:has(#prism-studio-chrome[data-instrument='leaf-study'][data-application]) :is(.site-header,.site-header.scrolled,.site-header nav,dialog,.panel,.workbench>aside,.experiment-footer) {
  background-color: #fff; color: #202620; border-color: #ccd2c8;
}
body:has(#prism-studio-chrome[data-instrument='leaf-study'][data-application]) :is(.site-header .brand img) { filter: invert(1); }
body:has(#prism-studio-chrome[data-instrument='leaf-study'][data-application]) :is(.site-header a,.panel a,.workbench>aside a,.stage-tools button,.btn,.seg button,.workbench>aside button,select,dialog .close,.example-nav button) { color: #273324; border-color: #a0ad9c; }
body:has(#prism-studio-chrome[data-instrument='leaf-study'][data-application]) :is(.btn,select,dialog .close,.stage-tools button,.workbench>aside button) { background-color: #fff; }
body:has(#prism-studio-chrome[data-instrument='leaf-study'][data-application]) :is(.btn.solid,.btn-solid,.seg .selected,.workbench>aside button[aria-pressed=true],.example-nav button[aria-pressed=true]) { background: #e0ead7; color: #273324; }
body:has(#prism-studio-chrome[data-instrument='leaf-study'][data-application]) :is(.menu span,.example-nav button:after) { background-color: #374d30; }
body:has(#prism-studio-chrome[data-instrument='leaf-study'][data-application]) input { accent-color: #436037; }
body:has(#prism-studio-chrome[data-instrument='leaf-study'][data-application]) :is(#stage,.stage) { --ink: #fff; --soft: #f1f2ed; --muted: #cdd4c7; }
body:has(#prism-studio-chrome[data-instrument='leaf-study'][data-application]) .stage-caption { color: var(--ink); text-shadow: 0 1px 3px #000; }
body:has(#prism-studio-chrome[data-instrument='leaf-study'][data-application]) :is(.panel,.workbench>aside) output { color: var(--ink); }
body:has(#prism-studio-chrome[data-instrument='leaf-study'][data-application]) .panel input[type='range']::-webkit-slider-thumb { background-color: #436037; }
body:has(#prism-studio-chrome[data-instrument='leaf-study'][data-application]) .panel input[type='range']::-moz-range-thumb { background-color: #436037; }
body:has(#prism-studio-chrome[data-instrument='leaf-study'][data-application]) :is(.panel,.workbench>aside) :focus-visible { outline: 2px solid #436037; outline-offset: 2px; }
body:has(#prism-studio-chrome[data-instrument='leaf-study'][data-application]) #motion[aria-checked='true'] { background-color: #436037; border-color: #436037; }
html[data-studio-surface] .topbar .theme,
html[data-studio-surface] .site-header .theme { display: none; }
html[data-studio-gis] #root button:is([aria-label="Switch to dark mode" i],[aria-label="Switch to light mode" i],[aria-label="Switch to dark theme" i],[aria-label="Switch to light theme" i]) { display: none; }
html:has(#prism-studio-chrome[data-instrument='sim'][data-application]) { color-scheme: light; }
body:has(#prism-studio-chrome[data-instrument='sim'][data-application]):not(:has(#prism-simulator-surface)) {
  --ink: #202620; --muted: #4d594a; --line: #c7cdbf; --bg: #fff; --surface: #f7f8f4; --rule: #c7cdbf; --accent: #436037;
  background: #fff; color: var(--ink);
}
body:has(> #status):has(#prism-studio-chrome[data-instrument='sim']) > #prism-studio-chrome { position: absolute; }
body:has(#prism-studio-chrome[data-instrument='sim']) > p,
body:has(#prism-studio-chrome[data-instrument='sim']) > p a { color: #394736; }
@media (max-width: 700px) {
  #prism-simulator-surface .help:not([hidden]) {
    display: block;
    width: min(290px, calc(100vw - 24px));
    max-height: 45dvh;
    overflow: auto;
    z-index: 4;
  }
}
@media (max-width: 700px) and (pointer: coarse) {
  #prism-simulator-surface .telemetry {
    left: 8px; bottom: max(8px,env(safe-area-inset-bottom)); transform: none; margin: 0;
    width: calc(100% - 171px); max-width: 320px; box-sizing: border-box;
    grid-template-columns: auto minmax(0,1fr); column-gap: 6px; padding: 7px; font-size: 12px;
  }
  #prism-simulator-surface .telemetry dd { overflow-wrap: anywhere; }
  #prism-simulator-surface .pad {
    right: 8px; bottom: max(8px,env(safe-area-inset-bottom));
    grid-template-columns: repeat(3,44px); grid-template-rows: repeat(2,44px); gap: 5px;
  }
}

/* The native demos share their simulation and model distributions byte-for-byte with their owners.
   These document-level styles apply Prism typography to the integrated instrument interface. */
@font-face {
  font-family: StudioMono; src: url("/assets/fonts/geist-mono.woff2") format("woff2");
  font-weight: 100 900; font-display: swap;
}
html:has(#prism-studio-chrome[data-instrument="leaf-study"][data-application]) {
  --serif: StudioDisplay, Arial, sans-serif; --serif-text: StudioBody, Arial, sans-serif;
  --sans: StudioBody, system-ui, sans-serif; --mono: StudioMono, ui-monospace, monospace;
  --bg: #f7f8f5; --ink: #202820; --soft: #414c3e; --muted: #546050; --line: #cbd3c7; --panel: #fff;
  background: #f7f8f5; color-scheme: light;
}
body:has(#prism-studio-chrome[data-instrument="leaf-study"][data-application]) :is(.nav,.site-footer,dialog) {
  background: #fff; color: #263226;
}
body:has(#prism-studio-chrome[data-instrument="leaf-study"][data-application]) :is(.nav a,.site-footer a,dialog a) {
  color: #365b35;
}
html:has(#prism-studio-chrome[data-instrument="sim"][data-application]) {
  --display: StudioDisplay, Arial, sans-serif; --body: StudioBody, system-ui, sans-serif;
  --mono: StudioMono, ui-monospace, monospace; background: #f7f8f5;
}
body:has(#prism-studio-chrome[data-instrument="sim"][data-application]) :is(code,pre,kbd,samp) {
  font-family: var(--mono);
}
body:has(#prism-studio-chrome[data-instrument='sim'][data-application]) #viewer {
  background: #fff;
  border: 1px solid #cbd3c7;
  border-radius: 10px;
  padding: 8px;
}
body:has(#prism-studio-chrome[data-instrument='sim'][data-application]) #viewer p { color: #202620; }
body:has(#prism-studio-chrome[data-instrument='sim'][data-application]) #viewer img { max-height: calc(96dvh - 48px); }
body:has(#prism-simulator-surface) { background: #f7f8f5; }
body:has(#prism-studio-chrome[data-instrument="sim"][data-application]) #loading { background: #f7f8f5; color: #243124; }
