.operating-shell {
  width: min(calc(100% - 32px), 1360px);
}

.operating-hero {
  background:
    radial-gradient(circle at top right, rgba(137, 169, 255, 0.24), transparent 30%),
    radial-gradient(circle at bottom left, rgba(212, 245, 223, 0.36), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(251, 250, 246, 0.96));
}

.operating-section {
  display: grid;
  gap: 16px;
}

.operating-intro,
.operating-controls,
.operating-map,
.sidebar-card {
  border: 1px solid var(--yma-line-soft);
  border-radius: var(--card-radius);
  background: var(--yma-surface-strong);
  box-shadow: var(--card-shadow);
}

.operating-intro {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 24px;
}

.operating-intro h3,
.operating-controls h3,
.sidebar-card h3 {
  margin: 0 0 8px;
}

.operating-intro p {
  margin: 0;
  color: var(--gray-600);
  line-height: 1.7;
  max-width: 720px;
}

.operating-intro-points {
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  max-width: 320px;
}

.operating-controls {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 16px;
  padding: 20px 24px;
}

.legend-group {
  display: grid;
  gap: 12px;
}

.legend-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.legend-pill {
  appearance: none;
  border: 1px solid var(--yma-line-soft);
  border-radius: 999px;
  background: var(--yma-surface);
  color: var(--gray-700);
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.legend-pill:hover {
  transform: translateY(-1px);
}

.legend-pill.is-active {
  color: var(--black);
  border-color: var(--yma-line);
  box-shadow: inset 0 0 0 1px rgba(17, 17, 17, 0.04);
}

.legend-pill[data-color="strategy"].is-active {
  background: var(--yma-lilac);
}
.legend-pill[data-color="product"].is-active {
  background: var(--yma-blue-soft);
}
.legend-pill[data-color="marketing"].is-active {
  background: var(--yma-peach);
}
.legend-pill[data-color="customer"].is-active {
  background: var(--yma-mint);
}
.legend-pill[data-color="operations"].is-active {
  background: rgba(248, 255, 120, 0.46);
}
.legend-pill[data-color="origin"].is-active,
.legend-pill[data-color="contributor"].is-active,
.legend-pill[data-color="decider"].is-active,
.legend-pill[data-color="influence"].is-active {
  background: rgba(17, 17, 17, 0.08);
}

.operating-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(320px, 0.9fr);
  gap: 16px;
}

.operating-map {
  padding: 18px;
}

.map-stage {
  position: relative;
  min-height: 940px;
  border-radius: 22px;
  border: 1px solid var(--yma-line-soft);
  background:
    linear-gradient(180deg, rgba(251, 250, 246, 0.94), rgba(255, 255, 255, 0.92)),
    radial-gradient(circle at top center, rgba(137, 169, 255, 0.12), transparent 26%);
  overflow: hidden;
}

.map-stage::before {
  content: "";
  position: absolute;
  inset: 18px;
  border-radius: 18px;
  border: 1px dashed rgba(156, 163, 175, 0.24);
  pointer-events: none;
}

.map-svg,
.map-grid {
  position: absolute;
  inset: 0;
}

.map-svg {
  width: 100%;
  height: 100%;
  z-index: 1;
}

.map-grid {
  z-index: 2;
}

.function-node {
  position: absolute;
  width: 240px;
  padding: 16px;
  border-radius: 20px;
  background: var(--yma-surface-strong);
  border: 1px solid var(--yma-line-soft);
  box-shadow: var(--card-shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.function-node:hover {
  transform: translateY(-2px);
  box-shadow: var(--card-shadow-lift);
}

.function-node.is-dim {
  opacity: 0.42;
}

.function-node.is-origin {
  border-color: rgba(17, 17, 17, 0.18);
}

.function-node.is-decider {
  box-shadow: 0 0 0 4px rgba(17, 17, 17, 0.06), 0 16px 34px rgba(17, 17, 17, 0.12);
}

.function-node-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.function-node h3 {
  margin: 0;
  font-size: 18px;
  line-height: 1.1;
}

.function-node p {
  margin: 0;
  color: var(--gray-600);
  line-height: 1.55;
  font-size: 13px;
}

.node-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 28px;
  border-radius: 999px;
  background: var(--yma-paper);
  color: var(--gray-700);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.node-list {
  margin: 12px 0 0;
  padding-left: 16px;
  color: var(--gray-700);
  display: grid;
  gap: 6px;
  font-size: 13px;
  line-height: 1.45;
}

.flow-segment {
  fill: none;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.92;
}

.flow-segment.is-origin { stroke-dasharray: none; }
.flow-segment.is-contributor { stroke-dasharray: 4 8; stroke-width: 2.5; opacity: 0.66; }
.flow-segment.is-influence { stroke-dasharray: 10 8; stroke-width: 2.5; opacity: 0.72; }

.flow-segment.type-strategy { stroke: #6366f1; }
.flow-segment.type-product { stroke: #0ea5e9; }
.flow-segment.type-marketing { stroke: #ec4899; }
.flow-segment.type-customer { stroke: #10b981; }
.flow-segment.type-operations { stroke: #f59e0b; }

.flow-badge {
  font-family: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 11px;
  font-weight: 700;
}

.flow-badge rect {
  fill: rgba(255, 255, 255, 0.94);
  stroke: rgba(17, 17, 17, 0.08);
  rx: 10;
  ry: 10;
}

.flow-badge text {
  fill: var(--black);
}

.operating-sidebar {
  display: grid;
  gap: 16px;
  align-self: start;
}

.sidebar-card {
  padding: 18px;
}

.sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.sidebar-head h3 {
  margin: 0;
}

.flow-list {
  display: grid;
  gap: 12px;
}

.flow-card {
  border: 1px solid var(--gray-200);
  border-radius: 18px;
  padding: 14px;
  background: #fcfcfd;
}

.flow-card.is-dim {
  opacity: 0.45;
}

.flow-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.flow-topline h4 {
  margin: 0;
  font-size: 15px;
}

.flow-type {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.flow-type.strategy { background: rgba(99, 102, 241, 0.12); color: #4338ca; }
.flow-type.product { background: rgba(14, 165, 233, 0.12); color: #0369a1; }
.flow-type.marketing { background: rgba(236, 72, 153, 0.12); color: #be185d; }
.flow-type.customer { background: rgba(16, 185, 129, 0.12); color: #047857; }
.flow-type.operations { background: rgba(245, 158, 11, 0.14); color: #b45309; }

.flow-card p {
  margin: 0 0 12px;
  color: var(--gray-600);
  line-height: 1.6;
  font-size: 14px;
}

.flow-meta {
  display: grid;
  gap: 8px;
}

.flow-meta-row {
  display: grid;
  gap: 4px;
}

.flow-meta-row strong {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gray-500);
}

.flow-pill-list {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.flow-pill {
  padding: 6px 8px;
  border-radius: 999px;
  background: var(--gray-100);
  color: var(--gray-700);
  font-size: 12px;
  font-weight: 600;
}

.role-key-card ul {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 8px;
  color: var(--gray-700);
  line-height: 1.55;
}

@media (max-width: 1240px) {
  .operating-layout {
    grid-template-columns: 1fr;
  }

  .operating-sidebar {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 920px) {
  .operating-intro,
  .operating-controls {
    grid-template-columns: 1fr;
    display: grid;
  }

  .operating-sidebar {
    grid-template-columns: 1fr;
  }

  .map-stage {
    min-height: 1980px;
  }

  .function-node {
    width: 210px;
  }
}
