.site-header nav { display:flex; gap:1rem; flex-wrap:wrap; }
.site-header nav a { color:inherit; }
.flow { max-width:none; color:#172b3b; }
.flow-controls { display:flex; flex-wrap:wrap; gap:.4rem; margin-bottom:1rem; }
.flow-controls button,.flow-panel button { min-height:44px; padding:.5rem .8rem; }
.flow-controls [aria-pressed="true"] { background:#17395c; color:#fff; }
.flow-frame { position:relative; overflow:hidden; border:1px solid #9caebc; background:#f6f9fc; touch-action:none; }
.flow-scene { width:max(100%, 1200px); transform-origin:top left; position:relative; }
.flow-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:16px; padding:16px; position:relative; }
.flow-zone { min-width:0; padding:12px; border:1px solid #b7c9d6; border-radius:12px; background:#eaf1f5e8; }
.flow-zone:first-child { background:#f9e7e7eb; }
.flow-zone h2 { font-size:20px; line-height:1.2; margin:0 0 8px; }
.flow-zone-description { min-height:62px; font-size:14px; line-height:1.35; margin:0 0 12px; }
.flow-card-wrap { margin:0 0 14px; position:relative; }
.flow-card { display:flex; width:100%; min-height:100px; text-align:left; flex-direction:column; gap:7px; padding:12px; border:2px solid #456782; border-radius:8px; background:#fff; color:#142c40; cursor:pointer; font-size:14px; line-height:1.3; }
.flow-card strong { font-size:15px; overflow-wrap:anywhere; }
.flow-card:focus-visible,.flow-controls button:focus-visible,.flow-panel button:focus-visible { outline:3px solid #003eaa; outline-offset:2px; }
.flow-new { border-style:dashed; }
.flow-meter { display:block; height:5px; width:100%; background:#d7e0e6; border-radius:4px; }
.flow-meter span { display:block; height:100%; background:#17644e; border-radius:4px; }
.flow-meter span.over { background:#b51d25; }
.flow-size,.flow-delta { font-size:13px; }.flow-delta { font-weight:700; }
.flow-lines { position:absolute; inset:0; width:100%; height:100%; pointer-events:none; z-index:1; }
.flow-arrow { fill:none; stroke:#305b9e; opacity:.72; }
.flow-card-wrap { z-index:2; }.flow-zone h2,.flow-zone-description { position:relative; z-index:2; }
.mech-always { stroke:#a02020; color:#8b1717; }.mech-skill_trigger { stroke:#8b4a00; color:#784000; }.mech-reference { stroke:#305b9e; color:#244b86; }.mech-code { stroke:#69368a; color:#62377c; }.mech-playbook { stroke:#006957; color:#006354; }.mech-cron { stroke:#754b27; color:#684122; }.mech-mixed { stroke:#444; color:#333; }
.flow-transfer-list { grid-column:1/-1; background:#fff; padding:12px 16px; border:1px solid #a5b3c1; border-radius:8px; z-index:2; }
.flow-transfer-list h2 { font-size:18px; }.flow-transfer-list p { display:inline-block; background:#fff; margin:.3rem .8rem .3rem 0; font-size:14px; }
.flow-mobile-moves { display:none; }
.flow-panel { position:fixed; z-index:40; right:0; top:0; bottom:0; width:min(440px,95vw); background:#fff; color:#172b3b; padding:1rem; box-shadow:0 0 12px #0006; overflow:auto; }
.flow-panel[hidden] { display:none; }.flow-panel>button { display:block; margin-bottom:.5rem; }.flow-panel h2 { overflow-wrap:anywhere; }
.flow-block-row { padding:.8rem 0; border-bottom:1px solid #b8c5ce; }.flow-block-row summary { cursor:pointer; }.flow-block-row summary span { display:block; }.flow-block-row p,.flow-block-row pre { white-space:pre-wrap; overflow-wrap:anywhere; font:inherit; }
.flow-legend { display:flex; gap:.5rem 1.2rem; flex-wrap:wrap; padding:1rem 0; font-size:14px; color:#172b3b; }.flow-legend strong { width:100%; }
body:has(.flow) > button { display:none !important; }
@media(max-width:650px) {
 .flow-frame { overflow:visible; touch-action:auto; }.flow-scene { width:100%; transform:none !important; }.flow-grid { display:block; padding:10px; }.flow-zone { margin-bottom:14px; }.flow-zone-description { min-height:0; }.flow-card { width:100%; }.flow-lines { display:none; }.flow-mobile-moves { display:block; padding:0 10px; font-size:14px; }.flow-mobile-moves p { margin:.4rem 0; }.flow-transfer-list { display:none; }.flow-panel { top:auto; width:100%; max-height:70vh; border-radius:16px 16px 0 0; }
}
/* Space for routes and their labels between the existing columns. */
.flow-scene { width:max(100%, 1800px); box-sizing:border-box; }
.flow-grid { gap:160px; padding:16px 60px; }
.flow-arrow-label { font-size:13px; fill:#172b3b; stroke:none; }
.flow-label-bg { fill:#fff; stroke:#b7c9d6; stroke-width:1; }
.flow-summary { margin:.3rem 0 1rem; }
@media(max-width:650px) {
 .flow-scene { width:100%; padding-top:0 !important; }
 .flow-grid { padding:10px; }
}

.flow-transfers { padding:1rem 0; }
.flow-transfers table { width:100%; border-collapse:collapse; }
.flow-transfers td { border-bottom:1px solid #b7c9d6; }
.flow-transfers button { display:block; width:100%; min-height:44px; padding:.6rem; text-align:left; background:#fff; color:#172b3b; border:0; cursor:pointer; }
.flow-transfers button:focus-visible { outline:3px solid #003eaa; }
.flow-legend span[class^="legend-"]::before { content:""; display:inline-block; width:1em; height:1em; margin-right:.35em; vertical-align:middle; background:currentColor; }
.legend-always { color:#8b1717; } .legend-skill_trigger { color:#784000; } .legend-reference { color:#244b86; } .legend-code { color:#62377c; } .legend-playbook { color:#006354; } .legend-cron { color:#684122; } .legend-drop { color:#555; }
/* Room for cards and routes at the diagram's fitted width. */
.flow-scene { width:max(100%, 1500px); }
.flow-grid { gap:150px; padding:16px; }
.flow-card.selected { border:4px solid #003eaa; box-shadow:0 3px 12px #003eaa66; }
.flow-card.flow-dim { opacity:.6; }
.flow-selected-badge { align-self:flex-start; padding:2px 7px; border-radius:4px; background:#003eaa; color:#fff; font-weight:700; }
.flow-legend h2 { width:100%; margin:0; font-size:18px; }
@media(max-width:650px) { .flow-scene { width:100%; } .flow-grid { padding:10px; } }

.flow-card.flow-destination { outline: 3px solid #1769a6; outline-offset: 3px; }
.flow-move-controls { display:flex; flex-wrap:wrap; gap:.6rem; align-items:end; padding:.5rem 0 1rem; }
.flow-move-controls label { display:flex; flex-direction:column; gap:.25rem; }
.flow-move-controls select { max-width:100%; min-height:44px; }
.flow-error,.flow-sensitive { color:#a10016; } .flow-sensitive { font-weight:700; border:2px solid #a10016; padding:.75rem; }
.flow-moved { color:#17644e; } .flow-warning { color:#784000; }
.flow-modal-backdrop { position:fixed; inset:0; z-index:100; display:flex; justify-content:center; align-items:center; background:#0009; }
.flow-modal { box-sizing:border-box; background:#fff; color:#172b3b; width:min(720px,95vw); max-height:90vh; overflow:auto; padding:1.2rem; border-radius:10px; }
.flow-modal pre { white-space:pre-wrap; overflow-wrap:anywhere; font:inherit; max-height:none; overflow:visible; }
.flow-modal button { min-height:44px; margin:.4rem .5rem .4rem 0; }
@media(max-width:650px) { .flow-modal-backdrop { align-items:flex-end; } .flow-modal { width:100%; max-height:90vh; border-radius:16px 16px 0 0; } }

/* Detail and preview must remain usable with long names and narrow screens. */
body:has(.flow-panel:not([hidden])) { overflow:hidden; }
.flow { min-width:0; overflow-wrap:anywhere; }
.flow-panel { box-sizing:border-box; min-width:0; overflow-x:hidden; overflow-y:auto; overscroll-behavior:contain; overflow-wrap:anywhere; }
.flow-panel > * { min-width:0; max-width:100%; }
.flow-block-row { display:grid; grid-template-columns:minmax(0,1fr); }
.flow-block-row > * { min-width:0; max-width:100%; }
.flow-move-controls { display:grid; grid-template-columns:minmax(0,1fr); }
.flow-move-controls label, .flow-move-controls select, .flow-move-controls button { box-sizing:border-box; min-width:0; max-width:100%; width:100%; }
.flow-move-controls [hidden] { display:none; }
.flow-modal { display:flex; flex-direction:column; min-width:0; overflow:hidden; padding:0; overflow-wrap:anywhere; }
.flow-modal-body { min-width:0; overflow-y:auto; overflow-x:hidden; padding:1.2rem; overscroll-behavior:contain; }
.flow-modal-footer { position:sticky; bottom:0; flex:none; display:flex; gap:.5rem; background:#fff; padding:.75rem 1.2rem; border-top:1px solid #b7c9d6; }
.flow-modal-footer button { margin:0; }
@media(max-width:650px) {
 .flow-frame { overflow:hidden; }
 .flow-panel { left:0; right:0; top:auto; bottom:0; width:100%; max-height:70vh; }
 .flow-modal { width:100%; max-width:100%; }
 .flow-modal-footer { flex-direction:column; }
 .flow-modal-footer button { width:100%; min-height:44px; }
}
