:root {
  --red-900: #6f0017;
  --red-800: #8e011f;
  --red-600: #bd0129;
  --ink: #171717;
  --muted: #666a72;
  --line: #dfe3e8;
  --line-strong: #b9c1ca;
  --paper: #ffffff;
  --canvas: #f7f8fa;
  --topbar-bg: rgba(255, 255, 255, .96);
  --panel-bg: rgba(255, 255, 255, .96);
  --panel-head-bg: #fbfcfd;
  --soft-bg: #f7f8fa;
  --grid-line: #edf0f4;
  --chart-bg: #ffffff;
  --chart-grid: #edf0f4;
  --chart-axis: #cbd3dd;
  --chart-text: #69717d;
  --chart-label: #303744;
  --cream: #fff3c6;
  --green: #69A257;
  --danger: #c33131;
  --shadow: 0 18px 50px rgba(18, 24, 33, 0.16);
  --sans: "Be Vietnam Pro", "Segoe UI", system-ui, -apple-system, sans-serif;
  --serif: Merriweather, Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; }
body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--paper);
  -webkit-user-select: none;
  user-select: none;
}
button, input, select, textarea { font: inherit; }
button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--paper);
  color: var(--ink);
  font-size: 12px;
  font-weight: 760;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease, transform .12s ease;
}
button:hover { border-color: var(--red-600); }
button:active { transform: translateY(1px); }
button:disabled { opacity: .45; cursor: not-allowed; }
input, select, textarea {
  width: 100%;
  min-height: 32px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--paper);
  color: var(--ink);
  font-size: 12px;
  -webkit-user-select: text;
  user-select: text;
}
[contenteditable="true"] {
  -webkit-user-select: text;
  user-select: text;
}
input[type="range"] { padding: 0; accent-color: var(--red-600); }
label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 820;
  letter-spacing: .055em;
  text-transform: uppercase;
}

.app {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  width: 100vw;
  height: 100vh;
  min-width: 1060px;
  min-height: 680px;
}
.topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--topbar-bg);
  z-index: 20;
}
.brand-title {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-width: 0;
}
.brand-title img {
  width: auto;
  height: 28px;
  flex: none;
}
.app-title {
  margin: 0;
  color: var(--red-600);
  font-family: var(--serif);
  font-size: 22px;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
}
.header-actions {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0;
  border: 0;
  background: transparent;
}
.primary-actions { justify-content: flex-start; }
.utility-actions { justify-content: flex-end; }
.primary-actions button { min-width: 82px; }
.btn-primary { background: var(--red-600); border-color: var(--red-600); color: white; }
.btn-danger { color: var(--danger); border-color: rgba(195,49,49,.38); }
.btn-quiet { background: var(--soft-bg); }
.icon-btn { width: 36px; padding: 0; }

.tabbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 6px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-head-bg);
  z-index: 19;
}
.tab-list,
.tab-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.tab-list {
  overflow-x: auto;
  scrollbar-width: thin;
}
.diagram-tab {
  max-width: 220px;
  min-height: 30px;
  padding: 0 12px;
  overflow: hidden;
  border-color: transparent;
  background: transparent;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.diagram-tab.active {
  border-color: rgba(189, 1, 41, .36);
  background: var(--paper);
  color: var(--red-600);
  box-shadow: 0 1px 7px rgba(16,24,40,.10);
}
.tab-actions button { min-height: 30px; }
.readouts, .sim-readouts { display: flex; align-items: center; gap: 8px; justify-content: flex-end; }
.sim-readouts { justify-content: stretch; margin-bottom: 12px; }
.sim-readouts .metric { flex: 1; min-width: 0; }
.metric {
  min-width: 82px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--soft-bg);
  color: var(--muted);
  font-size: 9px;
  font-weight: 820;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.metric strong { display: block; margin-top: 1px; color: var(--ink); font-size: 18px; line-height: 1; letter-spacing: 0; text-transform: none; }

.workspace {
  position: relative;
  min-height: 0;
  overflow: hidden;
  background:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px),
    var(--canvas);
  background-size: 36px 36px;
}
#diagram { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; }
#diagram.dragging { cursor: grabbing; }
.status-banner {
  position: static;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: none;
  margin: 12px 0;
  padding: 10px 12px;
  border-left: 4px solid var(--red-600);
  background: var(--cream);
  box-shadow: 0 10px 26px rgba(20, 20, 20, .12);
  color: #3d3010;
  font-size: 12px;
  line-height: 1.35;
}
.status-banner strong { color: var(--red-800); }
.status-banner button { min-height: 28px; padding: 0 10px; white-space: nowrap; }
.status-banner[data-state="running"] {
  border-left-color: var(--green);
  background: #eaf8f1;
  color: #123c2a;
}
.status-banner[data-state="running"] strong { color: #047857; }
.status-banner[data-state="paused"] {
  border-left-color: #FF9200;
  background: #fff3c6;
  color: #3d3010;
}
.status-banner[data-state="stopped"] {
  border-left-color: #1D1D1D;
  background: #f1f5f9;
  color: #334155;
}

.floating-panel {
  position: absolute;
  z-index: 8;
  width: 430px;
  max-height: calc(100vh - 118px);
  border: 1px solid rgba(148, 163, 184, .52);
  border-radius: 8px;
  background: var(--panel-bg);
  box-shadow: var(--shadow);
  overflow: hidden;
  backdrop-filter: blur(10px);
}
.floating-panel.hidden { display: none; }
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-head-bg);
  user-select: none;
}
.panel-head h2 { margin: 0; color: var(--red-600); font-family: var(--serif); font-size: 18px; line-height: 1; }
.panel-head span { color: var(--muted); font-size: 10px; font-weight: 760; letter-spacing: .05em; text-transform: uppercase; }
.panel-body { padding: 12px; overflow: auto; max-height: calc(100vh - 176px); }
.simulator-panel { left: 18px; top: 18px; width: 370px; max-height: calc(100vh - 104px); }
.simulator-panel .panel-body { max-height: calc(100vh - 158px); }
.editor-panel { right: 18px; top: 18px; width: 430px; max-height: calc(100vh - 104px); }
.editor-panel .panel-body { max-height: calc(100vh - 158px); }

.run-state {
  margin-bottom: 12px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--soft-bg);
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .065em;
  text-align: center;
  text-transform: uppercase;
}
.run-state[data-state="running"] {
  border-color: rgba(22, 139, 90, .38);
  background: #dcfce7;
  color: #047857;
  box-shadow: 0 0 0 3px rgba(22, 139, 90, .10);
}
.run-state[data-state="paused"] {
  border-color: rgba(245, 158, 11, .48);
  background: #fef3c7;
  color: #92400e;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, .12);
}
.run-state[data-state="stopped"] {
  border-color: rgba(100, 116, 139, .42);
  background: #f1f5f9;
  color: #475569;
}

.sim-controls { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; align-items: center; }
.step-toggle {
  grid-column: 1 / -1;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 28px;
}
.step-toggle input { width: auto; min-height: auto; accent-color: var(--red-600); }
.speed-row { margin-top: 10px; }
.speed-row label { gap: 8px; }
.step-row {
  display: none;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}
.step-row span {
  min-width: 72px;
  text-align: center;
  color: var(--muted);
  font-size: 11px;
  font-weight: 860;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.behavior-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin-bottom: 10px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft-bg);
}
.behavior-tabs button { min-height: 30px; border: 0; background: transparent; }
.behavior-tabs button.active { background: var(--paper); color: var(--red-600); box-shadow: 0 1px 7px rgba(16,24,40,.12); }
.behavior-section.hidden { display: none; }
.chart-wrap, .step-table-wrap {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--chart-bg);
  overflow: hidden;
}
.behavior-pane { display: none; }
.behavior-pane.active { display: block; }
.chart-wrap { padding: 8px; cursor: zoom-in; }
#historyChart { display: block; width: 100%; height: auto; }
.lightbox-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: none;
  background: rgba(15, 23, 42, .25);
  backdrop-filter: blur(2px);
}
body.chart-expanded .lightbox-backdrop { display: block; }
.chart-lightbox {
  position: fixed;
  left: 36px;
  right: 36px;
  top: 70px;
  bottom: 36px;
  z-index: 41;
  display: none;
  padding: 18px;
  border: 1px solid rgba(148, 163, 184, .62);
  border-radius: 8px;
  background: var(--chart-bg);
  box-shadow: 0 28px 80px rgba(15, 23, 42, .30);
}
.chart-lightbox.open { display: block; }
#expandedHistoryChart { display: block; width: 100%; height: 100%; }
.chart-close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 1;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
}
.step-table-wrap { display: none; flex-direction: column; height: 260px; }
.step-table-wrap.behavior-pane.active { display: flex; }
.step-table-title {
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
  color: var(--red-600);
  font-size: 11px;
  font-weight: 860;
  letter-spacing: .045em;
  text-transform: uppercase;
}
.step-table-scroll { overflow: auto; }
.step-table { width: 100%; min-width: 680px; border-collapse: collapse; font-size: 11px; }
.step-table th, .step-table td {
  padding: 7px 5px;
  border-bottom: 1px solid var(--grid-line);
  text-align: left;
  vertical-align: top;
  white-space: normal;
}
.step-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--soft-bg);
  color: var(--muted);
  font-size: 9px;
  font-weight: 860;
  letter-spacing: .055em;
  text-transform: uppercase;
}
.step-table td.link-event { min-width: 116px; overflow-wrap: anywhere; }
.step-table .empty-row { color: var(--muted); white-space: normal; line-height: 1.4; }

.field-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr) minmax(0, 1.15fr); gap: 10px; }
.field-grid .full, .field-grid .field-full { grid-column: 1 / -1; }
.editor-sections { display: grid; gap: 10px; }
.editor-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--red-600);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .065em;
  text-transform: uppercase;
}
.editor-section-title::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--line);
}
.node-identity-grid { grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr) minmax(0, 1.1fr); }
.field-block {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 820;
  letter-spacing: .055em;
  text-transform: uppercase;
}
.readonly-field {
  min-height: 52px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--soft-bg);
}
.readonly-field span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 860;
  letter-spacing: .06em;
}
.readonly-field strong {
  color: var(--ink);
  font-size: 12px;
  line-height: 1.25;
  letter-spacing: 0;
  text-transform: none;
}
.flow-row {
  display: grid;
  grid-template-columns: minmax(70px, .75fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
  align-items: end;
}
.flow-row-title {
  align-self: center;
  color: var(--muted);
  font-size: 10px;
  font-weight: 860;
  letter-spacing: .055em;
  text-transform: uppercase;
}
.field-title-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 16px; }
.field-title-row label { display: inline-flex; align-items: center; width: auto; min-height: auto; gap: 0; color: inherit; font-size: inherit; font-weight: inherit; letter-spacing: inherit; }
.strict-toggle { gap: 6px !important; color: var(--muted) !important; font-size: 9px !important; font-weight: 820 !important; letter-spacing: .05em !important; white-space: nowrap; }
.strict-toggle input[type="checkbox"] { width: auto; min-height: auto; margin: 0; accent-color: var(--red-600); }
.bounds-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px 10px;
  align-items: center;
}
.bound-check {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  gap: 7px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 820;
  letter-spacing: .045em;
  text-transform: uppercase;
}
.bound-check input {
  width: auto;
  min-height: auto;
  margin: 0;
  accent-color: var(--red-600);
}
.flow-matrix {
  display: grid;
  grid-template-columns: minmax(74px, .7fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px 10px;
  align-items: center;
}
.flow-heading,
.flow-label {
  color: var(--muted);
  font-size: 10px;
  font-weight: 860;
  letter-spacing: .055em;
  text-transform: uppercase;
}
.flow-heading { align-self: end; }
.flow-label { color: var(--ink); }
.color-picker {
  display: grid;
  gap: 9px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft-bg);
}
.color-current {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  width: fit-content;
  min-height: 32px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--paper);
  color: var(--muted);
  font-size: 10px;
  font-weight: 820;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.color-picker .color-swatches {
  display: grid;
  width: 100%;
  grid-template-columns: repeat(8, minmax(28px, 1fr));
  gap: 8px;
}
.color-current-chip { width: 34px; height: 22px; border-radius: 7px; box-shadow: inset 0 0 0 1px rgba(17, 24, 39, .18); }
.color-swatch {
  width: 100%;
  height: 32px;
  min-height: 32px;
  padding: 0;
  border-radius: 8px;
  border: 2px solid rgba(17, 24, 39, .16);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .24);
}
.color-swatch.light { box-shadow: inset 0 0 0 1px rgba(17, 24, 39, .20); }
.color-swatch.selected { border-color: var(--red-600); box-shadow: 0 0 0 2px #fff, 0 0 0 4px rgba(189, 1, 41, .28); }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.row-actions button { flex: 1; min-width: 86px; }
.empty-state { display: grid; gap: 10px; color: var(--muted); font-size: 13px; line-height: 1.45; }
.empty-state strong { color: var(--ink); font-family: var(--serif); font-size: 18px; }
.pill-row { display: flex; flex-wrap: wrap; gap: 7px; }
.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 25px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--soft-bg);
  color: var(--muted);
  font-size: 10px;
  font-weight: 820;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.toast {
  position: absolute;
  left: 50%;
  bottom: 22px;
  z-index: 30;
  transform: translateX(-50%);
  max-width: 720px;
  padding: 10px 13px;
  border-radius: 7px;
  background: #15181d;
  color: white;
  box-shadow: var(--shadow);
  font-size: 12px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease;
}
.toast.show { opacity: 1; }
.modal {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 28px;
  background: rgba(15, 18, 24, .42);
}
.modal.open { display: flex; }
.modal-card { width: min(980px, 94vw); max-height: 86vh; overflow: hidden; border-radius: 8px; background: var(--paper); box-shadow: 0 24px 80px rgba(0,0,0,.28); }
.start-card { width: min(460px, 94vw); }
.diagrams-card { width: min(760px, 94vw); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0; color: var(--red-600); font-family: var(--serif); font-size: 24px; }
.start-form { display: grid; gap: 12px; padding: 18px; }
.diagrams-body { display: grid; gap: 12px; padding: 16px; overflow: auto; max-height: calc(86vh - 74px); }
.diagram-save-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: end;
}
.diagram-save-row button { min-width: 108px; }
.diagram-library-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.diagram-list { display: grid; gap: 8px; }
.diagram-list-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 62px;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft-bg);
}
.diagram-list-item.active {
  border-color: rgba(189, 1, 41, .42);
  box-shadow: inset 3px 0 0 var(--red-600);
}
.diagram-list-item strong {
  display: block;
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.diagram-list-item span { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; }
.diagram-item-actions { display: flex; gap: 7px; }
.diagram-item-actions button { min-width: 72px; }
.example-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; padding: 18px; overflow: auto; max-height: calc(86vh - 74px); }
.example-card { min-height: 172px; padding: 13px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-head-bg); text-align: left; }
.example-card h3 { margin: 0 0 8px; font-family: var(--serif); color: var(--ink); font-size: 17px; line-height: 1.1; }
.example-card p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.42; }
.example-card:hover { border-color: var(--red-600); }

.svg-link { fill: none; stroke: #3e4652; stroke-width: 2.2; }
.svg-link.negative { stroke: var(--red-600); }
.svg-link.selected { stroke-width: 4; filter: drop-shadow(0 0 5px rgba(189,1,41,.34)); }
.node-shell { filter: drop-shadow(0 8px 12px rgba(20, 24, 30, .14)); }
.node-hit { cursor: grab; }
.node-hit:active { cursor: grabbing; }
.node-outline { stroke-width: 2.4; fill: var(--paper); }
.node-outline.selected { stroke-width: 3.4; }
.value-text { font-size: 18px; font-weight: 850; fill: var(--ink); text-anchor: middle; }
.label-text { font-size: 12px; font-weight: 820; text-anchor: middle; }
.flow-text { font-size: 11px; font-weight: 900; fill: var(--muted); text-anchor: middle; }
.link-label-bg { fill: color-mix(in srgb, var(--paper) 92%, transparent); stroke: var(--line); stroke-width: 1; }
.link-label { font-size: 11px; font-weight: 860; fill: var(--ink); text-anchor: middle; dominant-baseline: middle; }
.link-detail { display: none; }
.link-group:hover .link-summary { display: none; }
.link-group:hover .link-detail { display: inline; }
.fire-button { cursor: pointer; filter: drop-shadow(0 2px 4px rgba(0,0,0,.18)); }
.fire-up circle { fill: var(--green); }
.fire-down circle { fill: var(--danger); }
.fire-button text { fill: white; font-size: 15px; font-weight: 900; text-anchor: middle; dominant-baseline: middle; }
.package { filter: drop-shadow(0 1px 3px rgba(15, 23, 42, .18)); }
.package polygon { stroke: none; }
.loop-label { cursor: grab; filter: drop-shadow(0 5px 10px rgba(20, 24, 30, .14)); }
.loop-label:active { cursor: grabbing; }
.loop-label circle {
  fill: var(--paper);
  stroke: var(--red-600);
  stroke-width: 2.5;
}
.loop-label.balancing circle { stroke: var(--green); }
.loop-label.selected circle {
  stroke-width: 4;
  filter: drop-shadow(0 0 7px rgba(189,1,41,.28));
}
.loop-label text {
  fill: var(--red-600);
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 900;
  text-anchor: middle;
  dominant-baseline: middle;
  pointer-events: none;
}
.loop-label.balancing text { fill: var(--green); }
.pulse { animation: pulseNode .8s ease-in-out infinite alternate; }
@keyframes pulseNode {
  from { filter: drop-shadow(0 0 2px rgba(189,1,41,.38)); }
  to { filter: drop-shadow(0 0 18px rgba(189,1,41,.75)); }
}

@media (max-width: 900px) {
  .app { min-width: 0; min-height: 0; }
  .topbar { grid-template-columns: 1fr; height: auto; align-items: stretch; }
  .app-title { order: -1; text-align: left; }
  .primary-actions, .utility-actions { justify-content: flex-start; flex-wrap: wrap; }
  .diagram-save-row { grid-template-columns: 1fr; }
  .diagram-list-item { grid-template-columns: 1fr; }
  .diagram-item-actions { justify-content: stretch; }
  .diagram-item-actions button { flex: 1; }
  .floating-panel { width: min(330px, calc(100vw - 24px)); right: 12px; left: auto; }
  .simulator-panel { top: 18px; bottom: auto; max-height: 48vh; }
  .editor-panel { top: calc(48vh + 30px); bottom: 12px; }
  .simulator-panel .panel-body, .editor-panel .panel-body { max-height: calc(48vh - 64px); }
  .example-grid { grid-template-columns: 1fr; }
}
