/* Additive, component-scoped styles. No legacy narrative or view selectors. */
.workflow-map {
  --wm-ink: #102830;
  --wm-node: #1c3842;
  --wm-border: #526e76;
  --wm-text: #f3f8f7;
  --wm-muted: #b8cbd0;
  --wm-teal: #7acac1;
  --wm-amber: #e5ba77;
  --wm-small: .75rem;
  --wm-ui: .875rem;
  --wm-body: 1rem;
  margin: 0 0 56px;
  scroll-margin-top: 24px;
}
.workflow-map [hidden] { display: none !important; }
.wm-intro { max-width: 820px; margin-bottom: 24px; }
.wm-intro h2 { font-size: clamp(1.7rem, 3vw, 2.35rem); line-height: 1.12; margin-bottom: 14px; }
.wm-intro > p:last-child { color: var(--muted); margin-bottom: 0; font-size: var(--wm-body); }
.wm-app { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.wm-route-bar { padding: 22px 24px 18px; }
.wm-toolbar-label { color: var(--muted); font-size: var(--wm-small); font-weight: 800; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 10px; }
.wm-routes { display: flex; flex-wrap: wrap; gap: 8px; }
.workflow-map button, .wm-link, .wm-route-reading > summary { min-height: 44px; min-width: 44px; touch-action: manipulation; }
.wm-routes button, .wm-view button, .wm-controls button, .wm-link {
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
  padding: 10px 13px;
  cursor: pointer;
  font-size: var(--wm-ui);
  font-weight: 700;
  line-height: 1.35;
}
.wm-routes button { border-radius: 999px; }
.wm-routes button[aria-pressed="true"] { color: #fff; background: var(--ink); border-color: var(--ink); }
.wm-routes button:hover:not([aria-pressed="true"]), .wm-controls button:hover:not(:disabled), .wm-link:hover { background: var(--soft); border-color: #91b4af; }
.wm-route-description { max-width: 85ch; margin: 14px 0 0; color: #4e656c; font-size: var(--wm-ui); line-height: 1.6; }
.wm-route-reading { margin-top: 4px; font-size: var(--wm-ui); }
.wm-route-reading > summary { display: list-item; width: fit-content; padding: 11px 0; cursor: pointer; color: var(--teal-dark); font-weight: 700; }
.wm-route-list { display: flex; flex-wrap: wrap; gap: 7px 0; list-style: none; padding: 0 0 6px; margin: 0; color: #4e656c; }
.wm-route-list li { display: inline; }
.wm-route-list li:not(:last-child)::after { content: " → "; display: inline-block; padding: 0 9px; color: #687e84; }
.wm-route-list li[aria-current="step"] { color: var(--teal-dark); font-weight: 800; }
.wm-workspace { display: grid; grid-template-columns: minmax(0, 1fr) 340px; border-top: 1px solid var(--line); }
.wm-surface { min-width: 0; color: var(--wm-text); background: var(--wm-ink); border-bottom-left-radius: calc(var(--radius) - 1px); }
.wm-surface-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 20px; padding: 20px 24px 0; }
.wm-surface-title { margin: 0; font-size: var(--wm-small); font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--wm-muted); }
.wm-surface-header a { display: inline-flex; align-items: center; color: #b4e2dc; font-size: var(--wm-ui); text-underline-offset: 4px; min-height: 44px; }
.wm-diagram { position: relative; isolation: isolate; }
.wm-connectors { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: -1; }
.wm-nodes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: repeat(3, minmax(120px, auto));
  gap: 56px 38px;
  padding: 28px 32px;
  margin: 0;
  list-style: none;
}
.wm-node-item { grid-column: var(--map-col); grid-row: var(--map-row); display: flex; min-width: 0; }
.wm-node {
  display: flex;
  flex-direction: column;
  gap: 8px;
  justify-content: space-between;
  width: 100%;
  min-height: 120px;
  text-align: left;
  border: 1px solid var(--wm-border);
  border-radius: 10px;
  background: var(--wm-node);
  color: var(--wm-text);
  padding: 13px 14px;
  cursor: pointer;
  transition: background-color .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.wm-node-kind { display: flex; gap: 7px; align-items: baseline; color: var(--wm-muted); font-size: var(--wm-small); line-height: 1.35; }
.wm-node-kind::before { content: ""; display: inline-block; flex: 0 0 6px; width: 6px; height: 6px; border: 1px solid currentColor; }
.wm-node-label { font-size: .9375rem; font-weight: 750; line-height: 1.3; letter-spacing: -.015em; }
.wm-node-state { color: var(--wm-muted); font-size: var(--wm-small); line-height: 1.3; }
.wm-node[data-decision="true"] { border-color: #a48960; }
.wm-node[data-decision="true"] .wm-node-kind { color: var(--wm-amber); }
.wm-node[data-decision="true"] .wm-node-kind::before { transform: rotate(45deg); }
.wm-node[data-route-state="other"] { background: #152e37; border-color: #3b555e; }
.wm-node[data-route-state="other"] .wm-node-label { color: #c3d3d7; }
.wm-node[data-route-state="visited"] { background: #194b4d; border-color: #6badab; }
.wm-node[data-route-state="visited"] .wm-node-state { color: #a6e1d8; }
.wm-node[aria-current="step"] { background: #eef9f6; color: var(--ink); border-color: #dcf5ee; box-shadow: 0 0 0 3px #7acac126; }
.wm-node[aria-current="step"] .wm-node-kind, .wm-node[aria-current="step"] .wm-node-state { color: #315f60; }
.wm-node[data-decision="true"][aria-current="step"] { border-color: var(--wm-amber); box-shadow: 0 0 0 3px #e5ba7726; }
.wm-node[data-decision="true"][aria-current="step"] .wm-node-kind { color: #715121; }
.wm-node:hover:not([aria-current="step"]) { border-color: var(--wm-teal); background: #264852; }
.wm-legend { display: flex; flex-wrap: wrap; gap: 10px 18px; margin: 0; padding: 6px 24px 22px; list-style: none; font-size: var(--wm-small); color: var(--wm-muted); }
.wm-legend li { display: flex; align-items: center; gap: 7px; }
.wm-key { display: inline-block; width: 13px; height: 8px; border-radius: 2px; background: #eef9f6; }
.wm-key-visited { height: 3px; background: var(--wm-teal); }
.wm-key-ahead { height: 0; border-top: 2px dashed #8dabb0; background: none; }
.wm-key-decision { width: 7px; height: 7px; border: 1px solid var(--wm-amber); border-radius: 0; background: none; transform: rotate(45deg); margin-right: 4px; }
.wm-diagram-help { margin: 0; padding: 0 24px 24px; color: var(--wm-muted); font-size: var(--wm-small); }
.wm-inspector { min-width: 0; padding: 24px; background: #fcfdfb; border-bottom-right-radius: calc(var(--radius) - 1px); }
.wm-inspector-heading { scroll-margin-top: 24px; }
.wm-inspector-title { font-size: 1.35rem; font-weight: 800; letter-spacing: -.03em; line-height: 1.2; margin: 0 0 18px; }
.wm-view { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 18px; }
.wm-view button { flex: 1 1 auto; padding-inline: 10px; }
.wm-view button[aria-pressed="true"] { border-color: #95b7b1; background: var(--soft); color: var(--teal-dark); }
.wm-view button:hover { border-color: var(--teal); }
.wm-inspector-copy { color: #4b6269; font-size: var(--wm-body); line-height: 1.6; }
.wm-inspector-copy p { margin-bottom: 14px; max-width: 70ch; }
.wm-inspector-copy strong { color: var(--ink); font-weight: 750; }
.wm-inspector-note { margin: 0 0 16px; padding: 12px 13px; border-radius: 8px; background: #fbf1df; color: #69512d; font-size: var(--wm-ui); line-height: 1.55; }
.wm-stage-links { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 24px; }
.wm-link { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; }
.wm-link-primary { color: var(--teal-dark); }
.wm-walkthrough { border-top: 1px solid var(--line); padding-top: 20px; }
.wm-status { margin: 0 0 14px; color: #3f5961; font-size: var(--wm-ui); line-height: 1.55; }
.wm-controls { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.wm-controls [data-map-action="next"] { background: var(--teal-dark); border-color: var(--teal-dark); color: #fff; }
.wm-controls [data-map-action="next"]:hover:not(:disabled) { background: #074d4e; }
.wm-controls button:disabled { cursor: not-allowed; opacity: .48; }
.wm-motion-note { color: #4e656c; font-size: var(--wm-small); margin: 12px 0 0; }
.workflow-map :is(button, a, summary):focus-visible { outline: 3px solid #087b7b; outline-offset: 4px; }
.wm-surface :is(button, a):focus-visible { outline-color: #f4d29e; outline-offset: 5px; }
.wm-inspector-heading:focus { outline: 2px solid var(--teal); outline-offset: 6px; border-radius: 2px; }
.workflow-map button:active:not(:disabled), .wm-link:active { filter: brightness(.92); }
.wm-fallback-note { color: var(--muted); margin: 0 0 22px; }
.wm-fallback-note a { display: inline-flex; align-items: center; min-height: 44px; color: var(--teal-dark); }
.wm-fallback-stages { padding-left: 24px; }
.wm-fallback-stages li { margin-bottom: 20px; }
.wm-fallback-stages p { color: var(--muted); margin: 6px 0 0; }
@media (max-width: 1099px) {
  .wm-workspace { grid-template-columns: minmax(0, 1fr); }
  .wm-surface { border-bottom-left-radius: 0; }
  .wm-inspector { border-radius: 0 0 calc(var(--radius) - 1px) calc(var(--radius) - 1px); }
  .wm-inspector-title { max-width: 36ch; }
  .wm-view, .wm-controls { max-width: 400px; }
}
@media (max-width: 700px) {
  .wm-route-bar, .wm-inspector { padding: 20px 18px; }
  .wm-routes { gap: 8px; }
  .wm-routes button { flex: 1 1 auto; padding: 11px 12px; }
  .wm-surface-header { padding: 16px 18px 0; }
  .wm-nodes { display: flex; flex-direction: column; gap: 38px; padding: 24px 40px; }
  .wm-node-item { width: 100%; max-width: 420px; align-self: center; }
  .wm-node { min-height: 116px; padding: 14px; }
  .wm-node-label { font-size: var(--wm-body); }
  .wm-legend { padding: 6px 18px 18px; }
  .wm-diagram-help { padding: 0 18px 22px; }
  .wm-stage-links { flex-direction: column; }
  .wm-stage-links .wm-link { justify-content: center; }
  .wm-controls, .wm-view { max-width: none; }
}
@media (prefers-reduced-motion: reduce) {
  .workflow-map *, .workflow-map *::before, .workflow-map *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
@media (forced-colors: active) {
  .wm-node[aria-current="step"] { outline: 3px solid Highlight; outline-offset: 3px; }
  .wm-node[data-decision="true"] { border-style: double; border-width: 3px; }
  .wm-routes button[aria-pressed="true"], .wm-view button[aria-pressed="true"] { outline: 2px solid Highlight; }
  .wm-connectors { forced-color-adjust: none; }
}
