@layer demo {
:root {
  color-scheme: light;
  --bg: #f4f6f5;
  --card-bg: #ffffff;
  --border: #dce2df;
  --text-main: #24332d;
  --muted: #68766f;
  --moss: #71803e;
  --green: #188669;
  --danger: #ba4248;
  --blue: #317ba2;
  --grid: #e9eeeb;
}
* { box-sizing: border-box; letter-spacing: 0; }
body { margin: 0; background: var(--bg); color: var(--text-main); font: 14px/1.5 "Segoe UI", Arial, sans-serif; }
body[data-theme=dark] { color-scheme: dark; --bg: #171d1a; --card-bg: #222b26; --border: #3b4940; --text-main: #e7eee9; --muted: #acbab0; --green: #66c7a1; --danger: #f18c91; --blue: #82bddb; --grid: #354239; }
button, input, select { font: inherit; }
button, a, select, input, summary { touch-action: manipulation; }
button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 36px; padding: 7px 12px; background: transparent; color: inherit; border: 1px solid var(--border); border-radius: 4px; cursor: pointer; transition: border-color .2s, background .2s; }
button:hover { border-color: var(--moss); }
button:disabled { opacity: .45; cursor: not-allowed; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
svg { width: 18px; height: 18px; stroke-width: 1.5; flex-shrink: 0; }
a { color: inherit; text-decoration: none; }
input, select { min-width: 0; width: 100%; border: 1px solid var(--border); background: var(--card-bg); color: var(--text-main); border-radius: 4px; padding: 9px; }
input[type=checkbox] { width: 17px; height: 17px; accent-color: var(--green); margin: 0; flex-shrink: 0; }
input[type=number], .readout, .kpi-value, .chart-footer, .metrics { font-variant-numeric: tabular-nums; }
.icon-button { width: 36px; height: 36px; padding: 7px; flex-shrink: 0; }
.topbar { height: 64px; padding: 0 24px; display: flex; align-items: center; gap: 16px; background: #202923; color: #edf2ee; position: sticky; top: 0; z-index: 20; }
.topbar button { border-color: #515f55; }
.brand { font-size: 19px; font-weight: 650; white-space: nowrap; }
.brand span { font-weight: 400; color: #bfcbc2; }
.demo-tag { font-size: 10px; color: #dce3c9; border-left: 1px solid #55604e; padding-left: 16px; }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 18px; }
.header-actions a { font-size: 13px; }
.workspace { display: grid; grid-template-columns: 280px minmax(0, 1fr); max-width: 1720px; margin: auto; }
.workspace.menu-closed { grid-template-columns: 1fr; }
.menu-closed aside { display: none; }
aside { padding: 24px 20px; background: var(--card-bg); border-right: 1px solid var(--border); position: sticky; top: 64px; align-self: start; height: calc(100vh - 64px); overflow-y: auto; scrollbar-width: thin; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 24px; line-height: 1.3; font-weight: 600; margin-top: 4px; overflow-wrap: anywhere; }
h2 { font-size: 15px; font-weight: 650; }
h3 { font-size: 11px; font-weight: 600; color: var(--muted); margin: 18px 0 10px; }
.aside-heading { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.field-label { display: block; font-size: 11px; color: var(--muted); margin-bottom: 8px; }
#preset { font-size: 12px; height: 42px; margin-bottom: 22px; }
.config-group { border-top: 1px solid var(--border); padding: 0 0 8px; }
summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; min-height: 52px; font-size: 13px; font-weight: 600; }
summary::-webkit-details-marker { display: none; }
summary > svg:last-child { margin-left: auto; width: 14px; transition: transform .2s; }
details[open] > summary > svg:last-child { transform: rotate(180deg); }
summary > svg:first-child { color: var(--muted); }
#sensor-count { font-size: 11px; color: var(--muted); font-weight: 400; }
.module-option { display: flex; gap: 9px; align-items: center; min-height: 42px; padding: 7px 0; border-bottom: 1px solid var(--grid); cursor: pointer; font-size: 12px; }
.module-option span { flex: 1; }
.module-option small { display: block; color: var(--muted); font-size: 11px; margin-top: 3px; }
.module-option svg { color: var(--muted); width: 16px; }
.aside-footer { padding-top: 20px; border-top: 1px solid var(--border); }
.aside-footer button { width: 100%; font-size: 12px; color: var(--green); border-color: var(--green); }
#product-settings .field-label { margin-top: 15px; }
#product-settings select { font-size: 12px; }
#specialty { margin: 10px 0; }
.setting-note { font-size: 11px; color: var(--muted); line-height: 1.6; }
#syringe-capacity { margin-top: 6px; }
.mount-option { display: grid; grid-template-columns: 82px minmax(0,1fr); gap: 8px; align-items: center; margin-bottom: 9px; font-size: 12px; }
.mount-option select { font-size: 11px; padding: 7px 5px; }
.mount-option span { overflow-wrap: anywhere; }
main { min-width: 0; padding: 26px 30px; }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 24px; }
.page-heading > div:first-child { min-width: 0; }
.eyebrow { font-size: 10px; color: var(--muted); }
.simulation-controls { display: flex; align-items: center; gap: 9px; font-size: 12px; flex-shrink: 0; }
.simulation-controls select { width: 145px; font-size: 12px; }
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(140px,1fr)); gap: 10px; margin-bottom: 24px; }
.kpi { min-width: 0; border-radius: 5px; padding: 14px 16px; background: var(--card-bg); align-items: flex-start; flex-direction: column; gap: 8px; text-align: left; min-height: 96px; border: 1px solid var(--border); }
.kpi[aria-pressed=true] { box-shadow: inset 0 -2px var(--metric-color); }
.kpi-label { display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: 12px; }
.kpi-label svg { color: var(--metric-color); width: 17px; }
.kpi-value { font-size: 26px; line-height: 1.2; font-weight: 600; white-space: nowrap; }
.kpi-value small { font-size: 12px; color: var(--muted); font-weight: 400; margin-left: 6px; }
.bench-grid { display: grid; grid-template-columns: minmax(0,1fr) 245px; background: var(--card-bg); margin-bottom: 26px; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.process-section, .assembly { min-width: 0; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--border); min-height: 60px; }
.section-heading h2 span { font-size: 12px; color: var(--muted); font-weight: 400; margin-left: 8px; }
.section-heading button { font-size: 11px; }
.section-heading > .setting-note { margin-left: auto; font-size: 9px; }
#circuit { display: block; width: 100%; height: auto; aspect-ratio: 1000/410; }
.circuit-points { display: flex; flex-wrap: wrap; gap: 0; padding: 0 18px 16px; }
.circuit-points button { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; min-width: 140px; flex: 1; border: 0; border-left: 2px solid var(--metric-color); border-radius: 0; padding: 4px 10px; margin-top: 10px; font-size: 12px; }
.circuit-points button span { font-size: 11px; color: var(--muted); }
.circuit-points button strong { display: none; }
.circuit-points button:hover { background: var(--bg); }
.assembly { border-left: 1px solid var(--border); align-self: stretch; }
#product { display: block; width: 100%; height: auto; aspect-ratio: 720/650; background: #fff; }
.assembly-caption { font-size: 10px; color: var(--muted); padding: 4px 16px 12px; text-align: center; }
.parts { padding: 0 16px 14px; display: flex; gap: 5px 10px; flex-wrap: wrap; }
.parts span { font-size: 11px; color: var(--muted); }
.parts span:not(:last-child)::after { content: ' /'; padding-left: 6px; color: var(--border); }
#pump-section { margin-bottom: 32px; }
#pump-section > .section-heading { padding: 0 0 14px; border-bottom: 0; }
.section-heading h2 .product-title { font-size: 16px; color: var(--text-main); font-weight: 600; margin-left: 0; }
.section-heading h2 .product-title + span { display: block; margin: 2px 0 0; }
.pump-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
.pump { border: 1px solid var(--border); border-radius: 6px; background: var(--card-bg); overflow: hidden; }
.pump .section-heading { min-height: 44px; padding: 10px 16px; }
.pump .section-heading h2 { font-size: 12px; }
.mode { font-size: 11px; font-weight: 600; color: var(--muted); }
.mode[data-mode=INFUSING] { color: var(--green); }
.mode[data-mode=FILLING] { color: var(--blue); }
.pump-body { padding: 16px; }
.readout { font-size: 28px; font-weight: 600; display: flex; align-items: baseline; gap: 7px; }
.readout small { font-size: 12px; color: var(--muted); font-weight: 400; }
.machine { display: grid; grid-template-columns: 32px minmax(0,1fr) 24px; align-items: center; height: 62px; padding: 8px 0; }
.actuator { height: 32px; border: 1px solid #728379; background: repeating-linear-gradient(90deg,#45554b 0 6px,#8b9a90 6px 7px); border-radius: 3px 0 0 3px; }
.barrel { position: relative; height: 34px; border: 1px solid #6c7d73; border-radius: 2px; background: repeating-linear-gradient(90deg,transparent 0 calc(10% - 1px),#8d9d9240 calc(10% - 1px) 10%); overflow: hidden; }
.fluid { position: absolute; right: 0; top: 0; bottom: 0; width: 50%; background: #48b8a035; transition: width .1s linear; }
.plunger { position: absolute; top: 0; bottom: 0; width: 6px; background: #798e80; border: 1px solid #dbe3dd; left: 50%; transition: left .1s linear; }
.outlet { height: 12px; border: 1px solid #6c7d73; border-left: 0; border-radius: 0 3px 3px 0; }
.scale { display: flex; justify-content: space-between; margin: 0 24px 12px 32px; font-size: 10px; color: var(--muted); }
.metrics { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; padding: 10px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.metrics span { display: block; font-size: 11px; color: var(--muted); }
.metrics b { display: block; font-size: 16px; font-weight: 600; margin-top: 3px; }
.program { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 14px 0; }
.program label { font-size: 10px; color: var(--muted); }
.program input { margin-top: 5px; font-size: 14px; padding: 8px; }
.motion { display: grid; grid-template-columns: 1fr .85fr 1fr; gap: 8px; }
.motion button { font-size: 11px; min-height: 38px; }
.fill { color: var(--blue); border-color: #317ba24d; background: #317ba208; }
.infuse { color: var(--green); border-color: #18866955; background: #1886690d; }
.danger { color: var(--danger); border-color: #ba42484d; background: #ba424808; }
.danger:hover { border-color: var(--danger); }
.fast { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: 11px; color: var(--muted); }
.lower-grid { display: block; border-top: 1px solid var(--border); }
.telemetry { min-width: 0; background: var(--card-bg); }
.chart-toolbar { display: flex; align-items: center; gap: 12px; padding: 14px 18px; font-size: 12px; color: var(--muted); }
.chart-toolbar select { max-width: 250px; font-size: 12px; }
.chart-toolbar > span { margin-left: auto; }
.chart-wrap { position: relative; height: 250px; padding: 0 18px; }
.chart-wrap p { text-align: center; padding: 70px 10px; color: var(--muted); }
.chart-footer { display: flex; justify-content: space-between; gap: 10px; padding: 12px 18px; color: var(--muted); font-size: 11px; border-top: 1px solid var(--border); }
.event-section { margin-top: 20px; border-top: 1px solid var(--border); }
.event-section > summary { color: var(--muted); font-size: 12px; font-weight: 400; }
#events { margin: 0; padding: 0 18px; list-style: none; max-height: 170px; overflow: auto; }
#events li { padding: 10px 0; border-bottom: 1px solid var(--border); display: flex; gap: 18px; font-size: 12px; }
#events time { color: var(--muted); font-variant-numeric: tabular-nums; flex-shrink: 0; }
footer { display: flex; justify-content: space-between; gap: 14px; padding: 12px 0 0; color: var(--muted); font-size: 10px; }
#toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: #202923; color: white; border-radius: 4px; padding: 12px 18px; max-width: calc(100% - 32px); z-index: 30; font-size: 12px; display: none; }
#toast.visible { display: block; }
#telemetry-title { scroll-margin-top: 95px; }
[hidden] { display: none !important; }
@media (max-width:1200px) {
  .workspace { grid-template-columns: 255px minmax(0,1fr); }
  main { padding: 22px; }
  .bench-grid { grid-template-columns: minmax(0,1fr) 210px; }
  .page-heading { align-items: flex-start; flex-direction: column; gap: 14px; }
  .pump-grid { grid-template-columns: 1fr; }
}
@media (max-width:950px) {
  .bench-grid { grid-template-columns: minmax(0,1fr); }
  .assembly { display: grid; grid-template-columns: 170px 1fr; border-left: 0; border-top: 1px solid var(--border); }
  .assembly .section-heading { grid-column: 1 / -1; }
  #product { grid-row: 2 / 4; }
  .assembly-caption { align-self: end; text-align: left; }
  .parts { align-self: start; }
}
@media (max-width:700px) {
  .topbar { height: 58px; padding: 0 12px; gap: 10px; }
  .brand { font-size: 16px; }
  .demo-tag { position: absolute; top: 58px; left: 0; width: 100%; height: 23px; text-align: center; background: #e4eadc; color: #48563b; border: 0; padding: 4px; font-size: 9px; }
  .header-actions { gap: 10px; }
  .workspace { grid-template-columns: 1fr; padding-top: 23px; }
  aside { position: static; height: auto; padding: 20px; border-right: 0; border-bottom: 1px solid var(--border); }
  main { padding: 22px 14px; }
  h1 { font-size: 22px; }
  .page-heading { gap: 14px; margin-bottom: 20px; }
  .kpi-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; margin-bottom: 18px; }
  .kpi { padding: 13px; min-height: 90px; }
  .kpi-label { font-size: 11px; }
  .kpi-value { font-size: 25px; }
  .simulation-controls { width: 100%; }
  .simulation-controls select { flex: 1; max-width: 190px; }
  .section-heading { padding: 12px 14px; min-height: 52px; }
  .section-heading > .setting-note { font-size: 8px; }
  .circuit-points { padding: 0 14px 14px; }
  .circuit-points button { min-width: 125px; font-size: 11px; }
  .circuit-points button span { font-size: 10px; }
  .assembly { grid-template-columns: 150px 1fr; }
  .parts span { font-size: 10px; }
  .assembly-caption { font-size: 10px; }
  #pump-section { margin-bottom: 24px; }
  .pump-grid { gap: 14px; }
  .pump-body { padding: 14px; }
  .motion { gap: 6px; }
  .motion button { font-size: 10px; padding: 6px; min-height: 42px; }
  .program { gap: 10px; }
  .metrics span { font-size: 10px; }
  .fast { font-size: 10px; }
  .chart-wrap { height: 230px; padding: 0 10px; }
  .chart-toolbar { padding: 12px; font-size: 11px; }
  .chart-footer { padding: 12px; font-size: 10px; }
  footer { flex-direction: column; font-size: 9px; }
  #events li { gap: 10px; font-size: 11px; }
}
@media (prefers-reduced-motion:reduce) { * { transition: none !important; } }
}
