.efvp-map .relation {
  fill: none;
  stroke: rgba(57, 215, 238, 0.16);
  stroke-width: 1;
  opacity: 0.62;
  transition: opacity 0.16s ease, stroke 0.16s ease, stroke-width 0.16s ease, filter 0.16s ease;
}

.efvp-map.has-selection .relation {
  opacity: 0.07;
}

.efvp-map .relation.active {
  opacity: 1;
  stroke: var(--ef-cyan);
  stroke-width: 2;
  filter: drop-shadow(0 0 5px rgba(57, 215, 238, 0.72));
}

.efvp-map .relation.flow-destination.active {
  stroke: var(--ef-violet);
  filter: drop-shadow(0 0 5px rgba(165, 139, 250, 0.68));
}

.efvp-map .relation.risk-measure.active {
  stroke: var(--ef-green);
  filter: drop-shadow(0 0 5px rgba(61, 214, 162, 0.66));
}

.efvp-map .relation.risk-residual.active {
  stroke: var(--ef-amber);
  filter: drop-shadow(0 0 5px rgba(242, 184, 75, 0.62));
}

.efvp-map .relation.measure-residual.active {
  stroke: #9aeafa;
}

.efvp-steps-footer {
  min-width: 0;
  min-height: 0;
  max-height: min(34vh, 250px);
  max-height: min(34dvh, 250px);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}

.efvp-map-legend {
  margin: 8px 8px 0;
  padding: 10px;
  border: 1px solid var(--ef-line);
  border-radius: 8px;
  background: rgba(7, 30, 48, 0.72);
}

.efvp-map-legend-title {
  display: block;
  margin-bottom: 9px;
  color: var(--ef-muted);
  font-family: var(--ef-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.efvp-map-legend ul {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.efvp-map-legend li {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  gap: 5px;
  min-width: 0;
  color: #b8d4df;
  font-size: 9px;
  line-height: 1.18;
}

.efvp-legend-chip {
  display: block;
  width: 18px;
  height: 12px;
  border: 1px solid rgba(137, 225, 244, 0.4);
  border-radius: 3px;
  background: rgba(18, 55, 77, 0.94);
}

.efvp-legend-chip.is-sensitive {
  border-color: var(--ef-amber);
  border-style: dashed;
}

.efvp-legend-chip.is-overdue {
  border-color: var(--ef-red);
  border-style: dashed;
}

.efvp-legend-chip.is-foreign {
  border-color: var(--ef-violet);
}

.efvp-legend-line {
  display: block;
  width: 18px;
  height: 3px;
  border-radius: 2px;
}

.efvp-legend-line.is-muted {
  background: rgba(57, 215, 238, 0.22);
}

.efvp-legend-line.is-active-cyan {
  background: var(--ef-cyan);
  box-shadow: 0 0 5px rgba(57, 215, 238, 0.62);
}

.efvp-legend-line.is-active-violet {
  background: var(--ef-violet);
  box-shadow: 0 0 5px rgba(165, 139, 250, 0.58);
}

.efvp-workbench {
  position: relative;
}

.efvp-steps {
  min-height: 0;
  overflow: hidden;
}

.efvp-pane-resizer {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 120;
  display: none;
  width: 11px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: col-resize;
  touch-action: none;
}

.efvp-pane-resizer::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 5px;
  width: 1px;
  background: var(--ef-line);
  transition: width 0.14s ease, background 0.14s ease, box-shadow 0.14s ease;
}

.efvp-pane-resizer:hover::before,
.efvp-pane-resizer:focus-visible::before,
.efvp-pane-resizer.is-dragging::before {
  width: 2px;
  background: var(--ef-cyan);
  box-shadow: 0 0 8px rgba(57, 215, 238, 0.72);
}

body.efvp-pane-resizing,
body.efvp-pane-resizing * {
  cursor: col-resize !important;
  user-select: none !important;
}

button.efvp-consistency-mini {
  display: block;
  width: calc(100% - 16px);
  color: var(--ef-text);
  text-align: left;
  cursor: pointer;
}

button.efvp-consistency-mini:hover,
button.efvp-consistency-mini:focus-visible {
  border-color: var(--ef-line-strong);
  background: rgba(16, 49, 70, 0.86);
}

.efvp-global-controls {
  scroll-margin-top: 8px;
}

.efvp-global-controls:focus {
  outline: none;
}

.efvp-global-controls.is-targeted {
  animation: efvpControlFocus 1.1s ease;
}

@keyframes efvpControlFocus {
  0%, 100% { opacity: 1; }
  35% { opacity: 0.68; }
}

body.efvp-mode-map .efvp-map-legend,
body.efvp-steps-collapsed .efvp-map-legend,
body.efvp-mode-map button.efvp-consistency-mini,
body.efvp-steps-collapsed button.efvp-consistency-mini {
  display: none;
}

@media (max-width: 1180px) {
  .efvp-map-legend,
  button.efvp-consistency-mini {
    display: none;
  }
}

@media (min-width: 821px) {
  .efvp-app {
    height: 100dvh;
  }

  .efvp-workbench {
    overflow: hidden;
  }
}

@media (min-width: 1181px) {
  .efvp-workbench {
    --efvp-detail-width: 35vw;
    grid-template-columns: 214px minmax(360px, 1fr) clamp(280px, var(--efvp-detail-width), 60vw);
  }

  body.efvp-mode-expert .efvp-workbench {
    grid-template-columns: 214px minmax(360px, 1fr) clamp(280px, var(--efvp-detail-width), 60vw);
  }

  body.efvp-steps-collapsed .efvp-workbench {
    grid-template-columns: 74px minmax(360px, 1fr) clamp(280px, var(--efvp-detail-width), 60vw);
  }

  body.efvp-mode-expert.efvp-mini-map-hidden .efvp-workbench {
    grid-template-columns: 214px minmax(0, 1fr) 0;
  }

  body.efvp-mode-expert.efvp-mini-map-hidden.efvp-steps-collapsed .efvp-workbench {
    grid-template-columns: 74px minmax(0, 1fr) 0;
  }

  body.efvp-mode-map .efvp-workbench {
    grid-template-columns: 74px minmax(0, 1fr) 0;
  }

  .efvp-pane-resizer {
    display: block;
  }

  .efvp-pane-resizer-detail {
    right: clamp(280px, var(--efvp-detail-width), 60vw);
    transform: translateX(50%);
  }

  body.efvp-mode-map .efvp-pane-resizer,
  body.efvp-mode-expert.efvp-mini-map-hidden .efvp-pane-resizer-detail {
    display: none;
  }
}
