.model-layer-bar {display:flex;align-items:center;gap:10px;flex-wrap:wrap;padding:8px 24px 0;min-height:56px;flex-shrink:0}
.model-layer-bar label {font-size:12px;font-weight:600;margin:0}
.model-layer-bar select {width:auto;max-width:100%;min-height:44px;padding:8px 32px 8px 12px;font-size:13px}
.model-layer-bar #layer-state {flex:1;min-width:100px;font-size:12px}
.node-quick-actions .node-layer-action {opacity:1;pointer-events:auto;background:var(--md-sys-color-primary-container);color:var(--md-sys-color-on-primary-container);border:1px solid var(--md-sys-color-primary);padding:4px;gap:2px}
.node-quick-actions.compact-actions .node-layer-action::before {display:none}
#edges path.information-edge,#process-edges path.information-edge {stroke:var(--md-sys-color-tertiary);stroke-width:2.5;stroke-dasharray:6 4;fill:none}
#information-arrow path {fill:var(--md-sys-color-tertiary)}
.layer-marker-definitions {position:absolute;pointer-events:none}
.outline-row {display:flex;align-items:center;gap:6px}
#outline .outline-row>[data-node] {flex:1;min-width:0;width:auto}
#outline .outline-row>[data-layer-object] {width:44px;min-width:44px;flex-shrink:0;text-align:center;background:var(--md-sys-color-primary-container);color:var(--md-sys-color-on-primary-container)}
.information-popover {position:fixed;z-index:1300;max-height:calc(100dvh - 16px);overflow:auto;padding:12px;border:1px solid var(--md-sys-color-outline);background:var(--md-sys-color-surface-container-lowest);border-radius:16px;box-shadow:var(--mr-shadow-dialog)}
.information-header {display:flex;align-items:start;gap:8px}
.information-header h3 {flex:1;margin:8px 0;font-size:15px;overflow-wrap:anywhere}
.information-item {padding:8px 0;border-bottom:1px solid var(--md-sys-color-outline-variant);overflow-wrap:anywhere}
.information-item button {width:100%;text-align:left;white-space:normal;overflow-wrap:anywhere}
.information-item p {margin:4px 0;white-space:pre-wrap}
#information-edit {margin-top:12px;width:100%}
#process-panel {display:flex;flex-direction:column;gap:8px;padding:8px 24px 12px;flex:1;min-height:0;overflow:auto}
.process-toolbar {display:flex;align-items:center;flex-wrap:wrap;gap:6px}
.process-toolbar select {width:auto;max-width:100%;flex:1;min-width:130px}
.process-toolbar button {font-size:13px;padding:8px 12px}
.process-toolbar details {position:relative}
.process-toolbar summary {min-height:44px;display:flex;align-items:center;padding:8px;cursor:pointer;font-size:13px}
.process-toolbar details[open]>button {position:absolute;right:0;top:48px;min-width:180px;z-index:5;background:var(--md-sys-color-surface-container-lowest)}
#process-summary {margin:0;font-size:12px}
.process-stage-wrap {position:relative;flex:1;min-height:320px;border:1px solid var(--md-sys-color-outline-variant);border-radius:16px;overflow:hidden;background:var(--md-sys-color-surface-container-low)}
#process-stage {height:100%;min-height:320px;overflow:auto;touch-action:pan-x pan-y pinch-zoom;overscroll-behavior:contain;padding-bottom:64px}
#process-world {position:relative;min-width:100%;min-height:100%}
#process-drawing {position:absolute;transform-origin:top left}
#process-edges,#process-nodes {position:absolute;inset:0;width:100%;height:100%}
#process-edges {pointer-events:none;overflow:visible}
#process-edges path.process-flow {fill:none;stroke:var(--md-sys-color-outline);stroke-width:2}
#process-arrow path {fill:var(--md-sys-color-outline)}
#process-edges text {font-size:13px;fill:var(--md-sys-color-on-surface);paint-order:stroke;stroke:var(--md-sys-color-surface-container-low);stroke-width:5;stroke-linejoin:round}
.process-node-group {position:absolute}
.process-node {display:flex;flex-direction:column;align-items:flex-start;justify-content:center;gap:6px;position:absolute;inset:0;width:100%;height:100%;text-align:left;padding:16px 48px 16px 18px;border:1px solid var(--md-sys-color-outline);border-radius:10px;background:var(--md-sys-color-surface-container-lowest);box-shadow:var(--mr-shadow-low);overflow:hidden}
.process-node strong {display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;overflow-wrap:anywhere;font-size:14px;line-height:1.4}
.process-node[data-type=start],.process-node[data-type=end] {border-radius:48px}
.process-node[data-type=decision] {border-width:2px;border-style:dashed;border-radius:4px}
.process-node[aria-pressed=true] {outline:3px solid var(--md-sys-color-primary);outline-offset:3px;background:var(--md-sys-color-primary-container)}
.process-type {font-size:12px;color:var(--md-sys-color-on-surface-variant)}
.process-layer {position:absolute;right:6px;bottom:6px;min-height:44px;min-width:40px;padding:8px;background:var(--md-sys-color-primary-container);color:var(--md-sys-color-on-primary-container)}
.process-view-controls {position:absolute;bottom:8px;left:8px;display:flex;align-items:center;gap:4px;padding:4px;border-radius:12px;background:var(--md-sys-color-surface-container-lowest);border:1px solid var(--md-sys-color-outline-variant);max-width:calc(100% - 16px)}
.process-view-controls button {font-size:12px;padding:8px;min-height:44px}
.process-view-controls output {min-width:38px;text-align:center;font-size:12px}
.process-flows {flex-shrink:0;border-top:1px solid var(--md-sys-color-outline-variant)}
.process-flows summary {min-height:44px;cursor:pointer;padding:10px 0}
#process-flows {display:grid;gap:8px;max-height:240px;overflow:auto}
.process-flow-row button {width:100%;text-align:left;white-space:normal;overflow-wrap:anywhere}
#process-node-editor,#process-flow-editor {padding:20px}
#process-node-editor h2,#process-flow-editor h2 {font-size:20px}
.process-editor-actions {position:sticky;bottom:-20px;display:flex;justify-content:flex-end;flex-wrap:wrap;gap:8px;background:var(--md-sys-color-surface-container-low);padding:12px 0}
.process-editor-actions button {flex:1}
#workspace-main[data-view=process]>.heading {position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip-path:inset(50%)}
input:not([type=checkbox]):not([type=radio]),textarea,select {border-color:var(--mr-color-control-outline)}
@media(max-width:1100px){.object-detail-open>#process-panel,.object-detail-open>#model-layer-bar {display:none!important}}
@media(max-width:599px){.model-layer-bar {padding:8px 12px;gap:6px}.model-layer-bar label {font-size:13px}.model-layer-bar select {flex:1;font-size:16px;min-width:130px}.model-layer-bar #layer-state {display:none}#process-panel {padding:4px 12px 8px}.process-toolbar button {font-size:13px}.process-toolbar #process-overview {font-size:0;gap:0;width:44px;min-width:44px}.process-view-controls {gap:0}#process-node-editor,#process-flow-editor {padding:16px}.process-editor-actions {bottom:-16px}.process-type {font-size:13px}}
@media(forced-colors:active){#edges path.information-edge,#process-edges path.information-edge,#process-edges path.process-flow {stroke:CanvasText}#information-arrow path,#process-arrow path {fill:CanvasText}.process-node[aria-pressed=true] {outline-color:Highlight}.node-quick-actions .node-layer-action {border-color:ButtonText}}

/* Visual hierarchy: use the existing action row and keep the canvas primary. */
#map-toolbar {flex-wrap:wrap}
#map-toolbar .toolbar-gap {margin-left:auto}
#map-toolbar .model-layer-bar,#process-model-actions .model-layer-bar {padding:0;min-height:44px;gap:6px;flex:0 1 auto}
#map-toolbar .model-layer-bar select,#process-model-actions .model-layer-bar select {width:188px;min-width:120px;min-height:44px}
#map-toolbar .model-layer-bar #layer-state,#process-model-actions .model-layer-bar #layer-state {display:none}
#nodes .node,#probe {font-size:14px;line-height:1.45;font-weight:550}
#nodes .node-meta,#probe .node-meta {font-size:11px;line-height:1.35}
#edges path[data-branch] {stroke-width:2.25;stroke-dasharray:none}
#edges path[data-branch].selected-subtree-edge {stroke-width:3.5;stroke-dasharray:none}
#edges path.information-edge {stroke-dasharray:6 4;stroke-width:2.5}
.process-node strong {font-size:15px}
.process-toolbar button {min-height:44px}
.process-toolbar .icon-only {width:44px;min-width:44px;padding:10px}
.process-toolbar button:disabled,#map-toolbar>button:disabled {background:transparent;border-color:transparent;opacity:.55}
.information-item>button {min-height:44px;border-color:transparent;border-radius:8px;background:transparent;padding:8px;font-size:14px;justify-content:flex-start}
.information-item>button:hover {background:var(--md-sys-color-surface-container-low)}
.information-item {padding:6px 0}
@media(max-width:599px){
  #map-toolbar .model-layer-bar {grid-column:1/-1;flex:1;width:100%}
  #map-toolbar .model-layer-bar select {flex:1;width:auto;font-size:16px}
  #map-toolbar .model-layer-bar label {font-size:13px}
  #process-model-actions .model-layer-bar {flex:1 1 100%}
  #process-model-actions .model-layer-bar select {flex:1;width:auto;font-size:16px}
}

#stage {background-image:none}
#map-toolbar .model-layer-bar {margin-left:8px;padding-left:10px;border-left:1px solid var(--md-sys-color-outline-variant)}
#zoom-label,#process-zoom-label {min-width:48px;min-height:44px;padding:4px 8px;font-size:12px;font-variant-numeric:tabular-nums;border:0;background:transparent}
#zoom-label:hover,#process-zoom-label:hover {background:var(--md-sys-color-surface-container-high)}
@media(max-width:599px){#map-toolbar .model-layer-bar {margin-left:0;padding-left:0;border-left:0}}

.requirements-options {display:flex;gap:8px;margin-bottom:12px}
.requirements-options>.filter-disclosure {flex:1 1 0;min-width:0;margin:0}
.requirements-options>.filter-disclosure>summary {min-height:44px;padding:10px 12px}
.requirements-options:has(details[open]) {display:block}
.requirements-options:has(details[open])>.filter-disclosure {margin-bottom:8px}
.chosen-table {font-size:13px}
.chosen-table td[data-column] {padding:6px 12px}
.chosen-table td button {min-height:44px;font-size:14px;line-height:1.5;padding:4px 0;font-weight:550}
.chosen-table th {font-size:13px;padding:4px 12px}
.chosen-table th button {font-size:13px;min-height:44px;font-weight:650;padding:4px 0}
#req-table-hint {font-size:12px;margin:0 0 8px}
@container requirements (max-width:600px){.requirements-options {display:block}.requirements-options>.filter-disclosure {margin-bottom:8px}}
/* Readable touch forms; avoid undersized text inputs on narrow/coarse-pointer surfaces. */
@media(max-width:599px),(pointer:coarse){
  .object-details label,.node-details label,dialog label {font-size:14px}
  .object-details input,.object-details select,.object-details textarea,.node-details input,.node-details textarea,dialog input,dialog select,dialog textarea {font-size:16px}
  .inline-format-tools button {font-size:14px}
}
#process-node-delete,#process-flow-delete {border-color:transparent;border-radius:8px;background:transparent;justify-content:flex-start;font-size:14px}
.object-details {scroll-padding-bottom:88px}

@media(max-width:599px){.sidebar nav {grid-template-columns:repeat(6,minmax(0,1fr));gap:0}}
/* Selected library entity, independent of selected node and tree hierarchy. */
.layer-focus-controls {display:flex;align-items:center;gap:6px;min-width:0;flex-wrap:wrap}
#map-toolbar .model-layer-bar #layer-entity,#process-model-actions .model-layer-bar #layer-entity {width:230px;max-width:100%;text-overflow:ellipsis}
#layer-usage-open {font-size:13px;min-height:44px;padding:8px 10px}
#nodes .node.layer-match,#outline [data-node].layer-match,.process-node.layer-match {border-color:var(--md-sys-color-tertiary);box-shadow:0 0 0 3px var(--md-sys-color-tertiary-container);background:var(--md-sys-color-tertiary-container);color:var(--md-sys-color-on-tertiary-container)}
.layer-usage-panel {position:fixed;right:12px;top:150px;bottom:90px;width:min(380px,calc(100vw - 24px));z-index:1200;padding:12px;border:1px solid var(--md-sys-color-outline);border-radius:16px;box-shadow:var(--mr-shadow-dialog);background:var(--md-sys-color-surface-container-lowest)}
.layer-usage-panel:not([hidden]) {display:flex;flex-direction:column;gap:8px}
#layer-usage-summary {margin:0;line-height:1.5}
#layer-usage-query {font-size:16px}
#layer-usage-items {flex:1;min-height:0;overflow:auto;overscroll-behavior:contain}
.layer-usage-actions {display:flex;gap:6px;flex-wrap:wrap}
.layer-usage-actions button {font-size:13px;min-height:44px;padding:8px}
.layer-usage-item {padding:10px 0;border-top:1px solid var(--md-sys-color-outline-variant);overflow-wrap:anywhere}
.layer-usage-item>button {text-align:left;justify-content:flex-start;width:100%;font-size:14px;border:0;background:transparent;padding:8px 4px;white-space:normal}
.layer-usage-item p {margin:4px 0;white-space:pre-wrap;line-height:1.5}
.process-toolbar #process-direction {flex:0 1 185px;font-size:13px;min-width:160px}
#process-options .menu-content {display:grid;gap:4px;min-width:200px}
#process-options .menu-content button {position:static;white-space:normal;width:100%;justify-content:flex-start}
@media(max-width:599px){
  .layer-focus-controls {width:100%}
  #map-toolbar .model-layer-bar #layer-entity,#process-model-actions .model-layer-bar #layer-entity {width:100%;flex:1;min-width:150px}
  .layer-usage-panel {top:130px;bottom:84px;right:8px;width:calc(100vw - 16px)}
  .process-toolbar #process-select {min-width:180px}
  .process-toolbar #process-direction {font-size:16px;flex:1 1 100%}
  #process-model-actions {gap:4px}
}
@media(forced-colors:active){#nodes .node.layer-match,#outline [data-node].layer-match,.process-node.layer-match {border:3px dashed Highlight;color:CanvasText;background:Canvas}}
.node.layer-match .node-meta {color:var(--md-sys-color-on-tertiary-container)}
@media(min-width:1101px){
 body.usage-docked .map-workspace {margin-right:404px}
 body.usage-docked .process-stage-wrap {margin-right:400px}
}
@media(max-width:599px){#process-new-flow {width:44px;min-width:44px;font-size:0;gap:0;padding:10px}}

/* Constrain scrolling to the diagram, including when the flow list is open. */
.process-stage-wrap {flex:1 1 0;min-height:320px}
#process-stage {position:absolute;inset:0;padding-bottom:0;scrollbar-gutter:stable;cursor:grab;overflow-anchor:none}
#process-stage.is-panning {cursor:grabbing;user-select:none}
#process-world {min-height:calc(100% - 64px);padding-bottom:64px;box-sizing:content-box}
#process-find-node {max-width:100%;min-height:44px;flex-shrink:0}
#process-navigation-hint {margin:0;font-size:12px}
#process-lanes {position:absolute;inset:0;pointer-events:none}
.process-lane {position:absolute;border:1px solid var(--md-sys-color-outline-variant);background:var(--md-sys-color-surface-container);border-radius:8px}
.process-lane:nth-child(even) {background:var(--md-sys-color-surface-container-low)}
.process-lane>span {display:block;padding:5px 12px;font-size:13px;font-weight:600;max-width:260px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#process-options label:has(input) {display:flex;align-items:center;gap:8px;white-space:normal}
#process-options input[type=checkbox] {width:20px;height:20px;flex-shrink:0}
@media(max-width:599px){
  .process-view-controls button {flex-shrink:0}
  #process-zoom-label {min-width:52px;white-space:nowrap}
  #process-fit,#process-center {width:44px;min-width:44px;font-size:0;gap:0;padding:10px}
}

.process-node[data-type=parallel-split],.process-node[data-type=parallel-join] {border:4px double var(--md-sys-color-outline)}
.process-node[data-type=subprocess] {border:3px double var(--md-sys-color-outline);padding-bottom:38px}
.process-port {position:absolute;width:4px;height:4px;transform:translate(-50%,-50%);border-radius:50%;background:var(--md-sys-color-outline);pointer-events:none}
.process-subprocess-open {position:absolute;right:8px;bottom:6px;min-height:30px;padding:4px 10px;font-size:12px}
.process-node-group:has(.process-subprocess-open) .process-layer {right:auto;left:8px}
#process-diagnostics-list {display:grid;gap:8px;max-height:180px;overflow:auto}
#process-diagnostics-list button {text-align:left;white-space:normal;justify-content:flex-start;overflow-wrap:anywhere;font-size:13px}
#process-node-type-hint:empty {display:none}
#process-return {max-width:100%;white-space:normal;text-align:left}
/* Reserve a separate action row without clipping two-line subprocess titles. */
.process-node[data-type=subprocess] {padding-top:10px;padding-bottom:36px;gap:4px}

/* SVG hit strokes remain usable at every zoom; node backgrounds let them through. */
#process-nodes,.process-node-group,#process-flow-handles {pointer-events:none}
.process-node,.process-layer,.process-subprocess-open,.process-connect-port,.process-endpoint-handle {pointer-events:auto}
#process-flow-handles {position:absolute;inset:0}
#process-edges .process-flow-hit {pointer-events:stroke;fill:none;stroke:transparent;stroke-width:20;vector-effect:non-scaling-stroke;cursor:pointer;outline:none}
#process-edges .process-flow-hit:focus-visible {stroke:var(--md-sys-color-primary);stroke-opacity:.25}
#process-edges .process-flow.is-selected {stroke:var(--md-sys-color-primary);stroke-width:3}
#process-edges .process-connection-preview {fill:none;stroke:var(--md-sys-color-primary);stroke-width:2;stroke-dasharray:6 4;pointer-events:none;vector-effect:non-scaling-stroke}
.process-connect-port,.process-endpoint-handle {position:absolute;z-index:3;transform:translate(-50%,-50%);width:calc(44px / var(--process-scale,1));height:calc(44px / var(--process-scale,1));min-width:0;min-height:0;border:0;background:transparent;padding:0;display:grid;place-items:center;box-shadow:none;touch-action:none;font-size:calc(14px / var(--process-scale,1));color:var(--md-sys-color-primary)}
.process-connect-port::after,.process-endpoint-handle::after {content:'';position:absolute;width:calc(20px / var(--process-scale,1));height:calc(20px / var(--process-scale,1));border:1px solid var(--md-sys-color-primary);border-radius:50%;background:var(--md-sys-color-surface-container-lowest);z-index:-1}
.process-connect-port:hover,.process-endpoint-handle:hover {background:transparent}
.process-connect-port:focus-visible,.process-endpoint-handle:focus-visible {outline:2px solid var(--md-sys-color-primary);outline-offset:0}
.process-connect-port.in::after {background:var(--md-sys-color-primary-container)}
.process-node.is-connect-target {outline:3px solid var(--md-sys-color-primary);outline-offset:3px}
#process-stage.is-connecting {cursor:crosshair}
.process-node.has-diagnostic {border-color:var(--md-sys-color-error)}
@media(forced-colors:active){#process-edges .process-flow.is-selected,#process-edges .process-connection-preview {stroke:Highlight}.process-node.has-diagnostic {border-style:dashed}.process-connect-port::after,.process-endpoint-handle::after {border-color:ButtonText;background:Canvas}}

.process-selection-bar {display:flex;align-items:center;gap:8px;flex-wrap:wrap;padding:10px;border-radius:10px;background:var(--md-sys-color-secondary-container);flex-shrink:0}
.process-selection-bar p {flex-basis:100%;margin:0}
.process-selection-bar button {font-size:13px;min-height:44px}
#process-stage.is-selecting .process-connect-port,#process-stage.is-selecting #process-flow-handles {display:none}
#process-stage.is-selecting .process-flow-hit {pointer-events:none}
#process-stage.is-selecting .process-node {cursor:crosshair}
.process-node.is-marked {outline:3px solid var(--md-sys-color-primary);outline-offset:3px;background:var(--md-sys-color-primary-container)}
#process-extract-nodes {max-height:180px;overflow:auto;overflow-wrap:anywhere;padding-left:24px}
#process-usages-list {display:grid;gap:6px;max-height:220px;overflow:auto}
#process-usages-list button {text-align:left;justify-content:flex-start;white-space:normal;overflow-wrap:anywhere;font-size:13px}
@media(max-width:599px){#process-select-many {font-size:13px;padding:8px}#process-extract-dialog {padding:16px}.process-selection-bar {gap:6px}.process-selection-bar button {flex:1}}
