/* Operational Layout controls, scoped to the existing free planner. */

:where(.flow-map-body) {
  --process-layout-tool-row-height: 40px;
  --process-layout-tool-row-gap: 0.32rem;
  --process-layout-tool-area-height: 40px;
}

:where(.flow-map-body) .facility-section-grid {
  display: grid;
  grid-template-columns: repeat(3, max-content);
  grid-auto-rows: var(--process-layout-tool-row-height);
  align-items: center;
  align-self: center;
  align-content: center;
  justify-content: center;
  gap: var(--process-layout-tool-row-gap) 0.36rem;
  min-height: var(--process-layout-tool-area-height);
}

:where(.flow-map-body) .facility-draw-grid {
  grid-template-columns: repeat(2, max-content);
  grid-template-rows: var(--process-layout-tool-row-height);
}

:where(.flow-map-body) .facility-draw-grid .facility-line-tool {
  grid-row: auto;
  height: var(--process-layout-tool-row-height);
  min-height: var(--process-layout-tool-row-height);
}

:where(.flow-map-body) .facility-block-grid {
  grid-template-columns: max-content;
  grid-template-rows: var(--process-layout-tool-row-height);
}

:where(.flow-map-body) .facility-snap-grid {
  grid-template-columns: max-content;
  grid-template-rows: repeat(2, var(--process-layout-tool-row-height));
}

:where(.flow-map-body) .facility-lock-grid {
  grid-template-columns: repeat(2, max-content);
  grid-template-rows: repeat(2, var(--process-layout-tool-row-height));
  gap: var(--process-layout-tool-row-gap) 0.28rem;
}

:where(.flow-map-body) .facility-lock-grid #facilitySelectAllDrawings {
  grid-row: 1 / span 2;
  height: 100%;
  min-height: 100%;
}

:where(.flow-map-body) .facility-ribbon-button {
  min-width: 0;
  height: 26px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 0.05rem;
  border: 1px solid #cbd7e8;
  border-radius: 4px;
  background: #eef3f9;
  color: #263445;
  font: inherit;
  line-height: 1;
  padding: 0.14rem 0.1rem;
  cursor: pointer;
}

:where(.flow-map-body) .facility-ribbon-button > span {
  min-height: 10px;
  display: inline-grid;
  place-items: center;
  color: #1e3a5f;
  font-size: 0.66rem;
  font-weight: 900;
  line-height: 1;
}

:where(.flow-map-body) .facility-ribbon-button em {
  max-width: 100%;
  overflow: hidden;
  color: #334155;
  font-size: 0.42rem;
  font-style: normal;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1.05;
  text-overflow: ellipsis;
  white-space: nowrap;
}

:where(.flow-map-body) .facility-ribbon-button:hover:not(:disabled),
:where(.flow-map-body) .facility-ribbon-button:focus-visible {
  border-color: #95add0;
  background: #e5edf8;
}

:where(.flow-map-body) .facility-ribbon-button:focus-visible {
  outline: 2px solid rgba(21, 94, 239, 0.32);
  outline-offset: 2px;
}

:where(.flow-map-body) .facility-ribbon-button.is-active {
  border-color: #2563eb;
  background: #dbeafe;
  box-shadow: inset 0 -2px 0 #2563eb;
  color: #102a56;
}

:where(.flow-map-body) .facility-ribbon-button:disabled {
  opacity: 0.46;
  cursor: not-allowed;
}

:where(.flow-map-body) .facility-draw-icon {
  position: relative;
  display: inline-block;
}

:where(.flow-map-body) .facility-line-icon::before {
  content: "";
  position: absolute;
  left: 4px;
  right: 4px;
  top: 50%;
  height: 2px;
  background: currentColor;
  transform: rotate(-42deg);
  transform-origin: center;
}

:where(.flow-map-body) .facility-rectangle-icon {
  width: 23px;
  height: 14px;
  border: 2px solid currentColor;
  border-radius: 2px;
}

:where(.flow-map-body) .facility-arc-icon {
  width: 24px;
  height: 15px;
  border-top: 2px solid currentColor;
  border-radius: 999px 999px 0 0;
}

:where(.flow-map-body) .facility-layer-select {
  min-width: 0;
  display: flex;
  align-items: center;
  align-self: center;
  height: var(--process-layout-tool-row-height);
}

:where(.flow-map-body) .facility-layer-select select {
  width: 100%;
  height: var(--process-layout-tool-row-height);
  border: 1px solid #cbd7e8;
  border-radius: 6px;
  background: #ffffff;
  color: #1f2937;
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.1;
  padding: 0 0.34rem;
}

:where(.flow-map-body) .facility-layer-dropdown {
  position: relative;
  align-self: stretch;
  width: 136px;
  height: var(--process-layout-tool-area-height);
  display: flex;
  align-items: center;
}

:where(.flow-map-body) .facility-layer-menu-button {
  width: 100%;
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.28rem;
  border: 1px solid #cbd7e8;
  border-radius: 6px;
  background: #ffffff;
  color: #1f2937;
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.1;
  padding: 0 0.38rem;
  cursor: pointer;
}

:where(.flow-map-body) .facility-layer-menu-button span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

:where(.flow-map-body) .facility-layer-menu-button:hover,
:where(.flow-map-body) .facility-layer-menu-button:focus-visible {
  border-color: #95add0;
  outline: none;
}

:where(.flow-map-body) .facility-layer-menu {
  position: absolute;
  top: calc(100% + 5px);
  left: 0;
  z-index: 60;
  width: 202px;
  max-height: 210px;
  overflow-y: auto;
  border: 1px solid #cbd7e8;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 18px 36px rgba(18, 34, 56, 0.16);
  padding: 0.28rem;
}

:where(.flow-map-body) .facility-layer-menu-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 24px 24px;
  gap: 0.18rem;
  align-items: center;
}

:where(.flow-map-body) .facility-layer-menu-row + .facility-layer-menu-row {
  margin-top: 0.18rem;
}

:where(.flow-map-body) .facility-layer-row-main,
:where(.flow-map-body) .facility-layer-icon-button {
  height: 26px;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  color: #334155;
  font-family: inherit;
  font-size: 0.68rem;
  font-weight: 800;
  cursor: pointer;
}

:where(.flow-map-body) .facility-layer-row-main {
  min-width: 0;
  overflow: hidden;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 0 0.35rem;
}

:where(.flow-map-body) .facility-layer-icon-button {
  display: inline-grid;
  place-items: center;
  padding: 0;
}

:where(.flow-map-body) .facility-layer-menu-row.is-active .facility-layer-row-main {
  background: #eff6ff;
  color: #155eef;
}

:where(.flow-map-body) .facility-layer-row-main:hover,
:where(.flow-map-body) .facility-layer-row-main:focus-visible,
:where(.flow-map-body) .facility-layer-icon-button:hover,
:where(.flow-map-body) .facility-layer-icon-button:focus-visible {
  border-color: #cbd7e8;
  background: #f3f7fc;
  outline: none;
}

:where(.flow-map-body) .facility-layer-icon-button.is-muted {
  color: #94a3b8;
}

:where(.flow-map-body) .facility-layer-icon-button.is-locked {
  color: #a15c00;
}

:where(.flow-map-body) .facility-layer-grid #facilityAddLayer {
  align-self: stretch;
  width: 52px;
  height: var(--process-layout-tool-area-height);
  min-height: var(--process-layout-tool-area-height);
}

:where(.flow-map-body) .facility-ribbon-select,
:where(.flow-map-body) .facility-ribbon-number,
:where(.flow-map-body) .facility-ribbon-range {
  grid-column: 1 / -1;
  min-width: 0;
  display: grid;
  gap: 0.1rem;
  color: #526173;
  font-size: 0.5rem;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
}

:where(.flow-map-body) .facility-ribbon-select select,
:where(.flow-map-body) .facility-ribbon-number input {
  width: 100%;
  height: 18px;
  border: 1px solid #cbd7e8;
  border-radius: 4px;
  background: #ffffff;
  color: #1f2937;
  font-size: 0.56rem;
  font-weight: 800;
  padding: 0 0.18rem;
}

:where(.flow-map-body) .facility-ribbon-number {
  grid-column: span 1;
}

:where(.flow-map-body) .facility-ribbon-range input {
  width: 100%;
  height: 18px;
  accent-color: #2563eb;
}

:where(.flow-map-body) .facility-scale-status {
  grid-column: 1 / -1;
  min-height: 0.72rem;
  color: #647085;
  font-size: 0.54rem;
  font-weight: 800;
  line-height: 1.15;
}

:where(.flow-map-body) .facility-scale-status.is-error {
  color: #b42318;
}

:where(.flow-map-body) .connect-section-control {
  min-height: var(--process-layout-tool-area-height);
  display: grid;
  place-items: center;
}

:where(.flow-map-body) .connect-section-control button {
  width: 100%;
  min-height: 38px;
  border: 1px solid #cfd9e8;
  border-radius: 6px;
  background: #ffffff;
  color: #1f2937;
  cursor: pointer;
  font-size: 0.58rem;
  font-weight: 900;
  line-height: 1.08;
  padding: 0.24rem 0.32rem;
  text-align: center;
}

:where(.flow-map-body) .connect-section-control button:hover,
:where(.flow-map-body) .connect-section-control button:focus-visible,
:where(.flow-map-body) .connect-section-control button.is-active {
  border-color: #1d5cff;
  background: #e9f0ff;
  color: #155eef;
  outline: 2px solid rgba(21, 94, 239, 0.24);
  outline-offset: 1px;
}

:where(.flow-map-body) .saved-template-current {
  width: 100%;
  min-width: 0;
  min-height: var(--process-layout-tool-row-height);
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  gap: 0.26rem;
  border: 1px solid #d7e1ef;
  border-radius: 5px;
  background: #f8fbff;
  color: #334155;
  cursor: pointer;
  font: inherit;
  padding: 0.15rem 0.28rem;
  text-align: left;
}

:where(.flow-map-body) .saved-template-current:hover,
:where(.flow-map-body) .saved-template-current:focus-visible {
  border-color: #95add0;
  background: #eef5ff;
  color: #155eef;
  outline: none;
}

:where(.flow-map-body) .saved-template-current.is-saved {
  border-color: #9fc0e8;
  background: #eef5ff;
}

:where(.flow-map-body) .saved-template-current-icon {
  display: grid;
  place-items: center;
  color: #155eef;
  font-size: 1rem;
  font-weight: 900;
  line-height: 1;
}

:where(.flow-map-body) .saved-template-current-copy {
  min-width: 0;
  display: grid;
  gap: 0.03rem;
}

:where(.flow-map-body) .saved-template-current-copy small,
:where(.flow-map-body) .saved-template-current-copy strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

:where(.flow-map-body) .saved-template-current-copy small {
  color: #64748b;
  font-size: 0.48rem;
  font-weight: 800;
  line-height: 1;
}

:where(.flow-map-body) .saved-template-current-copy strong {
  color: currentColor;
  font-size: 0.59rem;
  font-weight: 850;
  line-height: 1.1;
}

:where(.flow-map-body) .flow-ribbon-panel[data-ribbon-panel="shapes"] .ribbon-saved-templates .flow-side-actions button.saved-template-current {
  width: 100%;
  min-width: 0;
  min-height: var(--process-layout-tool-row-height);
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  justify-content: stretch;
  gap: 0.26rem;
  border: 1px solid #d7e1ef;
  border-radius: 5px;
  background: #f8fbff;
  color: #334155;
  padding: 0.15rem 0.28rem;
  text-align: left;
}

:where(.flow-map-body) .flow-ribbon-panel[data-ribbon-panel="shapes"] .ribbon-saved-templates .flow-side-actions button.saved-template-current:hover,
:where(.flow-map-body) .flow-ribbon-panel[data-ribbon-panel="shapes"] .ribbon-saved-templates .flow-side-actions button.saved-template-current:focus-visible,
:where(.flow-map-body) .flow-ribbon-panel[data-ribbon-panel="shapes"] .ribbon-saved-templates .flow-side-actions button.saved-template-current.is-saved {
  border-color: #95add0;
  background: #eef5ff;
  color: #155eef;
}

:where(.flow-map-body) .preset-unit-section.hidden,
:where(.flow-map-body) #presetCustomUnitOfMeasureGroup.hidden {
  display: none;
}

:where(.flow-map-body) .facility-editor-summary {
  display: grid;
  gap: 0.08rem;
  border: 1px solid #d8e1ef;
  border-radius: 7px;
  background: #f8fafc;
  padding: 0.46rem 0.5rem;
}

:where(.flow-map-body) .facility-editor-summary span {
  color: #657084;
  font-size: 0.56rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  line-height: 1;
  text-transform: uppercase;
}

:where(.flow-map-body) .facility-editor-summary strong {
  color: #1f2937;
  font-size: 0.82rem;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

:where(.flow-map-body) .facility-checkbox-row {
  display: flex !important;
  grid-template-columns: none !important;
  align-items: center;
  gap: 0.42rem !important;
}

:where(.flow-map-body) .facility-checkbox-row input[type="checkbox"] {
  min-height: 0;
  width: 16px;
  height: 16px;
  padding: 0;
}

:where(.flow-map-body) .facility-editor-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.18rem;
  border-top: 1px solid #e5ebf5;
  padding-top: 0.38rem;
}

:where(.flow-map-body) .facility-editor-actions .facility-ribbon-button {
  width: auto;
  min-width: 76px;
}

:where(.flow-map-body) .facility-geometry-tools {
  display: grid;
  gap: 0.28rem;
}

:where(.flow-map-body) .facility-geometry-tool {
  min-height: 30px;
  display: flex;
  align-items: center;
  gap: 0.36rem;
  border: 1px solid #d8e1ef;
  border-radius: 7px;
  background: #f8fafc;
  color: #334155;
  font-family: inherit;
  font-size: 0.68rem;
  font-weight: 800;
  padding: 0.3rem 0.45rem;
}

:where(.flow-map-body) .facility-geometry-tool span {
  color: #155eef;
  font-size: 0.84rem;
}

:where(.flow-map-body) .facility-geometry-tool em {
  font-style: normal;
  font-weight: inherit;
}

:where(.flow-map-body) .facility-editor-scale {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.42rem;
  border-top: 1px solid #e5ebf5;
  padding-top: 0.5rem;
}

:where(.flow-map-body) .facility-editor-scale .facility-ribbon-button,
:where(.flow-map-body) .facility-editor-scale label:last-child {
  grid-column: 1 / -1;
}

:where(.flow-map-body) .facility-editor-scale input[type="range"] {
  width: 100%;
  accent-color: #2563eb;
}

:where(.flow-map-body) .facility-editor .hidden {
  display: none !important;
}

:where(.flow-map-body) .sort-routes {
  display: grid;
  gap: 0.28rem;
  max-height: min(42vh, 420px);
  overflow-y: auto;
  padding-right: 0.14rem;
}

:where(.flow-map-body) .storage-output-rate-editor {
  min-width: 0;
}

:where(.flow-map-body) .storage-output-section {
  display: grid;
  gap: 0.28rem;
  border-top: 1px solid #e5ebf5;
  padding-top: 0.38rem;
}

:where(.flow-map-body) .storage-output-rate-editor .rate-editor-header {
  align-items: flex-start;
}

:where(.flow-map-body) .storage-output-rate-editor .rate-unit-tabs button {
  min-width: 0;
}

:where(.flow-map-body) .facility-length-row {
  grid-template-columns: minmax(0, 1fr);
}

:where(.flow-map-body) .facility-transform-row {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.34rem;
}

:where(.flow-map-body) .connector-appearance-row {
  grid-template-columns: 68px repeat(2, minmax(0, 1fr));
  gap: 0.34rem;
  align-items: end;
}

:where(.flow-map-body) .connector-selection-summary {
  margin: 0;
  border: 1px solid #b8ccf1;
  border-radius: 7px;
  background: #eef4ff;
  color: #27436f;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1.35;
  padding: 0.45rem 0.5rem;
}

:where(.flow-map-body) .link-editor.is-multi-link-selection [data-link-single-only] {
  display: none !important;
}

:where(.flow-map-body) .connector-mixed-value {
  color: #667085;
  font-size: 0.56rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: none;
}

:where(.flow-map-body) .connector-color-field {
  min-width: 0;
  display: grid;
  gap: 0.22rem;
  color: #4b5567;
  font-size: 0.72rem;
  font-weight: 700;
}

:where(.flow-map-body) .flow-inspector .connector-apply-color {
  min-height: 22px;
  padding: 0.18rem 0.24rem;
  font-size: 0.56rem;
  line-height: 1.05;
}

:where(.flow-map-body) .connector-color-field.is-mixed input[type="color"] {
  opacity: 0.48;
}

:where(.flow-map-body) .connector-visual-dropdown.is-mixed .connector-dropdown-preview > * {
  visibility: hidden;
}

:where(.flow-map-body) .connector-visual-dropdown.is-mixed .connector-dropdown-preview::after {
  content: "Mixed";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #667085;
  font-size: 0.56rem;
  font-weight: 800;
}

:where(.flow-map-body) .connector-inspector-group {
  min-width: 0;
  display: grid;
  gap: 0.36rem;
  margin: 0;
  border: 1px solid #d8e1ef;
  border-radius: 7px;
  background: #fbfdff;
  padding: 0.38rem 0.44rem 0.44rem;
}

:where(.flow-map-body) .connector-inspector-group legend {
  color: #657084;
  font-size: 0.62rem;
  font-weight: 900;
  letter-spacing: 0.07em;
  padding: 0 0.2rem;
  text-transform: uppercase;
}

:where(.flow-map-body) .connector-path-actions {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.28rem;
}

:where(.flow-map-body) .flow-inspector .connector-path-actions button {
  width: 100%;
  min-height: 28px;
  padding: 0.28rem 0.34rem;
  font-size: 0.66rem;
  line-height: 1.05;
}

:where(.flow-map-body) .connector-path-actions #linkResetRoute {
  grid-column: 1 / -1;
}

:where(.flow-map-body) .connector-inspector-group .field-guidance {
  margin: 0;
  font-size: 0.64rem;
  line-height: 1.28;
}

:where(.flow-map-body) .connector-measure-grid,
:where(.flow-map-body) .connector-measure-field {
  min-width: 0;
  display: grid;
  gap: 0.28rem;
}

:where(.flow-map-body) .connector-label-line,
:where(.flow-map-body) .connector-measure-field > label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.35rem;
}

:where(.flow-map-body) .connector-optional-label {
  color: #7b8798;
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
}

:where(.flow-map-body) .connector-value-unit {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 58px;
  gap: 0.28rem;
}

:where(.flow-map-body) .connector-speed-value-unit {
  grid-template-columns: minmax(0, 1fr) 68px;
}

:where(.flow-map-body) .connector-value-unit input,
:where(.flow-map-body) .connector-value-unit select {
  width: 100%;
  min-width: 0;
}

:where(.flow-map-body) .connector-value-unit select {
  padding-right: 0.18rem;
  font-size: 0.68rem;
}

:where(.flow-map-body) .connector-travel-readout {
  min-width: 0;
  align-items: center;
}

:where(.flow-map-body) .connector-travel-readout strong {
  max-width: 56%;
  overflow-wrap: anywhere;
  text-align: right;
  white-space: normal;
}

:where(.flow-map-body) .connector-visual-field {
  min-width: 0;
  display: grid;
  gap: 0.22rem;
  color: #4b5567;
  font-size: 0.72rem;
  font-weight: 700;
}

:where(.flow-map-body) .connector-visual-dropdown {
  --connector-preview-color: #526b98;
  min-width: 0;
  position: relative;
}

:where(.flow-map-body) .flow-inspector .connector-visual-dropdown-button {
  width: 100%;
  min-width: 0;
  min-height: 30px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.28rem;
  border: 1px solid #ccd7e6;
  border-radius: 5px;
  background: #ffffff;
  color: var(--connector-preview-color);
  cursor: pointer;
  padding: 0.2rem 0.28rem 0.2rem 0.38rem;
}

:where(.flow-map-body) .flow-inspector .connector-visual-dropdown-button:hover,
:where(.flow-map-body) .flow-inspector .connector-visual-dropdown-button:focus-visible,
:where(.flow-map-body) .connector-visual-dropdown.is-open .connector-visual-dropdown-button {
  border-color: #95add0;
  background: #f1f6fd;
  outline: 2px solid rgba(21, 94, 239, 0.22);
  outline-offset: 1px;
}

:where(.flow-map-body) .connector-dropdown-preview {
  min-width: 0;
  min-height: 12px;
  display: grid;
  place-items: center;
  position: relative;
}

:where(.flow-map-body) .connector-dropdown-preview .connector-line-preview {
  width: 100%;
}

:where(.flow-map-body) .connector-dropdown-preview svg {
  width: 100%;
  height: 12px;
  overflow: visible;
}

:where(.flow-map-body) .connector-dropdown-preview line {
  fill: none;
  stroke: var(--connector-preview-color);
  stroke-linecap: butt;
}

:where(.flow-map-body) .connector-dropdown-caret {
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid #647085;
}

:where(.flow-map-body) .connector-visual-options {
  position: absolute;
  z-index: 70;
  top: calc(100% + 3px);
  right: 0;
  left: 0;
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.12rem;
  border: 1px solid #cfd9e8;
  border-radius: 6px;
  background: #ffffff;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.16);
  padding: 0.18rem;
}

:where(.flow-map-body) .connector-visual-options[hidden] {
  display: none;
}

:where(.flow-map-body) .flow-inspector .connector-visual-options button {
  min-width: 0;
  min-height: 28px;
  display: grid;
  place-items: center;
  border: 1px solid #ccd7e6;
  border-radius: 5px;
  background: #ffffff;
  color: var(--connector-preview-color);
  cursor: pointer;
  padding: 0.18rem;
}

:where(.flow-map-body) .flow-inspector .connector-visual-options button:hover,
:where(.flow-map-body) .flow-inspector .connector-visual-options button:focus-visible {
  border-color: #95add0;
  background: #f1f6fd;
  outline: 2px solid rgba(21, 94, 239, 0.22);
  outline-offset: 1px;
}

:where(.flow-map-body) .flow-inspector .connector-visual-options button.is-selected {
  border-color: #155eef;
  background: #e9f0ff;
  box-shadow: inset 0 0 0 1px #155eef;
}

:where(.flow-map-body) .connector-line-preview {
  width: 100%;
  height: var(--connector-preview-width);
  min-height: var(--connector-preview-width);
  border-radius: 999px;
  background: var(--connector-preview-color);
}

:where(.flow-map-body) .connector-visual-options svg {
  width: 100%;
  height: 12px;
  overflow: visible;
}

:where(.flow-map-body) .connector-visual-options line {
  fill: none;
  stroke: var(--connector-preview-color);
  stroke-linecap: butt;
}

:where(.flow-map-body) .connector-style-value {
  display: none;
}

:where(.flow-map-body) .facility-draft-hud {
  position: absolute;
  z-index: 42;
  width: auto;
  display: grid;
  grid-template-columns: repeat(2, max-content);
  align-items: end;
  gap: 0.1rem;
  border: 1px solid #95add0;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 5px 12px rgba(18, 34, 56, 0.12);
  padding: 0.12rem 0.16rem;
  pointer-events: auto;
}

:where(.flow-map-body) .facility-draft-hud.hidden,
:where(.flow-map-body) .facility-draft-hud:not([data-draft-active="true"]) {
  display: none !important;
}

:where(.flow-map-body) .facility-draft-hud label span {
  color: #526173;
  font-size: 0.52rem;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1;
}

:where(.flow-map-body) .facility-draft-hud label {
  display: grid;
  grid-template-columns: auto auto;
  align-items: center;
  gap: 0.08rem;
}

:where(.flow-map-body) .facility-draft-hud input {
  min-width: 0;
  width: calc((var(--draft-field-ch, 2) * 0.62em) + 1.35rem);
  max-width: 8rem;
  border: 1px solid #cbd7e8;
  border-radius: 6px;
  background: #ffffff;
  color: #1f2937;
  font: inherit;
  font-size: 0.6rem;
  font-weight: 800;
  min-height: 20px;
  padding: 0.08rem 0.12rem;
  text-align: right;
}

:where(.flow-map-body) .facility-draft-hud input[readonly] {
  background: #f8fbff;
}

:where(.flow-map-body) .facility-draft-hud input.is-invalid {
  border-color: #dc2626;
  background: #fff7f7;
}

:where(.flow-map-body) .facility-draft-hud[data-draft-type="rectangle"] {
  display: block;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  padding: 0;
  pointer-events: none;
}

:where(.flow-map-body) .facility-draft-hud[data-draft-type="rectangle"] label {
  position: absolute;
  display: grid;
  grid-template-columns: auto auto;
  align-items: center;
  gap: 0.12rem;
  pointer-events: auto;
}

:where(.flow-map-body) .facility-draft-hud[data-draft-type="rectangle"] #facilityDraftRectangleLengthField {
  left: 50%;
  top: -32px;
  transform: translateX(-50%);
}

:where(.flow-map-body) .facility-draft-hud[data-draft-type="rectangle"] #facilityDraftRectangleWidthField {
  right: -9.75rem;
  top: 50%;
  transform: translateY(-50%);
}

:where(.flow-map-body) .facility-draft-helper {
  grid-column: 1 / -1;
  color: #526173;
  font-size: 0.6rem;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
}

:where(.flow-map-body) #facilityLineTypeEditor {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.82rem;
  letter-spacing: 0;
}

:where(.flow-map-body) .facility-settings-dialog {
  width: min(420px, 100%);
  max-height: calc(100vh - 2rem);
  max-height: calc(100dvh - 2rem);
  overflow-y: auto;
  overscroll-behavior: contain;
}

:where(.flow-map-body) .facility-settings-field select,
:where(.flow-map-body) .connector-preset-field select {
  min-height: 34px;
  border: 1px solid #cbd7e8;
  border-radius: 6px;
  background: #ffffff;
  color: #172033;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 800;
  padding: 0.36rem 0.45rem;
}

:where(.flow-map-body) .connector-preset-dialog {
  width: min(460px, 100%);
  max-height: calc(100vh - 2rem);
  max-height: calc(100dvh - 2rem);
  overflow-y: auto;
  overscroll-behavior: contain;
}

:where(.flow-map-body) .connector-preset-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 0.72rem;
}

:where(.flow-map-body) .connector-preset-field input[type="color"] {
  width: 100%;
  min-height: 34px;
  border: 1px solid #cbd7e8;
  border-radius: 6px;
  background: #ffffff;
  cursor: pointer;
  padding: 0.18rem;
}

:where(.flow-map-body) .connector-preset-dialog .facility-scale-status {
  min-height: 1.1rem;
  margin-bottom: 0;
}

@media (max-width: 520px) {
:where(.flow-map-body) .connector-preset-grid {
    grid-template-columns: 1fr;
  }
}

:where(.flow-map-body) .node-unit-of-measure {
  display: grid;
  gap: 0.32rem;
  border: 1px solid #dbe4f0;
  border-radius: 6px;
  background: #f8fbff;
  padding: 0.42rem 0.48rem;
}

:where(.flow-map-body) .node-unit-of-measure.hidden,
:where(.flow-map-body) #nodeCustomUnitOfMeasureGroup.hidden {
  display: none;
}

:where(.flow-map-body) .saved-layouts-dialog {
  width: min(680px, calc(100vw - 2rem));
  max-height: min(720px, calc(100vh - 2rem));
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: 0.68rem;
}

:where(.flow-map-body) .saved-layouts-intro {
  margin: 0;
}

:where(.flow-map-body) .saved-layouts-grid {
  min-height: 0;
  display: grid;
  align-content: start;
  gap: 0.42rem;
  overflow-y: auto;
  padding: 0.08rem 0.12rem 0.08rem 0;
}

:where(.flow-map-body) .saved-layouts-grid .saved-template-empty {
  display: flex;
}

:where(.flow-map-body) .saved-layouts-grid .saved-template-card {
  min-height: 42px;
  height: auto;
  padding: 0.36rem 0.48rem;
}

:where(.flow-map-body) .starter-templates-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

:where(.flow-map-body) .starter-templates-header span {
  display: block;
  color: #647085;
  font-size: 0.58rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

:where(.flow-map-body) .starter-templates-header h2 {
  margin: 0.12rem 0 0;
  color: #172033;
  font-size: 1.08rem;
  line-height: 1.1;
}

:where(.flow-map-body) .starter-templates-actions {
  margin-top: 0;
}

:where(.flow-map-body) .facility-editor-summary {
  overflow-wrap: anywhere;
}

@media (max-width: 820px) {
:where(.flow-map-body) .flow-ribbon-panel[data-ribbon-panel="shapes"] .ribbon-saved-templates .flow-side-actions button.saved-template-current {
    min-height: var(--process-layout-tool-row-height);
  }
}

:where(.flow-map-body) .saved-layouts-dialog {
  max-height: min(720px, calc(100dvh - 24px));
}

:where(.flow-map-body) .saved-layouts-grid {
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

/* Keep the established vertical Flow panel and the single Inspector scroll. */
:where(.flow-map-body) .flow-tab-rail .facility-section-grid {
  width: 100%;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: auto;
  grid-auto-rows: minmax(40px, auto);
  justify-content: stretch;
  gap: 0.32rem;
}

:where(.flow-map-body) .flow-tab-rail .facility-lock-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

:where(.flow-map-body) .flow-tab-rail .facility-lock-grid #facilitySelectAllDrawings {
  grid-row: auto;
}

:where(.flow-map-body) .flow-tab-rail .facility-ribbon-button {
  min-height: 40px;
  height: auto;
  gap: 0.22rem;
  padding: 0.32rem;
  background: #fff;
  border-radius: 6px;
}

:where(.flow-map-body) .flow-tab-rail .facility-ribbon-button > span {
  min-width: 24px;
  min-height: 14px;
  font-size: 0.85rem;
}

:where(.flow-map-body) .flow-tab-rail .facility-ribbon-button em {
  font-size: 0.64rem;
  line-height: 1.15;
}

:where(.flow-map-body) .flow-tab-rail .facility-ribbon-button.is-active {
  background: #e9f0ff;
  border-color: #2563eb;
}

:where(.flow-map-body) .flow-tab-rail .connect-section-control {
  min-height: 0;
}

:where(.flow-map-body) .flow-tab-rail .connect-section-control button {
  min-height: 32px;
  font-size: 0.72rem;
}

:where(.flow-map-body) .ribbon-saved-templates .saved-template-command-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px;
  gap: 0.32rem;
}

:where(.flow-map-body) .flow-ribbon-panel[data-ribbon-panel="shapes"] .ribbon-saved-templates .flow-side-actions #saveCurrentTemplate {
  width: 34px;
  min-width: 34px;
  min-height: 32px;
  height: 32px;
  border: 1px solid #cbd7e8;
  border-radius: 6px;
  padding: 0.25rem;
}

:where(.flow-map-body) .flow-ribbon-panel[data-ribbon-panel="shapes"] .flow-side-actions .saved-template-current {
  width: 100%;
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 0.42rem;
  padding: 0.4rem;
  text-align: left;
}

:where(.flow-map-body) .saved-template-current-copy {
  min-width: 0;
  display: grid;
  gap: 0.14rem;
}

:where(.flow-map-body) .saved-template-current-copy small {
  color: #64748b;
  font-size: 0.6rem;
}

:where(.flow-map-body) .saved-template-current-copy strong {
  overflow: hidden;
  font-size: 0.7rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

:where(.flow-map-body) .flow-inspector .node-connections {
  position: static;
  margin: 0;
  padding: 0.45rem 0 0;
}

:where(.flow-map-body) .flow-workspace {
  position: relative;
}

:where(.flow-map-body) .flow-inspector .facility-editor-actions .facility-ribbon-button {
  min-height: 30px;
  padding: 0.3rem 0.5rem;
}

:where(.flow-map-body) .flow-inspector .facility-editor-actions .facility-ribbon-button em {
  font-size: 0.66rem;
}

:where(.flow-map-body) .saved-layouts-dialog {
  grid-template-rows: auto auto minmax(0, 1fr) auto auto;
}

:where(.flow-map-body) .saved-layouts-grid .saved-template-icon {
  width: 30px;
  min-width: 30px;
  min-height: 30px;
  display: inline-grid;
  place-items: center;
  border: 1px solid #cbd7e8;
  border-radius: 6px;
  background: #fff;
  color: #526071;
  padding: 0.25rem;
}

:where(.flow-map-body) .saved-layouts-grid .saved-template-icon:hover,
:where(.flow-map-body) .saved-layouts-grid .saved-template-icon:focus-visible {
  border-color: #95add0;
  background: #f1f6fd;
  color: #155eef;
}

:where(.flow-map-body) .saved-layouts-grid .saved-template-icon.danger:hover {
  color: #a61b1b;
}

:where(.flow-map-body) .facility-advanced-settings {
  border-top: 1px solid #e5ebf5;
  padding-top: 0.6rem;
}

:where(.flow-map-body) .facility-advanced-settings summary {
  cursor: pointer;
  color: #334155;
  font-size: 0.8rem;
  font-weight: 700;
}

:where(.flow-map-body) .facility-advanced-settings .facility-settings-field small {
  color: #64748b;
  font-size: 0.72rem;
  font-weight: 400;
  line-height: 1.4;
}

:where(.flow-map-body) .facility-advanced-settings button {
  min-height: 32px;
  font-size: 0.76rem;
}

:where(.flow-map-body) .facility-advanced-settings button.is-active {
  border-color: #2563eb;
  background: #e9f0ff;
  color: #1d4ed8;
}

@media (max-width: 520px) {
  .flow-map-body .flow-tabs {
    display: flex;
    overflow-x: auto;
  }

  .flow-map-body .flow-tabs button {
    min-width: 0;
    padding: 0.44rem 0.2rem;
    font-size: 0.69rem;
    white-space: normal;
  }
}

/* Guided Setup follows the current model without replacing its contents. */
.flow-map-body .flow-guide-shell {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  display: grid;
  gap: 24px;
}

.flow-map-body .flow-guide-step p {
  margin: 0;
  color: #526173;
  font-size: 0.81rem;
  line-height: 1.6;
}

.flow-map-body .flow-guide-shell button {
  max-width: 100%;
  min-height: 38px;
  border-radius: 6px;
  font-size: 0.76rem;
  font-weight: 750;
  line-height: 1.3;
  padding: 9px 12px;
  text-align: left;
}

.flow-map-body .flow-guide-shell button.ghost {
  border: 1px solid #ccd8e8;
  background: #f8fbff;
  color: #315889;
}

.flow-map-body .flow-guide-shell button.ghost:hover,
.flow-map-body .flow-guide-shell button.ghost:focus-visible {
  border-color: #8eaee0;
  background: #eef4ff;
  color: #155eef;
}

.flow-map-body .flow-guide-shell button:focus-visible {
  outline: 2px solid #155eef;
  outline-offset: 3px;
}

.flow-map-body .flow-guide-model {
  border: 1px solid #d7e0ee;
  border-radius: 8px;
  background: #edf3fa;
  padding: 18px 20px;
}

.flow-map-body .flow-guide-model-heading,
.flow-map-body .flow-guide-step-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.flow-map-body .flow-guide-model-heading h2 {
  margin: 0;
  color: #243449;
  font-size: 0.9rem;
}

.flow-map-body .flow-guide-status {
  max-width: 100%;
  color: #596b82;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1.4;
}

.flow-map-body .flow-guide-model-facts {
  display: grid;
  grid-template-columns: 1fr 1fr 1.5fr;
  gap: 16px;
  margin: 18px 0 14px;
}

.flow-map-body .flow-guide-model-facts dt {
  color: #64748b;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.flow-map-body .flow-guide-model-facts dd {
  margin: 4px 0 0;
  color: #243449;
  font-size: 0.83rem;
  font-weight: 750;
  line-height: 1.4;
}

.flow-map-body .flow-guide-model-note {
  margin: 0;
  border-top: 1px solid #d7e0ee;
  padding-top: 12px;
  color: #617187;
  font-size: 0.73rem;
  line-height: 1.5;
}

.flow-map-body .flow-guide-steps {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.flow-map-body .flow-guide-step {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  border: 1px solid #d7e0ee;
  border-radius: 8px;
  background: #ffffff;
  padding: 22px;
}

.flow-map-body .flow-guide-number {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border-radius: 7px;
  background: #eaf1fb;
  color: #315b94;
  font-size: 0.84rem;
  font-weight: 800;
}

.flow-map-body .flow-guide-step h2 {
  margin: 0;
  color: #243449;
  font-size: 1rem;
  line-height: 1.35;
}

.flow-map-body .flow-guide-step p.flow-guide-tip {
  color: #738094;
  font-size: 0.75rem;
}

.flow-map-body .flow-guide-step-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
  padding-top: 2px;
}

@media (max-width: 820px) {
  .flow-map-body .flow-guide-steps {
    grid-template-columns: minmax(0, 1fr);
  }

  .flow-map-body .flow-guide-shell button {
    min-height: 44px;
  }
}

@media (max-width: 520px) {
  .flow-map-body .flow-guide-model-facts {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }

  .flow-map-body .flow-guide-step,
  .flow-map-body .flow-guide-model {
    padding: 18px;
  }
}

/* FlowLab: top Flow ribbon and independent workspace pages. */
.flow-map-body .flow-map-app {
  grid-template-rows: auto auto auto minmax(0, 1fr);
}

.flow-map-body .flow-product-name {
  border-left: 1px solid #d7e0ee;
  padding-left: 0.8rem;
  color: #526071;
  font-size: 0.85rem;
  font-weight: 700;
}

.flow-map-body .flow-tabs {
  gap: 0;
  min-height: 42px;
  border: 1px solid #d7e0ee;
  border-bottom-color: #cfd9e8;
  border-radius: 6px;
  background: #ffffff;
  padding: 0 0.65rem;
  flex-wrap: nowrap;
  overflow-x: auto;
}

.flow-map-body .flow-tabs [data-ribbon-tab] {
  border: 0;
  border-radius: 0;
  min-height: 42px;
  min-width: fit-content;
  padding: 0 0.78rem;
  background: transparent;
  box-shadow: none;
  color: #5f6d83;
  font-weight: 900;
}

.flow-map-body .flow-tabs [data-ribbon-tab].is-active {
  background: transparent;
  box-shadow: inset 0 -2px 0 #1d5cff;
  color: #1d5cff;
}

.flow-map-body .flow-tabs [data-ribbon-tab]:hover,
.flow-map-body .flow-tabs [data-ribbon-tab]:focus-visible {
  background: #f7faff;
  color: #1d5cff;
}

.flow-map-body .flow-tabs [data-ribbon-tab].is-active:hover,
.flow-map-body .flow-tabs [data-ribbon-tab].is-active:focus-visible {
  background: transparent;
}

.flow-map-body #flowTabPages {
  grid-row: 4;
  /* Keep toolbar and inspector layers below the site navigation. */
  isolation: isolate;
  min-width: 0;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

.flow-map-body .flow-tab-page {
  height: 100%;
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: 0;
}

.flow-map-body .flow-tab-page[hidden] {
  display: none !important;
}

.flow-map-body #flow-panel-shapes.is-active {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  align-content: stretch;
  gap: 0;
  overflow: hidden;
}

.flow-map-body .flow-top-ribbon {
  --process-layout-tool-row-height: 34px;
  --process-layout-tool-row-gap: 0.16rem;
  --process-layout-tool-area-height: calc((var(--process-layout-tool-row-height) * 2) + var(--process-layout-tool-row-gap));
  --process-layout-title-height: 0.74rem;
  --process-layout-section-gap: 0.12rem;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: max-content;
  grid-template-columns: none;
  align-items: end;
  justify-content: start;
  gap: 0;
  min-width: 0;
  overflow-x: auto;
  padding: 0.34rem 0.48rem 0.36rem;
  border-top: 1px solid #e4ebf5;
  border-bottom: 1px solid #bdc8d8;
  background: #f8fbff;
  scrollbar-width: thin;
}

.flow-map-body .flow-top-ribbon .flow-ribbon-group {
  min-width: 0;
  width: max-content;
  display: grid;
  grid-template-rows: var(--process-layout-tool-area-height) var(--process-layout-title-height);
  align-content: start;
  gap: var(--process-layout-section-gap);
  border-right: 1px solid #dbe4f0;
  border-bottom: 0;
  padding: 0 0.44rem;
}

.flow-map-body .flow-top-ribbon .ribbon-saved-layout-region {
  min-width: 0;
  display: flex;
  align-items: stretch;
}

.flow-map-body .flow-top-ribbon .ribbon-saved-layout-region > .flow-ribbon-group:last-child {
  border-right: 0;
}

.flow-map-body .flow-top-ribbon .flow-group-heading {
  grid-row: 2;
  min-height: var(--process-layout-title-height);
  align-self: end;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  padding-top: 0;
  text-align: center;
}

.flow-map-body .flow-top-ribbon .flow-group-heading h2 {
  flex: 0 0 auto;
  margin: 0;
  color: #526173;
  font-size: 0.62rem;
  font-weight: 900;
  line-height: var(--process-layout-title-height);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.flow-map-body .flow-top-ribbon .icon-button.preset-gear-button {
  width: auto;
  min-width: 0;
  height: auto;
  min-height: 0;
  align-self: center;
  border: 0;
  background: transparent;
  color: #334155;
  font-size: 1.125rem;
  line-height: 1;
  padding: 0;
  transform: translateY(-1px);
}

.flow-map-body .flow-top-ribbon .process-steps-heading .preset-gear-button,
.flow-map-body .flow-top-ribbon .ribbon-connect .preset-gear-button {
  width: var(--process-layout-title-height);
  min-width: var(--process-layout-title-height);
  height: var(--process-layout-title-height);
  min-height: var(--process-layout-title-height);
  font-size: 0.74rem;
  line-height: var(--process-layout-title-height);
  transform: none;
}

.flow-map-body .flow-top-ribbon .process-steps-heading .flow-heading-actions {
  height: var(--process-layout-title-height);
  align-items: center;
}

.flow-map-body .flow-top-ribbon .process-step-actions {
  grid-row: 1;
  min-height: var(--process-layout-tool-area-height);
  display: grid;
  grid-template-columns: max-content;
  align-items: stretch;
  align-self: center;
  align-content: center;
  justify-content: center;
  gap: 0.36rem;
}

.flow-map-body .flow-top-ribbon .shape-grid {
  grid-column: 1;
  grid-row: 1;
  grid-template-columns: repeat(3, max-content);
  grid-template-rows: repeat(2, var(--process-layout-tool-row-height));
  align-items: center;
  align-self: center;
  align-content: center;
  justify-content: center;
  gap: var(--process-layout-tool-row-gap) 0.36rem;
}

.flow-map-body .flow-top-ribbon .shape-tool {
  height: var(--process-layout-tool-row-height);
  min-height: var(--process-layout-tool-row-height);
  width: max-content;
  min-width: 52px;
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  justify-items: center;
  align-content: center;
  gap: 0.18rem;
  border: 1px solid transparent;
  border-radius: 0;
  background: transparent;
  color: #1f2937;
  padding: 0.08rem 0;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.1;
  text-align: center;
}

.flow-map-body .flow-top-ribbon .shape-tool.is-selected,
.flow-map-body .flow-top-ribbon .shape-tool:hover {
  border-color: transparent;
  background: transparent;
  color: #155eef;
}

.flow-map-body .flow-top-ribbon .shape-tool:focus-visible {
  outline: 2px solid rgba(21, 94, 239, 0.3);
  outline-offset: 2px;
}

.flow-map-body .flow-top-ribbon .process-note-actions {
  grid-row: 1;
  min-height: var(--process-layout-tool-area-height);
  display: grid;
  place-items: center;
}

.flow-map-body .flow-top-ribbon .ribbon-connect {
  width: 92px;
  min-width: 92px;
}

.flow-map-body .flow-top-ribbon .connect-section-control,
.flow-map-body .flow-top-ribbon .guided-setup-section-control {
  grid-row: 1;
  min-height: var(--process-layout-tool-area-height);
  display: grid;
  place-items: center;
}

.flow-map-body .flow-top-ribbon .connect-section-control button,
.flow-map-body .flow-top-ribbon .guided-setup-section-control button {
  width: 100%;
  min-height: 38px;
  border: 1px solid #cfd9e8;
  border-radius: 6px;
  background: #ffffff;
  color: #1f2937;
  font-size: 0.58rem;
  font-weight: 900;
  line-height: 1.08;
  padding: 0.24rem 0.32rem;
  text-align: center;
}

.flow-map-body .flow-top-ribbon .connect-section-control button:hover,
.flow-map-body .flow-top-ribbon .connect-section-control button:focus-visible,
.flow-map-body .flow-top-ribbon .connect-section-control button.is-active,
.flow-map-body .flow-top-ribbon .guided-setup-section-control button:hover,
.flow-map-body .flow-top-ribbon .guided-setup-section-control button:focus-visible {
  border-color: #1d5cff;
  background: #e9f0ff;
  color: #155eef;
  outline: 2px solid rgba(21, 94, 239, 0.24);
  outline-offset: 1px;
}

.flow-map-body .flow-top-ribbon .facility-section-grid {
  grid-row: 1;
  min-height: var(--process-layout-tool-area-height);
}

.flow-map-body .flow-top-ribbon .facility-ribbon-button {
  min-width: 52px;
  height: var(--process-layout-tool-row-height);
  min-height: var(--process-layout-tool-row-height);
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: 18px 10px;
  align-content: center;
  justify-items: center;
  gap: 0.1rem;
  border-color: transparent;
  border-radius: 0;
  background: transparent;
  color: #1f2937;
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.1;
  padding: 0.08rem 0;
  text-align: center;
}

.flow-map-body .flow-top-ribbon .facility-ribbon-button > span {
  width: 24px;
  height: 18px;
  min-height: 18px;
  color: #334155;
  font-family: inherit;
  font-size: 0.72rem;
  font-style: normal;
  font-weight: 800;
  line-height: 1;
}

.flow-map-body .flow-top-ribbon .facility-draw-grid .facility-ribbon-button > span {
  width: 30px;
  height: 18px;
  min-height: 18px;
}

.flow-map-body .flow-top-ribbon .facility-ribbon-button em {
  display: block;
  min-height: 10px;
  color: inherit;
  font-family: inherit;
  font-size: 0.56rem;
  font-style: normal;
  font-weight: 900;
  line-height: 10px;
  letter-spacing: normal;
  text-transform: none;
  overflow: visible;
  text-overflow: clip;
}

.flow-map-body .flow-top-ribbon .facility-ribbon-button:hover:not(:disabled),
.flow-map-body .flow-top-ribbon .facility-ribbon-button:focus-visible,
.flow-map-body .flow-top-ribbon .facility-ribbon-button.is-active {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  color: #155eef;
}

.flow-map-body .flow-top-ribbon .facility-ribbon-button:hover:not(:disabled) > span,
.flow-map-body .flow-top-ribbon .facility-ribbon-button:focus-visible > span,
.flow-map-body .flow-top-ribbon .facility-ribbon-button.is-active > span {
  color: #155eef;
}

.flow-map-body .flow-top-ribbon .ribbon-facility-lock .facility-ribbon-button {
  min-width: 64px;
  border: 1px solid #d4dfed;
  border-radius: 5px;
  background: #f8fbff;
  padding-inline: 0.16rem;
}

.flow-map-body .flow-top-ribbon .ribbon-facility-lock .facility-ribbon-button > span {
  width: 20px;
}

.flow-map-body .flow-top-ribbon .ribbon-facility-lock .facility-ribbon-button:disabled {
  border-color: #e3eaf4;
  background: #f8fafc;
  opacity: 0.58;
}

.flow-map-body .flow-top-ribbon .ribbon-facility-lock .facility-ribbon-button.is-active,
.flow-map-body .flow-top-ribbon .ribbon-facility-lock .facility-ribbon-button.is-ready,
.flow-map-body .flow-top-ribbon .ribbon-facility-lock .facility-ribbon-button:hover:not(:disabled),
.flow-map-body .flow-top-ribbon .ribbon-facility-lock .facility-ribbon-button:focus-visible {
  border-color: #95add0;
  background: #eef5ff;
  box-shadow: none;
}

.flow-map-body .flow-top-ribbon .ribbon-saved-templates {
  width: 220px;
  min-width: 220px;
}

.flow-map-body .flow-top-ribbon .ribbon-saved-templates .flow-side-actions {
  grid-row: 1;
  width: 100%;
  height: var(--process-layout-tool-area-height);
  min-height: var(--process-layout-tool-area-height);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-self: center;
  align-content: center;
  gap: 0.2rem;
}

.flow-map-body .flow-top-ribbon .ribbon-saved-templates .saved-template-command-grid {
  grid-template-columns: minmax(0, 1fr) 32px;
  gap: 0.2rem;
}

.flow-map-body .flow-top-ribbon .ribbon-saved-templates .flow-side-actions button {
  width: 100%;
  min-width: 0;
  min-height: var(--process-layout-tool-row-height);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 6px;
  background: #f0f4fa;
  color: #1f2937;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.1;
  padding: 0.08rem 0.38rem;
  text-align: center;
}

.flow-map-body .flow-top-ribbon .saved-template-command-grid button {
  height: var(--process-layout-tool-row-height);
  overflow: hidden;
  white-space: nowrap;
}

.flow-map-body .flow-top-ribbon #savedLayoutsOpen {
  text-overflow: ellipsis;
}

.flow-map-body .flow-ribbon-panel[data-ribbon-panel="shapes"] .flow-top-ribbon .ribbon-saved-templates .flow-side-actions #saveCurrentTemplate {
  position: relative;
  width: 32px;
  min-width: 32px;
  height: var(--process-layout-tool-row-height);
  min-height: var(--process-layout-tool-row-height);
  border: 1px solid rgba(19, 121, 91, 0.26);
  border-radius: 6px;
  background: #e8f7ef;
  color: #0f684f;
  padding: 0.08rem 0.14rem;
  overflow: visible;
  z-index: 2;
}

.flow-map-body .flow-ribbon-panel[data-ribbon-panel="shapes"] .flow-top-ribbon .ribbon-saved-templates .flow-side-actions button.saved-template-current {
  width: 100%;
  min-width: 0;
  min-height: var(--process-layout-tool-row-height);
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  justify-content: stretch;
  gap: 0.26rem;
  border: 1px solid #d7e1ef;
  border-radius: 5px;
  background: #f8fbff;
  color: #334155;
  padding: 0.15rem 0.28rem;
  text-align: left;
}

.flow-map-body .flow-top-ribbon .saved-template-current-copy {
  display: grid;
  gap: 0.03rem;
}

.flow-map-body .flow-top-ribbon .saved-template-current-copy small {
  display: block;
  font-size: 0.48rem;
  font-weight: 800;
  line-height: 1;
}

.flow-map-body .flow-top-ribbon .saved-template-current-copy strong {
  font-size: 0.59rem;
  font-weight: 850;
  line-height: 1.1;
}

.flow-map-body .flow-top-ribbon .ribbon-saved-templates .flow-save-status:not(.hidden) {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.flow-map-body .flow-top-ribbon .ribbon-guided-setup {
  width: calc(190px + 0.36rem + 0.88rem);
  min-width: calc(190px + 0.36rem + 0.88rem);
}

.flow-map-body .flow-top-ribbon .ribbon-guided-setup-actions {
  grid-row: 1;
  height: var(--process-layout-tool-area-height);
  min-height: var(--process-layout-tool-area-height);
  display: grid;
  grid-template-columns: 112px 78px;
  align-items: center;
  align-self: center;
  gap: 0.36rem;
}

.flow-map-body .flow-top-ribbon .process-start-actions {
  width: 78px;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: repeat(2, var(--process-layout-tool-row-height));
  align-self: center;
  gap: var(--process-layout-tool-row-gap);
}

.flow-map-body .flow-top-ribbon .process-start-actions button {
  width: 100%;
  min-width: 0;
  min-height: var(--process-layout-tool-row-height);
  height: var(--process-layout-tool-row-height);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #cfd9e8;
  border-radius: 6px;
  background: #ffffff;
  color: #1f2937;
  font-size: 0.56rem;
  font-weight: 900;
  line-height: 1.05;
  padding: 0.14rem 0.2rem;
  text-align: center;
}

.flow-map-body .flow-top-ribbon .process-start-actions button:hover,
.flow-map-body .flow-top-ribbon .process-start-actions button:focus-visible {
  border-color: #1d5cff;
  color: #155eef;
  outline: 2px solid rgba(21, 94, 239, 0.24);
  outline-offset: 1px;
}

.flow-map-body .flow-map-app .flow-main-area {
  --flow-inspector-track-width: var(--flow-left-active-width);
  --flow-results-track-width: 281px;
  grid-row: 2;
  grid-template-columns: var(--flow-inspector-track-width) minmax(0, 1fr) var(--flow-results-track-width);
}

.flow-map-body .flow-map-app.inspector-collapsed .flow-main-area {
  --flow-inspector-track-width: 44px;
}

.flow-map-body .flow-map-app.results-collapsed .flow-main-area {
  --flow-results-track-width: 44px;
}

.flow-map-body .flow-map-app.inspector-collapsed .left-panel-resize-handle {
  display: none;
}

.flow-map-body #flowInspector {
  grid-column: 1;
  grid-row: 1;
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  min-width: 0;
  min-height: 0;
  width: 100%;
  height: 100%;
  max-height: 100%;
  padding: 0;
  overflow: hidden;
  scrollbar-gutter: auto;
  border-right: 1px solid #d7e0ee;
  background: #ffffff;
}

.flow-map-body #flowInspectorContent {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-width: 0;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

.flow-map-body #flowInspectorContent[hidden],
.flow-map-body #inspectorPanelExpand[hidden] {
  display: none;
}

.flow-map-body .flow-inspector-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.34rem;
  min-width: 0;
  padding: 0.52rem 0.6rem 0.5rem;
  border-bottom: 1px solid #e5ebf5;
  background: #ffffff;
}

.flow-map-body .flow-inspector-header h2 {
  position: static;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  font-size: 0.82rem;
  font-weight: 900;
  line-height: 1.2;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.flow-map-body #flowInspector .flow-inspector-fields {
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: 0.6rem 0.6rem 1rem;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-gutter: stable;
}

.flow-map-body #flowInspector .inspector-empty {
  margin: 0;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  background: #f8fafc;
  color: #64748b;
  font-size: 0.75rem;
  line-height: 1.5;
  padding: 0.75rem;
  overflow-wrap: anywhere;
}

.flow-map-body .inspector-collapsed-rail {
  display: none;
  width: 100%;
  min-width: 0;
  min-height: 100%;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  border: 0;
  border-radius: 0;
  background: #ffffff;
  color: #334155;
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.75rem 0.2rem;
}

.flow-map-body #flowInspector.is-collapsed .inspector-collapsed-rail:not([hidden]) {
  display: flex;
}

.flow-map-body .inspector-collapsed-rail svg {
  flex: 0 0 auto;
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.flow-map-body .inspector-collapsed-rail:hover,
.flow-map-body .inspector-collapsed-rail:focus-visible {
  background: #f2f6ff;
  color: #155eef;
}

.flow-map-body .inspector-collapsed-rail:focus-visible {
  outline: 2px solid #155eef;
  outline-offset: -4px;
}

@media (min-width: 821px) {
  .flow-map-body .inspector-collapsed-rail span {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
  }
}

.flow-map-body .flow-tab-page:not(#flow-panel-shapes).is-active {
  display: block;
  overflow-y: auto;
  padding: clamp(20px, 3vw, 40px);
  background: #f5f7fb;
  scrollbar-gutter: stable;
}

.flow-map-body .flow-tab-page:not(#flow-panel-shapes) > .flow-ribbon-group {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0;
  border: 0;
  gap: 24px;
}

.flow-map-body .flow-page-eyebrow {
  display: block;
  margin-bottom: 8px;
  color: #64748b;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.flow-map-body .flow-tab-page h1 {
  margin: 0;
  color: #17253a;
  font-size: clamp(1.5rem, 2.4vw, 2rem);
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.flow-map-body .flow-page-heading p,
.flow-map-body .operation-report-heading p,
.flow-map-body .scenario-section-heading p {
  margin: 8px 0 0;
  color: #64748b;
  font-size: 0.82rem;
  line-height: 1.5;
}

.flow-map-body #flow-panel-plan .flow-plan-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
  gap: 20px;
}

.flow-map-body #flow-panel-plan .flow-plan-grid > label,
.flow-map-body #flow-panel-plan .plan-current-time-field,
.flow-map-body #flow-panel-plan .plan-time-group {
  grid-column: auto;
  margin: 0;
  padding: 20px;
  border: 1px solid #d7e0ee;
  border-radius: 8px;
  background: #fff;
}

.flow-map-body #flow-panel-plan .plan-current-time-field,
.flow-map-body #flow-panel-plan .plan-time-group {
  grid-column: 1 / -1;
}

.flow-map-body #flow-panel-plan .plan-time-group {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
  gap: 16px;
}

.flow-map-body #flow-panel-plan .plan-time-group h3,
.flow-map-body #flow-panel-plan .shift-details-panel {
  grid-column: 1 / -1;
}

.flow-map-body #flow-panel-plan .flow-plan-grid input:not([type="range"]),
.flow-map-body #flow-panel-plan .flow-plan-grid select {
  min-height: 42px;
  font-size: 0.9rem;
}

.flow-map-body #flow-panel-plan .mapped-headcount-readout {
  grid-column: 1 / -1;
}

.flow-map-body #flow-panel-review .shareable-report-panel,
.flow-map-body #flow-panel-review .flow-detail-panel {
  margin: 0;
  padding: 22px;
  border: 1px solid #d7e0ee;
  border-radius: 8px;
  background: #fff;
}

.flow-map-body #flow-panel-review .shareable-report-metrics {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.flow-map-body #flow-panel-review .shareable-report-metrics div {
  padding: 15px;
}

.flow-map-body #flow-panel-review .shareable-report-body {
  gap: 20px;
}

.flow-map-body #flow-panel-review .shareable-report-section p,
.flow-map-body #flow-panel-review .shareable-report-section li {
  font-size: 0.82rem;
  line-height: 1.6;
}

.flow-map-body #flow-panel-scenarios .ribbon-scenarios {
  grid-template-columns: minmax(300px, 0.85fr) minmax(0, 1.4fr);
  align-items: start;
}

.flow-map-body #flow-panel-scenarios .scenario-section-heading {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

.flow-map-body #flow-panel-scenarios .scenario-manager-panel,
.flow-map-body #flow-panel-scenarios .scenario-workbench {
  min-width: 0;
  margin: 0;
  padding: 20px;
  border: 1px solid #d7e0ee;
  border-radius: 8px;
  background: #fff;
}

.flow-map-body .scenario-workbench {
  display: grid;
  gap: 16px;
}

.flow-map-body #flow-panel-scenarios .what-if-editor-fields {
  grid-template-columns: 1fr 1fr;
}

.flow-map-body #flow-panel-scenarios .what-if-editor-fields > button {
  grid-column: 1 / -1;
}

.flow-map-body #flow-panel-scenarios .custom-scenario-grid {
  grid-template-columns: 1fr 1fr;
}

.flow-map-body #flow-panel-scenarios .scenario-workflow-guide {
  grid-column: 1 / -1;
  margin: -8px 0 0;
  color: #526079;
  font-size: 0.84rem;
  line-height: 1.6;
}

.flow-map-body #flow-panel-scenarios .scenario-context-note,
.flow-map-body #flow-panel-scenarios .scenario-library-heading p {
  margin: 0;
  color: #526079;
  font-size: 0.8rem;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.flow-map-body #flow-panel-scenarios .scenario-library-heading {
  display: grid;
  gap: 6px;
  margin-top: 10px;
  padding-top: 16px;
  border-top: 1px solid #e5ebf5;
}

.flow-map-body #flow-panel-scenarios .scenario-library-heading h2,
.flow-map-body #flow-panel-scenarios .scenario-test-result h2 {
  margin: 0;
  color: #17243b;
  font-size: 0.95rem;
  line-height: 1.35;
}

.flow-map-body #flow-panel-scenarios .scenario-test-result,
.flow-map-body #flow-panel-scenarios .scenario-readiness {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid #d7e0ee;
  border-radius: 8px;
  background: #f8faff;
  min-width: 0;
}

.flow-map-body #flow-panel-scenarios .scenario-readiness[hidden] {
  display: none;
}

.flow-map-body #flow-panel-scenarios .scenario-readiness p {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.5;
}

.flow-map-body #flow-panel-scenarios .scenario-custom-details {
  border-top: 1px solid #d7e0ee;
  padding-top: 12px;
}

.flow-map-body #flow-panel-scenarios .scenario-custom-details > summary {
  cursor: pointer;
  padding: 8px 0;
  color: #234d86;
  font-size: 0.9rem;
  font-weight: 700;
}

.flow-map-body #flow-panel-scenarios .scenario-custom-details > .custom-scenario-builder {
  margin-top: 12px;
}

.flow-map-body #flow-panel-scenarios #scenarioComparison:focus-visible,
.flow-map-body #flow-panel-scenarios .scenario-custom-details > summary:focus-visible {
  outline: 2px solid #2a65bc;
  outline-offset: 4px;
}

.flow-map-body .starter-template-picker {
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100dvh - 40px);
  position: fixed;
  inset: 0;
  margin: auto;
  overflow-y: auto;
  padding: 22px;
  border: 1px solid #c3d0e3;
  border-radius: 12px;
  background: #fff;
  color: #263445;
  box-shadow: 0 20px 70px #182d5133;
}

.flow-map-body .starter-template-picker::backdrop {
  background: #182d5126;
}

.flow-map-body .starter-template-picker-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.flow-map-body .starter-template-picker-header h3 {
  margin: 0;
  font-size: 1.1rem;
}

.flow-map-body .starter-template-picker-header p {
  margin: 6px 0 0;
  color: #64748b;
  font-size: 0.78rem;
}

.flow-map-body .starter-template-picker .template-search-field,
.flow-map-body .starter-template-picker .template-search-status {
  grid-column: 1 / -1;
}

.flow-map-body .starter-template-picker [data-starter-template] {
  min-height: 44px;
  padding: 10px;
  text-align: left;
  font-size: 0.76rem;
}

@media (max-width: 1000px) {
  .flow-map-body #flow-panel-plan .flow-plan-grid,
  .flow-map-body #flow-panel-scenarios .ribbon-scenarios {
    grid-template-columns: minmax(0, 1fr);
  }

  .flow-map-body #flow-panel-plan .plan-time-group,
  .flow-map-body #flow-panel-review .shareable-report-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .flow-map-body .flow-map-app {
    height: auto;
    max-height: none;
    min-height: 100dvh;
  }

  .flow-map-body #flowTabPages,
  .flow-map-body .flow-tab-page {
    height: auto;
    overflow: visible;
  }

  .flow-map-body .flow-tabs [data-ribbon-tab] {
    min-height: 44px;
    padding: 0 0.78rem;
  }

  .flow-map-body .flow-map-app .flow-main-area {
    grid-template-columns: minmax(0, 1fr);
    height: auto;
    overflow: visible;
  }

  .flow-map-body .flow-workspace {
    min-height: 580px;
  }

  .flow-map-body #flowInspector {
    grid-row: auto;
    height: auto;
    max-height: none;
    border-right: 0;
    border-bottom: 1px solid #d7e0ee;
  }

  .flow-map-body #flowInspectorContent {
    height: auto;
  }

  .flow-map-body #flowInspector .flow-inspector-fields {
    max-height: 320px;
  }

  .flow-map-body #flowInspector.is-collapsed {
    min-height: 44px;
  }

  .flow-map-body .inspector-collapsed-rail {
    min-height: 44px;
    flex-direction: row;
    padding: 0.6rem;
  }

  .flow-map-body .inspector-sidebar-toggle {
    width: 36px;
    height: 36px;
  }

  .flow-map-body .flow-outputs {
    max-height: none;
    padding: 16px;
  }

  .flow-map-body .flow-tab-page:not(#flow-panel-shapes).is-active {
    padding: 20px 14px;
    overflow: visible;
  }

  .flow-map-body #flow-panel-plan .plan-time-group,
  .flow-map-body #flow-panel-review .shareable-report-metrics {
    grid-template-columns: minmax(0, 1fr);
  }

  .flow-map-body #flow-panel-scenarios .scenario-section-heading,
  .flow-map-body .operation-report-heading {
    align-items: start;
    flex-direction: column;
  }

  .flow-map-body .starter-template-picker {
    padding: 16px;
  }

  .flow-map-body .starter-template-picker .flow-template-actions {
    grid-template-columns: minmax(0, 1fr);
  }
}
