:root {
  color: #071f43;
  background: #ffffff;
  font-family: Inter, "Helvetica Neue", Arial, sans-serif;
  font-synthesis: none;
  --editor-width: 620px;
  --navy: #071f43;
  --blue: #124dbb;
  --border: #d8dee8;
  --muted: #637083;
  --canvas: #f4f6f9;
  --warning: #9a5b00;
  --warning-border: #e7ab4a;
  --warning-bg: #fff9eb;
}

* { box-sizing: border-box; }
html, body { min-width: 320px; min-height: 100%; }
body { margin: 0; background: #fff; }
button, input, select { font: inherit; }
button { cursor: pointer; }
svg { overflow: visible; }

.app-shell { min-height: 100vh; background: #fff; }
.app-header {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  padding: 12px 31px;
  border-bottom: 1px solid var(--border);
  background: #fff;
}
button.mobile-menu-button, .mobile-view-tabs { display: none; }
.wordmark {
  color: var(--navy);
  font-size: clamp(24px, 2vw, 31px);
  font-weight: 760;
  letter-spacing: -1.15px;
  text-decoration: none;
  white-space: nowrap;
}
.header-actions, .editor-toolbar, .export-actions, .layout-actions { display: flex; align-items: center; gap: 12px; }
.header-actions { justify-content: flex-end; flex-wrap: wrap; }
.header-link { padding: 9px 2px; color: #073aa0; font-size: 14px; font-weight: 650; text-decoration: none; white-space: nowrap; }
.header-link:hover { text-decoration: underline; text-underline-offset: 3px; }

.button {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid #bfc9d8;
  border-radius: 5px;
  padding: 8px 15px;
  color: #0c315f;
  background: #fff;
  font-size: 13px;
  font-weight: 670;
  line-height: 1;
  transition: background .14s ease, border-color .14s ease, color .14s ease, box-shadow .14s ease;
}
.button svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
.button:hover { border-color: #7d91ae; background: #f7f9fc; }
.button-primary { color: #fff; border-color: #124dbb; background: #124dbb; box-shadow: 0 2px 5px rgba(18, 77, 187, .16); }
.button-primary:hover { color: #fff; border-color: #0b3f9f; background: #0b3f9f; }
.button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible, .header-link:focus-visible, .workspace-divider:focus-visible, .link:focus-visible, .node:focus-visible, .node-label:focus-visible, .example-option:focus-visible {
  outline: 3px solid #8eb7f2;
  outline-offset: 2px;
}
.file-button { position: relative; }
.file-button input { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; pointer-events: none; }
.example-picker { position: relative; }
.example-button { white-space: nowrap; }
.example-button .example-chevron { width: 14px; height: 14px; transition: transform .14s ease; }
.example-picker.open .example-chevron { transform: rotate(180deg); }
.example-menu {
  position: absolute;
  z-index: 40;
  top: calc(100% + 8px);
  right: 0;
  width: min(350px, calc(100vw - 32px));
  overflow: hidden;
  border: 1px solid #cbd4df;
  border-radius: 7px;
  padding: 6px;
  background: #fff;
  box-shadow: 0 16px 38px rgba(7, 31, 67, .16);
}
.example-menu[hidden] { display: none; }
.example-option {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  border: 0;
  border-radius: 5px;
  padding: 10px 11px;
  color: #102d52;
  background: transparent;
  text-align: left;
}
.example-option:hover, .example-option:focus-visible { background: #f2f6fb; }
.example-option-copy { min-width: 0; display: grid; gap: 3px; }
.example-option-copy strong { overflow: hidden; font-size: 13px; font-weight: 720; text-overflow: ellipsis; white-space: nowrap; }
.example-option-copy span { overflow: hidden; color: #64738a; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.example-data-label { color: #718096; font-size: 10px; font-weight: 650; white-space: nowrap; }

.workspace {
  display: grid;
  grid-template-columns: var(--editor-width) 14px minmax(0, 1fr);
  height: calc(100vh - 64px);
  min-height: 640px;
  background: #fff;
}
.editor { grid-column: 1; min-width: 0; overflow: auto; padding: 20px 30px 28px; background: #fff; }
.editor-heading h1 { margin: 0; color: var(--navy); font-size: 24px; line-height: 1.15; font-weight: 730; letter-spacing: -.45px; }
.editor-heading p { margin: 5px 0 0; color: #46566c; font-size: 13px; line-height: 1.45; }
.metadata-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; margin: 18px 0 15px; }
label { display: grid; gap: 6px; color: #223c60; font-size: 12px; font-weight: 680; }
input[type="text"], input[type="number"] {
  width: 100%;
  height: 35px;
  min-width: 0;
  border: 1px solid #cdd5e0;
  border-radius: 4px;
  padding: 7px 9px;
  color: #102c51;
  background: #fff;
  font-size: 13px;
  font-weight: 500;
}
select {
  width: 100%;
  height: 35px;
  min-width: 0;
  border: 1px solid #cdd5e0;
  border-radius: 4px;
  padding: 6px 30px 6px 9px;
  color: #102c51;
  background: #fff;
  font-size: 12px;
}
input[type="number"] { appearance: textfield; }
.editor-toolbar { justify-content: space-between; margin-bottom: 15px; }
.save-status { min-height: 16px; color: #6b7788; font-size: 11px; }

.validation-summary, .balance-summary { margin: 0 0 13px; border-radius: 5px; font-size: 12px; line-height: 1.42; }
.validation-summary { display: none; padding: 11px 13px; border: 1px solid #dd7a7a; color: #861f24; background: #fff5f5; }
.validation-summary.active { display: block; }
.balance-summary { display: grid; grid-template-columns: 27px 1fr; gap: 10px; padding: 11px 14px; border: 1px solid var(--warning-border); color: #6d4300; background: var(--warning-bg); }
.balance-summary[hidden] { display: none; }
.balance-summary strong { display: block; margin-bottom: 2px; color: #674000; font-size: 13px; }
.balance-icon { width: 23px; height: 21px; display: grid; place-items: center; clip-path: polygon(50% 0, 100% 100%, 0 100%); color: white; background: #d68b12; font-size: 12px; font-weight: 800; padding-top: 5px; }
#balance-messages > div + div { margin-top: 4px; }

.flow-list { width: 100%; min-width: 0; }
.mobile-flow-summary { display: none; }
.flow-row-body, .flow-utilities { display: contents; }
.flow-header, .flow-row {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(120px, 1.3fr) minmax(120px, 1.3fr) minmax(96px, .7fr) 76px 52px;
  gap: 6px;
  align-items: center;
}
.flow-header { padding: 0 0 7px; color: #2f4059; font-size: 11px; font-weight: 700; }
.flow-row { position: relative; padding: 4px 0; }
.flow-field { display: block; min-width: 0; }
.flow-field > span, .mobile-field-label { display: none; }
.flow-row.invalid { margin: 2px -7px; padding: 6px 7px; border-radius: 4px; background: #fff7f7; }
.flow-row input { width: 100%; height: 32px; font-size: 12px; }
.flow-row input[aria-invalid="true"] { border-color: #d15e63; background: #fffafa; }
.flow-order { display: grid; grid-template-columns: 30px 1fr; align-items: center; gap: 3px; }
.order-number { color: #50627a; font-size: 11px; text-align: center; }
.flow-controls { display: inline-flex; gap: 2px; }
.flow-controls button, .icon-button {
  width: 25px;
  height: 27px;
  display: inline-grid;
  place-items: center;
  border: 1px solid #d1d8e2;
  border-radius: 4px;
  padding: 0;
  color: #244b79;
  background: #fff;
}
.flow-controls button { width: 20px; }
.flow-controls button:hover, .icon-button:hover { border-color: #8ca0ba; background: #f3f7fb; }
.flow-controls button:disabled { cursor: not-allowed; opacity: .35; }
.row-actions { display: flex; align-items: center; justify-content: flex-end; gap: 3px; }
.icon-button svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.delete-flow { color: #778396; }
.delete-flow:hover { color: #a61920; border-color: #efc6c8; background: #fff3f3; }
.row-error { grid-column: 1 / -1; color: #ad2228; font-size: 11px; line-height: 1.35; }
.empty-flows { padding: 25px 14px; border: 1px dashed #cfd7e2; border-radius: 5px; color: #66758a; text-align: center; font-size: 13px; line-height: 1.45; }

.branding-panel { margin-top: 14px; padding: 13px 0 14px; border-top: 1px solid #dce2ea; }
.branding-panel summary { display: block; list-style: none; cursor: default; pointer-events: none; }
.branding-panel summary::-webkit-details-marker { display: none; }
.branding-heading h2 { margin: 0; color: #152f53; font-size: 15px; font-weight: 720; }
.branding-heading p { margin: 3px 0 0; color: #6b7788; font-size: 11px; }
.branding-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(250px, 1fr); gap: 16px; margin-top: 11px; }
.logo-field { min-width: 0; }
.field-label { display: block; margin-bottom: 6px; color: #223c60; font-size: 12px; font-weight: 680; }
.logo-controls { min-height: 35px; display: flex; align-items: center; gap: 8px; min-width: 0; }
.logo-file-button { position: relative; flex: 0 0 auto; min-height: 35px; padding-block: 6px; }
.logo-file-button input { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; pointer-events: none; }
.logo-file-name { min-width: 0; overflow: hidden; color: #607089; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.remove-logo-button { flex: 0 0 auto; min-height: 35px; padding-inline: 10px; }
.remove-logo-button[hidden] { display: none; }
.branding-help { margin: 9px 0 0; color: #6b7788; font-size: 11px; line-height: 1.4; }

.layout-panel { padding: 13px 0 2px; border-top: 1px solid #dce2ea; border-bottom: 1px solid #dce2ea; }
.layout-panel summary { position: relative; list-style: none; cursor: pointer; color: #152f53; font-size: 15px; font-weight: 720; }
.layout-panel summary::-webkit-details-marker { display: none; }
.layout-panel summary::after { content: "⌄"; position: absolute; right: 2px; top: -2px; color: #60728b; font-size: 17px; }
.layout-panel[open] summary::after { transform: rotate(180deg); }
.range-label { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; }
.label-help { color: #6b7788; font-weight: 500; }
#label-size-input { width: 100%; accent-color: #124dbb; }
#label-size-output { color: #19365e; font-size: 12px; font-weight: 700; }
.layout-toggle-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding-top: 12px; }
.toggle-field { min-height: 54px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 1px solid #d6dde7; border-radius: 5px; padding: 9px 10px; background: #f9fafc; cursor: pointer; }
.toggle-field span { min-width: 0; }
.toggle-field strong, .toggle-field small { display: block; }
.toggle-field strong { color: #223c60; font-size: 12px; }
.toggle-field small { margin-top: 2px; color: #6b7788; font-size: 10px; line-height: 1.25; }
.toggle-field input { flex: 0 0 auto; width: 18px; height: 18px; accent-color: #124dbb; cursor: pointer; }
.layout-settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; padding: 12px 0 8px; }
.layout-color-input { width: 100%; height: 35px; border: 1px solid #cdd5e0; border-radius: 4px; padding: 3px; background: #fff; cursor: pointer; }
.layout-settings-grid label:last-child { grid-column: 1 / -1; }
.layout-actions { justify-content: space-between; padding: 8px 0 12px; }
.layout-actions span { color: #6b7788; font-size: 11px; text-align: right; }

.export-panel { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 15px; }
.export-panel h2 { margin: 0; color: #173456; font-size: 14px; font-weight: 720; }
.export-panel p { margin: 4px 0 0; color: #708095; font-size: 11px; }
.export-actions { gap: 6px; }
.button-export { min-width: 54px; padding-inline: 10px; }

.workspace-divider { position: relative; z-index: 5; grid-column: 2; cursor: col-resize; border-inline: 1px solid transparent; background: #eef1f5; touch-action: none; }
.workspace-divider:hover, .workspace-divider:focus-visible { background: #dfe5ec; }
.workspace-divider span { position: absolute; top: 45%; left: 50%; width: 5px; height: 34px; transform: translate(-50%, -50%); border-radius: 5px; background: radial-gradient(circle, #7b899b 1.25px, transparent 1.5px) center/5px 7px; }
.workspace-divider::after { content: "‹"; position: absolute; top: calc(45% + 25px); left: 50%; transform: translateX(-50%); color: #65758b; font-size: 17px; font-weight: 800; line-height: 1; }
.workspace.editor-collapsed .editor { display: none; }
.workspace.editor-collapsed .workspace-divider::after { content: "›"; }

.preview { position: relative; grid-column: 3; min-width: 0; overflow: hidden; padding: 18px 20px 24px; background: var(--canvas); }
.canvas-toolbar { min-height: 39px; display: flex; align-items: center; gap: 10px; margin: 0 0 14px; }
.canvas-button { min-width: 72px; }
.zoom-control { height: 38px; display: grid; grid-template-columns: 42px 58px 42px; align-items: stretch; overflow: hidden; border: 1px solid #cbd4df; border-radius: 5px; background: #fff; }
.zoom-control button { border: 0; color: #193b66; background: #fff; font-size: 20px; }
.zoom-control button:hover { background: #f3f6fa; }
.zoom-control output { display: grid; place-items: center; border-inline: 1px solid #e1e6ec; color: #253e5e; font-size: 12px; }
.canvas-warning { min-height: 38px; display: inline-flex; align-items: center; gap: 7px; border: 1px solid #d5dce6; border-radius: 5px; padding: 0 12px; color: #684400; background: #fff; font-size: 12px; }
.canvas-warning[hidden] { display: none; }
.canvas-warning span { width: 19px; height: 18px; display: grid; place-items: center; clip-path: polygon(50% 0, 100% 100%, 0 100%); color: #fff; background: #d68b12; font-size: 10px; font-weight: 800; padding-top: 4px; }
.preview-frame { width: 100%; max-width: 1600px; height: auto; min-height: 0; aspect-ratio: 1602 / 902; overflow: auto; margin-inline: auto; border: 1px solid #d8dee7; border-radius: 6px; background: #fff; box-shadow: 0 8px 30px rgba(21, 47, 83, .035); }
.diagram-stage { width: 100%; min-width: 620px; transform-origin: top left; }
#chart { display: block; width: 100%; height: auto; background: #fff; }

.chart-title { font-size: 43px; font-weight: 750; letter-spacing: -1.4px; }
.chart-subtitle { font-size: 18px; font-weight: 520; }
.link { fill: none; stroke-linecap: butt; mix-blend-mode: multiply; cursor: pointer; transition: stroke-opacity .12s ease; }
.link:hover, .link.selected { stroke-opacity: .86 !important; }
.link.selected { filter: drop-shadow(0 0 2px rgba(7, 31, 67, .4)); }
.node { stroke: rgba(7, 31, 67, .15); stroke-width: 1; cursor: grab; }
.node:active { cursor: grabbing; }
.node.selected { stroke: #0f4db4; stroke-width: 4; }
.node-label { font-weight: 570; cursor: pointer; paint-order: stroke; stroke: rgba(255, 255, 255, .92); stroke-width: 5px; stroke-linejoin: round; }
.node-label-hit { fill: transparent; stroke: none; pointer-events: all; }
.node-label-value, .node-label-percentage { font-weight: 760; }
.chart-source { fill: #69778a; font-size: 14px; font-weight: 520; }
.chart-logo { cursor: grab; }
.chart-logo:active { cursor: grabbing; }
.chart-logo-outline { fill: transparent; stroke: #124dbb; stroke-width: 2; stroke-dasharray: 6 4; opacity: 0; pointer-events: none; }
.chart-logo:hover .chart-logo-outline, .chart-logo:focus-visible .chart-logo-outline { opacity: .8; }
.logo-resize-handle { fill: #124dbb; stroke: #fff; stroke-width: 2; cursor: nwse-resize; }
.empty-state-title { fill: #0b294f; font-size: 34px; font-weight: 740; letter-spacing: -.9px; }
.empty-state-copy { fill: #718096; font-size: 18px; }

.inspector { position: absolute; z-index: 20; width: 250px; border: 1px solid #cdd5df; border-radius: 7px; padding: 15px; color: #102d52; background: #fff; box-shadow: 0 13px 34px rgba(7, 31, 67, .18); }
.inspector[hidden] { display: none; }
.inspector-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 13px; }
.inspector h2 { margin: 0; font-size: 15px; font-weight: 740; }
.inspector-close { width: 27px; height: 27px; border: 0; border-radius: 4px; color: #637187; background: transparent; font-size: 21px; line-height: 1; }
.inspector-close:hover { color: #183b68; background: #f1f4f8; }
.inspector-fields { display: grid; gap: 12px; }
.inspector .derived-value { min-height: 35px; display: flex; align-items: center; border: 1px solid #d7dee7; border-radius: 4px; padding: 7px 9px; color: #51637b; background: #f6f8fa; font-size: 13px; font-weight: 650; }
.inspector-colour { display: grid; grid-template-columns: 1fr 44px; align-items: end; gap: 8px; }
.color-input { width: 44px; height: 35px; border: 1px solid #cbd4df; border-radius: 4px; padding: 3px; background: #fff; cursor: pointer; }
.colour-presets { display: flex; flex-wrap: wrap; gap: 6px; }
.colour-preset { width: 24px; height: 24px; border: 1px solid rgba(7, 31, 67, .16); border-radius: 4px; padding: 0; background: var(--preset); }
.colour-preset.selected { box-shadow: 0 0 0 2px #fff, 0 0 0 4px #0d4bb3; }
.inspector-error { color: #a51f25; font-size: 11px; line-height: 1.35; }
.inspector .button-primary { width: 100%; margin-top: 14px; }

body.embed .app-header, body.embed .editor, body.embed .workspace-divider, body.embed .canvas-toolbar, body.embed .inspector { display: none; }
body.embed .mobile-view-tabs { display: none; }
body.embed .workspace { display: block; height: auto; min-height: 0; }
body.embed .preview { display: block; padding: 0; overflow: visible; background: #fff; }
body.embed .preview-frame { width: 1600px; height: 900px; min-height: 0; overflow: visible; border: 0; border-radius: 0; box-shadow: none; }
body.embed .diagram-stage, body.embed #chart { width: 1600px; min-width: 0; }

@media (max-width: 1120px) {
  body { overflow: auto; }
  .app-header { align-items: flex-start; flex-direction: column; padding: 16px 20px; }
  .header-actions { width: 100%; justify-content: flex-start; }
  .workspace { display: block; height: auto; min-height: 0; }
  .workspace-divider { display: none; }
  .workspace.editor-collapsed .editor { display: block; }
  .editor { overflow: visible; padding: 24px 20px 28px; border-bottom: 1px solid var(--border); }
  .preview { min-height: 640px; padding: 18px 20px 28px; overflow: visible; }
  .preview-frame { height: auto; min-height: 0; aspect-ratio: 16 / 9; }
  .diagram-stage { min-width: 760px; }
}

@media (max-width: 680px) {
  html, body { min-width: 0; }
  .app-header { position: relative; align-items: center; flex-direction: row; gap: 12px; padding: 12px 16px; }
  .wordmark { min-width: 0; overflow: hidden; font-size: 22px; letter-spacing: -.8px; text-overflow: ellipsis; }
  button.mobile-menu-button { min-width: 82px; display: inline-flex; flex: 0 0 auto; }
  .header-actions { position: absolute; z-index: 60; top: calc(100% + 6px); left: 16px; right: 16px; width: auto; display: grid; grid-template-columns: 1fr; gap: 8px; border: 1px solid #cbd4df; border-radius: 7px; padding: 10px; background: #fff; }
  .header-actions[hidden] { display: none; }
  .header-actions .button, .header-actions .header-link { width: 100%; min-height: 40px; text-align: center; }
  .header-actions .example-picker { width: 100%; }
  .header-link { display: grid; place-items: center; }
  .mobile-view-tabs { position: sticky; z-index: 30; top: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 4px; border-bottom: 1px solid var(--border); padding: 8px 16px; background: #fff; }
  .mobile-view-tabs button { position: relative; min-height: 44px; border: 0; border-radius: 4px; color: #52647c; background: transparent; font-size: 13px; font-weight: 720; }
  .mobile-view-tabs button[aria-selected="true"] { color: #0a3f91; background: #edf4ff; }
  .mobile-view-tabs button:focus-visible, .mobile-menu-button:focus-visible { outline: 3px solid #8eb7f2; outline-offset: 2px; }
  .diagram-updated { position: absolute; top: 7px; margin-left: 5px; color: #0a4bad; font-size: 9px; font-weight: 760; }
  .diagram-updated[hidden] { display: none; }
  .editor[hidden], .preview[hidden] { display: none; }
  .editor { padding-inline: 16px; }
  .metadata-grid { grid-template-columns: 1fr; gap: 12px; }
  .branding-grid { grid-template-columns: 1fr; }
  .branding-panel .branding-heading { position: relative; cursor: pointer; padding-right: 25px; pointer-events: auto; }
  .disclosure-chevron { position: absolute; right: 2px; top: 6px; width: 16px; height: 16px; fill: none; stroke: #60728b; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
  .branding-panel[open] .disclosure-chevron { transform: rotate(180deg); }
  .logo-controls { flex-wrap: wrap; }
  .layout-toggle-grid { grid-template-columns: 1fr; }
  .layout-settings-grid { grid-template-columns: 1fr; }
  .layout-settings-grid label:last-child { grid-column: auto; }
  .flow-list { overflow: visible; padding-bottom: 4px; }
  .flow-header { display: none; }
  .flow-row { min-width: 0; display: block; padding: 0; border-bottom: 1px solid #e0e5ec; }
  .flow-row.invalid { margin-inline: -6px; padding-inline: 6px; }
  .mobile-flow-summary { width: 100%; min-height: 56px; display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; align-items: center; gap: 9px; border: 0; padding: 6px 2px; color: #173456; background: #fff; text-align: left; }
  .mobile-flow-summary:hover { background: #f7f9fc; }
  .mobile-flow-summary:focus-visible { position: relative; z-index: 1; outline: 3px solid #8eb7f2; outline-offset: -1px; }
  .mobile-flow-order { color: #607089; font-size: 11px; font-weight: 720; text-align: center; }
  .mobile-flow-route { min-width: 0; display: grid; gap: 3px; }
  .mobile-flow-endpoints { overflow: hidden; font-size: 12px; font-weight: 680; text-overflow: ellipsis; white-space: nowrap; }
  .mobile-flow-value { color: #607089; font-size: 11px; font-weight: 620; }
  .mobile-flow-edit { min-width: 45px; display: inline-flex; align-items: center; justify-content: flex-end; gap: 4px; color: #0d4ca9; font-size: 11px; font-weight: 720; }
  .mobile-flow-edit svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; transition: transform .12s ease; }
  .mobile-expanded .mobile-flow-edit svg { transform: rotate(180deg); }
  .flow-row-body { display: none; }
  .flow-row.mobile-expanded { padding-bottom: 12px; }
  .flow-row.mobile-expanded .flow-row-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(210px, 1.2fr); gap: 9px 10px; padding: 5px 2px 0; }
  .flow-field > span, .mobile-field-label { display: block; margin-bottom: 5px; color: #42546e; font-size: 10px; font-weight: 720; }
  .flow-utilities { min-width: 0; display: flex; align-items: flex-end; justify-content: space-between; gap: 5px; }
  .flow-order { display: grid; grid-template-columns: 21px 1fr; align-self: end; gap: 2px; }
  .flow-order .mobile-field-label { grid-column: 1 / -1; }
  .flow-controls button, .icon-button { min-width: 44px; width: 44px; height: 44px; }
  .flow-controls button { width: 44px; }
  .row-actions { justify-content: flex-end; }
  .row-error { grid-column: 1 / -1; }
  .export-panel { align-items: flex-start; flex-direction: column; }
  .layout-actions { align-items: flex-start; flex-direction: column; }
  .layout-actions span { text-align: left; }
  .preview { min-height: 380px; padding: 14px 0 24px; }
  .canvas-toolbar { padding-inline: 16px; flex-wrap: wrap; }
  .preview-frame { border-radius: 0; border-inline: 0; }
  .diagram-stage { min-width: 0; }
  .inspector { position: fixed; left: 16px !important; right: 16px; bottom: 16px; top: auto !important; width: auto; }
  #mobile-export-mount { padding-inline: 16px; }
}

@media (max-width: 360px) {
  .flow-row.mobile-expanded .flow-row-body { grid-template-columns: 1fr; }
  .flow-utilities { grid-column: 1; display: grid; grid-template-columns: 1fr; justify-items: start; gap: 8px; }
  .row-actions { justify-content: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
