:root {
  color-scheme: dark;
  --bg: #09131c;
  --panel: #101f2b;
  --raised: #172b39;
  --line: #28404e;
  --text: #e5f0f2;
  --muted: #8faab7;
  --accent: #78e6cb;
  --accent-soft: #203f3e;
  --warm: #f3bf75;
  --red: #ff8996;
  --shadow: 0 24px 70px #0006;
  --mono: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    sans-serif;
  font-size: 14px;
}
.stream-group {
  color: #629d9f;
}
.stream-group.selected {
  color: var(--accent);
}
.guided-setting {
  border-bottom: 1px solid var(--line);
  padding: 12px 0;
}
.guided-setting-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 9px;
}
.guided-setting .field-help {
  margin: 7px 0;
  font-size: 10px;
}
.guided-setting input,
.guided-setting select {
  font-size: 12px;
  width: 100%;
}
.guided-setting-header input {
  width: 17px;
  flex: none;
}
.guided-setting .field-row select {
  max-width: 115px;
}
.guided-setting [disabled] {
  opacity: 0.5;
}
.reference-actions,
.result-pagination {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
  margin: 10px 0;
}
.reference-actions button {
  font-size: 10px;
  padding: 6px;
}
.result-link {
  border: 0;
  background: transparent;
  color: var(--accent);
  padding: 0;
  text-decoration: underline;
}
.result-detail .data-table td {
  white-space: normal;
  overflow-wrap: anywhere;
}
.result-profile {
  display: block;
  width: 100%;
  max-height: 300px;
  margin: 15px 0;
}
.result-pagination span {
  font: 10px var(--mono);
  color: var(--muted);
}
.account-status {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.account-status small {
  font: 9px var(--mono);
}
.account-status button {
  font-size: 11px;
}
.masthead .system-label {
  margin-left: auto;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
input,
select,
textarea {
  outline-offset: 4px;
}
button {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--raised);
  color: var(--text);
  padding: 9px 13px;
  cursor: pointer;
  transition:
    background 0.15s,
    border-color 0.15s;
}
button:hover:not(:disabled) {
  background: #244454;
  border-color: var(--accent);
}
button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #07231f;
  font-weight: 750;
}
.primary:hover:not(:disabled) {
  background: #acf3df;
  color: #07231f;
}
.danger {
  color: var(--red);
}
a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
input,
select,
textarea {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px;
  color: var(--text);
  min-width: 0;
  max-width: 100%;
}
input:focus,
textarea:focus,
select:focus {
  border-color: var(--accent);
}
input[type="checkbox"] {
  accent-color: var(--accent);
  width: 18px;
  height: 18px;
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
p {
  line-height: 1.65;
  color: var(--muted);
}
h2 {
  font-size: 21px;
}
h3 {
  font-size: 15px;
}
.eyebrow {
  font: 10px/1.5 var(--mono);
  letter-spacing: 2px;
  color: var(--accent);
  display: block;
}
.badge {
  font: 11px var(--mono);
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--muted);
}
small {
  color: var(--muted);
}
[hidden] {
  display: none !important;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}
.masthead {
  height: 76px;
  border-bottom: 1px solid var(--line);
  padding: 0 28px;
  display: flex;
  align-items: center;
  gap: 36px;
  background: #0c1821;
  position: relative;
  z-index: 5;
}
.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  color: var(--text);
  font-weight: 800;
  font-size: 20px;
  letter-spacing: 2px;
}
.brand:hover {
  text-decoration: none;
}
.brand small {
  display: block;
  font: 8px var(--mono);
  letter-spacing: 2.7px;
  margin-top: 4px;
}
.brand-mark {
  display: grid;
  place-items: center;
  border: 1px solid var(--accent);
  color: var(--accent);
  font-size: 23px;
  width: 41px;
  height: 43px;
  background: var(--accent-soft);
  clip-path: polygon(0 0, 80% 0, 100% 20%, 100% 100%, 20% 100%, 0 80%);
}
.masthead nav {
  display: flex;
  gap: 24px;
}
.masthead nav a {
  color: var(--muted);
  font-size: 12px;
}
.system-label {
  margin-left: auto;
  font: 9px var(--mono);
  color: var(--muted);
  letter-spacing: 1px;
  display: flex;
  gap: 9px;
  align-items: center;
}
.system-label i,
.status-dot,
.hero-chip i {
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 12px #78e6cb77;
}
.title-screen {
  min-height: calc(100dvh - 76px);
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  align-items: center;
  gap: 4vw;
  padding: 7vw;
  background: radial-gradient(ellipse at 80% 20%, #184f5133, transparent 60%);
}
.title-copy {
  z-index: 1;
  max-width: 640px;
}
.title-copy h1 {
  font-size: clamp(36px, 4.3vw, 70px);
  line-height: 1.1;
  letter-spacing: -3px;
  margin: 25px 0;
}
.title-copy h1 em {
  font-style: normal;
  color: var(--accent);
}
.lede {
  font-size: 17px;
  max-width: 480px;
}
.large {
  padding: 16px 20px;
  font-size: 14px;
}
.title-actions {
  display: flex;
  gap: 12px;
  margin: 34px 0 15px;
  flex-wrap: wrap;
}
.title-links {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}
.title-links button {
  background: none;
  border: 0;
  color: var(--muted);
  padding-left: 0;
  font-size: 12px;
}
.title-footer {
  display: flex;
  gap: 30px;
  border-top: 1px solid var(--line);
  margin-top: 50px;
  padding-top: 20px;
  font: 9px var(--mono);
  letter-spacing: 1.5px;
  color: var(--muted);
}
.hero-lab {
  position: relative;
  min-height: 460px;
  perspective: 800px;
}
.hero-grid {
  position: absolute;
  inset: 70px -100px -70px;
  background-image:
    linear-gradient(#34526055 1px, transparent 1px),
    linear-gradient(90deg, #34526055 1px, transparent 1px);
  background-size: 50px 50px;
  transform: rotateX(55deg) rotateZ(-25deg);
  mask-image: radial-gradient(ellipse, black 30%, transparent 70%);
}
#hero-equipment {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
#hero-equipment svg {
  width: 42%;
  filter: drop-shadow(0 22px 20px #0007);
}
#hero-equipment svg:nth-child(2) {
  transform: translateY(-60px);
  width: 50%;
}
.hero-pipe {
  position: absolute;
  left: 10%;
  right: 10%;
  height: 80px;
  top: 49%;
  border-bottom: 9px solid #72b4b3;
  border-right: 9px solid #72b4b3;
  border-radius: 15px;
  filter: drop-shadow(0 7px 0 #16333e);
}
.hero-chip {
  position: absolute;
  top: 20px;
  right: 0;
  background: var(--panel);
  padding: 12px;
  border: 1px solid var(--line);
  font: 10px var(--mono);
  letter-spacing: 2px;
}
.hero-chip i {
  margin-left: 15px;
}
.hero-caption {
  position: absolute;
  bottom: 0;
  left: 15%;
  border-left: 2px solid var(--accent);
  padding-left: 15px;
}
.hero-caption span {
  display: block;
  font: 9px var(--mono);
  letter-spacing: 2px;
  color: var(--muted);
  margin-bottom: 8px;
}
.hero-caption strong {
  font-size: 20px;
}
.orbit {
  position: absolute;
  width: 650px;
  height: 650px;
  border: 1px solid #78e6cb08;
  border-radius: 50%;
  right: -100px;
  top: 0;
  pointer-events: none;
}
.orbit-two {
  width: 850px;
  height: 850px;
  right: -200px;
  top: -100px;
}
.workspace {
  height: calc(100dvh - 76px);
  min-height: 500px;
  display: grid;
  grid-template-columns: 220px minmax(300px, 1fr) 330px;
  grid-template-rows: 82px minmax(0, 1fr) 32px;
  gap: 12px;
  padding: 0 16px;
}
.workspace-toolbar {
  grid-column: 1/-1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
}
.project-heading {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.project-heading strong {
  font-size: 16px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.project-heading small {
  font: 9px var(--mono);
}
.toolbar-actions {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.toolbar-actions button {
  font-size: 11px;
  padding: 9px 11px;
}
.panel-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.inventory {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.panel-heading {
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  min-height: 52px;
}
.panel-heading button {
  font-size: 10px;
  padding: 5px 8px;
}
.search {
  display: block;
  padding: 12px;
}
.search input {
  width: 100%;
  font-size: 12px;
}
#equipment-palette {
  overflow: auto;
  padding: 0 10px 14px;
  flex: 1;
}
.palette-category {
  font: 9px var(--mono);
  letter-spacing: 1px;
  color: var(--muted);
  padding: 14px 4px 9px;
  text-transform: uppercase;
}
.palette-item {
  display: flex;
  align-items: center;
  width: 100%;
  gap: 7px;
  padding: 4px 8px;
  margin: 3px 0;
  background: #132532;
  text-align: left;
  font-size: 11px;
}
.palette-item svg {
  width: 49px;
  height: 49px;
  flex: none;
}
.palette-item span {
  overflow-wrap: anywhere;
}
.inventory-footer {
  padding: 12px;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 8px;
}
.inventory-footer button {
  font-size: 11px;
  text-align: left;
}
.inventory-footer span {
  float: right;
  color: var(--accent);
}
.work-area {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: #0b1720;
}
.work-tabs {
  display: flex;
  align-items: center;
  padding: 0 12px;
  border-bottom: 1px solid var(--line);
  height: 48px;
  flex: none;
  background: var(--panel);
}
.work-tabs button {
  border: 0;
  border-radius: 0;
  background: none;
  font-size: 11px;
  height: 48px;
  padding: 0 16px;
  color: var(--muted);
}
.work-tabs button.active {
  color: var(--accent);
  border-bottom: 2px solid var(--accent);
}
#flowsheet-counts {
  font: 9px var(--mono);
  color: var(--muted);
  margin-left: auto;
}
.diagram-panel {
  position: relative;
  flex: 1;
  overflow: hidden;
  min-height: 0;
}
#flowsheet {
  width: 100%;
  height: 100%;
  touch-action: none;
  user-select: none;
  color: #25414c;
}
.unit-node {
  cursor: grab;
}
.unit-node:active {
  cursor: grabbing;
}
.unit-backdrop {
  fill: #142734;
  stroke: #33515e;
  stroke-width: 1;
}
.unit-node.selected .unit-backdrop {
  stroke: var(--accent);
  stroke-width: 2;
  fill: #18343d;
}
.unit-name {
  font: 700 12px var(--mono);
  fill: var(--text);
  text-anchor: middle;
}
.unit-type {
  font: 9px var(--mono);
  fill: var(--muted);
  text-anchor: middle;
}
.port {
  cursor: crosshair;
  stroke: #081a21;
  stroke-width: 3;
  fill: var(--accent);
}
.port.outlet {
  fill: var(--warm);
}
.port:hover,
.port.connecting {
  stroke: #fff;
  stroke-width: 3;
  r: 8;
}
.port-label {
  font: 8px var(--mono);
  fill: var(--muted);
  pointer-events: none;
}
.stream-path {
  fill: none;
  stroke: #629d9f;
  stroke-width: 2;
  marker-end: url(#stream-arrow);
  cursor: pointer;
}
.stream-hit {
  fill: none;
  stroke: transparent;
  stroke-width: 18;
  cursor: pointer;
}
.stream-group.selected .stream-path {
  stroke: var(--accent);
  stroke-width: 3;
}
.stream-label {
  font: 9px var(--mono);
  fill: var(--muted);
  paint-order: stroke;
  stroke: var(--bg);
  stroke-width: 4;
  cursor: pointer;
}
.boundary-label {
  font: 8px var(--mono);
  fill: var(--accent);
  text-anchor: middle;
}
.boundary-node {
  fill: #14383a;
  stroke: #4b9390;
  stroke-width: 1;
}
.preview-connection {
  stroke: var(--accent);
  stroke-dasharray: 5 5;
  fill: none;
  pointer-events: none;
}
.canvas-hud {
  position: absolute;
  bottom: 12px;
  left: 12px;
  right: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  pointer-events: none;
}
.canvas-hud > span {
  font: 9px var(--mono);
  color: var(--muted);
  background: #0b1720db;
  padding: 10px;
  border-radius: 6px;
}
.canvas-hud > div {
  display: flex;
  align-items: center;
  gap: 4px;
  pointer-events: auto;
  background: var(--panel);
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.canvas-hud button {
  padding: 5px 8px;
  font-size: 12px;
  background: none;
  border: 0;
}
#zoom-label {
  font: 9px var(--mono);
  width: 42px;
  text-align: center;
}
.empty-workspace {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  text-align: center;
  padding: 30px;
}
.empty-workspace button {
  pointer-events: auto;
}
.empty-icon {
  color: var(--accent);
  font-size: 54px;
}
.empty-workspace h2 {
  font-size: 23px;
  margin: 15px 0 10px;
}
.empty-workspace p {
  font-size: 12px;
}
.inspector {
  overflow: auto;
}
#inspector-heading {
  padding: 18px 16px 8px;
}
#inspector-heading h2 {
  font-size: 17px;
  margin-bottom: 6px;
  overflow-wrap: anywhere;
}
#inspector-heading p {
  font-size: 11px;
  margin-bottom: 8px;
}
.tabs {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  padding: 0 12px 12px;
  border-bottom: 1px solid var(--line);
}
.tabs button {
  font-size: 10px;
  padding: 7px 9px;
  background: none;
}
.tabs button.active {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: #477768;
}
#inspector-content {
  padding: 16px;
}
.workspace-footer {
  grid-column: 1/-1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font: 9px var(--mono);
  letter-spacing: 0.5px;
  color: var(--muted);
}
.workspace-footer .status-dot {
  margin-right: 8px;
}
.code-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.source-toolbar {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 12px;
  border-bottom: 1px solid var(--line);
  font: 10px var(--mono);
}
.source-toolbar span {
  margin-right: auto;
}
.source-toolbar button {
  font: 10px var(--mono);
}
#code-editor {
  resize: none;
  border: 0;
  border-radius: 0;
  flex: 1;
  min-height: 0;
  width: 100%;
  font: 12px/1.8 var(--mono);
  padding: 20px;
  tab-size: 4;
  background: #0b1720;
}
.source-note {
  font-size: 10px;
  padding: 8px 15px;
  margin: 0;
  background: var(--panel);
}
kbd {
  font: 9px var(--mono);
  opacity: 0.6;
  margin-left: 10px;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 14px;
}
.field-label {
  font-size: 11px;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.field input,
.field select,
.field textarea {
  width: 100%;
  font-size: 12px;
}
.field textarea {
  min-height: 64px;
  resize: vertical;
}
.field-row {
  display: flex;
  gap: 7px;
  align-items: center;
  min-width: 0;
}
.field-row > * {
  min-width: 0;
}
.field-row input,
.field-row select {
  flex: 1;
}
.field-row button {
  padding: 7px 9px;
  font-size: 10px;
  flex: none;
}
.check-field {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  margin: 15px 0;
}
.field-help {
  font-size: 10px;
  line-height: 1.5;
  color: var(--muted);
}
.structured-group {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 14px;
  min-width: 0;
}
.structured-group > summary {
  cursor: pointer;
  font: 11px var(--mono);
  color: var(--accent);
  margin-bottom: 12px;
  overflow-wrap: anywhere;
}
.structured-group .structured-group {
  background: #09131c44;
}
.array-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-bottom: 10px;
}
.array-header span {
  font: 10px var(--mono);
  color: var(--muted);
}
.array-header button {
  font-size: 10px;
  padding: 5px 8px;
}
.add-field {
  display: flex;
  gap: 6px;
  margin: 10px 0;
}
.add-field input,
.add-field select {
  flex: 1;
  font-size: 10px;
  padding: 8px;
}
.add-field button {
  font-size: 10px;
  padding: 7px;
}
.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  border-top: 1px solid var(--line);
  padding-top: 15px;
  margin-top: 20px;
}
.form-notice {
  padding: 12px;
  background: #234139;
  border: 1px solid #406956;
  border-radius: 7px;
  font-size: 11px;
  line-height: 1.65;
  color: #bbddcd;
}
.error-notice {
  background: #411f2c;
  border-color: #6c3c48;
  color: #ffb6be;
  white-space: pre-wrap;
}
.advanced-note {
  font: 10px/1.7 var(--mono);
  color: var(--muted);
}
.overview-stat {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}
.overview-stat strong {
  color: var(--accent);
}
.results-panel {
  flex: 1;
  overflow: auto;
  padding: 24px;
}
.results-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.results-heading h2 {
  margin-bottom: 15px;
}
#run-status {
  padding: 14px;
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 8px;
  font: 12px/1.6 var(--mono);
  white-space: pre-wrap;
}
#run-progress {
  font: 10px/1.8 var(--mono);
  color: var(--muted);
  max-height: 180px;
  overflow: auto;
  margin: 15px 0;
  white-space: pre-wrap;
}
.metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 20px 0;
}
.metric {
  border: 1px solid var(--line);
  padding: 15px;
  background: var(--panel);
  border-radius: 8px;
}
.metric span {
  display: block;
  font: 9px var(--mono);
  color: var(--muted);
  margin-bottom: 9px;
}
.metric strong {
  font: 21px var(--mono);
  color: var(--accent);
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  font: 11px var(--mono);
}
.data-table th,
.data-table td {
  padding: 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}
.data-table th {
  color: var(--muted);
  font-weight: 400;
}
.table-scroll {
  overflow: auto;
  margin: 15px 0;
}
.result-detail {
  border: 1px solid var(--line);
  padding: 14px;
  border-radius: 8px;
  margin: 10px 0;
  background: var(--panel);
}
.result-detail summary {
  cursor: pointer;
  font-size: 12px;
  color: var(--accent);
}
.result-detail pre {
  font: 11px/1.8 var(--mono);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: var(--muted);
}
.settings-screen {
  max-width: 1100px;
  margin: 0 auto;
  padding: 50px 30px;
}
.page-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 30px;
}
.page-heading h1 {
  font-size: 34px;
  letter-spacing: -1px;
  margin-bottom: 12px;
}
.settings-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 20px;
}
.vertical-tabs {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.vertical-tabs button {
  text-align: left;
  padding: 14px;
}
.vertical-tabs button.active {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}
#settings-content {
  padding: 30px;
}
dialog {
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0;
  box-shadow: var(--shadow);
  width: min(920px, 94vw);
  max-height: 88dvh;
}
dialog::backdrop {
  background: #020a10be;
  backdrop-filter: blur(8px);
}
.dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 3;
  background: var(--panel);
}
.dialog-header h2 {
  margin: 0;
  font-size: 19px;
}
.dialog-header button {
  border: 0;
  background: none;
}
#modal-content {
  padding: 24px;
}
.dialog-layout {
  display: grid;
  grid-template-columns: 165px minmax(0, 1fr);
  gap: 24px;
}
.dialog-form {
  min-width: 0;
}
.example-list {
  display: grid;
  gap: 10px;
  max-height: 56dvh;
  overflow: auto;
  margin-top: 15px;
}
.example-item {
  text-align: left;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.example-item strong {
  display: block;
  font-size: 13px;
}
.example-item small {
  display: block;
  font: 10px var(--mono);
  margin-top: 7px;
}
#notifications {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: min(600px, 90vw);
}
.toast {
  background: #193a39;
  border: 1px solid #578378;
  color: var(--text);
  padding: 13px 20px;
  border-radius: 8px;
  box-shadow: var(--shadow);
  font-size: 12px;
}
.toast.error {
  background: #411f2c;
  border-color: #8c4b58;
}
.atlas-screen {
  padding: 32px;
  max-width: 1500px;
  margin: auto;
}
.atlas-layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 20px;
}
.atlas-controls {
  padding: 24px;
}
.atlas-chart {
  padding: 24px;
  min-width: 0;
}
.chart-frame {
  min-height: 420px;
  display: grid;
  place-items: center;
  background: #0b1720;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.chart-frame svg {
  width: 100%;
  height: auto;
  max-height: 600px;
}
.chart-line {
  fill: none;
  stroke-width: 2;
}
.chart-axis {
  stroke: #577681;
  stroke-width: 1;
}
.chart-grid {
  stroke: #29434e;
  stroke-width: 0.6;
}
.chart-text {
  fill: var(--muted);
  font: 11px var(--mono);
}
.chart-legend {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  padding: 16px 0;
  font-size: 11px;
  color: var(--muted);
}
.legend-dot {
  width: 18px;
  height: 3px;
  display: inline-block;
  vertical-align: middle;
  margin-right: 7px;
}
.loading-pulse {
  animation: pulse 1.5s ease-in-out infinite;
}
@keyframes pulse {
  50% {
    opacity: 0.4;
  }
}
.equipment-art .metal {
  fill: #739aa9;
  stroke: #bed2d6;
  stroke-width: 1.3;
}
.equipment-art .metal-dark {
  fill: #294c60;
  stroke: #7198aa;
  stroke-width: 1.3;
}
.equipment-art .glass {
  fill: #245761;
  stroke: #7bc7c5;
  stroke-width: 1.2;
}
.equipment-art .liquid {
  fill: #69c6b5;
  opacity: 0.65;
}
.equipment-art .detail {
  fill: none;
  stroke: #b5d4dc;
  stroke-width: 1.4;
}
.equipment-art .heat {
  fill: #f3bf75;
  stroke: #e58e64;
  stroke-width: 1;
}
.equipment-art .cool {
  fill: #6bc9e5;
  stroke: #beeaff;
  stroke-width: 1;
}
.equipment-art .support {
  fill: #284758;
  stroke: #5a7c8c;
  stroke-width: 1;
}
.equipment-art .pipe {
  fill: none;
  stroke: #7aa5b2;
  stroke-width: 7;
  stroke-linejoin: round;
}
.equipment-art .highlight {
  fill: none;
  stroke: #e5f9f5;
  stroke-width: 2;
  opacity: 0.5;
}
body[data-grid="off"] #grid-surface {
  display: none;
}
body[data-theme="light"] {
  color-scheme: light;
  --bg: #e4edf0;
  --panel: #f4f8fa;
  --raised: #dce8ed;
  --line: #b7cbd3;
  --text: #16313d;
  --muted: #516e7c;
  --accent: #146f61;
  --accent-soft: #cae8df;
  --warm: #8e601a;
  --red: #ac364b;
}
body[data-theme="light"] .masthead {
  background: #f4f8fa;
}
body[data-theme="light"] .work-area,
body[data-theme="light"] #code-editor {
  background: #eaf1f4;
}
body[data-theme="light"] .palette-item {
  background: #e3eef2;
}
body[data-theme="light"] .unit-backdrop {
  fill: #d5e5ec;
}
body[data-motion="off"] * {
  animation: none !important;
  transition: none !important;
}
@media (min-width: 1800px) {
  .workspace {
    grid-template-columns: 255px minmax(300px, 1fr) 380px;
  }
}
@media (max-width: 1200px) {
  .workspace {
    grid-template-columns: 180px minmax(250px, 1fr) 280px;
    gap: 8px;
    padding: 0 10px;
  }
  .toolbar-actions {
    gap: 4px;
  }
  .toolbar-actions button {
    padding: 8px;
    font-size: 10px;
  }
  .canvas-hud > span {
    max-width: 160px;
    line-height: 1.7;
  }
  .system-label {
    display: none;
  }
}
@media (max-width: 900px) {
  .masthead {
    padding: 0 16px;
    height: 66px;
    gap: 20px;
  }
  .masthead nav {
    gap: 15px;
  }
  .workspace {
    height: auto;
    min-height: calc(100dvh - 66px);
    grid-template-columns: 160px minmax(0, 1fr);
    grid-template-rows: auto 65dvh auto 32px;
  }
  .workspace-toolbar {
    padding: 15px 0;
    align-items: flex-start;
    flex-direction: column;
  }
  .toolbar-actions {
    justify-content: flex-start;
  }
  .inspector {
    grid-column: 1/-1;
    max-height: 60dvh;
  }
  .inventory {
    grid-column: 1;
    grid-row: 2;
  }
  .work-area {
    grid-column: 2;
    grid-row: 2;
  }
  .title-screen {
    grid-template-columns: 1fr;
    padding: 50px 7vw;
  }
  .hero-lab {
    min-height: 350px;
    max-width: 600px;
    width: 100%;
    margin: auto;
  }
  .title-copy {
    margin: auto;
    max-width: 600px;
  }
  .title-copy h1 {
    letter-spacing: -1.5px;
  }
  .atlas-screen {
    padding: 20px;
  }
  .atlas-layout {
    grid-template-columns: 240px 1fr;
  }
}
@media (max-width: 600px) {
  .brand {
    font-size: 16px;
  }
  .brand small {
    font-size: 6px;
  }
  .brand-mark {
    width: 30px;
    height: 33px;
  }
  .masthead {
    gap: 14px;
  }
  .masthead nav {
    gap: 10px;
  }
  .masthead nav a {
    font-size: 10px;
  }
  .workspace {
    grid-template-columns: 1fr;
    grid-template-rows: auto 170px 65dvh auto 32px;
  }
  .inventory {
    grid-column: 1;
    grid-row: 2;
  }
  .inventory .panel-heading {
    display: none;
  }
  .inventory .search {
    padding: 8px;
  }
  #equipment-palette {
    display: flex;
    gap: 5px;
    padding: 0 8px 8px;
    overflow: auto;
  }
  .palette-category {
    display: none;
  }
  .palette-item {
    width: 120px;
    flex: none;
  }
  .inventory-footer {
    padding: 5px 8px;
    display: flex;
    gap: 8px;
  }
  .inventory-footer button {
    padding: 5px 9px;
  }
  .work-area {
    grid-column: 1;
    grid-row: 3;
  }
  .inspector {
    grid-row: 4;
  }
  .workspace-footer > span:last-child {
    display: none;
  }
  .work-tabs {
    padding: 0 4px;
  }
  .work-tabs button {
    padding: 0 12px;
  }
  #flowsheet-counts,
  .canvas-hud > span {
    display: none;
  }
  .canvas-hud {
    justify-content: flex-end;
  }
  .settings-screen {
    padding: 25px 16px;
  }
  .settings-layout,
  .dialog-layout,
  .atlas-layout {
    grid-template-columns: 1fr;
  }
  .vertical-tabs {
    flex-direction: row;
    flex-wrap: wrap;
  }
  .vertical-tabs button {
    font-size: 11px;
    padding: 9px;
  }
  .page-heading {
    align-items: flex-start;
    flex-direction: column;
  }
  .page-heading h1 {
    font-size: 29px;
  }
  #settings-content {
    padding: 20px;
  }
  .atlas-controls,
  .atlas-chart {
    padding: 16px;
  }
  .atlas-screen {
    padding: 16px;
  }
  .title-footer {
    gap: 15px;
    font-size: 8px;
  }
  .title-copy h1 {
    font-size: 38px;
  }
  .hero-lab {
    min-height: 300px;
  }
  .source-toolbar {
    flex-wrap: wrap;
  }
  .source-toolbar span {
    width: 100%;
  }
  .metrics {
    grid-template-columns: 1fr;
  }
  .results-panel {
    padding: 16px;
  }
  .results-heading {
    align-items: flex-start;
    flex-direction: column;
  }
  .chart-frame {
    min-height: 220px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}
@media (max-width: 900px) {
  .masthead {
    height: auto;
    min-height: 66px;
    flex-wrap: wrap;
    padding-top: 10px;
    padding-bottom: 10px;
    gap: 12px;
  }
  .account-status {
    gap: 6px;
  }
  .account-status small {
    font-size: 8px;
  }
}
@media (max-width: 600px) {
  .account-status {
    width: 100%;
    justify-content: space-between;
  }
  .workspace {
    min-height: calc(100dvh - 108px);
  }
  .workspace-toolbar .project-heading {
    max-width: 100%;
  }
}
