.flow-page {
  --flow-board: #202e26;
  --flow-board-height: clamp(440px, calc(100svh - 303px), 820px);
  --flow-panel-gap: clamp(12px, 1.4vw, 20px);
  background: #f4f2e9;
}
.flow-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 56px;
  padding: 0 clamp(14px, 2.5vw, 40px);
  border-bottom: 1px solid #38473b;
  color: var(--shell-text);
  background: #121b17;
}
.flow-header :focus-visible { outline-color: var(--accent); }
.flow-home { display: inline-flex; align-items: center; gap: 7px; min-height: 44px; color: var(--shell-muted); font-size: 14px; font-weight: 650; text-decoration: none; }
.flow-home span { color: #bed88a; }
.flow-home:hover { color: var(--accent); }
.flow-brand { display: inline-flex; align-items: center; gap: 3px; min-height: 44px; color: var(--shell-text); text-decoration: none; flex: none; font-size: 20px; font-weight: 750; letter-spacing: -.045em; }
.flow-brand:hover { color: var(--accent); }
.flow-brand strong { margin-left: 3px; color: var(--accent); font: 700 11px/1.2 var(--mono); letter-spacing: 0; }
.flow-main { width: min(100%, 1850px); margin: 0 auto; padding: 0 clamp(12px, 2.4vw, 36px) 26px; }
.flow-mast {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 20px;
  margin-bottom: 14px;
  padding: 18px 0 13px;
  border-bottom: 1px solid #d6dace;
}
.flow-mast > div { min-width: 0; }
.flow-project { margin-bottom: 4px; color: #53654f; font-size: 13px; font-weight: 650; }
.flow-project:empty { display: none; }
.flow-mast h1 { font: 730 clamp(25px, 2.45vw, 37px)/1.12 var(--display); letter-spacing: -.035em; }
.flow-library { display: grid; grid-template-columns: minmax(115px, 1fr) minmax(135px, 1fr) auto; align-items: end; gap: 8px; width: min(515px, 100%); }
.flow-library .secondary-button { min-height: 42px; justify-content: center; white-space: nowrap; }
.flow-message { margin-bottom: 14px; padding: 10px 12px; border: 1px solid #bfd0a4; border-radius: 8px; color: #355031; background: var(--wash); }
.flow-message.is-error { color: var(--error); border-color: #dcab9f; background: #fff0e8; }
.flow-draft { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; margin-bottom: 14px; padding: 8px 10px; border: 1px solid #c3d0b8; border-radius: 8px; color: #355031; background: #f0f4e8; }
.flow-draft.is-conflict { border-color: #d8b887; color: #694621; background: #fcf1dc; }
.flow-draft > p { flex: 1 1 240px; min-width: 0; }
.flow-draft-body { display: grid; justify-items: start; gap: 10px; padding: 16px 20px 20px; }
.flow-draft-body label { width: 100%; }
.flow-draft-body textarea { width: 100%; min-height: 160px; max-height: 45vh; padding: 9px; resize: vertical; border: 1px solid var(--line); border-radius: 6px; background: var(--paper); color: var(--ink); font: 400 13px/1.5 var(--mono); }
.flow-layout { display: grid; grid-template-columns: minmax(0, 1fr) clamp(262px, 23.5vw, 352px); align-items: start; gap: var(--flow-panel-gap); }
.flow-card { min-width: 0; border: 1px solid #d9ddd0; border-radius: 15px; background: #fffdf7; }
.flow-card h2 { font-size: 18px; font-weight: 720; letter-spacing: -.02em; }
.flow-empty { display: grid; justify-items: start; gap: 14px; padding: 24px; }
.flow-meta { color: var(--muted); font-size: 13px; }
.flow-canvas-card { overflow: hidden; border-color: #394b40; box-shadow: 0 13px 40px #20312316; }
.flow-canvas-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 9px 14px; padding: 11px clamp(12px, 1.45vw, 21px); color: var(--shell-text); background: #19231d; }
.flow-canvas-identity { min-width: 0; }
.flow-canvas-header .flow-meta { margin-top: 4px; color: #b9c5b7; font-variant-numeric: tabular-nums; }
.flow-canvas-header .secondary-button { min-height: 39px; padding-inline: 10px; border-color: #4e6153; color: #edf2e8; background: #26332a; }
.flow-canvas-header .secondary-button:hover:not(:disabled) { border-color: #93ab72; background: #344636; }
.flow-canvas-header .primary-button { min-height: 39px; padding-inline: 13px; color: #192418; background: #bed88a; }
.flow-canvas-header .primary-button:disabled { color: #c2cbbf; border-color: #4e6153; background: #39483b; }
.flow-canvas-header :focus-visible { outline-color: #bed88a; }
.flow-actions, .flow-inline, .flow-zoom { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.flow-canvas-tools { display: none; }
#flow-add-form { display: none; }
.flow-main .flow-inline select { width: min(155px, 100%); }
.flow-zoom button { min-width: 38px; min-height: 40px; padding-inline: 6px; border: 1px solid #ced9c8; border-radius: 6px; color: var(--accent-dark); background: #fffdf5; font-size: 13px; font-weight: 680; }
.flow-zoom button:hover:not(:disabled) { border-color: #7b985f; background: var(--wash); }
.flow-zoom button:disabled { color: #6c776b; background: #e9eee4; }
.flow-zoom output { min-width: 47px; color: var(--muted); font: 650 12px/1.2 var(--mono); text-align: center; }
.flow-viewport { position: relative; height: var(--flow-board-height); overflow: auto; overscroll-behavior: contain; scrollbar-color: #657765 #233229; background: var(--flow-board); }
.flow-viewport:focus-visible { outline-color: #bed88a; outline-offset: -3px; }
.flow-viewport.is-panning { cursor: grabbing; user-select: none; }
.flow-world-size { position: relative; min-width: 100%; min-height: 100%; overflow: hidden; }
.flow-world {
  position: absolute;
  inset: 0 auto auto 0;
  transform-origin: left top;
  background: radial-gradient(circle at 0 0, #71897465 1px, transparent 1.4px) 0 0 / 24px 24px,
    linear-gradient(90deg, #9ba99218 1px, transparent 1px) 0 0 / 120px 120px,
    linear-gradient(#9ba99218 1px, transparent 1px) 0 0 / 120px 120px;
}
.flow-lines, .flow-nodes { position: absolute; inset: 0; width: 100%; height: 100%; }
.flow-lines { overflow: visible; pointer-events: none; }
.flow-lines path { fill: none; stroke: #b0c78f; stroke-width: 2; }
.flow-lines marker path { fill: #b0c78f; stroke: none; }
.flow-nodes { pointer-events: none; }
.flow-board-empty {
  position: absolute; z-index: 2; inset: 50% auto auto 50%; transform: translate(-50%, -50%);
  display: grid; gap: 10px; width: min(405px, calc(100% - 30px));
  padding: clamp(13px, 2vw, 23px); border: 1px solid #849477; border-radius: 14px;
  color: var(--muted); background: #fffdf7; box-shadow: 0 15px 44px #111c1780;
}
.flow-board-empty h3 { margin: 0; color: var(--ink); font: 730 clamp(18px, 2vw, 25px)/1.2 var(--display); }
.flow-board-empty p { margin: 0; font-size: 13px; }
.flow-start-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.flow-start-actions :is(.primary-button, .secondary-button) { min-height: 44px; padding-inline: 9px; }
.flow-node {
  --node-tone: #dfead6;
  position: absolute;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  justify-items: start;
  gap: 4px;
  width: 206px;
  height: 102px;
  padding: 8px 10px;
  border: 1px solid #a4b39a;
  border-radius: 8px;
  color: var(--ink);
  background: #fffdf6;
  box-shadow: 0 3px 8px #1b35271a;
  text-align: start;
  cursor: grab;
  touch-action: none;
  user-select: none;
  pointer-events: auto;
}
.flow-node[data-type="image"], .flow-node[data-type="director"] { --node-tone: #e7e7d0; }
.flow-node[data-type="video"], .flow-node[data-type="editor"] { --node-tone: #d9e9df; }
.flow-node[data-type="audio"] { --node-tone: #e7dfcf; }
.flow-node.is-dragging { cursor: grabbing; }
.flow-node[aria-pressed="true"] { z-index: 1; border-color: #799d54; box-shadow: 0 0 0 2px #bed88a, 0 8px 21px #101c1680; }
.flow-node.is-marked { border-style: dashed; }
.flow-node::before, .flow-node::after { position: absolute; top: 46px; width: 9px; height: 9px; border: 1px solid #658759; border-radius: 50%; background: #e1eccd; }
.flow-node.has-input::before { left: -5px; content: ""; }
.flow-node.has-output::after { right: -5px; content: ""; }
.flow-node-type { padding: 2px 6px; border-radius: 3px; color: #38502c; background: var(--node-tone); font-size: 11px; font-weight: 700; }
.flow-node-title, .flow-node-body { min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.flow-node-title { align-self: end; font-size: 15px; font-weight: 740; }
.flow-node-body { color: var(--muted); font-size: 12px; }
.flow-inspector { display: grid; min-width: 0; gap: 10px; }
.flow-detail, .flow-create-form { display: grid; gap: 12px; padding: clamp(12px, 1.3vw, 18px); }
.flow-detail .flow-panel-heading { padding-bottom: 8px; border-bottom: 1px solid #e4e7db; }
.flow-node-layout { padding: 4px 7px 7px; border: 1px solid #e1e6d9; border-radius: 9px; background: #f7f8ef; }
.flow-node-layout summary { min-height: 37px; padding: 8px 3px; color: #476337; cursor: pointer; font-size: 13px; font-weight: 690; }
.flow-node-footer { padding-top: 2px; }
#flow-node-kind:not(:empty) { padding: 3px 8px; border-radius: 999px; color: #476337; background: #edf2e2; font-weight: 660; }
#flow-node-empty { padding: 14px; border: 1px dashed #ccd6c3; border-radius: 9px; }
#flow-connect { grid-template-columns: repeat(2, minmax(0, 1fr)); }
#flow-connect-submit { grid-column: 1 / -1; justify-self: start; }
#flow-jump-inspector { display: none; }
@media (min-width: 981px) {
  .flow-inspector { position: sticky; top: 12px; max-height: calc(100svh - 24px); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
}
.flow-panel-heading { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 4px 9px; }
.flow-fields { display: grid; gap: 8px; }
.flow-field { display: grid; min-width: 0; gap: 4px; font-size: 13px; font-weight: 620; }
.flow-main input:not([type="checkbox"]), .flow-main select, .flow-main textarea, .flow-create-form input {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  padding: 7px 9px;
  border: 1px solid #c7d3bd;
  border-radius: 7px;
  color: var(--ink);
  background: #fbfbf2;
  font-size: 16px;
}
.flow-main textarea { min-height: 65px; resize: vertical; }
.flow-main select:disabled { color: #647168; background: #edf0e9; }
.flow-coordinate { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.flow-node-actions { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 5px 8px; }
.flow-run {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 10px;
  border: 1px solid #baccae;
  border-radius: 8px;
  background: #f1f4e9;
}
.flow-run-header { display: grid; justify-items: start; gap: 4px; min-width: 0; }
.flow-run-header h3 { margin: 0; font-size: 15px; font-weight: 740; }
.flow-run :is(p, pre) { margin: 0; overflow-wrap: anywhere; }
.flow-run .secondary-button, .flow-run .primary-button, .flow-run-jump { min-height: 44px; }
.flow-run-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; min-width: 0; }
.flow-run-output { display: grid; gap: 7px; min-width: 0; padding-top: 8px; border-top: 1px solid var(--line); }
.flow-run-output summary { padding: 9px 0; color: var(--accent-dark); font-size: 13px; font-weight: 680; cursor: pointer; }
.flow-run-output pre {
  max-height: 15rem;
  padding: 8px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  background: var(--surface);
  font-family: inherit;
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-wrap;
}
.flow-run-shot-list { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.flow-run-shot-list li { display: grid; gap: 4px; min-width: 0; padding: 7px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.flow-run-shot-list strong { overflow-wrap: anywhere; font-size: 13px; }
.flow-run-status.is-error { color: var(--error); }
.flow-local-video-inputs {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 6px 8px;
}
.flow-local-video-inputs > p { grid-column: 1 / -1; }
.flow-local-video-inputs select { width: 100%; min-width: 0; }
.flow-local-video-settings { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
#flow-run-video-preview { display: block; width: 100%; max-height: 320px; border-radius: 7px; background: #101b16; }
.flow-back-to-board { display: none; }
@media (max-width: 530px) {
  .flow-back-to-board { display: inline-flex; align-items: center; min-height: 44px; white-space: nowrap; font-size: 13px; }
}
.flow-run-jump { display: none; }
.flow-check { display: inline-flex; align-items: center; min-height: 42px; font-size: 13px; }
.flow-check input { width: 17px; height: 17px; margin: 0 6px 0 0; accent-color: var(--accent-dark); }
.flow-remove { color: var(--error); }
.flow-ports { margin-top: 3px; overflow-wrap: anywhere; }
.flow-asset-preview :is(img, video, audio) { display: block; max-width: 100%; width: 100%; border-radius: 7px; }
.flow-asset-preview :is(img, video) { max-height: 150px; object-fit: contain; background: #182b21; }
.flow-asset-preview p { margin-top: 4px; }
.flow-process-link { justify-self: start; }
.flow-process-link[hidden] { display: none; }
.flow-edge-list { display: grid; gap: 6px; max-height: 270px; margin: 0; padding: 0; overflow: auto; list-style: none; }
.flow-edge-list:empty { display: none; }
.flow-edge-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 5px; padding: 4px 5px 4px 7px; border: 1px solid var(--line); border-radius: 5px; color: var(--muted); font-size: 12px; }
.flow-edge-row p { min-width: 0; }
.flow-edge-row .secondary-button { min-height: 38px; padding: 5px 7px; }
.flow-create-form { padding: 16px 20px 20px; }
.flow-create-form .primary-button { justify-self: start; }
#flow-create-error { color: var(--error); }

@media (max-width: 980px) {
  .flow-layout { grid-template-columns: minmax(0, 1fr); }
  .flow-inspector { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
  .flow-run-jump:not([hidden]) { display: inline-flex; }
  #flow-jump-inspector:not([hidden]) { display: inline-flex; }
  .flow-canvas-tools:has(> button:not([hidden])) { display: flex; flex-wrap: wrap; gap: 5px 7px; }
  .flow-canvas-tools > button { min-height: 44px; }
}
@media (max-width: 530px) {
  .flow-page { --flow-board-height: clamp(310px, 46svh, 420px); }
  .flow-header { min-height: 47px; }
  .flow-inspector { grid-template-columns: minmax(0, 1fr); }
  .flow-mast { gap: 8px; padding-block: 10px; margin-bottom: 8px; }
  .flow-mast > div:first-child { display: flex; align-items: baseline; gap: 9px; min-width: 0; }
  .flow-mast h1 { order: -1; flex: none; font-size: 24px; }
  .flow-project { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .flow-library { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; }
  .flow-library .secondary-button { padding-inline: 7px; font-size: 13px; }
  .flow-canvas-header { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 5px 7px; padding: 7px 9px 9px; }
  .flow-canvas-header .flow-actions { grid-column: 1/-1; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
  .flow-canvas-header .flow-actions :is(a, button) { min-height: 44px; justify-content: center; padding-inline: 2px; font-size: 12px; }
  .flow-canvas-header h2 { font-size: 14px; }
  .flow-canvas-header .flow-meta { margin: 1px 0 0; font-size: 11px; }
  .flow-canvas-tools { grid-column: 2; grid-row: 1; justify-content: end; }
  .flow-canvas-tools > button { min-height: 39px; padding-inline: 6px; font-size: 12px; }
  #flow-open-assistant span { display: none; }
  .flow-zoom button { min-width: 44px; min-height: 44px; }
}

.flow-workspace-shell {
  --workspace-rail: 83px;
  position: relative;
  display: grid;
  grid-template-columns: var(--workspace-rail) minmax(0, 1fr);
  border-top: 1px solid #3c4c40;
}
.flow-workspace-stage { min-width: 0; }
.flow-workspace-rail {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 5px;
  padding: 9px 6px;
  border-right: 1px solid #405344;
  background: #19271f;
  color: var(--shell-text);
}
.flow-workspace-rail button {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 4px;
  min-width: 0;
  min-height: 58px;
  padding: 4px 3px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: inherit;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.25;
}
.flow-workspace-rail button span:first-child { color: #c6d8ae; font-size: 18px; line-height: 1; }
.flow-workspace-rail button:hover { background: #304b39; }
.flow-workspace-rail button[aria-expanded="true"] { border-color: #9bb473; background: #385135; }
.flow-workspace-rail button:focus-visible { outline-color: var(--accent); outline-offset: -2px; }

.flow-workspace-panel {
  position: absolute;
  z-index: 5;
  top: 8px;
  left: calc(var(--workspace-rail) + 8px);
  display: flex;
  flex-direction: column;
  width: min(342px, calc(100% - var(--workspace-rail) - 16px));
  max-height: min(580px, calc(100% - 24px));
  border: 1px solid #9eaf95;
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 9px 30px #1b2d2326;
}
.flow-workspace-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 48px;
  padding: 4px 8px 4px 13px;
  border-bottom: 1px solid var(--line);
  border-radius: 10px 10px 0 0;
  background: #edf2e1;
}
.flow-workspace-panel-header h3 { font-size: 16px; font-weight: 750; }
.flow-panel-close {
  display: grid;
  place-items: center;
  min-width: 44px;
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  font-size: 21px;
}
.flow-panel-close:hover { background: #e1e9d4; }
.flow-workspace-panel-content { min-height: 0; padding: 10px; overflow: auto; overscroll-behavior: contain; }
.flow-workspace-panel-content :is(input, select) { max-width: 100%; }
.flow-workspace-panel-content :is(.primary-button, .secondary-button) { min-height: 44px; }
.flow-panel-fields {
  display: grid;
  gap: 7px;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  margin-bottom: 9px;
}
.flow-panel-fields > *, .flow-panel-field { min-width: 0; }
.flow-panel-field { display: grid; gap: 3px; color: var(--muted); font-size: 12px; }
.flow-panel-fields :is(input, select), .flow-panel-field :is(input, select) { width: 100%; }
.flow-panel-count, .flow-panel-meta, .flow-panel-empty, #flow-panel-status { margin: 4px 0; color: var(--muted); font-size: 12px; }
.flow-panel-empty { padding: 10px 8px; border-radius: 6px; background: var(--wash); }
.flow-panel-list { display: grid; gap: 7px; min-width: 0; margin: 6px 0; padding: 0; list-style: none; }
.flow-panel-card {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  overflow-wrap: anywhere;
}
.flow-panel-card :is(h3, h4), .flow-media-card :is(h3, h4) { font-size: 14px; font-weight: 720; }
.flow-panel-actions, .flow-media-actions { display: flex; flex-wrap: wrap; gap: 5px; margin-block: 4px; }
.flow-panel-cover, .flow-panel-media {
  display: block;
  width: 100%;
  max-height: 150px;
  border-radius: 6px;
  object-fit: contain;
}
.flow-panel-cover { aspect-ratio: 16 / 9; object-fit: cover; }
.flow-panel-unavailable { margin-top: 12px; padding: 5px 0; border-top: 1px solid var(--line); }
.flow-panel-unavailable summary { min-height: 44px; padding-block: 10px; cursor: pointer; color: var(--accent-dark); }

.flow-canvas-controls {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 10px;
  min-width: 0;
  padding: 7px 9px;
  border-top: 1px solid #c3d1b9;
  background: #eef2e6;
}
.flow-view-controls { display: flex; flex-wrap: wrap; gap: 5px; }
.flow-canvas-controls button {
  min-height: 44px;
  padding: 5px 8px;
  border: 1px solid #bdcab4;
  border-radius: 6px;
  background: var(--surface);
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 700;
}
.flow-canvas-controls button[aria-pressed="true"] { background: #dce8bd; border-color: #739050; }
.flow-canvas-controls button:hover:not(:disabled) { border-color: #739050; }
.flow-canvas-controls button:disabled { color: #777f75; background: #e9eee4; }
.flow-canvas-controls select { width: auto; min-height: 44px; max-width: 128px; font-size: 13px; }
.flow-workspace-shortcuts summary {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding-inline: 7px;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 680;
  cursor: pointer;
}
.flow-workspace-shortcuts ul {
  position: absolute;
  z-index: 6;
  bottom: calc(100% + 6px);
  left: 9px;
  display: grid;
  gap: 6px;
  width: min(244px, calc(100% - 18px));
  margin: 0;
  padding: 10px 11px;
  border: 1px solid #a6b49d;
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 7px 25px #213b2733;
  color: var(--ink);
  font-size: 12px;
  list-style: none;
}
.flow-workspace-shortcuts kbd { padding: 1px 4px; border: 1px solid var(--line); border-radius: 3px; background: var(--wash); }
.flow-canvas-assistant { border-color: #a8bc9e; background: #fafbf2; }
.flow-canvas-assistant .flow-panel-heading { min-height: 44px; }
.flow-canvas-assistant .flow-panel-heading .flow-panel-close { margin: -4px -4px -4px 0; }
.flow-canvas-assistant #flow-assistant-submit { justify-self: start; min-height: 44px; }
.flow-canvas-assistant #flow-assistant-results { max-height: 320px; overflow: auto; padding: 1px; }
.flow-canvas-assistant #flow-assistant-results strong { overflow-wrap: anywhere; }
.flow-canvas-assistant #flow-assistant-status.is-error, .flow-panel-meta.is-error { color: var(--error); }
.flow-viewport.is-hand-mode { touch-action: none; cursor: grab; }
.flow-viewport.is-hand-mode :is(.flow-node, .flow-world-size) { cursor: inherit; touch-action: none; }
.flow-viewport.is-panning, .flow-viewport.is-panning .flow-node { cursor: grabbing; }
.flow-arrange-preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px 12px;
  padding: 7px 9px;
  border-top: 1px solid #bed1a3;
  background: #eff3df;
}
.flow-arrange-preview button { min-height: 44px; }
.flow-storyboard-view { height: var(--flow-board-height); padding: 12px; overflow: auto; background: #f4f5ec; }
.flow-storyboard-header { display: flex; flex-wrap: wrap; align-items: end; gap: 7px 12px; margin-bottom: 9px; }
.flow-storyboard-header > :first-child { min-width: 112px; margin-right: auto; }
.flow-storyboard-header h3 { font-size: 17px; }
.flow-storyboard-header .flow-field { flex: 1 1 115px; max-width: 225px; }
.flow-media-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(190px, 100%), 1fr)); align-items: start; gap: 8px; }
.flow-media-card { display: grid; gap: 4px; min-width: 0; padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.flow-media-card :is(img, video, audio), .flow-media-player { width: 100%; max-height: 178px; border-radius: 5px; object-fit: contain; }
.flow-media-card :is(img, video) { background: var(--shell); }
.flow-media-card :is(.primary-button, .secondary-button) { min-height: 44px; }

@media (max-width: 980px) {
  .flow-workspace-shell { grid-template-columns: minmax(0, 1fr); }
  .flow-workspace-rail { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 2px; padding: 4px; border: 0; }
  .flow-workspace-rail button { min-height: 52px; padding-inline: 0; }
  .flow-workspace-panel { top: 66px; left: 6px; width: min(400px, calc(100% - 12px)); max-height: min(62svh, calc(100% - 80px)); }
}
@media (max-width: 530px) {
  .flow-workspace-rail { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 2px; }
  .flow-workspace-rail button { justify-content: center; align-items: center; min-height: 50px; font-size: 11px; }
  .flow-workspace-rail button span:first-child { font-size: 15px; }
  .flow-workspace-panel { top: 60px; max-height: min(62svh, calc(100% - 68px)); }
  .flow-storyboard-view { padding: 8px; }
  .flow-canvas-controls { padding-inline: 6px; }
  .flow-canvas-controls :is(.flow-view-controls, .flow-zoom) { gap: 4px; }
}

.flow-generation { display: grid; gap: 8px; padding: 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--wash); }
.flow-generation h3 { margin: 0; font-size: 15px; }
.flow-generation-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; min-width: 0; }
.flow-generation-fields label:first-child { grid-column: 1 / -1; }
.flow-generation-fields select { width: 100%; min-width: 0; }
.flow-generation .secondary-button { justify-self: start; }

.flow-groups { position: absolute; inset: 0; pointer-events: none; }
.flow-group-frame {
  position: absolute;
  border: 1px dashed #b9cb89;
  border-radius: 14px;
  background: #afc28018;
}
.flow-group-handle {
  position: absolute;
  top: 2px;
  left: 3px;
  max-width: calc(100% - 6px);
  min-height: 31px;
  padding: 2px 8px;
  overflow: hidden;
  border: 1px solid #b1c280;
  border-radius: 8px;
  color: #f5f5e7;
  background: #374b33;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 700;
  cursor: grab;
  touch-action: none;
  pointer-events: auto;
}
.flow-group-handle:active { cursor: grabbing; }
.flow-group-handle:focus-visible { outline-color: #bed88a; }
.flow-group-lower-label .flow-group-handle { top: auto; bottom: 3px; }
.flow-group-size { margin-left: 8px; color: #d8e8bf; font: 650 11px/1 var(--mono); }
.flow-panel-group {
  min-width: 0;
  padding: 7px;
  border: 1px solid #c3d0ab;
  border-radius: 10px;
  background: #eff3e6;
}
.flow-panel-group .flow-group-disclosure {
  width: 100%;
  justify-content: flex-start;
  color: #344b2d;
  background: #dde8ca;
}
.flow-group-disclosure::before { content: "▸"; margin-right: 5px; }
.flow-group-disclosure[aria-expanded="true"]::before { content: "▾"; }
.flow-group-members { margin: 4px 0 0; }
.flow-group-members .flow-panel-card { background: #fffdf7; }
.flow-group-mark { display: inline-flex; align-items: center; min-height: 44px; gap: 5px; font-size: 13px; }
.flow-group-mark input { width: 16px; height: 16px; accent-color: #4c6d39; }
