
* { box-sizing: border-box; }

/* Marketing System Map prototype */
.msm-shell {
  min-height: 100vh;
  padding: 24px;
  background:
    radial-gradient(circle at 12% 10%, rgba(29, 78, 216, 0.32), transparent 32%),
    radial-gradient(circle at 88% 12%, rgba(250, 204, 21, 0.14), transparent 24%),
    #0d0d0d;
  color: #ffffff;
  font-family: "PP Mori Book", system-ui, sans-serif;
}
.msm-shell::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.18;
  background-image:
    linear-gradient(rgba(255,255,255,0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.05) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, black, transparent 76%);
}
.msm-hero, .msm-workbench {
  position: relative;
  width: min(1760px, 100%);
  margin: 0 auto;
}
.msm-hero {
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 28px;
  min-height: 360px;
  padding: clamp(22px, 4vw, 54px);
  background:
    linear-gradient(135deg, rgba(29, 78, 216, 0.94), rgba(15, 32, 64, 0.92)),
    #1d4ed8;
  overflow: hidden;
}
.msm-hero::after {
  content: "Mm";
  position: absolute;
  right: -24px;
  bottom: -72px;
  font-family: "PP Neue York", Georgia, serif;
  font-weight: 700;
  font-size: clamp(180px, 24vw, 390px);
  line-height: 0.8;
  color: rgba(255,255,255,0.07);
  letter-spacing: -0.08em;
}
.msm-nav {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-family: "PP Neue Montreal Mono", ui-monospace, monospace;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 11px;
  color: rgba(255,255,255,0.74);
}
.msm-nav a {
  font-family: "PP Palma Fizzy Heavy", Georgia, serif;
  text-transform: lowercase;
  letter-spacing: -0.04em;
  font-size: 26px;
  font-weight: 800;
  color: white;
  text-decoration: none;
}
.msm-hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  gap: clamp(24px, 6vw, 96px);
  align-items: end;
  min-height: 250px;
  padding-top: 58px;
}
.msm-eyebrow, .msm-kicker {
  margin: 0 0 12px;
  font-family: "PP Neue Montreal Mono", ui-monospace, monospace;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 12px;
  font-weight: 600;
}
.msm-eyebrow { color: #facc15; }
.msm-hero h1 {
  max-width: 980px;
  font-size: clamp(58px, 10vw, 156px);
  line-height: 0.83;
  letter-spacing: -0.065em;
  margin: 0;
  text-wrap: balance;
}
.msm-hero-copy p {
  margin: 0;
  color: rgba(255,255,255,0.82);
  font-size: clamp(18px, 2vw, 24px);
  line-height: 1.35;
  letter-spacing: -0.02em;
}
.msm-loop {
  margin-top: 24px;
  display: inline-flex;
  border: 1px solid rgba(255,255,255,0.24);
  border-radius: 999px;
  padding: 10px 14px;
  color: #facc15;
  background: rgba(13,13,13,0.22);
  font-family: "PP Neue Montreal Mono", ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.04em;
}
.msm-workbench {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(360px, 0.7fr);
  gap: 20px;
  margin-top: 20px;
}
.msm-map-card, .msm-detail {
  border: 1px solid rgba(13,13,13,0.16);
  border-radius: 28px;
  background: #fafcff;
  color: #0d0d0d;
  box-shadow: 0 28px 80px rgba(0,0,0,0.24);
}
.msm-map-card {
  min-height: 720px;
  padding: clamp(18px, 3vw, 32px);
}
.msm-map-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.msm-map-header h2, .msm-detail h2 {
  margin: 0;
  font-size: clamp(28px, 3vw, 46px);
  line-height: 0.95;
  letter-spacing: -0.045em;
}
.msm-kicker { color: #1d4ed8; }
.msm-reset {
  border: 1px solid rgba(13,13,13,0.16);
  border-radius: 999px;
  background: white;
  color: #0d0d0d;
  padding: 10px 14px;
  cursor: pointer;
  font-family: "PP Neue Montreal Mono", ui-monospace, monospace;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 10px;
}
.msm-map {
  position: relative;
  height: min(62vw, 560px);
  min-height: 520px;
  border-radius: 24px;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 42%, rgba(29,78,216,0.15), transparent 32%),
    linear-gradient(rgba(29,78,216,0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(29,78,216,0.045) 1px, transparent 1px),
    #eef3ff;
  background-size: auto, 36px 36px, 36px 36px, auto;
  border: 1px solid rgba(29,78,216,0.16);
}
.msm-lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.msm-lines line {
  stroke: rgba(13,13,13,0.18);
  stroke-width: 0.28;
  vector-effect: non-scaling-stroke;
  transition: stroke 180ms ease, stroke-width 180ms ease;
}
.msm-lines line.is-active {
  stroke: #1d4ed8;
  stroke-width: 0.7;
}
.msm-node {
  position: absolute;
  transform: translate(-50%, -50%);
  width: clamp(118px, 12vw, 170px);
  min-height: 88px;
  border: 1px solid rgba(13,13,13,0.16);
  border-radius: 20px;
  background: rgba(255,255,255,0.86);
  color: #0d0d0d;
  cursor: pointer;
  display: grid;
  align-content: center;
  gap: 7px;
  padding: 14px;
  text-align: left;
  box-shadow: 0 18px 40px rgba(15,32,64,0.12);
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}
.msm-node span {
  font-family: "PP Neue Montreal Mono", ui-monospace, monospace;
  color: #6b7280;
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.msm-node strong {
  font-size: clamp(17px, 1.4vw, 22px);
  line-height: 0.96;
  letter-spacing: -0.035em;
}
.msm-node:hover, .msm-node.is-selected {
  transform: translate(-50%, -50%) translateY(-3px);
  border-color: #1d4ed8;
  box-shadow: 0 20px 54px rgba(29,78,216,0.22);
}
.msm-node.is-selected {
  background: #1d4ed8;
  color: white;
}
.msm-node.is-selected span { color: #facc15; }
.msm-node.is-journey:not(.is-selected) {
  border-color: rgba(250,204,21,0.8);
  background: #fff9d7;
}
.msm-journeys {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 16px;
}
.msm-journeys button {
  border: 1px solid rgba(13,13,13,0.14);
  border-radius: 18px;
  background: white;
  color: #0d0d0d;
  padding: 16px;
  text-align: left;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease;
}
.msm-journeys button:hover { transform: translateY(-2px); border-color: #1d4ed8; }
.msm-journeys span {
  display: block;
  font-weight: 800;
  letter-spacing: -0.025em;
  margin-bottom: 8px;
}
.msm-journeys small { color: #6b7280; line-height: 1.35; }
.msm-detail {
  padding: clamp(20px, 3vw, 34px);
  align-self: start;
  position: sticky;
  top: 20px;
}
.msm-detail p {
  color: rgba(13,13,13,0.66);
  font-size: 16px;
  line-height: 1.56;
}
.msm-question {
  font-family: "PP Neue York", Georgia, serif;
  font-style: italic;
  color: #0d0d0d !important;
  font-size: clamp(21px, 2vw, 28px) !important;
  line-height: 1.12 !important;
  letter-spacing: -0.025em;
}
.msm-detail-section {
  border-top: 1px solid rgba(13,13,13,0.12);
  padding-top: 20px;
  margin-top: 20px;
}
.msm-detail-section h3 {
  margin: 0 0 12px;
  font-family: "PP Neue Montreal Mono", ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #6b7280;
}
.msm-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.msm-chip-row span {
  border: 1px solid rgba(29,78,216,0.16);
  border-radius: 999px;
  padding: 7px 10px;
  background: #eef3ff;
  color: #0f2b5c;
  font-size: 13px;
}
.msm-detail ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 9px;
}
.msm-detail li {
  padding-left: 18px;
  position: relative;
  color: rgba(13,13,13,0.72);
  line-height: 1.4;
}
.msm-detail li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #facc15;
}
.msm-connection-list p {
  margin: 0 0 10px;
  padding: 12px;
  border-radius: 14px;
  background: #f2ede4;
}
.msm-resource-card {
  margin-top: 22px;
  border-radius: 22px;
  padding: 18px;
  background: #0d0d0d;
  color: white;
  display: grid;
  gap: 10px;
}
.msm-resource-card span {
  font-family: "PP Neue Montreal Mono", ui-monospace, monospace;
  color: #b8d4ff;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 10px;
}
.msm-resource-card strong {
  font-size: 15px;
  letter-spacing: -0.015em;
}
@media (max-width: 1040px) {
  .msm-hero-grid, .msm-workbench { grid-template-columns: 1fr; }
  .msm-detail { position: static; }
}
@media (max-width: 760px) {
  .msm-shell { padding: 12px; }
  .msm-hero { min-height: auto; }
  .msm-loop { border-radius: 16px; line-height: 1.4; }
  .msm-map { min-height: 690px; }
  .msm-node { width: 132px; min-height: 78px; }
  .msm-journeys { grid-template-columns: 1fr; }
  .msm-map-header { flex-direction: column; }
}

/* Marketing System Map v2 iteration */
.msm-v2 .msm-hero-compact {
  min-height: 0;
  padding: clamp(16px, 2.2vw, 30px);
  border-radius: 24px;
}
.msm-v2 .msm-hero-compact::after {
  font-size: clamp(96px, 15vw, 220px);
  bottom: -46px;
}
.msm-v2 .msm-hero-grid {
  min-height: 116px;
  padding-top: 24px;
  grid-template-columns: minmax(0, 0.95fr) minmax(300px, 0.8fr);
  align-items: end;
}
.msm-v2 .msm-hero h1 {
  font-size: clamp(36px, 6.8vw, 84px);
  max-width: 780px;
}
.msm-v2 .msm-hero-copy p {
  font-size: clamp(15px, 1.45vw, 18px);
  line-height: 1.42;
}
.msm-v2 .msm-loop {
  margin-top: 12px;
  font-size: 10px;
  padding: 8px 11px;
}
.msm-workbench-v2 {
  grid-template-columns: minmax(0, 1.45fr) minmax(360px, 0.55fr);
}
.msm-map-header-v2 {
  align-items: flex-end;
}
.msm-breadcrumb {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  justify-content: flex-end;
  color: #6b7280;
  font-family: "PP Neue Montreal Mono", ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.msm-breadcrumb button {
  border: 1px solid rgba(13,13,13,0.12);
  border-radius: 999px;
  background: white;
  color: #0d0d0d;
  cursor: pointer;
  padding: 7px 9px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 10px;
}
.msm-breadcrumb strong { color: #1d4ed8; }
.msm-v2 .msm-map {
  min-height: 500px;
  height: min(52vw, 540px);
  transition: transform 280ms ease, background 280ms ease;
}
.msm-v2 .msm-map.is-drilled {
  background:
    radial-gradient(circle at 50% 42%, rgba(250,204,21,0.18), transparent 36%),
    linear-gradient(rgba(29,78,216,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(29,78,216,0.04) 1px, transparent 1px),
    #f2ede4;
  transform: scale(1.006);
}
.msm-v2 .msm-node {
  width: clamp(112px, 10.5vw, 154px);
  min-height: 80px;
}
.msm-v2 .msm-node.is-route:not(.is-selected) {
  border-color: rgba(250,204,21,0.9);
  background: #fff9d7;
}
.msm-drilldown {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(520px, calc(100% - 42px));
  transform: translate(-50%, -50%);
  border: 1px solid rgba(13,13,13,0.18);
  border-radius: 28px;
  background: rgba(255,255,255,0.94);
  color: #0d0d0d;
  padding: clamp(20px, 3vw, 34px);
  box-shadow: 0 28px 90px rgba(15,32,64,0.2);
  animation: msmZoomIn 260ms ease both;
  z-index: 5;
}
@keyframes msmZoomIn {
  from { opacity: 0; transform: translate(-50%, -48%) scale(0.94); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
.msm-drill-back {
  border: 1px solid rgba(13,13,13,0.12);
  border-radius: 999px;
  background: #eef3ff;
  color: #0f2b5c;
  cursor: pointer;
  padding: 8px 11px;
  margin-bottom: 18px;
  font-family: "PP Neue Montreal Mono", ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.msm-drilldown h3 {
  margin: 0;
  font-size: clamp(32px, 5vw, 68px);
  line-height: 0.88;
  letter-spacing: -0.055em;
}
.msm-drilldown p {
  color: rgba(13,13,13,0.68);
  font-size: 18px;
  line-height: 1.42;
}
.msm-subcards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  margin-top: 20px;
}
.msm-subcards span {
  border-radius: 16px;
  background: #0d0d0d;
  color: white;
  padding: 14px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.msm-routes-panel {
  margin-top: 18px;
  border-top: 1px solid rgba(13,13,13,0.12);
  padding-top: 18px;
}
.msm-routes-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}
.msm-routes-head h3 {
  margin: 0;
  font-size: clamp(24px, 2.3vw, 34px);
  line-height: 0.95;
  letter-spacing: -0.04em;
}
.msm-route-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.msm-route-filters button {
  border: 1px solid rgba(13,13,13,0.12);
  border-radius: 999px;
  background: white;
  color: #0d0d0d;
  cursor: pointer;
  padding: 8px 10px;
  font-family: "PP Neue Montreal Mono", ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.msm-route-filters button.is-active {
  background: #1d4ed8;
  border-color: #1d4ed8;
  color: white;
}
.msm-routes-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
}
.msm-routes-list button {
  display: grid;
  gap: 7px;
  min-height: 132px;
  border: 1px solid rgba(13,13,13,0.14);
  border-radius: 18px;
  background: white;
  color: #0d0d0d;
  padding: 14px;
  text-align: left;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}
.msm-routes-list button:hover,
.msm-routes-list button.is-selected {
  transform: translateY(-2px);
  border-color: #1d4ed8;
  background: #eef3ff;
}
.msm-routes-list small {
  color: #1d4ed8;
  font-family: "PP Neue Montreal Mono", ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.msm-routes-list span {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
}
.msm-routes-list em {
  color: #6b7280;
  font-style: normal;
  font-size: 13px;
  line-height: 1.35;
}
.msm-route-chain {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}
.msm-route-chain span {
  border: 1px solid rgba(29,78,216,0.18);
  border-radius: 999px;
  background: #eef3ff;
  color: #0f2b5c;
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 700;
}
.msm-topic-buttons button {
  border: 1px solid rgba(29,78,216,0.16);
  border-radius: 999px;
  padding: 7px 10px;
  background: #eef3ff;
  color: #0f2b5c;
  font-size: 13px;
  cursor: pointer;
}
.msm-topic-buttons button:hover {
  background: #1d4ed8;
  color: white;
}
@media (max-width: 1040px) {
  .msm-workbench-v2 { grid-template-columns: 1fr; }
  .msm-map-header-v2 { align-items: flex-start; }
}
@media (max-width: 760px) {
  .msm-v2 .msm-hero-grid { grid-template-columns: 1fr; min-height: 0; }
  .msm-v2 .msm-map { min-height: 660px; }
  .msm-routes-head { flex-direction: column; }
  .msm-routes-list { grid-template-columns: 1fr; }
}

/* ============================================================
   Marketing System Map v3 — banded layout, drawers, portal
   ============================================================ */

/* --- Hero (slim) --- */
.msm-v3 .msm-hero { min-height: 0; }
.msm-hero-slim {
  padding: clamp(18px, 2.4vw, 30px) clamp(20px, 3vw, 40px) clamp(22px, 3vw, 34px);
  border-radius: 24px;
}
.msm-hero-slim::after { content: none; }
.msm-brandline {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: baseline;
  gap: 14px;
  flex-wrap: wrap;
}
.msm-brandline a {
  font-family: "PP Palma Fizzy Heavy", Georgia, serif;
  text-transform: lowercase;
  letter-spacing: -0.04em;
  font-size: 26px;
  font-weight: 800;
  color: #fff;
  text-decoration: none;
}
.msm-brandtag {
  font-family: "PP Palma Fizzy Heavy", Georgia, serif;
  text-transform: lowercase;
  letter-spacing: -0.04em;
  font-size: 26px;
  font-weight: 800;
  color: #facc15;
}
.msm-herobody {
  position: relative;
  z-index: 1;
  margin-top: clamp(20px, 3vw, 34px);
}
.msm-herohead {
  margin: 0;
  max-width: 1100px;
  font-size: clamp(28px, 4.6vw, 56px);
  line-height: 0.96;
  letter-spacing: -0.05em;
  font-weight: 800;
  color: #fff;
  text-wrap: balance;
}
.msm-herolede {
  margin: 12px 0 0;
  max-width: 960px;
  color: rgba(255,255,255,0.82);
  font-size: clamp(14px, 1.4vw, 18px);
  line-height: 1.4;
  letter-spacing: -0.01em;
}

/* --- Stage / full-width map card --- */
.msm-stage {
  position: relative;
  width: min(1760px, 100%);
  margin: 20px auto 0;
}
.msm-map-card-full {
  position: relative;
  border: 1px solid rgba(13,13,13,0.16);
  border-radius: 28px;
  background: #fafcff;
  color: #0d0d0d;
  box-shadow: 0 28px 80px rgba(0,0,0,0.24);
  padding: clamp(18px, 3vw, 30px);
}
.msm-stage-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.msm-stage-toolbar h2 {
  margin: 0;
  font-size: clamp(22px, 2.4vw, 34px);
  line-height: 0.98;
  letter-spacing: -0.04em;
}
.msm-stage-hint {
  font-family: "PP Neue Montreal Mono", ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #6b7280;
}

/* --- Banded map --- */
.msm-bandmap {
  position: relative;
  display: grid;
  gap: 14px;
  padding: clamp(16px, 2.6vw, 30px);
  border-radius: 24px;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 36%, rgba(29,78,216,0.12), transparent 36%),
    linear-gradient(rgba(29,78,216,0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(29,78,216,0.045) 1px, transparent 1px),
    #eef3ff;
  background-size: auto, 36px 36px, 36px 36px, auto;
  border: 1px solid rgba(29,78,216,0.16);
}
.msm-row-4 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.msm-box {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 92px;
  padding: 18px 20px;
  border: 1px solid rgba(13,13,13,0.16);
  border-radius: 20px;
  background: rgba(255,255,255,0.9);
  color: #0d0d0d;
  cursor: pointer;
  text-align: left;
  box-shadow: 0 14px 34px rgba(15,32,64,0.1);
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}
.msm-box:hover {
  transform: translateY(-2px);
  border-color: #1d4ed8;
  box-shadow: 0 18px 48px rgba(29,78,216,0.2);
}
.msm-box.is-selected { background: #1d4ed8; border-color: #1d4ed8; color: #fff; }
.msm-box.is-route:not(.is-selected) { border-color: rgba(250,204,21,0.9); background: #fff9d7; }
.msm-box-name {
  font-size: clamp(17px, 1.7vw, 26px);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.02;
  text-wrap: balance;
  min-width: 0;
}
.msm-row-4 .msm-box {
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}
.msm-row-4 .msm-box-name { font-size: clamp(16px, 1.5vw, 22px); }
.msm-row-4 .msm-box-actions { align-self: flex-end; }
.msm-box-actions { display: flex; gap: 8px; flex-shrink: 0; }
.msm-icon-btn {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(13,13,13,0.18);
  background: #fff;
  color: #1d4ed8;
  cursor: pointer;
  transition: background 140ms ease, color 140ms ease, border-color 140ms ease;
}
.msm-icon-btn:hover { background: #1d4ed8; color: #fff; border-color: #1d4ed8; }
.msm-box.is-selected .msm-icon-btn {
  background: rgba(255,255,255,0.14);
  color: #fff;
  border-color: rgba(255,255,255,0.42);
}
.msm-box.is-selected .msm-icon-btn:hover { background: #facc15; color: #0d0d0d; border-color: #facc15; }
/* --- Routes FAB --- */
.msm-routes-fab {
  position: absolute;
  right: 20px;
  bottom: 20px;
  z-index: 12;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 12px 17px;
  border: 1px solid #1d4ed8;
  border-radius: 999px;
  background: #1d4ed8;
  color: #fff;
  cursor: pointer;
  font-family: "PP Neue Montreal Mono", ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  box-shadow: 0 16px 40px rgba(29,78,216,0.34);
  transition: transform 150ms ease, background 150ms ease;
}
.msm-routes-fab:hover { transform: translateY(-2px); background: #0f2b5c; }

/* --- Portal (drill into a layer) --- */
.msm-portal {
  position: absolute;
  inset: 0;
  z-index: 30;
  border-radius: 24px;
  overflow-y: auto;
  padding: clamp(22px, 3.4vw, 40px);
  background:
    radial-gradient(circle at 50% 0%, rgba(250,204,21,0.16), transparent 42%),
    #f2ede4;
  animation: msmPortalIn 380ms cubic-bezier(0.65, 0, 0.35, 1) both;
}
.msm-portal.is-closing { animation: msmPortalOut 300ms cubic-bezier(0.65, 0, 0.35, 1) both; }
@keyframes msmPortalIn {
  from { opacity: 0; transform: scale(0.1); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes msmPortalOut {
  from { opacity: 1; transform: scale(1); }
  to { opacity: 0; transform: scale(0.1); }
}
.msm-portal-back {
  border: 1px solid rgba(13,13,13,0.16);
  border-radius: 999px;
  background: #fff;
  color: #0d0d0d;
  cursor: pointer;
  padding: 9px 14px;
  margin-bottom: 18px;
  font-family: "PP Neue Montreal Mono", ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.msm-portal-back:hover { background: #1d4ed8; color: #fff; border-color: #1d4ed8; }
.msm-portal-close {
  position: absolute;
  top: clamp(18px, 2.4vw, 28px);
  right: clamp(18px, 2.4vw, 28px);
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(13,13,13,0.16);
  background: #fff;
  color: #0d0d0d;
  cursor: pointer;
  z-index: 2;
  transition: background 140ms ease, color 140ms ease, border-color 140ms ease;
}
.msm-portal-close:hover { background: #0d0d0d; color: #fff; border-color: #0d0d0d; }
.msm-portal-title {
  margin: 0;
  padding-right: 52px;
  font-size: clamp(34px, 6vw, 76px);
  line-height: 0.86;
  letter-spacing: -0.055em;
}
.msm-portal-desc {
  max-width: 760px;
  margin: 14px 0 0;
  color: rgba(13,13,13,0.7);
  font-size: clamp(15px, 1.5vw, 19px);
  line-height: 1.45;
}
.msm-portal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
  margin-top: 26px;
}
.msm-portal-card {
  border: 1px solid rgba(13,13,13,0.14);
  border-radius: 20px;
  background: #fff;
  padding: 20px;
}
.msm-portal-card h3 {
  margin: 0 0 8px;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.03em;
}
.msm-portal-card p {
  margin: 0 0 14px;
  color: rgba(13,13,13,0.66);
  font-size: 14px;
  line-height: 1.45;
}

/* --- Right slide-in drawers --- */
.msm-scrim {
  position: fixed;
  inset: 0;
  z-index: 55;
  background: rgba(13,13,13,0.3);
  backdrop-filter: blur(2px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 300ms ease;
}
.msm-scrim.is-on { opacity: 1; pointer-events: auto; }
.msm-drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  width: min(440px, 92vw);
  z-index: 60;
  background: #fafcff;
  color: #0d0d0d;
  border-left: 1px solid rgba(13,13,13,0.16);
  box-shadow: -24px 0 70px rgba(0,0,0,0.22);
  transform: translateX(100%);
  transition: transform 380ms cubic-bezier(0.65, 0, 0.35, 1);
  overflow-y: auto;
  padding: clamp(22px, 3vw, 34px);
}
.msm-drawer.is-open { transform: translateX(0); }
.msm-drawer-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(13,13,13,0.16);
  background: #fff;
  color: #0d0d0d;
  cursor: pointer;
}
.msm-drawer-close:hover { background: #0d0d0d; color: #fff; border-color: #0d0d0d; }
.msm-drawer h2 {
  margin: 0;
  font-size: clamp(28px, 3vw, 44px);
  line-height: 0.95;
  letter-spacing: -0.045em;
  padding-right: 40px;
}
.msm-drawer .msm-routes-list { grid-template-columns: 1fr; }
.msm-drawer-entails {
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 9px;
}
.msm-drawer-entails li {
  padding-left: 18px;
  position: relative;
  color: rgba(13,13,13,0.72);
  line-height: 1.4;
  font-size: 14px;
}
.msm-drawer-entails li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.6em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #facc15;
}

@media (max-width: 760px) {
  .msm-row-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .msm-box-name { font-size: clamp(15px, 4vw, 20px); }
}

/* ============================================================
   Marketing System Map v4 — single canvas on a gradient field
   ============================================================ */
.msm-v4 {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 22px 24px 28px;
  background:
    radial-gradient(circle at 86% 6%, rgba(250,204,21,0.10), transparent 30%),
    linear-gradient(150deg, #1d4ed8 0%, #163a93 36%, #0f2040 66%, #0a0a0a 100%);
}
.msm-v4::before {
  opacity: 0.13;
  mask-image: linear-gradient(to bottom, black, transparent 58%);
}

/* --- Top bar (replaces hero) --- */
.msm-topbar {
  position: relative;
  z-index: 1;
  width: min(1760px, 100%);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 4px 6px 16px;
}
.msm-topbar-copy {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: 14px;
  row-gap: 5px;
  align-items: baseline;
  min-width: 0;
}
.msm-topbar-primary { grid-column: 1; grid-row: 1; }
.msm-topbar-primary a {
  font-family: "PP Palma Fizzy Heavy", Georgia, serif;
  text-transform: lowercase;
  letter-spacing: -0.04em;
  font-size: 26px;
  font-weight: 800;
  color: #fff;
  text-decoration: none;
}
.msm-topbar-secondary { display: contents; }
.msm-topbar-secondary .msm-brandtag { grid-column: 2; grid-row: 1; }
.msm-topsub {
  grid-column: 1 / span 2;
  grid-row: 2;
  margin: 0;
  max-width: 100%;
  color: rgba(255,255,255,0.72);
  font-size: 13px;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.msm-topinfo {
  position: relative;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.3);
  background: rgba(255,255,255,0.06);
  color: #fff;
  cursor: pointer;
  transition: background 150ms ease, color 150ms ease, border-color 150ms ease;
}
.msm-topinfo svg { width: 19px; height: 19px; }
.msm-topinfo:hover { background: #facc15; color: #0d0d0d; border-color: #facc15; }
.msm-topinfo-glyph {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  transition: opacity 140ms ease, transform 140ms ease;
}
.msm-topinfo-x {
  opacity: 0;
  transform: scale(0.7) rotate(-20deg);
}
.msm-topinfo.is-overview-open:hover .msm-topinfo-i {
  opacity: 0;
  transform: scale(0.7) rotate(20deg);
}
.msm-topinfo.is-overview-open:hover .msm-topinfo-x {
  opacity: 1;
  transform: scale(1) rotate(0);
}

/* --- Canvas card fills the field --- */
.msm-v4 .msm-stage {
  margin-top: 0;
  flex: 1;
  display: flex;
  width: 100%;
  min-width: 0;
  max-width: 100%;
}
.msm-v4 .msm-map-card-full {
  flex: 1;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  min-height: calc(100vh - 150px);
  padding: clamp(20px, 3vw, 40px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.msm-v4 .msm-bandmap {
  flex: 1;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  gap: 26px;
  padding: clamp(24px, 3.6vw, 50px);
  padding-bottom: 88px;
  align-content: center;
}

/* half-height full-width boxes (objective / infrastructure / expert judgment) */
.msm-v4 .msm-bandmap > .msm-box {
  min-height: 56px;
  padding: 9px 22px;
}

/* --- Flow row with arrows --- */
.msm-flowrow {
  position: relative;
  display: flex;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  align-items: stretch;
  gap: 4px;
  padding-bottom: 62px;
}
.msm-flowrow > .msm-box {
  flex: 1 1 0;
  min-width: 0;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  min-height: 108px;
}
.msm-flowrow > .msm-box .msm-box-actions { align-self: flex-end; }
.msm-flowrow > .msm-box .msm-box-name { font-size: clamp(16px, 1.5vw, 22px); }
.msm-flowarrow {
  flex: 0 1 34px;
  min-width: 16px;
  display: grid;
  place-items: center;
  color: #9aa3b2;
}
.msm-loopline {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 60px;
  overflow: visible;
  pointer-events: none;
}
.msm-loop-label {
  position: absolute;
  left: 50%;
  bottom: 16px;
  transform: translate(-50%, 50%);
  background: #eef3ff;
  padding: 2px 9px;
  font-family: "PP Neue Montreal Mono", ui-monospace, monospace;
  font-size: 9px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #6b7280;
}

/* --- Subtle, smaller icon buttons --- */
.msm-v4 .msm-icon-btn {
  width: 26px;
  height: 26px;
  background: transparent;
  border-color: rgba(13,13,13,0.12);
  color: #9aa3b2;
}
.msm-v4 .msm-icon-btn svg { width: 14px; height: 14px; }
.msm-v4 .msm-icon-btn:hover {
  background: rgba(13,13,13,0.05);
  color: #4b5563;
  border-color: rgba(13,13,13,0.22);
}
.msm-v4 .msm-box.is-selected .msm-icon-btn {
  background: transparent;
  color: rgba(255,255,255,0.78);
  border-color: rgba(255,255,255,0.34);
}
.msm-v4 .msm-box.is-selected .msm-icon-btn:hover {
  background: rgba(255,255,255,0.16);
  color: #fff;
  border-color: rgba(255,255,255,0.5);
}

/* --- Routes FAB: icon only, inside the grid canvas --- */
.msm-v4 .msm-routes-fab {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 50%;
  justify-content: center;
  right: 22px;
  bottom: 22px;
  box-shadow: 0 6px 16px rgba(29,78,216,0.32);
}
.msm-v4 .msm-routes-fab svg { width: 15px; height: 15px; }

/* --- Overview drawer --- */
.msm-overview-layers { display: grid; gap: 10px; }
.msm-overview-layer {
  border: 1px solid rgba(13,13,13,0.1);
  border-radius: 14px;
  padding: 12px 14px;
  background: #fff;
}
.msm-overview-layer strong { font-size: 16px; letter-spacing: -0.02em; }
.msm-overview-layer small {
  display: block;
  font-family: "PP Neue Montreal Mono", ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #1d4ed8;
  margin-top: 3px;
}
.msm-overview-layer p {
  margin: 7px 0 0;
  font-family: "PP Neue York", Georgia, serif;
  font-style: italic;
  font-size: 15px;
  color: rgba(13,13,13,0.7);
  line-height: 1.3;
}

@media (max-width: 960px) {
  .msm-flowrow { flex-direction: column; padding-bottom: 0; }
  .msm-flowarrow { transform: rotate(90deg); flex-basis: 26px; }
  .msm-loopline, .msm-loop-label { display: none; }
}

/* --- Canvas sheet (panel that slides up and fills the grid) --- */
.msm-sheet {
  position: absolute;
  inset: 0;
  z-index: 22;
  border-radius: 24px;
  background: #fafcff;
  color: #0d0d0d;
  overflow-y: auto;
  padding: clamp(24px, 3.4vw, 46px);
  animation: msmSheetUp 380ms cubic-bezier(0.65, 0, 0.35, 1) both;
}
@keyframes msmSheetUp {
  from { transform: translateY(101%); }
  to { transform: translateY(0); }
}
.msm-sheet.is-closing { animation: msmSheetDown 320ms cubic-bezier(0.65, 0, 0.35, 1) both; }
@keyframes msmSheetDown {
  from { transform: translateY(0); }
  to { transform: translateY(101%); }
}
.msm-sheet-body {
  max-width: 1080px;
  margin: 0 auto;
}
.msm-sheet h2 {
  margin: 0;
  font-size: clamp(30px, 3.6vw, 50px);
  line-height: 0.95;
  letter-spacing: -0.045em;
  padding-right: 52px;
}
.msm-sheet > .msm-portal-close { top: clamp(20px, 2.6vw, 30px); right: clamp(20px, 2.6vw, 30px); }
.msm-sheet p {
  color: rgba(13,13,13,0.7);
  font-size: 16px;
  line-height: 1.5;
}
.msm-sheet .msm-question { max-width: 900px; }
.msm-sheet ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 9px;
}
.msm-sheet .msm-detail-section ul { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.msm-sheet li {
  padding-left: 18px;
  position: relative;
  color: rgba(13,13,13,0.72);
  line-height: 1.4;
}
.msm-sheet li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #facc15;
}
.msm-sheet .msm-routes-list { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.msm-sheet .msm-overview-layers { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.msm-sheet .msm-connection-list { max-width: 900px; }

/* ============================================================
   Canonical IMSM hierarchy — components, states and flows
   ============================================================ */
.msm-box {
  display: grid;
  place-items: center;
}
.msm-box-copy {
  position: static;
  grid-area: 1 / 1;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  min-width: 0;
  padding: 12px;
  text-align: center;
  pointer-events: none;
}
.msm-box-name {
  display: block;
  max-width: 100%;
  font-family: "PP Palma Fizzy Heavy", Georgia, serif;
  font-weight: 400;
  line-height: 0.95;
  text-align: center;
}
.msm-box-actions {
  position: absolute;
  top: auto;
  right: 12px;
  bottom: 12px;
  transform: none;
}
.msm-box.is-memory:not(.is-selected) {
  border-color: rgba(29,78,216,0.46);
  background: #f5f8ff;
  box-shadow: 0 16px 40px rgba(29,78,216,0.14);
}
.msm-v4 .msm-bandmap > .msm-box .msm-box-copy {
  display: grid;
}
.msm-flowrow > .msm-box .msm-box-copy {
  display: grid;
}

.msm-route-chain > span {
  display: grid;
  gap: 3px;
  border-radius: 14px;
  text-align: left;
}
.msm-routes-list button { align-content: start; }
.msm-route-chain > span strong {
  font-size: 12px;
  line-height: 1.2;
}
.msm-route-chain > span small {
  color: #4b5563;
  font-family: "PP Mori Book", system-ui, sans-serif;
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.25;
  text-transform: none;
}

.msm-memory-states {
  margin-top: 24px;
  border: 1px solid rgba(29,78,216,0.18);
  border-radius: 20px;
  padding: clamp(16px, 2vw, 22px);
  background: #eef3ff;
}
.msm-memory-state-intro {
  display: block;
  margin-bottom: 16px;
}
.msm-memory-state-intro > strong {
  font-family: "PP Neue Montreal Mono", ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #1d4ed8;
}
.msm-memory-state-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}
.msm-memory-state {
  align-self: stretch;
  border: 1px solid rgba(13,13,13,0.1);
  border-radius: 14px;
  padding: 14px;
  background: rgba(255,255,255,0.86);
}
.msm-memory-state small {
  display: block;
  margin-bottom: 7px;
  color: #1d4ed8;
  font-family: "PP Neue Montreal Mono", ui-monospace, monospace;
  font-size: 9px;
  letter-spacing: 0.16em;
}
.msm-memory-state strong {
  display: block;
  font-size: 16px;
  letter-spacing: -0.02em;
}
.msm-memory-state p,
.msm-portal .msm-memory-state p {
  margin: 7px 0 0;
  color: rgba(13,13,13,0.66);
  font-size: 13px;
  line-height: 1.4;
}
.msm-memory-state-arrow {
  color: #1d4ed8;
  font-size: 18px;
}
.msm-architecture-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.msm-architecture-summary > div {
  display: grid;
  gap: 5px;
  border: 1px solid rgba(13,13,13,0.1);
  border-radius: 14px;
  padding: 14px;
  background: #fff;
}
.msm-architecture-summary small {
  color: #1d4ed8;
  font-family: "PP Neue Montreal Mono", ui-monospace, monospace;
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.msm-architecture-summary strong {
  font-size: 15px;
  line-height: 1.3;
}

@media (max-width: 760px) {
  .msm-v4 .msm-bandmap > .msm-box .msm-box-copy {
    display: grid;
  }
  .msm-box-copy { padding: 12px; }
  .msm-memory-state-grid { grid-template-columns: 1fr; }
  .msm-memory-state-arrow { justify-self: center; transform: rotate(90deg); }
  .msm-architecture-summary { grid-template-columns: 1fr; }
}

@media (max-width: 960px) {
  .msm-box-actions { display: none; }
}

@media (max-width: 760px) {
  .msm-topbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto auto;
    column-gap: 16px;
    row-gap: 18px;
    align-items: center;
    padding: 4px 6px 18px;
  }
  .msm-topbar-copy,
  .msm-v4 .msm-topbar-actions {
    display: contents;
  }
  .msm-topbar-primary {
    grid-column: 1;
    grid-row: 1;
    min-width: 0;
  }
  .msm-topbar-secondary {
    grid-column: 1;
    grid-row: 2;
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
  }
  .msm-topsub {
    display: block;
    margin: 0;
    color: rgba(255,255,255,0.72);
    font-size: 14px;
    line-height: 1.35;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
  }
  .msm-menu-btn {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
  }
  .msm-topinfo {
    grid-column: 2;
    grid-row: 2;
    align-self: center;
    justify-self: end;
  }
}

/* ============================================================
   Marketing System Map v4.1 — guided routes
   Route preview, persistent guide, numbered map badges.
   Uses existing tokens (blue #1d4ed8, yellow #facc15) only.
   ============================================================ */

.msm-visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* --- Active route card in the catalogue (marked, never expanded) --- */
.msm-routes-list button.is-active-route {
  border-color: #1d4ed8;
  background: #eef3ff;
}

/* --- Route preview (replaces catalogue inside the sheet) --- */
.msm-route-back {
  display: inline-flex;
  align-items: center;
  margin: 0 0 16px;
  padding: 6px 0;
  border: none;
  background: transparent;
  color: #1d4ed8;
  cursor: pointer;
  font-family: "PP Neue Montreal Mono", ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.msm-route-back:hover { color: #0f2b5c; text-decoration: underline; }
.msm-route-note {
  max-width: 760px;
  margin: 12px 0 0;
  color: rgba(13,13,13,0.7);
  font-size: 16px;
  line-height: 1.5;
}
.msm-route-steps {
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}
.msm-route-steps li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: start;
  padding: 12px 14px;
  border: 1px solid rgba(13,13,13,0.12);
  border-radius: 14px;
  background: #fff;
}
.msm-route-steps li::before { content: none; }
.msm-route-step-num {
  display: inline-grid;
  place-items: center;
  min-width: 26px;
  min-height: 26px;
  padding: 0 6px;
  border-radius: 999px;
  background: #1d4ed8;
  color: #fff;
  font-family: "PP Neue Montreal Mono", ui-monospace, monospace;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
}
.msm-route-step-body { display: grid; gap: 2px; min-width: 0; }
.msm-route-step-body strong { font-size: 15px; letter-spacing: -0.02em; }
.msm-route-step-body small {
  color: #6b7280;
  font-family: "PP Mori Book", system-ui, sans-serif;
  font-size: 12px;
  line-height: 1.3;
}
.msm-route-entails { max-width: 760px; }
.msm-route-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 24px;
}
.msm-route-primary {
  display: inline-flex;
  align-items: center;
  padding: 13px 20px;
  border: 1px solid #1d4ed8;
  border-radius: 999px;
  background: #1d4ed8;
  color: #fff;
  cursor: pointer;
  font-family: "PP Neue Montreal Mono", ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  transition: background 150ms ease, border-color 150ms ease;
}
.msm-route-primary:hover { background: #0f2b5c; border-color: #0f2b5c; }
.msm-route-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.msm-route-primary:focus-visible { outline: 2px solid #1d4ed8; outline-offset: 3px; }
.msm-route-exit {
  display: inline-flex;
  align-items: center;
  padding: 13px 18px;
  border: 1px solid rgba(13,13,13,0.24);
  border-radius: 999px;
  background: transparent;
  color: #0d0d0d;
  cursor: pointer;
  font-family: "PP Neue Montreal Mono", ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  transition: background 150ms ease, color 150ms ease, border-color 150ms ease;
}
.msm-route-exit:hover { background: #0d0d0d; color: #fff; border-color: #0d0d0d; }
.msm-route-exit:focus-visible { outline: 2px solid #1d4ed8; outline-offset: 3px; }
.msm-route-unavailable {
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid rgba(13,13,13,0.16);
  border-radius: 12px;
  background: #f2ede4;
  color: rgba(13,13,13,0.7);
  font-size: 14px;
}

/* --- Persistent route guide (desktop: above the canvas) --- */
.msm-route-guide {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 22px 24px;
  margin-bottom: 16px;
  border: 1px solid rgba(29,78,216,0.18);
  border-radius: 18px;
  background: linear-gradient(180deg, #f5f8ff, #eef3ff);
  box-shadow: 0 8px 24px rgba(15,32,64,0.08);
  flex-wrap: wrap;
}
.msm-route-guide-id {
  display: grid;
  gap: 6px;
  flex: 1 1 220px;
  min-width: 0;
}
.msm-route-guide-id small {
  font-family: "PP Neue Montreal Mono", ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #1d4ed8;
}
.msm-route-guide-id strong {
  font-family: "PP Palma Fizzy Heavy", Georgia, serif;
  font-size: clamp(18px, 1.8vw, 26px);
  line-height: 1;
  letter-spacing: -0.03em;
  color: #0d0d0d;
}
.msm-route-guide-step {
  display: grid;
  gap: 6px;
  flex: 1.2 1 240px;
  min-width: 0;
}
.msm-route-guide-step small {
  font-family: "PP Neue Montreal Mono", ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #6b7280;
}
.msm-route-guide-current {
  margin: 0;
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}
.msm-route-guide-current strong {
  font-family: "PP Palma Fizzy Heavy", Georgia, serif;
  font-size: clamp(16px, 1.6vw, 22px);
  letter-spacing: -0.02em;
  color: #0d0d0d;
}
.msm-route-guide-current span {
  color: rgba(13,13,13,0.66);
  font-size: 14px;
}
.msm-route-guide-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
  flex-shrink: 0;
}
.msm-route-guide-nav,
.msm-route-guide-all {
  border: 1px solid rgba(13,13,13,0.16);
  border-radius: 999px;
  background: #fff;
  color: #0d0d0d;
  padding: 9px 13px;
  cursor: pointer;
  font-family: "PP Neue Montreal Mono", ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: background 140ms ease, color 140ms ease, border-color 140ms ease;
}
.msm-route-guide-nav:hover:not(:disabled),
.msm-route-guide-all:hover { background: #1d4ed8; color: #fff; border-color: #1d4ed8; }
.msm-route-guide-nav:focus-visible { outline: 2px solid #1d4ed8; outline-offset: 2px; }
.msm-route-guide-nav:disabled { opacity: 0.4; cursor: not-allowed; }
.msm-route-guide-exit {
  border: 1px solid rgba(13,13,13,0.24);
  border-radius: 999px;
  background: #0d0d0d;
  color: #fff;
  padding: 9px 14px;
  cursor: pointer;
  font-family: "PP Neue Montreal Mono", ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: background 140ms ease, color 140ms ease, border-color 140ms ease;
}
.msm-route-guide-exit:hover { background: #fff; color: #0d0d0d; border-color: #0d0d0d; }
.msm-route-guide-exit:focus-visible { outline: 2px solid #1d4ed8; outline-offset: 2px; }

/* --- Numbered map badges --- */
.msm-box-badges {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  max-width: calc(100% - 16px);
}
.msm-route-badge {
  min-width: 28px;
  min-height: 28px;
  padding: 0 6px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  border: 1px solid rgba(13,13,13,0.18);
  background: #facc15;
  color: #0d0d0d;
  font-family: "PP Neue Montreal Mono", ui-monospace, monospace;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease;
}
.msm-route-badge:hover { transform: translateY(-1px); }
.msm-route-badge:focus-visible {
  outline: 2px solid #1d4ed8;
  outline-offset: 2px;
}
.msm-route-badge.is-current {
  background: #1d4ed8;
  color: #fff;
  border-color: #1d4ed8;
  box-shadow: 0 0 0 2px rgba(29,78,216,0.28), 0 4px 10px rgba(29,78,216,0.3);
}

/* Current route node emphasis — independent of ordinary selection.
   Scoped to beat .is-memory/:not specificity by source order. */
/* Route-node yellow must win over the permanent is-memory pale-blue emphasis so
   every component the active route touches reads consistently as a route node. */
.msm-bandmap .msm-box.is-route:not(.is-selected) {
  border-color: rgba(250, 204, 21, 0.9);
  background: #fff9d7;
}
.msm-bandmap .msm-box.is-current-route {
  border-color: #1d4ed8;
  background: #eef3ff;
  box-shadow: 0 0 0 2px rgba(29,78,216,0.18), 0 18px 48px rgba(29,78,216,0.2);
}
.msm-bandmap .msm-box.is-current-route .msm-box-name { color: #0f2b5c; }

/* --- Launcher active state --- */
.msm-routes-fab.is-active {
  box-shadow: 0 0 0 3px rgba(250,204,21,0.55), 0 6px 16px rgba(29,78,216,0.32);
}

/* --- Route guide mobile: compact sticky bottom bar --- */
@media (max-width: 760px) {
  .msm-route-guide {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 40;
    margin-bottom: 0;
    border-radius: 18px 18px 0 0;
    padding: 12px 14px calc(12px + env(safe-area-inset-bottom));
    box-shadow: 0 -10px 30px rgba(15,32,64,0.18);
  }
  .msm-route-guide-id { flex: 1 1 100%; }
  .msm-route-guide-step { flex: 1 1 100%; }
  .msm-route-guide-controls { flex: 1 1 100%; justify-content: space-between; }
  .msm-v4 .msm-bandmap { padding-bottom: 150px; }
  .msm-route-badge { min-width: 24px; min-height: 24px; font-size: 11px; }
}

/* --- Reduced motion: remove travel-implying transitions --- */
@media (prefers-reduced-motion: reduce) {
  .msm-sheet,
  .msm-portal,
  .msm-route-guide,
  .msm-route-badge,
  .msm-box {
    animation: none !important;
    transition: none !important;
  }
}
