:root{--settings-bg:#fff;--settings-panel:#f5f5f7;--settings-text:#1d1d1f;--settings-muted:#6e6e73;--settings-line:#e5e5e7;--settings-control:#e8e8ed;--settings-selected:#1d1d1f;--settings-selected-text:#fff}
.header-tools{position:absolute;right:24px;top:50%;transform:translateY(-50%);display:flex;align-items:center;gap:14px}.header-update{display:flex;flex-direction:column;align-items:flex-end;gap:1px;font-size:11px;line-height:1.5;color:#86868b;font-variant-numeric:tabular-nums}.header-update strong{font-weight:500;color:#6e6e73}.settings-trigger,.settings-close{width:36px;height:36px;display:grid;place-items:center;border-radius:50%;background:#e8e8ed;color:#1d1d1f;transition:background .15s,transform .15s}.settings-trigger:hover,.settings-close:hover{background:#dedee3;transform:scale(1.035)}.settings-trigger svg{width:20px;height:20px}.settings-open{overflow:hidden}.settings-dialog{width:min(660px,calc(100vw - 32px));max-height:min(840px,calc(100dvh - 48px));padding:0;border:1px solid var(--settings-line);border-radius:24px;background:var(--settings-bg);color:var(--settings-text);box-shadow:0 24px 90px #00000040}.settings-dialog::backdrop{background:#00000045;backdrop-filter:blur(7px);-webkit-backdrop-filter:blur(7px)}.settings-dialog-header{position:sticky;top:0;z-index:1;display:flex;justify-content:space-between;align-items:center;padding:22px 26px;background:var(--settings-bg);border-bottom:1px solid var(--settings-line)}.settings-dialog h2{font-size:24px;line-height:1.3;margin:0;font-weight:600;letter-spacing:-.025em}.settings-close{background:var(--settings-control);color:var(--settings-text)}.settings-dialog-body{padding:24px 26px 28px;display:grid;gap:25px}.settings-section h3{font-size:15px;font-weight:600;margin:0 0 12px}.theme-choices{display:flex;gap:4px;padding:5px;border-radius:999px;background:var(--settings-control)}.theme-choices button{flex:1;border-radius:999px;padding:9px 10px;font-size:13px;line-height:20px;color:var(--settings-muted);white-space:nowrap}.theme-choices button[aria-pressed="true"]{background:var(--settings-selected);color:var(--settings-selected-text)}.release-current{display:flex;justify-content:space-between;gap:15px;flex-wrap:wrap;font-size:12px;color:var(--settings-muted);padding:13px 0 0}.release-current strong{font-weight:600;color:var(--settings-text)}.release-entry{padding:20px;border-radius:18px;background:var(--settings-panel)}.release-meta{display:flex;align-items:center;gap:10px;font-size:11px;color:var(--settings-muted);font-variant-numeric:tabular-nums}.release-meta span{background:var(--settings-control);color:var(--settings-text);padding:2px 8px;border-radius:999px}.release-entry h4{font-size:16px;margin:10px 0 12px;font-weight:600}.release-entry ul{margin:0;padding-left:18px;color:var(--settings-muted);font-size:13px;line-height:1.8}.release-entry li+li{margin-top:7px}.author-card{display:flex;align-items:center;justify-content:space-between;gap:22px;padding:20px;background:var(--settings-panel);border-radius:18px}.author-profile{display:flex;align-items:center;gap:15px}.author-avatar{width:64px;height:64px;border-radius:50%;object-fit:cover;background:#fff}.author-profile strong{font-size:19px;font-weight:600}.author-profile p{font-size:12px;color:var(--settings-muted);margin:3px 0 0}.author-qr{width:112px;min-height:112px;flex-shrink:0;border-radius:14px;display:flex;align-items:center;justify-content:center;background:var(--settings-bg);border:1px dashed var(--settings-line);padding:10px;text-align:center;font-size:11px;color:var(--settings-muted);line-height:1.7}.author-qr img{display:block;width:100%;height:auto}.author-qr a{display:block;text-decoration:none;color:inherit}.author-qr-caption{font-size:10px;line-height:1.4;margin-top:5px}.settings-dialog button:focus-visible{outline:2px solid var(--settings-text);outline-offset:2px}
@media(max-width:800px){.header-update{display:none}.header-tools{right:18px}}@media(max-width:480px){.header .brand{gap:9px}.header h1{font-size:20px}.header .brand-mark{width:30px;height:30px}.header-tools{right:12px}.settings-trigger{width:32px;height:32px}.settings-dialog-header{padding:18px 20px}.settings-dialog-body{padding:20px}.settings-dialog h2{font-size:22px}.author-card{padding:15px;gap:12px}.author-profile{gap:10px}.author-avatar{width:48px;height:48px}.author-qr{width:98px;min-height:98px}.release-entry{padding:16px}.theme-choices button{font-size:12px;padding:8px}}
/* Dark appearance mirrors the same workflow layout and role colors. */
html[data-theme="dark"]{color-scheme:dark;--settings-bg:#202022;--settings-panel:#29292c;--settings-text:#f5f5f7;--settings-muted:#a1a1a6;--settings-line:#3a3a3e;--settings-control:#343438;--settings-selected:#f5f5f7;--settings-selected-text:#1d1d1f}
html[data-theme="dark"] body{background:#151517;color:#f5f5f7}html[data-theme="dark"] .header{background:rgba(21,21,23,.76);border-color:#ffffff14}html[data-theme="dark"] .header h1{color:#f5f5f7}html[data-theme="dark"] .header-update,html[data-theme="dark"] .header-update strong{color:#a1a1a6}html[data-theme="dark"] .settings-trigger{background:#343438;color:#f5f5f7}html[data-theme="dark"] .settings-trigger:hover{background:#404046}html[data-theme="dark"] .role-bar,html[data-theme="dark"] .sidebar,html[data-theme="dark"] .workspace,html[data-theme="dark"] .canvas-toolbar{background:#202022;border-color:#3a3a3e}html[data-theme="dark"] .flow-layout{background:#202022;border-color:#3a3a3e}html[data-theme="dark"] .viewport{background:#151517}html[data-theme="dark"] .role-filter{background:#29292c;border-color:#444449;color:#d2d2d7}html[data-theme="dark"] .role-filter:hover{background:#343438;border-color:#65656b}html[data-theme="dark"] .role-filter.active{background:#f5f5f7;border-color:#f5f5f7;color:#1d1d1f;box-shadow:0 0 0 1px #f5f5f7}html[data-theme="dark"] .role-actions .reset-button,html[data-theme="dark"] .zoom-controls button,html[data-theme="dark"] .cancel-filter-button{background:#343438;color:#d2d2d7}html[data-theme="dark"] .role-actions .reset-button:hover,html[data-theme="dark"] .zoom-controls button:hover,html[data-theme="dark"] .cancel-filter-button:hover{background:#444449;color:#fff}html[data-theme="dark"] .zoom-controls button:disabled{background:#252527;color:#5c5c64}html[data-theme="dark"] .zoom-controls #zoomValue{color:#a1a1a6}html[data-theme="dark"] .divider{background:#444449}html[data-theme="dark"] .step-item{background:#202022;color:#a1a1a6}html[data-theme="dark"] .step-item:not(.selected):hover{background:#343438;color:#f5f5f7}html[data-theme="dark"] .step-item.selected{background:#f5f5f7;color:#1d1d1f}html[data-theme="dark"] .step-item.selected:hover{background:#e5e5e7;color:#1d1d1f}html[data-theme="dark"] .step-item .step-no{background:#e8e8ed;color:#1d1d1f}html[data-theme="dark"] .step-item.selected .step-no{background:#1d1d1f;color:#fff}html[data-theme="dark"] .flow-node:not(.decision){background:#29292c;color:#f5f5f7}html[data-theme="dark"] .flow-node .node-description{color:#b3b3bb;border-color:#444449}html[data-theme="dark"] .flow-node .number{background:#f5f5f7;color:#1d1d1f}html[data-theme="dark"] .flow-node.decision{background:transparent;color:#f5f5f7}html[data-theme="dark"] .flow-node.decision:after{background:#29292c}html[data-theme="dark"] .flow-node:not(.decision).is-relevant{box-shadow:0 0 0 2.5px #e8e8ed}html[data-theme="dark"] .flow-node:not(.decision).is-selected,html[data-theme="dark"] .flow-node:not(.decision):hover{box-shadow:0 10px 30px #00000070}html[data-theme="dark"] .flow-node:not(.decision).is-relevant.is-selected,html[data-theme="dark"] .flow-node:not(.decision).is-relevant:hover{box-shadow:0 0 0 2.5px #e8e8ed,0 10px 30px #00000070}html[data-theme="dark"] .role-chip.is-active,html[data-theme="dark"] .role-chip:focus-visible,html[data-theme="dark"] .flow-node:focus-visible,html[data-theme="dark"] button:focus-visible{outline-color:#f5f5f7}html[data-theme="dark"] #edges path{stroke:#7d7d85}html[data-theme="dark"] #edges text{fill:#a1a1a6;stroke:#151517}html[data-theme="dark"] .font-tabs{background:#343438}html[data-theme="dark"] .font-tabs button{color:#b3b3bb}html[data-theme="dark"] .font-tabs button:hover{background:#444449}html[data-theme="dark"] .font-tabs button[aria-selected="true"]{background:#f5f5f7;color:#1d1d1f}html[data-theme="dark"] .delivery-card{background:#202022;border-color:#3a3a3e}html[data-theme="dark"] .delivery-card h3{color:#f5f5f7}html[data-theme="dark"] .delivery-card ul{color:#b3b3bb}html[data-theme="dark"] .inline-role{color:var(--role)}html[data-theme="dark"] .resource-link{background:#343438;color:#b3b3bb}html[data-theme="dark"] .resource-link:not(:disabled):hover{background:#444449;color:#f5f5f7}html[data-theme="dark"] .node-tooltip{background:#09090b;border-color:#3a3a3e;color:#e8e8ed;box-shadow:0 16px 48px #00000080}html[data-theme="dark"] .resource-notice{background:#f5f5f7;color:#1d1d1f}html[data-theme="dark"] .viewport::-webkit-scrollbar-track{background:#252529}html[data-theme="dark"] .viewport::-webkit-scrollbar-thumb{background:#55555d;border-color:#252529}html[data-theme="dark"] .viewport::-webkit-scrollbar-thumb:hover{background:#676771}
/* Display controls sit at the upper left, opposite role filters. */
.role-bar{justify-content:space-between;flex-wrap:wrap;gap:12px 20px}.diagram-controls{display:flex;align-items:center;gap:16px;flex-shrink:0}.role-actions{margin-left:auto;max-width:100%}@media(max-width:680px){.diagram-controls{gap:10px}.role-bar{gap:12px}.role-actions{margin-left:auto}.diagram-controls .zoom-controls{gap:4px}}

/* Filter borders breathe gently without changing card colors or geometry. */
:root{--filter-outline:#1d1d1f}html[data-theme="dark"]{--filter-outline:#e8e8ed}
html[data-theme] .flow-node:not(.decision).is-relevant{box-shadow:none}
html[data-theme] .flow-node:not(.decision).is-relevant.is-selected,html[data-theme] .flow-node:not(.decision).is-relevant:hover{box-shadow:0 8px 26px #0000002e,0 2px 7px #00000012}
.flow-node:not(.decision).is-relevant:before{content:"";position:absolute;inset:-3px;border:3px solid var(--filter-outline);border-radius:inherit;pointer-events:none;animation:filter-outline-breathe 2.8s ease-in-out infinite}
.flow-node.decision.is-relevant:before{display:block;inset:-3px;background:var(--filter-outline);clip-path:url(#roundedDecision);pointer-events:none;animation:filter-outline-breathe 2.8s ease-in-out infinite}
@keyframes filter-outline-breathe{0%,100%{opacity:.72}50%{opacity:1}}
.node-tooltip{box-shadow:0 16px 40px #0000004d,0 4px 12px #00000029}html[data-theme="dark"] .node-tooltip{box-shadow:0 16px 48px #000000a6,0 4px 14px #00000066}
/* Display controls follow reading order: overview, zoom, then font size. */
.overview-button{display:grid;place-items:center;min-width:56px;height:34px;padding:0 14px;border-radius:999px;background:#e8e8ed;color:#515154;font-size:12px;line-height:20px;transition:background .18s,transform .18s}.overview-button:hover{background:#dedee3;transform:scale(1.035)}.font-size-control{display:flex;align-items:center;gap:9px}.font-size-label{font-size:12px;color:#6e6e73;white-space:nowrap}html[data-theme="dark"] .overview-button{background:#343438;color:#d2d2d7}html[data-theme="dark"] .overview-button:hover{background:#444449}html[data-theme="dark"] .font-size-label{color:#b3b3bb}
/* Nonmodal settings panel beside the gear. */
.settings-dialog{position:fixed;inset:76px 24px auto auto;margin:0;width:min(460px,calc(100vw - 32px));max-height:calc(100dvh - 96px);border-radius:22px;box-shadow:0 16px 52px #0000002e,0 3px 12px #00000012}.settings-dialog::backdrop{background:none;backdrop-filter:none;-webkit-backdrop-filter:none}.settings-dialog-header{padding:18px 20px}.settings-dialog-body{padding:20px;gap:22px}.settings-dialog h2{font-size:21px}.settings-dialog .release-entry{padding:17px}.settings-dialog .release-entry li+li{margin-top:6px}
/* Sliding segmented controls. */
.theme-choices,.font-tabs{position:relative;isolation:isolate}.theme-choices:before{content:"";position:absolute;left:5px;top:5px;width:calc((100% - 18px)/3);height:calc(100% - 10px);border-radius:999px;background:var(--settings-selected);transform:translateX(var(--theme-shift,calc(200% + 8px)));transition:transform .28s cubic-bezier(.2,.8,.2,1),background-color .22s}
.theme-choices button,.font-tabs button{position:relative;z-index:1;transition:color .22s,background-color .22s}.theme-choices button[aria-pressed="true"]{background:transparent}
.font-tabs:before{content:"";position:absolute;left:4px;top:4px;width:34px;height:calc(100% - 8px);border-radius:999px;background:var(--settings-selected);transform:translateX(var(--font-shift,calc(100% + 2px)));transition:transform .28s cubic-bezier(.2,.8,.2,1),background-color .22s}html[data-theme] .font-tabs button[aria-selected="true"]{background:transparent;color:var(--settings-selected-text)}
body,.header,.role-bar,.sidebar,.workspace,.viewport,.delivery-card,.settings-dialog,.settings-dialog-header,.release-entry,.author-card{transition:background-color .22s,color .22s,border-color .22s}
@media(max-width:680px){.diagram-controls{gap:12px}.font-tabs:before{width:29px}.font-size-control{gap:7px}.font-size-label{font-size:11px}.settings-dialog{inset:72px 12px auto auto;width:calc(100vw - 24px);max-height:calc(100dvh - 84px)}}
@media(prefers-reduced-motion:reduce){.flow-node.is-relevant:before{animation:none;opacity:1}.theme-choices:before,.font-tabs:before,.theme-choices button,.font-tabs button,body,.header,.role-bar,.sidebar,.workspace,.viewport,.delivery-card,.settings-dialog,.settings-dialog-header,.release-entry,.author-card{transition:none}}

.settings-dialog{overflow:auto;scrollbar-width:thin}.author-card{display:block;padding:0;background:transparent;border-radius:0}.author-profile{display:inline-flex;align-items:center;gap:8px}.author-avatar{width:24px;height:24px}.author-profile strong{font-size:14px;font-weight:500;line-height:24px}.workspace{position:relative}.viewport{overscroll-behavior:contain}.pan-controls{position:absolute;left:16px;right:16px;bottom:30px;display:flex;justify-content:space-between;pointer-events:none;z-index:6}.pan-button{display:grid;place-items:center;width:34px;height:34px;min-width:34px;padding:0;background:#e8e8ed;color:#515154;border-radius:50%;box-shadow:0 3px 10px #00000012;pointer-events:auto;transition:background .18s,transform .18s}.pan-button:hover{background:#dedee3;transform:scale(1.035)}.pan-button:disabled{opacity:.4;cursor:default;transform:none}html[data-theme="dark"] .pan-button{background:#343438;color:#d2d2d7}html[data-theme="dark"] .pan-button:hover{background:#444449}@media(max-width:680px){.author-avatar{width:24px;height:24px}.author-profile{gap:8px}.pan-controls{left:12px;right:12px;bottom:28px}}

.overview-button[aria-pressed="true"]{background:#1d1d1f;color:#fff}html[data-theme="dark"] .overview-button[aria-pressed="true"]{background:#f5f5f7;color:#1d1d1f}.author-profile{position:relative}.author-qr-trigger{display:grid;place-items:center;width:26px;height:26px;min-width:26px;padding:0;border-radius:50%;background:var(--settings-control);color:var(--settings-text);transition:background .18s,transform .18s}.author-qr-trigger:hover{transform:scale(1.035)}.author-qr-popover{position:absolute;bottom:calc(100% + 10px);left:0;z-index:3;width:202px;padding:10px;background:#fff;color:#1d1d1f;border:1px solid #e5e5e7;border-radius:16px;box-shadow:0 10px 32px #00000035}.author-qr-popover img{display:block;width:180px;height:180px}.author-qr-popover p{margin:6px 0 0;text-align:center;font-size:11px;color:#6e6e73;line-height:18px}.author-qr-popover a{display:block}

.settings-dialog{z-index:70}

.view-reset-button{display:grid;place-items:center;width:34px;height:34px;min-width:34px;padding:0;border-radius:50%;background:#e8e8ed;color:#515154;transition:background .18s,transform .18s}.view-reset-button:hover{background:#dedee3;transform:scale(1.035)}html[data-theme="dark"] .view-reset-button{background:#343438;color:#d2d2d7}html[data-theme="dark"] .view-reset-button:hover{background:#444449}

/* Display controls float at bottom right; end-navigation stays at the top. */
.workspace>.diagram-controls{position:absolute;right:16px;bottom:30px;z-index:8;max-width:calc(100% - 32px);padding:6px 10px;gap:12px;border:1px solid #e5e5e780;border-radius:999px;background:rgba(255,255,255,.88);backdrop-filter:blur(14px);-webkit-backdrop-filter:blur(14px);box-shadow:0 4px 18px #00000014}.pan-controls{top:16px;bottom:auto}html[data-theme="dark"] .workspace>.diagram-controls{background:rgba(32,32,34,.9);border-color:#444449;box-shadow:0 4px 18px #00000045}@media(max-width:1000px){.workspace>.diagram-controls{flex-wrap:wrap;justify-content:flex-end;border-radius:20px}}@media(max-width:680px){.workspace>.diagram-controls{right:12px;bottom:28px;max-width:calc(100% - 24px);padding:8px;gap:8px}.pan-controls{top:12px;bottom:auto}}

.author-card{display:flex;align-items:center;justify-content:space-between;gap:16px}.release-current{display:flex;flex-direction:column;align-items:flex-end;gap:1px;padding:0;font-size:11px;line-height:1.5;flex-shrink:0}.release-current strong{font-weight:500}

.overview-button.is-overview{width:34px;height:34px;min-width:34px;padding:0;border-radius:50%}.workspace .pan-button:disabled,.workspace .zoom-controls button:disabled,.workspace #actualSize:disabled{display:none}#jumpEnd{margin-left:auto}.flow-node.decision.is-relevant:before{display:none;animation:none}.flow-node.decision:focus-visible{outline:none;filter:drop-shadow(0 8px 14px #00000030)}
/* Role labels use equal pill dimensions in cards and tips. */
.role-chip{display:inline-flex;align-items:center;justify-content:center;width:44px;min-width:44px;height:24px;padding:1px 2px;line-height:20px;flex-shrink:0}.flow-node .node-roles{column-gap:2px;row-gap:5px}

:root{--font-ui:"PingFang SC","PingFang-SC","苹方",-apple-system,BlinkMacSystemFont,"Helvetica Neue","Microsoft YaHei",Arial,sans-serif}body,button,input,select,textarea,dialog,svg text{font-family:var(--font-ui)}body{-webkit-font-smoothing:antialiased}

.sidebar .step-list{padding-top:14px}
.role-bar{justify-content:center}
.role-bar .role-actions{margin-inline:auto;justify-content:center}
.role-bar .role-filters{justify-content:center}

#canvas #edges .is-direct-downstream>.edge-line{stroke:#6e6e73}
#canvas #edges .edge-flow-arrow{fill:none;stroke:#48484d;stroke-width:2.4;stroke-linecap:round;stroke-linejoin:round;pointer-events:none}
#canvas #edges .is-direct-downstream>.edge-line.return{animation:downstream-dashes .65s linear infinite}
@keyframes downstream-dashes{from{stroke-dashoffset:10}to{stroke-dashoffset:0}}
html[data-theme="dark"] #canvas #edges .is-direct-downstream>.edge-line{stroke:#b3b3bb}
html[data-theme="dark"] #canvas #edges .edge-flow-arrow{stroke:#f5f5f7}
@media(prefers-reduced-motion:reduce){#canvas #edges .edge-flow-arrow{display:none}#canvas #edges .is-direct-downstream>.edge-line.return{animation:none}}

body{height:100dvh;min-height:400px;display:flex;flex-direction:column;overflow:hidden}
.header,.role-bar{flex-shrink:0}
body>.flow-layout{flex:1 1 0;height:auto;min-height:220px;margin:14px 24px 0}
.site-footer{position:relative;display:flex;flex-shrink:0;align-items:center;justify-content:center;height:54px;padding:0 24px;color:var(--settings-muted);font-size:11px}
.site-release{display:flex;align-items:center;justify-content:center;gap:12px;font-variant-numeric:tabular-nums}
.site-release strong{font-size:inherit;font-weight:400}
.delivery-trigger{position:absolute;right:24px;display:flex;align-items:center;gap:7px;height:34px;padding:0 15px;border-radius:999px;background:var(--settings-control);color:var(--settings-text);font-size:12px;transition:background .18s,transform .18s}
.delivery-trigger:hover{transform:translateY(-1px)}
.delivery-dialog{position:fixed;inset:76px 24px auto auto;margin:0;width:min(760px,calc(100vw - 48px));max-height:calc(100dvh - 150px);padding:0;border:1px solid var(--settings-line);border-radius:22px;background:var(--settings-bg);color:var(--settings-text);box-shadow:0 16px 52px #0000002e,0 3px 12px #00000012;z-index:75;overflow:auto;overscroll-behavior:contain}
.delivery-dialog-header{position:sticky;top:0;z-index:1;display:flex;align-items:center;justify-content:space-between;padding:18px 22px;background:var(--settings-bg);border-bottom:1px solid var(--settings-line)}
.delivery-dialog h2{margin:0;font-size:21px;font-weight:600}
.delivery-close{display:grid;place-items:center;width:30px;height:30px;border-radius:50%;background:var(--settings-control);color:var(--settings-text)}
.delivery-dialog .delivery-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;margin:0;padding:20px}
.delivery-dialog .delivery-card{padding:20px;border-color:var(--settings-line);background:var(--settings-panel)}
.delivery-dialog .delivery-card h3{font-size:18px;margin:0}
.delivery-dialog .delivery-card ul{font-size:13px}
.workspace #fitView,.workspace #fitView.is-overview{width:34px;min-width:34px;height:34px;padding:0;border-radius:50%;flex-shrink:0}
.workspace #fitView:hover{transform:none}
.role-chip,.role-chip:hover,html[data-theme="dark"] .role-chip:hover{cursor:default;outline:none;box-shadow:none}
#releaseHistory{display:grid;gap:16px}
.node-tooltip.role-definition-tip{z-index:60;width:300px;padding:16px 18px;font-size:14px;line-height:1.7}
.node-tooltip.role-definition-tip h3{font-size:16px;margin:0 0 6px;color:var(--tip-role,#fff)}
.node-tooltip.role-definition-tip p{margin:0}
#canvas .flow-node:not(.decision) h3{transition:transform .18s ease}
#canvas .flow-node:not(.decision).is-selected h3{transform:scale(1.1);transform-origin:center}
#canvas .flow-node:not(.decision).is-selected .number{font-size:calc(var(--diagram-number)*1.35);min-width:32px;height:24px;line-height:24px;padding:0 7px}
.workspace>.diagram-controls{gap:20px}
@media(max-width:680px){.workspace>.diagram-controls{gap:12px}}
@media(prefers-reduced-motion:reduce){#canvas .flow-node:not(.decision) h3{transition:none}}
.site-release{font-size:11px;color:var(--settings-muted);cursor:pointer;border-radius:8px;padding:4px 8px}
.site-release:hover{color:var(--settings-text)}
.release-popover{position:fixed;left:50%;bottom:64px;translate:-50% 0;z-index:80;display:flex;flex-direction:column;width:min(420px,calc(100vw - 24px));height:360px;max-height:calc(100dvh - 100px);padding:0;border:1px solid #e5e5e7;border-radius:20px;background:#fff;color:#1d1d1f;box-shadow:0 16px 52px #0000002e,0 3px 12px #00000012;animation:popup-reveal .2s cubic-bezier(.2,.7,.3,1) both}
.release-popover>h2{flex-shrink:0;margin:0;padding:17px 20px;border-bottom:1px solid #e5e5e7;font-size:18px;font-weight:600}
.release-popover-list{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;display:grid;align-content:start;gap:16px;padding:16px;scrollbar-width:thin}
.release-popover .release-entry{padding:16px;background:#f5f5f7;color:#1d1d1f;border-radius:14px}
.release-popover .release-meta,.release-popover .release-entry ul{color:#6e6e73}
.release-popover .release-meta span{background:#e8e8ed;color:#1d1d1f}
.release-popover .release-entry h4{font-size:15px;margin:10px 0}
.release-popover .release-entry li+li{margin-top:5px}
@media(prefers-reduced-motion:reduce){.release-popover{animation:none}}
.workspace #zoomOut:disabled{display:grid}
#canvas #edges .edge-flow-arrow{fill:#a1a1a6;stroke:none}
html[data-theme="dark"] #canvas #edges .edge-flow-arrow{fill:#a1a1a6;stroke:none}
.settings-dialog[open],.delivery-dialog[open],.node-tooltip:not([hidden]),.author-qr-popover:not([hidden]){animation:popup-reveal .2s cubic-bezier(.2,.7,.3,1) both}
@keyframes popup-reveal{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:translateY(0)}}
@media(max-width:680px){body>.flow-layout{margin:10px 12px 0;min-height:200px}.site-footer{padding:0 12px}.delivery-trigger{right:12px}.delivery-dialog{right:12px;width:calc(100vw - 24px)}.delivery-dialog .delivery-grid{grid-template-columns:1fr;padding:14px}.site-release{gap:8px;font-size:10px}}
@media(prefers-reduced-motion:reduce){.settings-dialog[open],.delivery-dialog[open],.node-tooltip:not([hidden]),.author-qr-popover:not([hidden]){animation:none}}

.header-tools .delivery-trigger{position:static;right:auto;flex-shrink:0;height:36px}
@media(max-width:600px){.header{justify-content:flex-start}.header .brand{width:auto}.header-tools{gap:8px}.header-tools .delivery-trigger{height:32px;padding:0 12px}.delivery-dialog{top:72px}}

#canvas .flow-node:not(.decision).is-selected{z-index:4;animation:none;transform:translate(-50%,-50%)}
.delivery-dialog .resource-link{display:inline-flex;align-items:center;justify-content:center;width:28px;min-width:28px;height:28px;margin-left:7px;padding:0;border-radius:50%;background:var(--settings-control);color:var(--settings-muted);text-decoration:none;vertical-align:middle;flex-shrink:0;transition:background .16s,color .16s}
.delivery-dialog .resource-link:hover{background:var(--settings-line);color:var(--settings-text)}
.delivery-dialog .resource-link svg{display:block}
.node-tooltip .tooltip-ai{margin-top:12px;padding-top:11px;border-top:1px solid #ffffff26}
.node-tooltip .tooltip-ai h4{margin:0 0 5px;font-size:14px;font-weight:600;color:#fff}
.node-tooltip .tooltip-ai .ai-label{color:#ffd166}
.node-tooltip .tooltip-ai p{margin:0;color:#e8e8ed}
html.theme-fade *,html.theme-fade *::before,html.theme-fade *::after{transition-property:background-color,color,border-color,fill,stroke,box-shadow,transform!important;transition-duration:.28s!important;transition-timing-function:ease-in-out!important;transition-delay:0s!important}
@media(prefers-reduced-motion:reduce){html.theme-fade *,html.theme-fade *::before,html.theme-fade *::after{transition:none!important}}
.role-filter .role-icon{display:block;width:16px;height:16px;flex:0 0 16px;color:var(--role)}
.brand .brand-mark{background:transparent}

.node-selection-frame{display:none;position:absolute;inset:-14px;width:calc(100% + 28px);height:calc(100% + 28px);pointer-events:none;transform-origin:center}
.selection-corner{position:absolute;display:block;width:35px;height:35px;color:var(--filter-outline,#1d1d1f);overflow:visible}
.selection-corner.top-left{top:0;left:0}
.selection-corner.top-right{top:0;right:0;transform:rotate(90deg)}
.selection-corner.bottom-right{bottom:0;right:0;transform:rotate(180deg)}
.selection-corner.bottom-left{bottom:0;left:0;transform:rotate(270deg)}
#canvas .flow-node.is-selected>.node-selection-frame{display:block;animation:selection-corner-breathe 2.2s ease-in-out infinite}
#canvas .flow-node:not(.decision).is-selected.is-relevant:before{display:block}
@keyframes selection-corner-breathe{0%,100%{transform:scale(1);opacity:.8}50%{transform:scale(1.012);opacity:1}}
@media(prefers-reduced-motion:reduce){#canvas .flow-node.is-selected>.node-selection-frame{animation:none;transform:none;opacity:1}}

/* Mobile: one filter rail, a stage picker, and a single bottom control row. */
.mobile-stage-control{display:none}
@media(max-width:680px){
  body{min-height:320px}
  .header{min-height:60px;height:60px}
  .role-bar{padding:10px 12px;overflow:hidden}
  .role-bar .role-actions{display:flex;flex-wrap:nowrap;width:100%;min-width:0;gap:10px;margin:0}
  .role-bar .role-filters{display:flex;flex:1 1 0;min-width:0;justify-content:flex-start;flex-wrap:nowrap;gap:6px;overflow-x:auto;overscroll-behavior-x:contain;scrollbar-width:none;padding:2px 0;touch-action:pan-x}
  .role-filters::-webkit-scrollbar{display:none}
  .role-filter{flex:0 0 76px;width:76px;min-width:76px;white-space:nowrap}
  .role-actions .reset-button{position:static;flex:0 0 34px;width:34px;height:34px;margin:0}
  body>.flow-layout{display:flex;flex-direction:column;min-height:140px;margin:8px 8px 0;overflow:hidden}
  .flow-layout>.sidebar{display:none}
  .flow-layout>.workspace{display:flex;flex-direction:column;flex:1 1 0;min-width:0;min-height:0;width:100%;overflow:hidden;background:var(--bg)}
  .mobile-stage-control{display:flex;order:0;flex:0 0 auto;align-items:center;gap:12px;margin:12px 12px 0;min-height:42px}
  .mobile-stage-control>label{flex-shrink:0;font-size:14px;color:var(--settings-muted)}
  .stage-select-wrap{position:relative;flex:1;min-width:0}
  .stage-select-wrap select{display:block;width:100%;min-height:42px;appearance:none;-webkit-appearance:none;padding:9px 38px 9px 14px;border:1px solid var(--settings-line);border-radius:12px;background:var(--settings-bg);color:var(--settings-text);font-size:16px;line-height:22px;text-overflow:ellipsis}
  .stage-select-wrap>svg{position:absolute;right:14px;top:50%;transform:translateY(-50%);pointer-events:none;color:var(--settings-muted)}
  .stage-select-wrap select:focus-visible{outline:2px solid var(--filter-outline);outline-offset:2px}
  .workspace>.viewport{order:1;flex:1 1 0;min-height:0;width:100%}
  .workspace>.pan-controls{top:66px;left:12px;right:12px}
  .workspace>.diagram-controls{position:relative;order:2;flex:0 0 auto;right:auto;bottom:auto;display:flex;flex-wrap:nowrap;justify-content:space-between;gap:4px;width:calc(100% - 16px);max-width:none;margin:8px;padding:7px 5px;border-radius:999px;overflow-x:auto;overflow-y:hidden;scrollbar-width:none;box-sizing:border-box}
  .diagram-controls::-webkit-scrollbar{display:none}
  .workspace .diagram-controls #fitView,.workspace .diagram-controls #fitView.is-overview,.workspace .diagram-controls .view-reset-button{width:26px;min-width:26px;height:30px;flex-shrink:0}
  .diagram-controls .zoom-controls{display:flex;align-items:center;flex-wrap:nowrap;gap:2px;flex-shrink:0}
  .workspace .diagram-controls .zoom-controls button{width:26px;min-width:26px;height:30px;padding:0}
  .diagram-controls #zoomValue{display:inline-block;min-width:28px;font-size:11px;text-align:center}
  .workspace .diagram-controls .actual-size-button{min-width:36px;height:30px;padding:0 4px;font-size:11px;flex-shrink:0}
  .diagram-controls .font-size-control{gap:0;flex-shrink:0}
  .diagram-controls .font-size-label{display:none}
  .diagram-controls .font-tabs{display:flex;flex-wrap:nowrap;gap:2px;padding:3px}
  .diagram-controls .font-tabs button{width:22px;height:24px;font-size:12px;flex-shrink:0}
  .diagram-controls .font-tabs:before{left:3px;top:3px;width:22px;height:calc(100% - 6px)}
  .site-footer{height:calc(32px + env(safe-area-inset-bottom,0px));padding:0 12px env(safe-area-inset-bottom,0px)}
  .release-popover{bottom:42px}
  html[data-theme="dark"] .flow-layout>.workspace{background:#151517}
}

/* Keep the graph scrollbar subtle while preserving drag affordance. */
.viewport{--scroll-track:#f0f0f3;--scroll-thumb:#d0d1d7;--scroll-hover:#bfc1c9;--scroll-active:#b4b6bf}
.viewport::-webkit-scrollbar-track{background:var(--scroll-track)}
.viewport::-webkit-scrollbar-thumb{background:var(--scroll-thumb);border-color:var(--scroll-track)}
.viewport::-webkit-scrollbar-thumb:hover{background:var(--scroll-hover)}
.viewport::-webkit-scrollbar-thumb:active{background:var(--scroll-active)}
html[data-theme="dark"] .viewport{--scroll-track:#1c1c20;--scroll-thumb:#3a3a42;--scroll-hover:#4b4b54;--scroll-active:#585862}
html[data-theme="dark"] .viewport::-webkit-scrollbar-track{background:var(--scroll-track)}
html[data-theme="dark"] .viewport::-webkit-scrollbar-thumb{background:var(--scroll-thumb);border-color:var(--scroll-track)}
html[data-theme="dark"] .viewport::-webkit-scrollbar-thumb:hover{background:var(--scroll-hover)}
html[data-theme="dark"] .viewport::-webkit-scrollbar-thumb:active{background:var(--scroll-active)}

@supports not selector(::-webkit-scrollbar){.viewport{scrollbar-color:var(--scroll-thumb) var(--scroll-track)}}

/* Keep mobile icons circular and use the same stage badge as workflow cards. */
.viewport{touch-action:none}
@media(max-width:680px){
  .workspace>.viewport{overflow-y:auto}
  .workspace>.diagram-controls{gap:3px;padding-inline:4px}
  .workspace .diagram-controls #fitView,.workspace .diagram-controls #fitView.is-overview,.workspace .diagram-controls .view-reset-button,.workspace .diagram-controls .zoom-controls button{width:28px;min-width:28px;max-width:28px;height:28px;min-height:28px;max-height:28px;aspect-ratio:1;flex:0 0 28px;border-radius:50%;padding:0;box-sizing:border-box}
  .diagram-controls .font-tabs button{width:24px;min-width:24px;height:24px;min-height:24px;flex:0 0 24px;border-radius:50%;padding:0}
  .diagram-controls .font-tabs:before{width:24px;height:24px;border-radius:50%}
  .stage-select-wrap{border:1px solid var(--settings-line);border-radius:999px;background:var(--settings-bg)}
  .stage-select-wrap select{border:0;border-radius:999px;opacity:0;position:relative;z-index:1;background:transparent}
  .stage-select-wrap:focus-within{outline:2px solid var(--filter-outline);outline-offset:2px}
  .stage-select-value{position:absolute;inset:0;display:flex;align-items:center;gap:9px;min-width:0;padding:9px 38px 9px 14px;pointer-events:none;color:var(--settings-text);font-size:14px}
  .stage-select-number{display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;min-width:25px;padding:0 6px;border-radius:999px;background:#1d1d1f;color:#fff;font-size:11px;font-weight:700;line-height:18px;letter-spacing:0;font-variant-numeric:tabular-nums}
  .stage-select-title{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  html[data-theme="dark"] .stage-select-number{background:#e8e8ed;color:#1d1d1f}
}

/* Prevent mobile text inflation from changing measured workflow geometry. */
html{-webkit-text-size-adjust:100%;text-size-adjust:100%}

/* Keep keyboard focus distinct from the one active appearance segment. */
.theme-choices{display:grid;grid-template-columns:repeat(3,minmax(0,1fr))}
.theme-choices:before{left:0;width:var(--theme-width,calc((100% - 18px)/3));transform:translateX(var(--theme-left,5px))}
.theme-choices button{min-width:0}
html[data-theme] .theme-choices button[aria-pressed="true"]{background:transparent;color:var(--settings-selected-text)}
.settings-dialog:focus{outline:none}
.settings-dialog .theme-choices button:focus-visible{outline:2px dotted var(--settings-muted);outline-offset:-5px}
@media(max-width:680px){
  .settings-dialog{inset:50% auto auto 50%;translate:-50% -50%;width:min(340px,calc(100vw - 40px));max-height:min(480px,70dvh);margin:0;border-radius:20px;overflow:hidden}
  .settings-dialog[open]{display:flex;flex-direction:column}
  .settings-dialog::backdrop{background:rgba(0,0,0,.34);backdrop-filter:none;-webkit-backdrop-filter:none}
  .settings-dialog-header{flex:0 0 auto;padding:15px 16px}
  .settings-dialog h2{font-size:20px}
  .settings-dialog-body{flex:1 1 auto;min-height:0;overflow-y:auto;overscroll-behavior:contain;padding:16px;gap:18px}
  .settings-dialog .settings-section h3{font-size:14px;margin-bottom:10px}
  .settings-dialog .theme-choices button{padding:8px 4px;font-size:12px}
  .settings-dialog .release-entry{padding:14px;border-radius:14px}
  .settings-dialog .release-entry h4{font-size:15px;margin:9px 0}
  .settings-dialog .release-entry ul{font-size:12px;line-height:1.7}
  .settings-dialog .author-profile strong{font-size:13px}
}
