/* Full-screen case workspace, isolated from the site's legacy SVG/icon rules. */
.drawer.case-workspace{inset:0;width:100vw;height:100dvh;max-width:none;z-index:160;grid-template-rows:auto minmax(0,1fr) auto}
.case-workspace .drawer-head{padding:12px 24px;background:var(--surface);min-height:76px}
.case-workspace .drawer-head .eyebrow{margin-bottom:3px;font-size:11px}
.case-workspace .drawer-body{padding:0;overflow:hidden;min-height:0}
.case-workspace #caseForm{display:flex;flex-direction:column;height:100%;gap:0;min-height:0}
.case-workspace .drawer-foot{min-height:68px;padding:10px 24px}
.case-workspace .workspace-tabs{display:flex;align-items:center;gap:8px;padding:8px 24px;background:var(--surface);border-bottom:1px solid var(--border);flex-shrink:0}
.workspace-tabs button{min-height:40px;border:0;background:transparent;border-radius:8px;padding:8px 16px;color:var(--muted);font-weight:750}
.workspace-tabs button.active{background:var(--primary-soft);color:var(--primary)}
.workspace-tabs small{margin-left:auto;color:var(--muted)}
.case-workspace .case-metadata{padding:24px;overflow:auto;display:grid;grid-template-columns:1fr 1fr;gap:0 24px;max-width:1200px;width:100%;margin:auto}
.case-workspace #advancedFlow{display:flex;flex:1;min-height:0;width:100%}
.case-workspace [hidden]{display:none!important}
.workspace-tabs>span{margin-left:auto;color:var(--muted);font-size:12px}
@media(max-width:650px){.workspace-tabs>span{display:none}}
#modalRoot .modal-backdrop{z-index:180}
#modalRoot .modal{z-index:190}
.modal .diagram-canvas svg{max-width:100%;height:auto}
.flow-preview svg{display:block;width:100%;height:auto;stroke:none;fill:none}
.case-workspace #simpleSteps,.case-workspace .legacy-flow-mode{display:none!important}
.fe{display:flex;flex:1;flex-direction:column;min-width:0;min-height:0;font-size:14px}
.fe [hidden]{display:none!important}
.fe button{border:1px solid var(--border);background:var(--surface);color:var(--text);border-radius:8px;min-height:36px;padding:7px 10px;font-size:13px;font-weight:650}
.fe button:hover{background:var(--primary-soft);border-color:var(--primary)}
.fe button:disabled{opacity:.4;cursor:default}
.fe button:focus-visible,.fe [tabindex]:focus-visible{outline:3px solid var(--primary);outline-offset:2px}
.fe-toolbar{display:flex;gap:6px;align-items:center;padding:8px 16px;background:var(--surface);flex-wrap:wrap;border-bottom:1px solid var(--border)}
.fe-view-switch{display:flex;gap:3px;margin-right:8px;border-radius:9px;background:var(--surface-2);padding:3px}
.fe-view-switch button{border:0;background:transparent}
.fe-view-switch button.active{background:var(--primary-soft);color:var(--primary)}
.fe-status{margin-left:auto;color:var(--muted);font-size:12px}
.fe-palette{display:flex;align-items:center;gap:8px;padding:8px 16px;border-bottom:1px solid var(--border);background:var(--surface);flex-wrap:wrap}
.fe-palette>span{font-size:12px;color:var(--muted);margin-right:4px}
.fe-palette button{border-style:dashed;cursor:grab}
.fe-palette small{margin-left:auto;color:var(--muted);font-size:11px}
.fe-work{display:grid;grid-template-columns:minmax(0,1fr) 310px;flex:1;min-height:0;position:relative}
.fe-viewport{min-height:240px;position:relative;overflow:hidden;background-color:var(--bg);background-image:radial-gradient(var(--border) 1px,transparent 1px);background-size:20px 20px;touch-action:none;cursor:grab;outline:none}
.fe-world{position:absolute;left:0;top:0;width:1px;height:1px;transform-origin:0 0}
.fe .fe-wires{position:absolute;left:0;top:0;width:1px;height:1px;overflow:visible;fill:none;stroke:none;max-width:none;pointer-events:none}
.fe .fe-edge{pointer-events:none;cursor:pointer}
.fe .fe-edge-line{stroke:var(--muted);stroke-width:1.7;fill:none;pointer-events:none}
.fe .fe-edge-hit{stroke:transparent;stroke-width:12;fill:none;pointer-events:stroke;vector-effect:non-scaling-stroke}
.fe .fe-edge-label{pointer-events:none}
.fe .fe-edge-label rect{fill:var(--bg);stroke:var(--border);stroke-width:1;pointer-events:visiblePainted}
.fe .fe-edge:hover .fe-edge-line,.fe .fe-edge:focus-visible .fe-edge-line{stroke:var(--primary);stroke-width:3}
.fe .fe-edge.selected .fe-edge-line{stroke:var(--primary);stroke-width:3}
.fe .fe-wires text{font-family:Arial,sans-serif;font-size:12px;fill:var(--muted);stroke:none;pointer-events:none}
.fe .fe-pending{stroke:var(--primary);stroke-width:2;stroke-dasharray:6 4;fill:none;pointer-events:none}
.fe-node{position:absolute;width:248px;height:138px;border:1px solid var(--border);border-radius:12px;background:var(--surface);box-shadow:0 3px 12px rgba(15,23,42,.06);user-select:none;cursor:pointer;padding:0 16px;touch-action:none}
.fe-node.selected{border:2px solid var(--primary);box-shadow:0 0 0 4px var(--primary-soft);padding:0 15px}
.fe-drag{display:flex;justify-content:space-between;align-items:center;height:35px;color:var(--primary);font-size:11px;font-weight:800;cursor:grab}
.fe-node>strong{display:block;font-size:14px;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;color:var(--text)}
.fe-node>p{font-size:12px;line-height:1.55;margin:7px 0 0;color:var(--muted);display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;white-space:pre-wrap}
.fe-node.type-decision{border-color:#8b5cf6;background:var(--primary-soft)}
.fe-node.type-start,.fe-node.type-end{border-radius:24px;border-color:var(--success)}
.fe-node.type-error{border-color:var(--danger)}
.fe .fe-node .fe-port{position:absolute;top:55px;width:28px;height:28px;min-height:28px;padding:0;border-radius:50%;border:7px solid var(--surface);background:var(--primary);z-index:3;cursor:crosshair}
.fe .fe-node .fe-in{left:-15px}.fe .fe-node .fe-out{right:-15px}
.fe .fe-node .fe-port:hover{background:var(--success);box-shadow:0 0 0 2px var(--primary)}
.fe .fe-node .fe-plus{position:absolute;right:12px;bottom:-16px;width:32px;min-height:32px;border-radius:50%;padding:0;background:var(--surface);color:var(--primary);font-size:22px;z-index:2}
.fe-inspector{border-left:1px solid var(--border);background:var(--surface);overflow:auto;padding:16px;min-width:0}
.fe-inspector header{display:flex;justify-content:space-between;align-items:center;margin-bottom:14px}
.fe-inspector h3{font-size:15px;margin:0}.fe-inspector h4{font-size:13px;margin:20px 0 8px}
.fe-inspector label{display:grid;gap:5px;font-size:12px;font-weight:750;margin-bottom:12px;color:var(--muted)}
.fe-inspector input,.fe-inspector select,.fe-inspector textarea{width:100%;min-width:0;padding:9px 10px;min-height:40px;font:inherit;font-size:13px;color:var(--text);background:var(--bg);border:1px solid var(--border);border-radius:8px;outline:none}
.fe-inspector textarea{resize:vertical;min-height:92px;font-weight:400}
.fe-inspector input:focus,.fe-inspector select:focus,.fe-inspector textarea:focus{border-color:var(--primary);box-shadow:var(--focus)}
.fe-inspector-actions{display:flex;gap:6px;flex-wrap:wrap;margin:10px 0}
.fe-position{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.fe .fe-danger{color:var(--danger);margin-top:18px;font-size:12px}
.fe .fe-outgoing{display:block;width:100%;text-align:left;margin-bottom:6px;font-weight:500}
.fe-note{font-size:12px;color:var(--muted);line-height:1.5}
.fe-inspector-empty{padding:26px 4px;color:var(--muted);line-height:1.7;font-size:13px}
.fe-large{font-size:40px;display:block;color:var(--primary)}
.fe-hint{position:absolute;top:12px;left:16px;right:16px;font-size:11px;color:var(--muted);background:var(--surface);padding:7px 10px;border:1px solid var(--border);border-radius:8px;pointer-events:none;max-height:90px;overflow:auto}
.fe-zoom{position:absolute;left:16px;bottom:16px;display:flex;align-items:center;gap:5px;padding:5px;background:var(--surface);border:1px solid var(--border);border-radius:12px}
.fe-zoom output{min-width:44px;text-align:center;font-size:12px;color:var(--muted)}
.fe-list{padding:16px;overflow:auto;background:var(--bg)}
.fe-list>button{display:grid;text-align:left;width:100%;margin-bottom:8px;gap:6px;padding:12px 16px}
.fe-list>button.selected{border-color:var(--primary);background:var(--primary-soft)}
.fe-list span,.fe-list small{font-weight:400;color:var(--muted);overflow-wrap:anywhere}
.fe-list strong{font-size:15px}
@media(max-width:900px){.fe-work{grid-template-columns:minmax(0,1fr) 270px}.fe-status{width:100%;margin:0}.fe-palette small{display:none}}
@media(max-width:650px){.case-workspace .drawer-head{padding:8px 12px;min-height:62px}.case-workspace .drawer-head h2{font-size:16px}.case-workspace .drawer-foot{padding:8px 10px;flex-wrap:wrap;min-height:64px}.case-workspace .drawer-foot>span{font-size:11px}.case-workspace .workspace-tabs{padding:6px 10px}.workspace-tabs small{display:none}.case-workspace .case-metadata{grid-template-columns:1fr;padding:16px}.fe-work{grid-template-columns:1fr}.fe-inspector{display:none}.fe-inspector.has-selection{display:block;position:absolute;right:0;top:0;bottom:0;width:min(310px,86vw);z-index:8;box-shadow:-10px 0 30px rgba(0,0,0,.16)}.fe-toolbar{padding:6px;gap:4px}.fe-toolbar button{font-size:12px;padding:6px}.fe-toolbar button span{display:none}.fe-palette{padding:6px;gap:5px;flex-wrap:nowrap;overflow-x:auto;flex-shrink:0}.fe-palette button{white-space:nowrap;font-size:12px;min-height:40px}.fe-palette>span{display:none}.fe-hint{font-size:10px;left:8px;right:8px}.fe-zoom{left:8px;bottom:8px}.fe button{min-height:40px}}

/* Canvas-first workspace. Panels float above a stable, full-width viewport. */
.case-workspace .drawer-head{min-height:58px;padding:8px 16px}
.case-workspace .drawer-foot{min-height:54px;padding:8px 16px}
.case-workspace .workspace-tabs{padding:4px 16px}
.workspace-tabs button{min-height:34px;padding:6px 12px}
.fe-wide{position:relative;isolation:isolate;background:var(--bg)}
.fe-wide .fe-work{display:block;position:relative;flex:1;min-height:0;width:100%;overflow:hidden}
.fe-wide .fe-viewport,.fe-wide .fe-list{position:absolute;inset:0;min-height:0;width:100%;height:100%}
.fe-wide .fe-list{padding:66px 80px 62px;overflow:auto}
.fe-wide .fe-world.fe-reveal{transition:transform 180ms ease-out}
.fe-wide .fe-icon{display:block;width:20px;height:20px;min-width:20px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round;overflow:visible}
.fe-wide .fe-icon-button,.fe-wide summary{position:relative;display:grid;place-items:center;width:38px;height:38px;min-height:38px;padding:8px;border:0;border-radius:9px;background:transparent;color:var(--muted);cursor:pointer;list-style:none;flex-shrink:0}
.fe-wide summary::-webkit-details-marker{display:none}
.fe-wide summary:hover,.fe-wide summary:focus-visible,.fe-wide details[open]>summary,.fe-wide button[aria-pressed=true]{background:var(--primary-soft);color:var(--primary)}
.fe-wide summary:focus-visible{outline:3px solid var(--primary);outline-offset:2px}
.fe-wide .fe-icon-button:hover{background:var(--primary-soft);color:var(--primary)}
.fe-wide .fe-dock{position:absolute;left:12px;top:12px;z-index:12;padding:5px;display:flex;flex-direction:column;gap:4px;border:1px solid var(--border);border-radius:14px;background:var(--surface);box-shadow:0 4px 18px #0f172a12}
.fe-wide .fe-dock-body{display:flex;flex-direction:column;gap:4px}
.fe-wide .fe-dock-divider{height:1px;background:var(--border);margin:2px 4px}
.fe-wide .fe-tool-group{position:static;border:0;padding:0;margin:0;overflow:visible}
.fe-wide .fe-flyout{position:absolute;left:calc(100% + 12px);top:0;z-index:20;display:flex;flex-direction:column;align-items:stretch;width:220px;max-width:calc(100vw - 100px);max-height:min(380px,65dvh);overflow-y:auto;gap:4px;padding:10px;margin:0;background:var(--surface);border:1px solid var(--border);border-radius:12px;box-shadow:0 8px 32px #0f172a26}
.fe-wide details:not([open])>.fe-flyout{display:none}
.fe-wide .fe-flyout strong{font-size:12px;color:var(--muted);padding:4px 8px}
.fe-wide .fe-flyout button{display:flex;align-items:center;gap:9px;min-height:38px;padding:9px 10px;text-align:left;border:0;border-radius:8px;background:transparent;font-weight:550}
.fe-wide .fe-flyout button:hover,.fe-wide .fe-flyout button.active{background:var(--primary-soft);color:var(--primary)}
.fe-wide .fe-flyout small{display:block;margin:5px 8px;color:var(--muted);font-size:11px;line-height:1.5;white-space:normal}
.fe-wide .fe-canvas-actions{position:absolute;top:12px;right:12px;z-index:12;display:flex;gap:3px;padding:4px;border:1px solid var(--border);border-radius:12px;background:var(--surface);box-shadow:0 4px 18px #0f172a12}
.fe-wide .fe-inspector,.fe-wide .fe-inspector.has-selection{display:block;position:absolute;inset:68px 12px 60px auto;width:320px;max-width:calc(100% - 90px);padding:16px;border:1px solid var(--border);border-radius:14px;background:var(--surface);box-shadow:0 6px 26px #0f172a18;z-index:10;overscroll-behavior:contain}
.fe-wide .fe-inspector header{position:sticky;top:-16px;padding:8px 0;margin-top:-8px;background:var(--surface);z-index:1}
.fe-wide .fe-inspector-empty{padding:10px 2px}
.fe-wide .fe-zoom{position:absolute;left:12px;bottom:12px;z-index:12;gap:2px;padding:4px;box-shadow:0 4px 18px #0f172a12}
.fe-wide .fe-zoom output{min-width:44px;font-size:12px;font-variant-numeric:tabular-nums}
.fe-wide .fe-zoom-menu{position:relative}
.fe-wide .fe-zoom-menu .fe-flyout{left:auto;right:0;top:auto;bottom:calc(100% + 12px);width:120px}
.fe-wide .fe-status{position:absolute;right:16px;bottom:24px;max-width:calc(100% - 300px);font-size:11px;line-height:1.5;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;color:var(--muted);pointer-events:none}
.fe-wide .fe-hint{top:14px;left:76px;right:110px;z-index:9;max-height:100px;pointer-events:auto;overscroll-behavior:contain;box-shadow:0 2px 8px #0f172a10}
.fe-wide [data-tip]:hover::after,.fe-wide [data-tip]:focus-visible::after{content:attr(data-tip);position:absolute;left:calc(100% + 12px);top:50%;transform:translateY(-50%);padding:6px 9px;border-radius:6px;color:var(--surface);background:var(--text);font-size:11px;font-weight:500;white-space:nowrap;pointer-events:none;z-index:40}
.fe-wide .fe-canvas-actions [data-tip]::after{left:auto;right:0;top:calc(100% + 10px);transform:none}
.fe-wide .fe-zoom [data-tip]::after{left:0;top:auto;bottom:calc(100% + 10px);transform:none}
.fe-wide.fe-expanded{position:fixed;inset:0;z-index:500;width:100vw;height:100dvh}
.case-workspace.fe-immersive{grid-template-rows:minmax(0,1fr) auto}
.case-workspace.fe-immersive>.drawer-head,.case-workspace.fe-immersive .workspace-tabs{display:none}
.case-workspace.fe-immersive .fe-expanded{position:relative;inset:auto;width:100%;height:100%;z-index:auto}
.case-workspace.fe-immersive>.drawer-foot{min-height:48px;padding:5px 12px}
@media(max-width:650px){
  .fe-wide .fe-dock{left:8px;top:8px;padding:3px}
  .fe-wide .fe-canvas-actions{right:8px;top:8px}
  .fe-wide .fe-icon-button,.fe-wide summary{width:36px;height:36px;min-height:36px;padding:7px}
  .fe-wide .fe-inspector,.fe-wide .fe-inspector.has-selection{inset:auto 8px 62px 60px;width:auto;max-width:none;height:44%;max-height:370px;padding:12px}
  .fe-wide .fe-inspector header{top:-12px}
  .fe-wide .fe-zoom{left:8px;bottom:8px}
  .fe-wide .fe-status{display:none}
  .fe-wide .fe-list{padding:64px 58px 64px 64px}
  .fe-wide .fe-hint{left:60px;right:92px;top:8px}
  .fe-wide .fe-flyout{max-height:48dvh;width:205px}
  .case-workspace .drawer-foot>span{font-size:10px}
  .case-workspace .drawer-foot{min-height:50px}
}
@media(prefers-reduced-motion:reduce){.fe-wide .fe-world.fe-reveal{transition:none}}
