@font-face {
  font-family: "Manrope";
  src: url("fonts/Manrope-Variable.woff2") format("woff2");
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
}

@font-face {
  font-family: "Instrument Sans";
  src: url("fonts/InstrumentSans-Variable.woff2") format("woff2");
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
}

:root {
  --canvas: #f3efe7;
  --paper: #fbfaf7;
  --white: #ffffff;
  --ink: #141414;
  --ink-soft: #414141;
  --muted: #6d6b66;
  --stone: #d8d5cc;
  --blue: #c9dae9;
  --blue-soft: #e4edf3;
  --line: rgba(20, 20, 20, 0.1);
  --glass-white: rgba(255, 255, 255, 0.72);
  --glass-paper: rgba(255, 253, 249, 0.7);
  --glass-stone: rgba(216, 213, 204, 0.66);
  --glass-blue: rgba(201, 218, 233, 0.66);
  --glass-border: rgba(255, 255, 255, 0.62);
  --glass-shadow: 0 18px 50px rgba(38, 34, 28, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.72), inset 0 0 0 1px rgba(20, 20, 20, 0.022);
  --glass-shadow-float: 0 30px 78px rgba(38, 34, 28, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.76), inset 0 0 0 1px rgba(20, 20, 20, 0.025);
  --blur: blur(18px) saturate(108%);
  --font-display: "Manrope", system-ui, sans-serif;
  --font-body: "Instrument Sans", system-ui, sans-serif;
  --shell: 1480px;
  --radius-large: 30px;
  --radius-card: 22px;
  --radius-control: 13px;
  --touch: 44px;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html { scroll-behavior: smooth; }

body {
  min-width: 320px;
  overflow-x: hidden;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  font-synthesis: none;
  font-feature-settings: "kern" 1, "liga" 1;
  -webkit-font-smoothing: antialiased;
}

button, input { font: inherit; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
h1, h2, h3 { text-wrap: balance; }
p { text-wrap: pretty; }

a:focus-visible,
button:focus-visible,
input:focus-visible,
[tabindex="0"]:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 4px;
}

.shell {
  width: min(calc(100% - 48px), var(--shell));
  margin-inline: auto;
}

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

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 200;
  padding: 10px 14px;
  color: var(--white);
  background: var(--ink);
  border-radius: var(--radius-control);
  transform: translateY(-160%);
  transition: transform 180ms ease;
}

.skip-link:focus { transform: translateY(0); }

.topbar {
  position: sticky;
  top: 14px;
  z-index: 100;
  width: min(calc(100% - 32px), 1180px);
  min-height: 62px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 20px;
  margin: 14px auto 0;
  padding: 8px 10px 8px 20px;
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid var(--glass-border);
  border-radius: 19px;
  box-shadow: var(--glass-shadow);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
}

.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  width: fit-content;
}

.brand strong {
  font-family: var(--font-display);
  font-size: 1.18rem;
  font-weight: 650;
  letter-spacing: -0.029em;
}

.brand > .brand-context {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.topbar-meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ink);
}

.back-link {
  min-height: var(--touch);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  justify-self: end;
  padding: 0 16px;
  color: var(--white);
  background: var(--ink);
  border-radius: var(--radius-control);
  font-size: 0.84rem;
  font-weight: 600;
}

.intro {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(300px, 0.6fr);
  align-items: end;
  gap: clamp(40px, 7vw, 100px);
  padding-top: clamp(88px, 11vw, 148px);
  padding-bottom: 72px;
}

.eyebrow,
.card-label {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 650;
  letter-spacing: 0.065em;
  text-transform: uppercase;
}

.intro h1 {
  max-width: 12.5ch;
  margin-top: 16px;
  font-family: var(--font-display);
  font-size: clamp(3.25rem, 6.8vw, 6.2rem);
  font-weight: 590;
  line-height: 0.99;
  letter-spacing: -0.038em;
}

.intro-text {
  max-width: 650px;
  margin-top: 26px;
  color: var(--ink-soft);
  font-size: clamp(1.05rem, 1.5vw, 1.22rem);
  line-height: 1.58;
}

.intro-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 28px;
}

.intro-tags span {
  padding: 8px 11px;
  color: var(--muted);
  background: rgba(216, 213, 204, 0.42);
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
}

.open-library-card {
  padding: 2px 0 2px 30px;
  background: transparent;
  border: 0;
  border-left: 1px solid var(--line);
  border-radius: 0;
  box-shadow: none;
}

.open-library-card h2 {
  max-width: 15ch;
  margin-top: 10px;
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 620;
  line-height: 1.16;
  letter-spacing: -0.019em;
}

.open-library-card > p:not(.card-label) {
  margin-top: 14px;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.repo-preview {
  display: grid;
  gap: 7px;
  margin-top: 22px;
}

.repo-preview span {
  min-height: 34px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  color: var(--ink-soft);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  box-shadow: none;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.72rem;
}

.selector {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(320px, 0.82fr) minmax(560px, 1.18fr);
  gap: clamp(36px, 5vw, 64px);
  align-items: start;
  padding-top: 72px;
  padding-bottom: 72px;
}

.selector::before,
.workspace::before,
.page-cta::before {
  content: "";
  position: absolute;
  inset-block: 0;
  left: 50%;
  z-index: -1;
  width: 100vw;
  transform: translateX(-50%);
}

.selector::before { background: var(--canvas); }

.glass-card,
.bento-card {
  background: transparent;
  border: 0;
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

.filter-panel {
  min-height: 0;
  padding: 18px 0;
  border-radius: 0;
}

.filter-panel h2,
.deck-heading h2,
.panel-heading h2,
.flow-heading h2 {
  font-family: var(--font-display);
  font-weight: 620;
  letter-spacing: -0.022em;
}

.filter-panel h2 {
  max-width: 13ch;
  margin-top: 10px;
  font-size: clamp(1.8rem, 3vw, 2.55rem);
  line-height: 1.08;
}

.search-field {
  min-height: 54px;
  display: grid;
  grid-template-columns: 24px 1fr;
  align-items: center;
  gap: 8px;
  margin-top: 28px;
  padding: 0 16px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid transparent;
  border-radius: 15px;
  box-shadow: none;
  transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.search-field:focus-within {
  background: var(--white);
  border-color: rgba(20, 20, 20, 0.26);
  box-shadow: 0 0 0 3px rgba(20, 20, 20, 0.055);
}

.search-icon {
  color: var(--muted);
  font-size: 1.3rem;
  line-height: 1;
}

.search-field input {
  min-width: 0;
  height: 52px;
  color: var(--ink);
  background: transparent;
  border: 0;
  outline: 0;
  font-size: 0.92rem;
}

.search-field input::placeholder { color: #8a8883; }

.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 18px;
}

.filter-chip {
  min-height: 38px;
  padding: 0 13px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.5);
  border: 0;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: color 180ms ease, background 180ms ease, transform 180ms ease;
}

.filter-chip:hover { color: var(--ink); transform: translateY(-1px); }
.filter-chip[aria-pressed="true"] { color: var(--white); background: var(--ink); border-color: var(--ink); }

.filter-status {
  margin-top: 18px;
  color: var(--muted);
  font-size: 0.78rem;
}

.deck-panel {
  position: relative;
  min-width: 0;
  min-height: 552px;
  overflow: visible;
  padding: 18px 8px 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  isolation: isolate;
}

.deck-panel::before {
  content: "";
  position: absolute;
  width: 420px;
  height: 310px;
  top: 124px;
  right: 22px;
  z-index: -1;
  background: rgba(201, 218, 233, 0.42);
  border-radius: 50%;
  filter: blur(64px);
}

.deck-heading {
  position: relative;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 24px;
}

.deck-heading h2 {
  margin-top: 5px;
  font-size: 1.18rem;
}

.deck-count {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.05em;
}

.deck-stage {
  position: relative;
  height: 410px;
  margin-top: 8px;
  perspective: 1150px;
  perspective-origin: 28% 72%;
  transform-style: preserve-3d;
}

.deck-card {
  --deck-x: 0px;
  --deck-y: 0px;
  --deck-z: 0px;
  --deck-ry: 0deg;
  --deck-rz: 0deg;
  --deck-scale: 1;
  position: absolute;
  top: 28px;
  left: 44%;
  width: 232px;
  height: 320px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  align-content: stretch;
  gap: 20px;
  padding: 20px;
  text-align: left;
  color: var(--ink);
  background: rgba(255, 253, 249, 0.8);
  border: 0;
  border-radius: 20px;
  box-shadow: var(--glass-shadow-float);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  transform: translate3d(-50%, 0, 0) translate3d(var(--deck-x), var(--deck-y), var(--deck-z)) rotateY(var(--deck-ry)) rotateZ(var(--deck-rz)) scale(var(--deck-scale));
  transform-origin: 32% 74%;
  transition: transform 660ms cubic-bezier(0.22, 1, 0.36, 1), opacity 420ms ease, filter 420ms ease;
  cursor: default;
}

.deck-card[data-state="active"] {
  --deck-x: -92px;
  --deck-y: 40px;
  --deck-z: 95px;
  z-index: 4;
  opacity: 1;
}

.deck-card[data-state="next"] {
  --deck-x: -36px;
  --deck-y: -2px;
  --deck-z: 20px;
  --deck-ry: -2.5deg;
  --deck-rz: -0.3deg;
  --deck-scale: 0.98;
  z-index: 3;
  opacity: 0.86;
}

.deck-card[data-state="far"] {
  --deck-x: 20px;
  --deck-y: -44px;
  --deck-z: -55px;
  --deck-ry: -5deg;
  --deck-rz: -0.6deg;
  --deck-scale: 0.955;
  z-index: 2;
  opacity: 0.52;
  filter: saturate(0.8) blur(0.35px);
}

.deck-card[data-state="exit"] {
  --deck-x: 76px;
  --deck-y: -86px;
  --deck-z: -135px;
  --deck-ry: -8deg;
  --deck-rz: -0.9deg;
  --deck-scale: 0.93;
  z-index: 1;
  opacity: 0.18;
  filter: saturate(0.7) blur(0.65px);
}

.deck-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.deck-card-area {
  color: var(--muted);
  font-size: 0.67rem;
  font-weight: 700;
  letter-spacing: 0.065em;
  text-transform: uppercase;
}

.deck-card-index {
  color: #8a8883;
  font-size: 0.68rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.deck-card h3 {
  max-width: 18ch;
  min-height: 3.42em;
  display: -webkit-box;
  overflow: hidden;
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 620;
  line-height: 1.14;
  letter-spacing: -0.019em;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.deck-card-bottom {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 14px;
}

.mini-logo-row { display: flex; }

.mini-logo {
  width: 31px;
  height: 31px;
  display: grid;
  place-items: center;
  padding: 5px;
  margin-left: -5px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: 9px;
  box-shadow: 0 4px 11px rgba(38, 34, 28, 0.1);
}

.mini-logo:first-child { margin-left: 0; }
.mini-logo img { width: 20px; height: 20px; object-fit: contain; }

.deck-card-result {
  max-width: 22ch;
  display: -webkit-box;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.28;
  text-align: left;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.deck-controls {
  position: relative;
  z-index: 12;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.round-control {
  width: var(--touch);
  height: var(--touch);
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.72);
  border: 0;
  border-radius: 50%;
  box-shadow: none;
  cursor: pointer;
  transition: transform 180ms ease, background 180ms ease;
}

.round-control:hover { background: var(--white); transform: translateY(-1px); }
.deck-control-copy { color: var(--muted); font-size: 0.72rem; font-weight: 600; }

.workspace {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(760px, 1.8fr) minmax(360px, 0.82fr);
  align-items: start;
  gap: clamp(28px, 3vw, 44px);
  padding-top: 92px;
  padding-bottom: 112px;
}

.workspace::before { background: var(--white); }

.map-panel {
  position: sticky;
  top: 94px;
  align-self: start;
  min-width: 0;
  padding: 0;
  border-radius: 0;
}

.explorer-side {
  min-width: 0;
  display: grid;
  gap: 54px;
}

.panel-heading,
.flow-heading,
.library-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.panel-heading { margin-bottom: 18px; }
.panel-heading h2 { margin-top: 5px; font-size: clamp(1.35rem, 1.6vw, 1.7rem); }

.map-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.map-legend {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
}

.map-legend span {
  width: 28px;
  height: 2px;
  background: var(--ink);
  border-radius: 99px;
}

.system-toggle,
.map-footer-meta button {
  min-height: 34px;
  padding: 0 11px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.72);
  border: 0;
  border-radius: 10px;
  font-size: 0.69rem;
  font-weight: 650;
  cursor: pointer;
}

.system-toggle[aria-pressed="true"] {
  color: var(--white);
  background: var(--ink);
}

.system-toggle:disabled {
  display: none;
}

.map-scroll {
  overflow: hidden;
  border-radius: 24px;
}

.map-stage {
  position: relative;
  width: 100%;
  min-width: 0;
  height: clamp(570px, calc(100svh - 235px), 720px);
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.92) 0, rgba(255, 255, 255, 0.62) 28%, transparent 60%),
    rgba(243, 239, 231, 0.62);
  border: 0;
  border-radius: 24px;
  box-shadow: none;
}

.system-map-lines {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: visible;
}

.map-base-line,
.map-ring-line {
  fill: none;
  stroke: var(--ink);
  vector-effect: non-scaling-stroke;
}

.map-base-line {
  stroke-width: 1;
  opacity: 0.11;
}

.map-ring-line {
  stroke-width: 0.8;
  stroke-dasharray: 2 5;
  opacity: 0.07;
}

.map-trail-line,
.map-control-link {
  fill: none;
  stroke: var(--ink);
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.map-trail-line {
  stroke-width: 2.2;
  path-length: 1;
}

.map-trail-line.is-revealing {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: revealTrail 720ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
  animation-delay: var(--trail-delay, 0ms);
}

.map-trail-line.is-branch {
  stroke-width: 1.7;
  stroke-dasharray: 4 5;
  opacity: 0.72;
}

.map-control-link {
  stroke-width: 1.2;
  stroke-dasharray: 2 4;
  opacity: 0.42;
}

@keyframes revealTrail {
  to { stroke-dashoffset: 0; }
}

.map-hub,
.map-core,
.system-node,
.map-control {
  position: absolute;
  transform: translate(-50%, -50%);
}

.map-hub {
  z-index: 3;
  display: grid;
  place-items: center;
  min-width: 96px;
  min-height: 34px;
  padding: 8px 12px;
  color: rgba(20, 20, 20, 0.5);
  background: rgba(255, 255, 255, 0.64);
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.035em;
  text-align: center;
  opacity: 0.48;
  transition: color 220ms ease, background 220ms ease, opacity 220ms ease;
}

.map-hub.is-active {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.96);
  opacity: 1;
}

.map-core {
  z-index: 4;
  width: 104px;
  height: 104px;
  display: grid;
  place-items: center;
  padding: 12px;
  color: var(--white);
  background: var(--ink);
  border: 0;
  border-radius: 50%;
  box-shadow: 0 12px 28px rgba(38, 34, 28, 0.16);
  text-align: center;
}

.map-core span {
  color: var(--muted);
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.56rem;
  font-weight: 700;
  letter-spacing: 0.065em;
  text-transform: uppercase;
}

.map-core strong {
  display: block;
  margin-top: 1px;
  font-size: 0.8rem;
  line-height: 1.15;
}

.tool-node {
  position: absolute;
  z-index: 2;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  padding: 6px;
  background: rgba(255, 255, 255, 0.32);
  border: 0;
  border-radius: 10px;
  box-shadow: none;
  opacity: 0.08;
  filter: saturate(0.38);
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0.92);
  transition:
    opacity 260ms ease,
    filter 260ms ease,
    transform 440ms cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 260ms ease;
}

.tool-node img { width: 22px; height: 22px; object-fit: contain; }

.tool-node.is-active {
  z-index: 5;
  opacity: 1;
  filter: none;
  background: rgba(255, 255, 255, 0.96);
  transform: translate(-50%, -50%) scale(1);
  box-shadow: 0 9px 22px rgba(38, 34, 28, 0.14), 0 0 0 1px rgba(20, 20, 20, 0.68);
}

.tool-node.is-active::after,
.system-node.is-active::after,
.map-hub[data-step]::after {
  content: attr(data-step);
  position: absolute;
  top: -9px;
  right: -9px;
  width: 19px;
  height: 19px;
  display: grid;
  place-items: center;
  color: var(--white);
  background: var(--ink);
  border: 1.5px solid var(--white);
  border-radius: 50%;
  font-size: 0.52rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.tool-node.is-entering { animation: toolEnter 460ms cubic-bezier(0.22, 1, 0.36, 1) both; animation-delay: var(--step-delay, 0ms); }

@keyframes toolEnter {
  from { opacity: 0.08; transform: translate(-50%, -50%) scale(0.76); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

.system-node {
  z-index: 4;
  min-width: 62px;
  min-height: 28px;
  display: grid;
  place-items: center;
  padding: 6px 8px;
  color: rgba(20, 20, 20, 0.58);
  background: rgba(255, 255, 255, 0.82);
  border-radius: 9px;
  font-size: 0.58rem;
  font-weight: 700;
  line-height: 1.15;
  text-align: center;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.92);
  transition: opacity 220ms ease, transform 220ms ease, color 220ms ease;
}

.map-stage.is-system .system-node { opacity: 0; }

.map-stage.is-system .system-node.is-active {
  color: var(--ink);
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.map-control {
  z-index: 7;
  display: none;
  max-width: 132px;
  padding: 5px 8px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.94);
  border-radius: 8px;
  box-shadow: 0 6px 16px rgba(38, 34, 28, 0.08);
  font-size: 0.55rem;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
}

.map-stage.is-system .map-control { display: block; }

.map-stage:not(.is-system) .system-only-line { display: none; }
.map-stage:not(.is-system) .system-hub {
  opacity: 0;
  pointer-events: none;
}

.map-stage.is-neutral .tool-node {
  opacity: 0.2;
  filter: saturate(0.62);
}

.map-stage.is-neutral .map-hub {
  color: rgba(20, 20, 20, 0.72);
}

.map-stage.is-neutral .system-node,
.map-stage.is-neutral .map-control {
  opacity: 0;
  display: none;
}

.map-footer {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-top: 17px;
  color: var(--muted);
  font-size: 0.76rem;
}

.map-footer p { max-width: 68ch; }
.map-footer-meta { display: flex; align-items: center; gap: 12px; flex: 0 0 auto; }
.map-footer span { color: var(--ink); font-weight: 650; }
.map-footer-meta button { text-decoration: underline; text-underline-offset: 3px; }

.inspector {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.bento-card { border-radius: 20px; }

.problem-card {
  grid-column: 1 / -1;
  padding: 24px;
  background: rgba(243, 239, 231, 0.92);
  border: 0;
}

.problem-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 18px;
}

.problem-meta span {
  padding: 6px 9px;
  background: rgba(255, 255, 255, 0.68);
  border: 0;
  border-radius: 999px;
  color: var(--ink-soft);
  font-size: 0.68rem;
  font-weight: 650;
}

.problem-card h2 {
  margin-top: 9px;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 2vw, 1.9rem);
  font-weight: 620;
  line-height: 1.08;
  letter-spacing: -0.029em;
}

.problem-copy {
  margin-top: 15px;
  color: var(--ink-soft);
  font-size: 0.84rem;
  line-height: 1.5;
}

.solution-block {
  margin-top: 18px;
  padding: 17px 18px;
  background: rgba(255, 255, 255, 0.68);
  border: 0;
  border-radius: 15px;
}

.solution-block span {
  color: rgba(20, 20, 20, 0.58);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.065em;
  text-transform: uppercase;
}

.solution-block p { margin-top: 5px; font-size: 0.84rem; font-weight: 600; line-height: 1.42; }

.path-system-card {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 14px;
  margin-top: 12px;
  padding: 15px;
  background: rgba(201, 218, 233, 0.42);
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 15px;
}

.path-system-card > div + div {
  padding-left: 14px;
  border-left: 1px solid rgba(20, 20, 20, 0.09);
}

.agent-role-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 8px;
}

.agent-role-list span {
  padding: 4px 7px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.68);
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 650;
  line-height: 1.25;
}

.path-system-card > div:last-child > p:last-child {
  margin-top: 7px;
  color: var(--ink-soft);
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.42;
}

.flow-card {
  grid-column: 1 / -1;
  padding: 22px;
  background: var(--paper);
  border: 0;
  box-shadow: 0 12px 32px rgba(38, 34, 28, 0.055);
}
.flow-heading { align-items: center; margin-bottom: 19px; }
.flow-heading h2 { margin-top: 4px; font-size: 1.22rem; }
.flow-heading > span { color: var(--muted); font-size: 0.7rem; font-weight: 650; }

.flow-list { list-style: none; }

.flow-step {
  position: relative;
  display: grid;
  grid-template-columns: 24px 34px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  min-height: 58px;
}

.flow-step:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 27px;
  bottom: 4px;
  left: 11px;
  width: 1px;
  background: rgba(20, 20, 20, 0.22);
}

.flow-num {
  position: relative;
  z-index: 1;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  color: var(--white);
  background: var(--ink);
  border-radius: 50%;
  font-size: 0.58rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.flow-logo {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  padding: 6px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 10px;
  box-shadow: 0 5px 13px rgba(38, 34, 28, 0.09), inset 0 1px 0 rgba(255, 255, 255, 0.76);
}

.flow-logo img { width: 22px; height: 22px; object-fit: contain; }
.flow-symbol {
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 750;
}
.flow-copy strong { display: block; font-size: 0.83rem; line-height: 1.25; }
.flow-copy p { margin-top: 2px; color: var(--muted); font-size: 0.75rem; line-height: 1.4; }

.result-grid {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 0;
  border: 0;
}

.outcome-card,
.review-card { min-height: 144px; padding: 20px; }
.outcome-card {
  background: var(--blue-soft);
}
.review-card {
  color: var(--white);
  background: rgba(20, 20, 20, 0.96);
  border-radius: 20px;
}
.review-card .card-label { color: rgba(255, 255, 255, 0.52); }
.outcome-card p:last-child,
.review-card p:last-child { margin-top: 12px; font-size: 0.82rem; font-weight: 600; line-height: 1.42; }

.trust-strip {
  grid-column: 1 / -1;
  padding: 19px 20px;
  background: rgba(216, 213, 204, 0.42);
  border: 0;
  border-radius: 17px;
}

.trust-strip > p:last-child {
  margin-top: 7px;
  color: var(--ink-soft);
  font-size: 0.74rem;
  font-weight: 600;
  line-height: 1.48;
}

.source-card {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 4px 4px;
  border: 0;
  border-radius: 0;
}

.source-card p:not(.card-label) { margin-top: 3px; color: var(--muted); font-size: 0.72rem; }
.source-card a { flex: 0 0 auto; font-size: 0.75rem; font-weight: 650; text-decoration: underline; text-underline-offset: 3px; }
.safety-note {
  grid-column: 1 / -1;
  padding: 4px;
  color: var(--muted);
  font-size: 0.68rem;
  line-height: 1.45;
}

.library {
  position: relative;
  padding: 10px 0 0;
  border-top: 0;
}

.library-heading {
  align-items: flex-start;
  flex-direction: column;
  margin-bottom: 22px;
}
.library-heading h2 {
  margin-top: 7px;
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 2.6vw, 2.35rem);
  font-weight: 600;
  line-height: 1.04;
  letter-spacing: -0.03em;
}
.library-heading > p { max-width: 38ch; color: var(--muted); font-size: 0.82rem; }

.path-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.path-tile {
  min-height: 154px;
  display: grid;
  align-content: space-between;
  gap: 16px;
  padding: 18px;
  text-align: left;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.74);
  border: 0;
  border-radius: 18px;
  box-shadow: none;
  cursor: pointer;
  transition: transform 220ms cubic-bezier(0.22, 1, 0.36, 1), box-shadow 220ms ease, background 220ms ease;
}

.path-tile:hover { transform: translateY(-2px); background: var(--white); box-shadow: 0 16px 36px rgba(38, 34, 28, 0.065); }
.path-tile[aria-current="true"] {
  background: rgba(201, 218, 233, 0.66);
  box-shadow: inset 3px 0 0 var(--ink);
}

.path-tile-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.path-tile-area { color: var(--muted); font-size: 0.66rem; font-weight: 700; letter-spacing: 0.065em; text-transform: uppercase; }
.path-tile-badges { display: inline-flex; align-items: center; gap: 6px; }

.evidence-pill,
.system-path-pill {
  padding: 5px 8px;
  color: var(--ink-soft);
  background: rgba(216, 213, 204, 0.48);
  border-radius: 999px;
  font-size: 0.62rem;
  font-weight: 650;
}

.system-path-pill {
  color: var(--white);
  background: var(--ink);
}

.path-tile h3 { max-width: 24ch; margin-top: 10px; font-family: var(--font-display); font-size: 1.02rem; font-weight: 620; line-height: 1.18; letter-spacing: -0.016em; }
.path-tile-copy,
.path-tile-problem { display: block; }
.path-tile-problem {
  display: -webkit-box;
  margin-top: 7px;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.4;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.path-tile-bottom { display: flex; align-items: end; justify-content: space-between; gap: 14px; }
.path-tile-count { color: var(--muted); font-size: 0.67rem; font-weight: 650; }

.empty-state {
  padding: 70px 24px;
  text-align: center;
  background: rgba(216, 213, 204, 0.36);
  border-radius: var(--radius-large);
}
.empty-state h3 { font-family: var(--font-display); font-size: 1.6rem; }
.empty-state p { margin-top: 8px; color: var(--muted); }
.empty-state button { min-height: var(--touch); margin-top: 20px; padding: 0 16px; color: var(--white); background: var(--ink); border: 0; border-radius: var(--radius-control); cursor: pointer; }

.page-cta {
  position: relative;
  isolation: isolate;
  min-height: 320px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 48px;
  margin-bottom: 0;
  padding: clamp(34px, 6vw, 72px);
  color: var(--white);
  background: transparent;
  border-radius: 0;
}

.page-cta::before { background: var(--ink); }

.page-cta .card-label { color: rgba(255, 255, 255, 0.5); }
.page-cta h2 { max-width: 16ch; margin-top: 10px; font-family: var(--font-display); font-size: clamp(2.1rem, 4vw, 3.6rem); font-weight: 590; line-height: 1.04; letter-spacing: -0.033em; }
.page-cta p:not(.card-label) { max-width: 560px; margin-top: 14px; color: rgba(255, 255, 255, 0.68); }

.cta-button {
  min-height: 50px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  padding: 0 20px;
  color: var(--ink);
  background: var(--white);
  border-radius: var(--radius-control);
  font-size: 0.85rem;
  font-weight: 650;
}

.footer {
  min-height: 126px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.78rem;
}
.footer > div { display: flex; align-items: center; gap: 18px; }
.footer strong { color: var(--ink); font-family: var(--font-display); font-size: 1rem; }
.footer a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }

@media (max-width: 1260px) {
  .workspace {
    grid-template-columns: 1fr;
    gap: 64px;
  }
  .map-panel {
    position: static;
    top: auto;
  }
  .explorer-side { gap: 58px; }
  .path-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 1100px) {
  .intro { grid-template-columns: 1fr; align-items: start; }
  .open-library-card {
    max-width: 620px;
    padding: 28px 0 0;
    border-left: 0;
    border-top: 1px solid var(--line);
  }
  .selector { grid-template-columns: 1fr; }
  .filter-panel { min-height: 0; }
  .deck-panel { min-height: 520px; }
  .deck-stage { height: 380px; }
  .deck-card {
    top: 24px;
    width: 216px;
    height: 296px;
  }
  .deck-card[data-state="active"] { --deck-x: -78px; --deck-y: 36px; --deck-z: 82px; }
  .deck-card[data-state="next"] { --deck-x: -30px; --deck-y: 0px; --deck-z: 18px; }
  .deck-card[data-state="far"] { --deck-x: 18px; --deck-y: -36px; --deck-z: -50px; }
  .deck-card[data-state="exit"] { --deck-x: 66px; --deck-y: -72px; --deck-z: -118px; }
  .workspace { grid-template-columns: 1fr; }
  .inspector { position: static; grid-template-columns: 1fr; }
  .problem-card, .flow-card, .source-card, .safety-note { grid-column: 1 / -1; }
  .result-grid { display: grid; }
  .path-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .shell { width: min(calc(100% - 28px), var(--shell)); }
  .topbar {
    grid-template-columns: 1fr auto;
    width: calc(100% - 20px);
    top: 10px;
    margin-top: 10px;
    padding-left: 15px;
  }
  .topbar-meta { display: none; }
  .back-link { padding-inline: 13px; font-size: 0.76rem; }
  .brand > .brand-context { display: none; }
  .intro { gap: 34px; padding-top: 82px; padding-bottom: 48px; }
  .intro h1 { font-size: clamp(3rem, 15vw, 4.35rem); }
  .intro-text { font-size: 1rem; }
  .open-library-card { padding: 24px 0 0; }
  .selector { gap: 42px; padding-top: 54px; padding-bottom: 58px; }
  .filter-panel { padding: 0; }
  .filter-panel h2 { font-size: 1.8rem; }
  .filter-chips { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 5px; scrollbar-width: none; }
  .filter-chip { flex: 0 0 auto; }
  .deck-panel { min-height: 468px; padding: 6px 0 0; }
  .deck-heading { padding-inline: 4px; }
  .deck-heading h2 { font-size: 1rem; }
  .deck-stage { height: 330px; }
  .deck-card {
    top: 20px;
    left: 49%;
    width: min(190px, 61vw);
    height: 258px;
    gap: 15px;
    padding: 16px;
  }
  .deck-card h3 { font-size: 1.05rem; }
  .deck-card-result { font-size: 0.67rem; -webkit-line-clamp: 2; }
  .mini-logo { width: 28px; height: 28px; padding: 5px; border-radius: 8px; }
  .mini-logo img { width: 18px; height: 18px; }
  .deck-card[data-state="active"] { --deck-x: -34px; --deck-y: 30px; --deck-z: 64px; }
  .deck-card[data-state="next"] { --deck-x: -6px; --deck-y: 4px; --deck-z: 12px; }
  .deck-card[data-state="far"] { --deck-x: 22px; --deck-y: -22px; --deck-z: -42px; }
  .deck-card[data-state="exit"] { --deck-x: 50px; --deck-y: -48px; --deck-z: -92px; }
  .deck-controls { justify-content: center; }
  .workspace { padding-top: 72px; padding-bottom: 76px; }
  .map-panel { padding: 0; }
  .panel-heading { align-items: flex-start; flex-direction: column; margin: 4px 4px 16px; }
  .panel-heading h2 { font-size: 1.2rem; }
  .map-legend { display: none; }
  .map-actions { width: 100%; align-items: center; justify-content: flex-end; }
  .system-toggle,
  .map-footer-meta button { min-height: 44px; }
  .map-scroll { overflow: hidden; }
  .map-stage { min-width: 0; height: 390px; border-radius: 20px; }
  .map-hub { min-width: 70px; min-height: 27px; padding: 6px 7px; font-size: 0.54rem; }
  .map-core { width: 78px; height: 78px; padding: 9px; }
  .map-core span { font-size: 0.45rem; }
  .map-core strong { font-size: 0.65rem; }
  .tool-node { width: 30px; height: 30px; padding: 5px; }
  .tool-node img { width: 20px; height: 20px; }
  .map-stage.is-neutral .tool-node { opacity: 0.05; }
  .system-node { min-width: 48px; min-height: 24px; padding: 5px 6px; font-size: 0.48rem; }
  .map-control { display: none !important; }
  .map-footer { flex-direction: column; gap: 9px; padding-inline: 4px; }
  .map-footer-meta { width: 100%; justify-content: space-between; }
  .inspector { grid-template-columns: 1fr; }
  .problem-card { padding: 20px; }
  .flow-card { padding: 20px; }
  .source-card { align-items: flex-start; flex-direction: column; padding: 22px 0; }
  .result-grid { display: grid; grid-template-columns: 1fr; }
  .outcome-card,
  .review-card { min-height: 0; padding: 20px; }
  .library { padding-top: 8px; padding-bottom: 0; }
  .library-heading { align-items: flex-start; flex-direction: column; }
  .library-heading h2 { font-size: 2rem; }
  .path-grid { grid-template-columns: 1fr; }
  .path-tile { min-height: 154px; }
  .page-cta { align-items: flex-start; flex-direction: column; margin-bottom: 0; padding: 52px 0; }
  .cta-button { width: 100%; }
  .footer { align-items: flex-start; flex-direction: column; justify-content: center; padding-block: 30px; }
  .footer > div { flex-wrap: wrap; }
}

/* Single-viewport workflow explorer */

:root { --shell: 1720px; }

.topbar {
  width: min(calc(100% - 24px), var(--shell));
  top: 10px;
  min-height: 58px;
  margin-top: 10px;
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(20, 20, 20, 0.06);
  border-radius: 17px;
  box-shadow: 0 8px 28px rgba(38, 34, 28, 0.06);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.explorer-app {
  height: calc(100dvh - 82px);
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
  padding-block: 12px 14px;
}

.explorer-heading {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  padding-inline: 4px;
}

.explorer-heading > div:first-child {
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 18px;
}

.explorer-heading h1 {
  overflow: hidden;
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 1.7vw, 1.65rem);
  font-weight: 620;
  line-height: 1.12;
  letter-spacing: -0.025em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.explorer-heading-actions {
  flex: 0 1 auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 18px;
}

.explorer-heading-actions p {
  max-width: 50ch;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.4;
  text-align: right;
}

.compact-cta {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  padding: 0 14px;
  color: var(--white);
  background: var(--ink);
  border-radius: 11px;
  font-size: 0.76rem;
  font-weight: 650;
}

.workspace {
  position: relative;
  min-height: 0;
  height: 100%;
  display: grid;
  grid-template-columns: clamp(210px, 15vw, 240px) minmax(540px, 1fr) clamp(340px, 24vw, 380px);
  align-items: stretch;
  gap: 12px;
  padding: 0;
}

.workspace::before { display: none; }

.path-browser,
.map-panel,
.inspector {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(20, 20, 20, 0.055);
  border-radius: 22px;
  box-shadow: 0 14px 38px rgba(38, 34, 28, 0.045);
}

.path-browser {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr) 42px;
}

.path-browser-head { padding: 17px 15px 11px; }

.path-browser-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.path-browser-title h2 {
  margin-top: 4px;
  font-family: var(--font-display);
  font-size: 1.12rem;
  font-weight: 630;
  line-height: 1.1;
  letter-spacing: -0.022em;
}

.path-total {
  min-width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: rgba(216, 213, 204, 0.42);
  border-radius: 9px;
  font-size: 0.68rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.path-browser .search-field {
  min-height: 42px;
  grid-template-columns: 18px 1fr;
  margin-top: 15px;
  padding-inline: 12px;
  background: rgba(243, 239, 231, 0.78);
  border-radius: 11px;
}

.path-browser .search-icon { font-size: 1rem; }
.path-browser .search-field input { height: 40px; font-size: 0.8rem; }

.path-browser .filter-chips {
  flex-wrap: nowrap;
  gap: 5px;
  margin-top: 10px;
  padding-bottom: 3px;
  overflow-x: auto;
  scrollbar-width: none;
}

.path-browser .filter-chips::-webkit-scrollbar { display: none; }

.path-browser .filter-chip {
  min-height: 30px;
  flex: 0 0 auto;
  padding: 0 9px;
  background: rgba(216, 213, 204, 0.3);
  font-size: 0.66rem;
}

.path-browser .filter-chip[aria-pressed="true"] {
  color: var(--white);
  background: var(--ink);
}

.path-list-scroll {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 3px 8px 10px;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.path-grid {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 3px;
}

.path-tile {
  position: relative;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 76px;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  align-content: center;
  gap: 9px;
  overflow: hidden;
  padding: 10px 10px 10px 12px;
  background: transparent;
  border: 0;
  border-radius: 12px;
  box-shadow: none;
}

.path-tile::before {
  content: "";
  position: absolute;
  inset-block: 13px;
  left: 0;
  width: 3px;
  background: transparent;
  border-radius: 99px;
}

.path-tile:hover {
  background: rgba(243, 239, 231, 0.58);
  box-shadow: none;
  transform: none;
}

.path-tile[aria-current="true"] {
  background: rgba(201, 218, 233, 0.42);
  box-shadow: none;
}

.path-tile[aria-current="true"]::before { background: var(--ink); }

.path-tile:focus-visible {
  outline-offset: -3px;
}

.path-tile-index {
  color: #99958d;
  font-size: 0.62rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.path-tile-main { min-width: 0; }

.path-tile-area {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.59rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.path-tile h3 {
  max-width: none;
  margin-top: 3px;
  display: -webkit-box;
  overflow: hidden;
  overflow-wrap: anywhere;
  font-size: 0.78rem;
  font-weight: 640;
  line-height: 1.22;
  white-space: normal;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.path-tile .mini-logo-row { display: none; }

.path-tile .mini-logo {
  width: 23px;
  height: 23px;
  padding: 4px;
  margin-left: -8px;
  border: 0;
  border-radius: 7px;
  box-shadow: 0 2px 7px rgba(38, 34, 28, 0.09);
}

.path-tile .mini-logo img { width: 15px; height: 15px; }

.path-browser-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 14px;
  border-top: 1px solid rgba(20, 20, 20, 0.055);
}

.path-browser-foot .filter-status {
  margin: 0;
  overflow: hidden;
  font-size: 0.66rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.path-browser-foot button {
  flex: 0 0 auto;
  color: var(--ink);
  background: transparent;
  border: 0;
  font-size: 0.65rem;
  font-weight: 650;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.empty-state {
  margin: 8px;
  padding: 32px 14px;
  border-radius: 14px;
}

.empty-state h3 { font-size: 1rem; }
.empty-state p { font-size: 0.74rem; }
.empty-state button { margin-top: 14px; font-size: 0.7rem; }

.map-panel {
  position: static;
  top: auto;
  align-self: stretch;
  height: 100%;
  display: grid;
  grid-template-rows: 62px minmax(0, 1fr) 42px;
  padding: 0;
  background: rgba(246, 243, 237, 0.94);
}

.map-panel .panel-heading {
  min-width: 0;
  align-items: center;
  margin: 0;
  padding: 0 17px 0 19px;
  border-bottom: 1px solid rgba(20, 20, 20, 0.045);
}

.map-panel .panel-heading h2 {
  margin-top: 2px;
  font-size: 1.06rem;
}

.map-actions { gap: 7px; }

.map-actions .system-toggle,
.map-actions #resetMapTrail,
.map-zoom button {
  min-height: 32px;
  padding: 0 10px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.72);
  border: 0;
  border-radius: 9px;
  font-size: 0.65rem;
  font-weight: 650;
  cursor: pointer;
}

.map-actions #resetMapTrail:hover,
.map-zoom button:hover { background: var(--white); }

.map-zoom {
  height: 32px;
  display: grid;
  grid-template-columns: 30px 42px 30px;
  align-items: stretch;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.72);
  border-radius: 9px;
}

.map-zoom button {
  min-width: 0;
  min-height: 0;
  padding: 0;
  background: transparent;
  border-radius: 0;
  font-size: 0.9rem;
}

.map-zoom output {
  display: grid;
  place-items: center;
  color: var(--muted);
  border-inline: 1px solid rgba(20, 20, 20, 0.055);
  font-size: 0.56rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.map-scroll {
  min-height: 0;
  height: 100%;
  overflow: hidden;
  border-radius: 0;
}

.map-stage {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  cursor: grab;
  touch-action: none;
  user-select: none;
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.96) 0, rgba(255, 255, 255, 0.66) 30%, transparent 62%),
    rgba(243, 239, 231, 0.55);
  border-radius: 0;
}

.map-stage.is-dragging { cursor: grabbing; }

.map-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: translate3d(0, 0, 0) scale(1);
  transform-origin: 50% 50%;
  transition: transform 260ms cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}

.map-stage.is-dragging .map-canvas,
.map-canvas.is-instant {
  transition: none;
}

.map-footer {
  min-width: 0;
  align-items: center;
  margin: 0;
  padding: 0 18px;
  border-top: 1px solid rgba(20, 20, 20, 0.045);
  font-size: 0.67rem;
}

.map-footer p {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-footer > span {
  flex: 0 0 auto;
  color: var(--ink);
  font-weight: 650;
}

.map-hub {
  min-width: 86px;
  min-height: 31px;
  padding: 7px 10px;
  font-size: 0.62rem;
}

.map-core { width: 92px; height: 92px; }
.map-core strong { font-size: 0.74rem; }

.tool-node {
  width: 33px;
  height: 33px;
  opacity: 0.055;
}

.tool-node.is-active { box-shadow: 0 7px 18px rgba(38, 34, 28, 0.13), 0 0 0 1px rgba(20, 20, 20, 0.58); }

.tool-node.is-active.is-step-focus {
  z-index: 8;
  transform: translate(-50%, -50%) scale(1.18);
  box-shadow: 0 10px 26px rgba(38, 34, 28, 0.2), 0 0 0 2px var(--ink);
}

.map-hub.is-active.is-step-focus,
.system-node.is-active.is-step-focus {
  z-index: 8;
  color: var(--white);
  background: var(--ink);
  transform: translate(-50%, -50%) scale(1.06);
}

.inspector {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: auto minmax(0, 1fr) 40px;
  gap: 0;
  background: rgba(255, 255, 255, 0.9);
}

.inspector-head {
  min-width: 0;
  padding: 17px 16px 0;
  border-bottom: 1px solid rgba(20, 20, 20, 0.05);
}

.inspector-head .problem-meta {
  gap: 5px;
  margin-bottom: 9px;
  overflow: hidden;
}

.inspector-head .problem-meta span {
  padding: 4px 7px;
  background: rgba(216, 213, 204, 0.34);
  font-size: 0.59rem;
  white-space: nowrap;
}

.inspector-head h2 {
  max-width: 25ch;
  display: -webkit-box;
  overflow: hidden;
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 1.45vw, 1.36rem);
  font-weight: 630;
  line-height: 1.12;
  letter-spacing: -0.025em;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.inspector-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
  margin-top: 14px;
  padding: 3px;
  background: rgba(216, 213, 204, 0.34);
  border-radius: 11px 11px 0 0;
}

.inspector-tabs button {
  min-height: 32px;
  color: rgba(20, 20, 20, 0.66);
  background: transparent;
  border: 0;
  border-radius: 8px;
  font-size: 0.66rem;
  font-weight: 650;
  cursor: pointer;
}

.inspector-tabs button[aria-selected="true"] {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 2px 8px rgba(38, 34, 28, 0.07);
}

.inspector-viewport {
  min-height: 0;
  overflow: hidden;
}

.inspector-view {
  height: 100%;
  min-height: 0;
  overflow-y: auto;
  padding: 13px 14px 17px;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.inspector-view[hidden] { display: none; }

.inspector-view.is-active { display: block; }

.inspector .problem-card {
  padding: 17px;
  background: rgba(243, 239, 231, 0.9);
  border-radius: 16px;
}

.inspector .problem-copy {
  margin-top: 8px;
  font-size: 0.78rem;
  line-height: 1.45;
}

.inspector .solution-block {
  margin-top: 14px;
  padding: 13px 14px;
  border-radius: 12px;
}

.inspector .solution-block span { font-size: 0.61rem; }
.inspector .solution-block p { font-size: 0.77rem; line-height: 1.4; }

.inspector .result-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 8px;
}

.inspector .outcome-card,
.inspector .review-card {
  min-height: 112px;
  padding: 15px;
  border-radius: 15px;
}

.inspector .outcome-card p:last-child,
.inspector .review-card p:last-child {
  margin-top: 8px;
  font-size: 0.72rem;
  line-height: 1.38;
}

.inspector .flow-card {
  min-height: 100%;
  padding: 17px;
  background: rgba(243, 239, 231, 0.52);
  border-radius: 16px;
  box-shadow: none;
}

.inspector .flow-heading { margin-bottom: 16px; }
.inspector .flow-heading h2 { font-size: 1rem; }
.inspector .flow-list { padding-right: 3px; }

.inspector .flow-step {
  grid-template-columns: 22px 31px minmax(0, 1fr);
  gap: 8px;
  min-height: 56px;
}

.inspector .flow-step:not(:last-child)::after {
  top: 25px;
  left: 10px;
}

.inspector .flow-num { width: 22px; height: 22px; font-size: 0.53rem; }

.inspector .flow-logo {
  width: 31px;
  height: 31px;
  padding: 5px;
  border: 0;
  border-radius: 8px;
  box-shadow: 0 3px 9px rgba(38, 34, 28, 0.08);
}

.inspector .flow-logo img { width: 20px; height: 20px; }
.inspector .flow-copy strong { font-size: 0.77rem; }
.inspector .flow-copy p { font-size: 0.69rem; line-height: 1.35; }

.inspector .trust-strip {
  padding: 18px;
  background: rgba(20, 20, 20, 0.95);
  border-radius: 16px;
}

.inspector .trust-strip .card-label { color: rgba(255, 255, 255, 0.5); }

.inspector .trust-strip > p:last-child {
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.77rem;
}

.inspector .source-card {
  display: block;
  margin-top: 9px;
  padding: 17px;
  background: rgba(243, 239, 231, 0.78);
  border-radius: 15px;
}

.inspector .source-card p:not(.card-label) { font-size: 0.7rem; }
.inspector .source-card a { display: inline-block; margin-top: 14px; font-size: 0.7rem; }

.inspector .safety-note {
  padding: 14px 4px 2px;
  font-size: 0.66rem;
}

.inspector-foot {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 15px;
  border-top: 1px solid rgba(20, 20, 20, 0.055);
  color: var(--muted);
  font-size: 0.62rem;
}

.inspector-foot span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inspector-foot a {
  flex: 0 0 auto;
  color: var(--ink);
  font-weight: 650;
}

.path-list-scroll,
.inspector-view {
  scrollbar-color: rgba(20, 20, 20, 0.22) transparent;
  scrollbar-width: thin;
}

.path-list-scroll::-webkit-scrollbar,
.inspector-view::-webkit-scrollbar { width: 5px; }

.path-list-scroll::-webkit-scrollbar-thumb,
.inspector-view::-webkit-scrollbar-thumb {
  background: rgba(20, 20, 20, 0.18);
  border-radius: 99px;
}

@media (min-width: 1181px) and (min-height: 720px) {
  html, body { height: 100%; }
  body { height: 100dvh; overflow: hidden; }
}

@media (min-width: 1181px) and (max-height: 719px) {
  body { overflow-y: auto; }
  .explorer-app { height: 650px; }
}

@media (max-width: 1320px) {
  .explorer-heading-actions p { display: none; }
  .map-legend { display: none; }
  .workspace {
    grid-template-columns: clamp(200px, 16vw, 224px) minmax(500px, 1fr) clamp(320px, 27vw, 360px);
  }
  .map-actions .system-toggle { padding-inline: 8px; }
}

@media (max-width: 1180px) {
  body { overflow-y: auto; }
  .explorer-app {
    height: auto;
    min-height: 0;
    display: block;
    padding-block: 26px 48px;
  }
  .explorer-heading { margin-bottom: 18px; }
  .workspace {
    height: auto;
    grid-template-columns: minmax(220px, 0.42fr) minmax(520px, 1fr);
  }
  .path-browser { height: 650px; }
  .map-panel { height: 650px; }
  .map-stage { touch-action: pan-y; }
  .inspector {
    grid-column: 1 / -1;
    height: 620px;
  }
  .inspector-head h2 { max-width: none; }
}

@media (max-width: 820px) {
  .explorer-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
  }
  .explorer-heading > div:first-child {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }
  .explorer-heading h1 {
    overflow: visible;
    font-size: 1.55rem;
    white-space: normal;
  }
  .explorer-heading-actions { width: 100%; justify-content: flex-start; }
  .workspace { grid-template-columns: 1fr; }
  .path-browser,
  .map-panel,
  .inspector {
    grid-column: auto;
    height: auto;
  }
  .path-browser { height: 480px; }
  .map-panel { height: 590px; }
  .inspector { height: 590px; }
}

@media (max-width: 560px) {
  .topbar { width: calc(100% - 16px); }
  .explorer-app { padding-top: 22px; }
  .compact-cta { width: 100%; }
  .path-browser { height: 440px; }
  .map-panel { height: 470px; }
  .map-panel .panel-heading { padding-inline: 14px; }
  .map-actions #resetMapTrail { display: none; }
  .map-zoom { grid-template-columns: 34px 42px 34px; }
  .map-footer p { display: none; }
  .map-footer { justify-content: flex-end; }
  .map-hub { min-width: 68px; min-height: 26px; font-size: 0.5rem; }
  .map-core { width: 72px; height: 72px; }
  .tool-node { width: 28px; height: 28px; padding: 5px; }
  .tool-node img { width: 18px; height: 18px; }
  .inspector { height: 610px; }
  .inspector .result-grid { grid-template-columns: 1fr; }
  .inspector .outcome-card,
  .inspector .review-card { min-height: 0; }
  .path-system-card { grid-template-columns: 1fr; }
  .path-system-card > div + div {
    padding-top: 12px;
    padding-left: 0;
    border-top: 1px solid rgba(20, 20, 20, 0.09);
    border-left: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* Spatial Tool Atlas — full map plane with four floating information surfaces */

.explorer-app {
  height: calc(100dvh - 82px);
  display: block;
  padding-block: 12px 14px;
}

.spatial-workspace {
  --left-card: clamp(230px, 18vw, 272px);
  --right-card: clamp(320px, 25vw, 372px);
  position: relative;
  isolation: isolate;
  width: 100%;
  height: 100%;
  min-height: 0;
  display: block;
  overflow: hidden;
  padding: 0;
  background:
    radial-gradient(circle at 50% 43%, rgba(255, 255, 255, 0.96) 0 15%, rgba(255, 255, 255, 0.52) 38%, transparent 67%),
    linear-gradient(135deg, rgba(251, 250, 247, 0.98), rgba(243, 239, 231, 0.72));
  border-radius: 28px;
}

.spatial-workspace::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(251, 250, 247, 0.72), transparent 20% 80%, rgba(251, 250, 247, 0.72)),
    linear-gradient(0deg, rgba(251, 250, 247, 0.64), transparent 20% 82%, rgba(251, 250, 247, 0.36));
}

.map-layer {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
  display: block;
  overflow: hidden;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.map-layer .map-scroll,
.map-layer .map-stage {
  width: 100%;
  height: 100%;
  min-height: 0;
  border-radius: 0;
}

.map-layer .map-stage {
  background: transparent;
}

.floating-panel {
  position: absolute;
  z-index: 10;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.64);
  border-radius: 18px;
  box-shadow:
    0 18px 48px rgba(38, 34, 28, 0.09),
    inset 0 0 0 1px rgba(20, 20, 20, 0.022),
    inset 0 1px 0 rgba(255, 255, 255, 0.82);
  -webkit-backdrop-filter: blur(18px) saturate(112%);
  backdrop-filter: blur(18px) saturate(112%);
}

.discover-panel {
  top: 14px;
  left: 50%;
  width: min(700px, calc(100% - var(--left-card) - var(--right-card) - 72px));
  min-width: 520px;
  min-height: 72px;
  display: grid;
  grid-template-columns: minmax(132px, 0.8fr) minmax(230px, 1.35fr) auto;
  align-items: center;
  gap: 13px;
  padding: 10px 12px 10px 16px;
  transform: translateX(-50%);
}

.discover-title {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.discover-title > div { min-width: 0; }

.discover-title h1 {
  overflow: hidden;
  margin-top: 1px;
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 660;
  line-height: 1.15;
  letter-spacing: -0.015em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.discover-title > span {
  display: none;
  color: var(--muted);
  font-size: 0.58rem;
  font-weight: 650;
  white-space: nowrap;
}

.discover-panel .card-label {
  font-size: 0.54rem;
  letter-spacing: 0.075em;
}

.layer-switcher {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 3px;
  padding: 3px;
  background: rgba(243, 239, 231, 0.7);
  border-radius: 11px;
}

.layer-switcher button {
  min-width: 0;
  min-height: 31px;
  overflow: hidden;
  padding-inline: 6px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 8px;
  font-size: 0.58rem;
  font-weight: 660;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}

.layer-switcher button[aria-pressed="true"] {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 2px 9px rgba(38, 34, 28, 0.07);
}

.discover-panel .map-actions {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
}

.discover-panel .map-actions > button,
.discover-panel .map-zoom,
.discover-panel .map-zoom button {
  min-height: 32px;
  color: var(--ink);
  background: rgba(243, 239, 231, 0.62);
  border: 0;
  border-radius: 9px;
  font-size: 0.58rem;
  font-weight: 670;
}

.discover-panel .map-actions > button {
  max-width: 82px;
  overflow: hidden;
  padding-inline: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.discover-panel .map-actions > button:hover,
.discover-panel .map-zoom button:hover { background: rgba(243, 239, 231, 0.96); }

.discover-panel .map-zoom {
  grid-template-columns: 26px 38px 26px;
  flex: 0 0 auto;
}

.discover-panel .map-zoom button {
  min-width: 0;
  padding: 0;
  background: transparent;
  font-size: 0.8rem;
}

.discover-panel .map-zoom output { font-size: 0.5rem; }

.path-browser {
  top: 14px;
  bottom: 204px;
  left: 14px;
  width: var(--left-card);
  height: auto;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) 38px;
}

.path-browser-head { padding: 15px 13px 9px; }

.path-browser-title h2 {
  margin-top: 2px;
  font-size: 0.98rem;
}

.path-total {
  min-width: 28px;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  font-size: 0.61rem;
}

.path-browser .search-field,
.tool-search-field {
  min-height: 37px;
  display: grid;
  grid-template-columns: 17px minmax(0, 1fr);
  align-items: center;
  gap: 4px;
  margin-top: 10px;
  padding-inline: 10px;
  background: rgba(243, 239, 231, 0.66);
  border: 0;
  border-radius: 10px;
}

.tool-search-field { margin-top: 6px; }

.path-browser .search-field input,
.tool-search-field input {
  width: 100%;
  height: 36px;
  min-width: 0;
  color: var(--ink);
  background: transparent;
  border: 0;
  outline: 0;
  font-size: 0.72rem;
}

.path-browser .search-icon,
.tool-search-icon {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 0.8rem;
}

.selected-tool-chips {
  display: flex;
  gap: 5px;
  margin-top: 7px;
  overflow-x: auto;
  scrollbar-width: none;
}

.selected-tool-chips:empty { display: none; }
.selected-tool-chips::-webkit-scrollbar { display: none; }

.selected-tool-chips button {
  min-height: 28px;
  display: inline-grid;
  grid-template-columns: 17px auto 12px;
  align-items: center;
  gap: 5px;
  flex: 0 0 auto;
  padding: 0 7px 0 5px;
  color: var(--ink);
  background: rgba(201, 218, 233, 0.52);
  border: 0;
  border-radius: 8px;
  font-size: 0.61rem;
  font-weight: 650;
  cursor: pointer;
}

.selected-tool-chips img {
  width: 17px;
  height: 17px;
  object-fit: contain;
}

.path-browser .filter-chips { margin-top: 8px; }

.path-browser .filter-chip {
  min-height: 27px;
  padding-inline: 8px;
  font-size: 0.59rem;
}

.path-list-scroll { padding: 2px 7px 8px; }

.path-grid { gap: 2px; }

.path-tile {
  min-height: 65px;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 7px;
  padding: 8px 9px;
  border-radius: 10px;
}

.path-tile[aria-current="true"] { background: rgba(201, 218, 233, 0.38); }

.path-tile-area { font-size: 0.53rem; }

.path-tile h3 {
  margin-top: 2px;
  font-size: 0.7rem;
  line-height: 1.2;
}

.path-tile-match {
  display: inline-block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.52rem;
  font-weight: 650;
}

.path-browser-foot {
  min-width: 0;
  padding-inline: 11px;
}

.path-browser-foot .filter-status {
  min-width: 0;
  overflow: hidden;
  margin: 0;
  font-size: 0.56rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.path-browser-foot button { font-size: 0.56rem; }

.inspector {
  top: 14px;
  right: 14px;
  bottom: 204px;
  width: var(--right-card);
  height: auto;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: auto minmax(0, 1fr) 38px;
  gap: 0;
}

.inspector-head { padding: 14px 14px 0; }

.inspector-head h2 {
  max-width: 27ch;
  margin-bottom: 10px;
  font-size: clamp(0.96rem, 1.2vw, 1.14rem);
  line-height: 1.16;
}

.inspector-head .problem-meta { margin-bottom: 7px; }
.inspector-head .problem-meta span { font-size: 0.52rem; }

.inspector-tabs {
  min-height: 36px;
  padding: 3px;
  border-radius: 10px 10px 0 0;
}

.inspector-tabs button {
  min-height: 30px;
  font-size: 0.58rem;
}

.inspector-view { padding: 11px 12px 14px; }

.inspector .problem-card {
  padding: 15px;
  background: rgba(243, 239, 231, 0.66);
  border-radius: 14px;
}

.inspector .problem-copy {
  margin-top: 7px;
  font-size: 0.72rem;
  line-height: 1.42;
}

.inspector .solution-block {
  margin-top: 12px;
  padding: 11px 12px;
  background: rgba(255, 255, 255, 0.72);
  border-radius: 10px;
}

.inspector .solution-block p { font-size: 0.71rem; }

.focused-step-card {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 11px;
  align-items: start;
  margin-top: 9px;
  padding: 12px;
  background: rgba(201, 218, 233, 0.38);
  border-radius: 13px;
}

.focused-step-card[hidden] { display: none; }

.focused-step-card > img {
  width: 38px;
  height: 38px;
  padding: 7px;
  object-fit: contain;
  background: rgba(255, 255, 255, 0.88);
  border-radius: 10px;
  box-shadow: 0 5px 13px rgba(38, 34, 28, 0.09);
}

.focused-step-card strong {
  display: block;
  margin-top: 1px;
  font-size: 0.76rem;
}

.focused-step-card p:last-child {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.67rem;
  line-height: 1.35;
}

.path-system-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 9px;
}

.path-system-card > div {
  min-width: 0;
  padding: 12px;
  background: rgba(243, 239, 231, 0.58);
  border-radius: 12px;
}

.agent-role-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 7px;
}

.agent-role-list span {
  padding: 4px 6px;
  background: rgba(255, 255, 255, 0.76);
  border-radius: 7px;
  font-size: 0.56rem;
  font-weight: 650;
}

#activeAutomation {
  margin-top: 7px;
  color: var(--muted);
  font-size: 0.61rem;
  line-height: 1.35;
}

.inspector .result-grid { margin-top: 0; }
.inspector .outcome-card,
.inspector .review-card { min-height: 96px; padding: 13px; }
.inspector .trust-strip { margin-top: 8px; padding: 14px; border-radius: 13px; }
.inspector .source-card { padding: 13px; border-radius: 13px; }
.inspector-foot { padding-inline: 12px; font-size: 0.55rem; }

.workflow-panel {
  right: calc(var(--right-card) + 28px);
  bottom: 14px;
  left: calc(var(--left-card) + 28px);
  height: 176px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  padding: 12px 14px 9px;
}

.workflow-panel-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
}

.workflow-panel-head h2 {
  margin-top: 1px;
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 660;
  line-height: 1.15;
}

.workflow-panel-head > span {
  color: var(--muted);
  font-size: 0.58rem;
  font-weight: 650;
  white-space: nowrap;
}

.workflow-panel .flow-list {
  min-width: 0;
  display: flex;
  gap: 7px;
  margin-top: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0 0 5px;
  scroll-snap-type: x proximity;
  scrollbar-color: rgba(20, 20, 20, 0.18) transparent;
  scrollbar-width: thin;
}

.workflow-panel .flow-step {
  position: relative;
  min-width: 0;
  min-height: 76px;
  width: 112px;
  flex: 1 0 112px;
  display: grid;
  grid-template-columns: 27px minmax(0, 1fr);
  grid-template-rows: 28px minmax(26px, auto);
  align-items: center;
  gap: 6px;
  overflow: hidden;
  padding: 8px;
  background: rgba(243, 239, 231, 0.6);
  border-radius: 11px;
  scroll-snap-align: start;
  cursor: pointer;
  transition: background 160ms ease, transform 160ms ease;
}

.workflow-panel .flow-step:hover,
.workflow-panel .flow-step:focus-visible {
  background: rgba(201, 218, 233, 0.42);
  transform: translateY(-1px);
}

.workflow-panel .flow-step:not(:last-child)::after { display: none; }

.workflow-panel .flow-num {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 20px;
  height: 20px;
  font-size: 0.48rem;
}

.workflow-panel .flow-logo {
  width: 27px;
  height: 27px;
  padding: 4px;
  border-radius: 8px;
}

.workflow-panel .flow-logo img { width: 19px; height: 19px; }

.workflow-panel .flow-copy {
  display: contents;
}

.workflow-panel .flow-copy strong {
  grid-column: 2;
  min-width: 0;
  overflow: hidden;
  padding-right: 17px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workflow-panel .flow-copy strong { font-size: 0.56rem; }

.workflow-panel .flow-copy p {
  grid-column: 1 / -1;
  min-width: 0;
  display: -webkit-box;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.5rem;
  line-height: 1.22;
  white-space: normal;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.workflow-hint {
  overflow: hidden;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.52rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-canvas { overflow: visible; }

.map-base-line {
  stroke-width: 0.86;
  opacity: 0.13;
}

.map-ring-line {
  stroke-width: 0.72;
  stroke-dasharray: none;
  opacity: 0.055;
}

.map-trail-line {
  stroke-width: 2.05;
  opacity: 0.94;
}

.map-trail-line.is-revealing {
  stroke-dasharray: none;
  stroke-dashoffset: 0;
  animation: trailFade 480ms ease-out both;
  animation-delay: var(--trail-delay, 0ms);
}

.map-trail-line:not(.is-branch) { stroke-dasharray: none; }

@keyframes trailFade {
  from { opacity: 0.08; }
  to { opacity: 0.94; }
}

.map-trail-line.is-branch {
  stroke-dasharray: 4 5;
  opacity: 0.7;
}

.map-core {
  z-index: 6;
  width: 108px;
  height: 108px;
  overflow: hidden;
  padding: 15px;
  box-shadow: 0 13px 30px rgba(38, 34, 28, 0.16);
}

.map-core > div {
  width: 100%;
  display: grid;
  place-items: center;
}

.map-core span {
  font-size: 0.51rem;
  line-height: 1.1;
}

.map-core strong {
  max-width: 7ch;
  margin-top: 4px;
  font-size: 0.82rem;
  line-height: 1.1;
  overflow-wrap: normal;
}

.map-hub {
  z-index: 4;
  width: max-content;
  min-width: 0;
  max-width: none;
  min-height: 29px;
  padding: 6px 10px;
  overflow: visible;
  color: rgba(20, 20, 20, 0.58);
  background: rgba(255, 255, 255, 0.74);
  font-size: 0.58rem;
  line-height: 1;
  letter-spacing: 0.015em;
  white-space: nowrap;
  opacity: 0.72;
}

.map-hub.is-active,
.map-hub.is-layer-active,
.map-hub.has-owned-tool {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.96);
  opacity: 1;
}

.tool-node {
  z-index: 3;
  width: 28px;
  height: 28px;
  padding: 5px;
  overflow: visible;
  background: rgba(255, 255, 255, 0.66);
  border-radius: 8px;
  opacity: 0.14;
  filter: saturate(0.62);
  pointer-events: auto;
  cursor: pointer;
}

.tool-node img {
  width: 18px;
  height: 18px;
  pointer-events: none;
}

.tool-node.is-active,
.tool-node.is-owned,
.tool-node.is-layer-active {
  z-index: 7;
  width: 38px;
  height: 38px;
  padding: 7px;
  opacity: 1;
  filter: none;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 8px 20px rgba(38, 34, 28, 0.14);
  transform: translate(-50%, -50%) scale(1);
}

.tool-node.is-layer-context {
  opacity: 0.34;
  filter: saturate(0.78);
}

.tool-node.is-active { box-shadow: 0 9px 23px rgba(38, 34, 28, 0.16), 0 0 0 1.5px rgba(20, 20, 20, 0.74); }

.tool-node.is-owned {
  box-shadow: 0 9px 23px rgba(38, 34, 28, 0.16), 0 0 0 2px rgba(76, 111, 138, 0.8);
}

.tool-node .tool-label {
  position: absolute;
  top: calc(100% + 5px);
  left: 50%;
  z-index: 12;
  max-width: 132px;
  overflow: hidden;
  padding: 4px 7px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.96);
  border-radius: 7px;
  box-shadow: 0 6px 16px rgba(38, 34, 28, 0.11);
  font-size: 0.52rem;
  font-weight: 680;
  line-height: 1.15;
  opacity: 0;
  pointer-events: none;
  text-overflow: ellipsis;
  white-space: nowrap;
  transform: translate(-50%, -3px);
  transition: opacity 140ms ease, transform 140ms ease;
}

.tool-node[data-caption-side="left"] .tool-label {
  top: 50%;
  right: calc(100% + 6px);
  left: auto;
  transform: translate(3px, -50%);
}

.tool-node[data-caption-side="right"] .tool-label {
  top: 50%;
  left: calc(100% + 6px);
  transform: translate(-3px, -50%);
}

.tool-node:hover .tool-label,
.tool-node:focus-visible .tool-label,
.tool-node.is-step-focus .tool-label {
  opacity: 1;
  transform: translate(-50%, 0);
}

.tool-node[data-caption-side="left"]:hover .tool-label,
.tool-node[data-caption-side="left"]:focus-visible .tool-label,
.tool-node[data-caption-side="left"].is-step-focus .tool-label,
.tool-node[data-caption-side="right"]:hover .tool-label,
.tool-node[data-caption-side="right"]:focus-visible .tool-label,
.tool-node[data-caption-side="right"].is-step-focus .tool-label {
  transform: translate(0, -50%);
}

.map-stage.is-neutral .tool-node {
  opacity: 0.52;
  filter: saturate(0.85);
}

.map-stage.is-neutral .map-hub { opacity: 0.88; }

.system-node {
  z-index: 8;
  width: 27px;
  height: 27px;
  min-width: 27px;
  max-width: 27px;
  min-height: 27px;
  display: grid;
  place-items: center;
  padding: 0;
  overflow: visible;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.94);
  border: 0;
  border-radius: 50%;
  box-shadow: 0 5px 14px rgba(38, 34, 28, 0.08);
  pointer-events: none;
  cursor: pointer;
}

.system-node-symbol {
  font-size: 0.58rem;
  font-weight: 750;
  line-height: 1;
}

.system-node-label {
  position: absolute;
  top: calc(100% + 5px);
  left: 50%;
  z-index: 14;
  max-width: 128px;
  overflow: hidden;
  padding: 4px 7px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.97);
  border-radius: 7px;
  box-shadow: 0 6px 16px rgba(38, 34, 28, 0.11);
  font-size: 0.51rem;
  font-weight: 680;
  line-height: 1.15;
  opacity: 0;
  pointer-events: none;
  text-overflow: ellipsis;
  white-space: nowrap;
  transform: translate(-50%, -3px);
  transition: opacity 140ms ease, transform 140ms ease;
}

.system-node:hover .system-node-label,
.system-node:focus-visible .system-node-label,
.system-node.is-step-focus .system-node-label {
  opacity: 1;
  transform: translate(-50%, 0);
}

.map-stage.is-system .system-node.is-active,
.map-stage.is-system .system-node.is-layer-active {
  color: var(--ink);
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}

.map-stage .system-only-line.is-layer-active {
  display: block;
  opacity: 0.22;
}

.map-stage[data-layer="skills"] .system-node[data-layer-node="skills"],
.map-stage[data-layer="knowledge"] .system-node[data-layer-node="knowledge"],
.map-stage[data-layer="code"] .system-node[data-layer-node="code"],
.map-stage[data-layer="safety"] .system-node[data-layer-node="safety"] {
  color: var(--ink);
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}

.map-stage[data-layer="skills"] [data-layer-line="skills"],
.map-stage[data-layer="knowledge"] [data-layer-line="knowledge"],
.map-stage[data-layer="code"] [data-layer-line="code"],
.map-stage[data-layer="safety"] [data-layer-line="safety"] {
  display: block;
  opacity: 0.22;
}

@media (max-width: 1320px) and (min-width: 1181px) {
  .discover-panel {
    grid-template-columns: minmax(104px, 0.6fr) minmax(205px, 1.35fr) auto;
    gap: 8px;
    padding-left: 12px;
  }

  .discover-title .card-label { display: none; }
  .discover-panel .map-actions > button { max-width: 76px; padding-inline: 7px; }
  .layer-switcher button { padding-inline: 4px; font-size: 0.54rem; }
}

@media (max-width: 1180px) {
  body { overflow-y: auto; }

  .explorer-app {
    height: auto;
    min-height: 0;
    padding-block: 22px 48px;
  }

  .spatial-workspace {
    display: grid;
    grid-template-columns: minmax(230px, 0.42fr) minmax(0, 1fr);
    grid-template-areas:
      "discover discover"
      "paths map"
      "inspector inspector"
      "workflow workflow";
    gap: 12px;
    height: auto;
    overflow: visible;
    background: transparent;
    border-radius: 0;
  }

  .spatial-workspace::after { display: none; }

  .floating-panel,
  .map-layer {
    position: relative;
    inset: auto;
    width: auto;
    min-width: 0;
    transform: none;
  }

  .discover-panel {
    grid-area: discover;
    min-width: 0;
  }

  .path-browser {
    grid-area: paths;
    height: 620px;
  }

  .map-layer {
    grid-area: map;
    height: 620px;
    background: linear-gradient(135deg, rgba(251, 250, 247, 0.98), rgba(243, 239, 231, 0.72));
    border-radius: 20px;
  }

  .inspector {
    grid-area: inspector;
    height: 470px;
  }

  .workflow-panel {
    grid-area: workflow;
    height: 176px;
  }
}

@media (max-width: 820px) {
  .spatial-workspace {
    grid-template-columns: 1fr;
    grid-template-areas:
      "discover"
      "map"
      "paths"
      "inspector"
      "workflow";
  }

  .discover-panel {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .discover-title { justify-content: space-between; }
  .discover-title > span { display: block; }
  .discover-panel .map-actions { justify-content: flex-start; }
  .path-browser { height: 500px; }
  .map-layer { height: 560px; }
  .inspector { height: 520px; }
  .workflow-panel { height: 180px; }
}

@media (max-width: 560px) {
  .shell { width: min(calc(100% - 20px), var(--shell)); }
  .topbar-meta { display: none; }
  .topbar { grid-template-columns: 1fr auto; }
  .brand > .brand-context { display: none; }
  .back-link { padding-inline: 12px; font-size: 0.72rem; }
  .map-layer { height: 480px; }
  .map-core { width: 86px; height: 86px; }
  .map-core strong { font-size: 0.69rem; }
  .map-hub { font-size: 0.48rem; }
  .tool-node { width: 24px; height: 24px; padding: 4px; }
  .tool-node img { width: 16px; height: 16px; }
  .tool-node.is-active,
  .tool-node.is-owned,
  .tool-node.is-layer-active { width: 32px; height: 32px; padding: 6px; }
  .inspector .result-grid { grid-template-columns: 1fr; }
}

/* Full-screen explorer grid */

.panel-toggle {
  position: absolute;
  z-index: 24;
  top: 12px;
  right: 12px;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  padding: 0;
  color: var(--ink);
  background: rgba(243, 239, 231, 0.76);
  border: 0;
  border-radius: 9px;
  font-size: 0.72rem;
  font-weight: 720;
  line-height: 1;
  cursor: pointer;
  transition: background 150ms ease, transform 150ms ease;
}

.panel-toggle:hover { background: rgba(232, 228, 219, 0.94); }
.panel-toggle:active { transform: scale(0.96); }

.path-panel-content,
.inspector-panel-content,
.workflow-panel-content {
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  grid-template-columns: minmax(0, 1fr);
  overflow: hidden;
}

.path-panel-content > *,
.inspector-panel-content > *,
.workflow-panel-content > * {
  min-width: 0;
  max-width: 100%;
}

.path-panel-content {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) 38px;
}

.inspector-panel-content {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) 38px;
}

.workflow-panel-content {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  padding: 14px 16px 10px;
}

.path-browser-title { padding-right: 36px; }
.inspector-head { padding-right: 52px; }
.workflow-panel-head { padding-right: 36px; }

.map-home {
  flex: 0 0 auto;
  padding-right: 12px;
  border-right: 1px solid rgba(20, 20, 20, 0.11);
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 720;
  letter-spacing: -0.025em;
}

.layer-menu-details {
  position: relative;
  flex: 0 0 auto;
}

.layer-menu-details > summary {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  padding-inline: 10px;
  color: var(--ink);
  background: rgba(243, 239, 231, 0.62);
  border-radius: 9px;
  font-size: 0.58rem;
  font-weight: 680;
  list-style: none;
  cursor: pointer;
}

.layer-menu-details > summary::-webkit-details-marker { display: none; }
.layer-menu-details[open] > summary { background: rgba(232, 228, 219, 0.96); }

.layer-menu-popover {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 40;
  width: 306px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(20, 20, 20, 0.06);
  border-radius: 13px;
  box-shadow: 0 18px 44px rgba(38, 34, 28, 0.14);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}

.layer-menu-popover > p {
  margin-bottom: 9px;
  color: var(--muted);
  font-size: 0.6rem;
  line-height: 1.4;
}

.layer-menu-popover .layer-switcher {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.layer-menu-popover .system-toggle {
  width: 100%;
  min-height: 32px;
  margin-top: 7px;
  color: var(--ink);
  background: rgba(243, 239, 231, 0.7);
  border: 0;
  border-radius: 9px;
  font-size: 0.58rem;
  font-weight: 670;
  cursor: pointer;
}

.floating-panel.is-collapsed > [data-panel-content] {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.floating-panel.is-collapsed::before {
  position: absolute;
  z-index: 20;
  color: var(--muted);
  font-size: 0.55rem;
  font-weight: 690;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.path-browser.is-collapsed::before {
  content: "Fälle";
  top: 15px;
  left: 12px;
  writing-mode: vertical-rl;
  transform: translateY(38px) rotate(180deg);
}

.inspector.is-collapsed::before {
  content: "Erklärung";
  top: 15px;
  left: 12px;
  writing-mode: vertical-rl;
  transform: translateY(38px);
}

.workflow-panel.is-collapsed::before {
  content: "Workflow";
  top: 18px;
  left: 16px;
  writing-mode: initial;
  transform: none;
}

@media (min-width: 1181px) {
  body {
    height: 100dvh;
    overflow: hidden;
  }

  .topbar { display: none; }

  .explorer-app.shell {
    width: 100%;
    max-width: none;
    height: 100dvh;
    margin: 0;
    padding: 0;
  }

  .spatial-workspace {
    --edge: clamp(14px, 1.25vw, 20px);
    --gap: clamp(10px, 0.9vw, 14px);
    --left-open: clamp(264px, 19vw, 312px);
    --right-open: clamp(330px, 24vw, 390px);
    --workflow-open: clamp(202px, 25vh, 236px);
    --rail: 52px;
    --left-used: var(--left-open);
    --right-used: var(--right-open);
    --workflow-used: var(--workflow-open);
    width: 100%;
    height: 100%;
    overflow: hidden;
    background:
      radial-gradient(circle at 51% 43%, rgba(255, 255, 255, 0.98) 0 14%, rgba(255, 255, 255, 0.57) 38%, transparent 69%),
      linear-gradient(135deg, #fbfaf7, #f5f2eb 74%, #fbfaf7);
    border-radius: 0;
  }

  .spatial-workspace[data-paths-open="false"] { --left-used: var(--rail); }
  .spatial-workspace[data-inspector-open="false"] { --right-used: var(--rail); }
  .spatial-workspace[data-workflow-open="false"] { --workflow-used: var(--rail); }
  .spatial-workspace::after { display: none; }

  .floating-panel {
    border: 1px solid rgba(20, 20, 20, 0.055);
    border-radius: 16px;
    box-shadow:
      0 16px 42px rgba(38, 34, 28, 0.085),
      inset 0 1px 0 rgba(255, 255, 255, 0.82);
  }

  .path-browser {
    top: var(--edge);
    right: auto;
    bottom: calc(var(--edge) + var(--workflow-used) + var(--gap));
    left: var(--edge);
    width: var(--left-used);
    height: auto;
    display: block;
  }

  .inspector {
    top: var(--edge);
    right: var(--edge);
    bottom: calc(var(--edge) + var(--workflow-used) + var(--gap));
    left: auto;
    width: var(--right-used);
    height: auto;
    display: block;
  }

  .workflow-panel {
    top: auto;
    right: var(--edge);
    bottom: var(--edge);
    left: calc(var(--edge) + var(--left-used) + var(--gap));
    width: auto;
    height: var(--workflow-used);
    display: block;
    padding: 0;
  }

  .discover-panel {
    top: var(--edge);
    right: calc(var(--edge) + var(--right-used) + var(--gap));
    left: calc(var(--edge) + var(--left-used) + var(--gap));
    width: auto;
    min-width: 0;
    min-height: 52px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 8px 9px 8px 13px;
    transform: none;
  }

  .discover-title {
    overflow: hidden;
    gap: 10px;
  }

  .discover-title h1 {
    max-width: 22ch;
    font-size: 0.78rem;
  }

  .discover-title > span {
    display: block;
    overflow: hidden;
    max-width: 21ch;
    margin-left: auto;
    color: var(--muted);
    font-size: 0.52rem;
    text-overflow: ellipsis;
  }

  .discover-panel .map-actions { gap: 5px; }
  .discover-panel .map-actions > button { max-width: none; }

  .path-browser.is-collapsed,
  .inspector.is-collapsed {
    bottom: auto;
    width: var(--rail);
    height: var(--rail);
  }

  .floating-panel.is-collapsed .panel-toggle {
    top: 11px;
    right: 11px;
  }

  .workflow-panel.is-collapsed .panel-toggle {
    top: 11px;
    right: 11px;
  }

  .path-system-card { display: none; }

  .workflow-panel .flow-list {
    gap: 10px;
    margin-top: 12px;
    padding-bottom: 7px;
  }

  .workflow-panel .flow-step {
    min-height: 100px;
    width: 152px;
    flex: 1 1 152px;
    grid-template-columns: 34px minmax(0, 1fr);
    grid-template-rows: 36px minmax(38px, auto);
    gap: 8px;
    padding: 11px;
    border-radius: 12px;
  }

  .workflow-panel .flow-logo {
    width: 34px;
    height: 34px;
    padding: 6px;
    border-radius: 9px;
  }

  .workflow-panel .flow-logo img {
    width: 22px;
    height: 22px;
  }

  .workflow-panel .flow-copy strong {
    padding-right: 22px;
    font-size: 0.64rem;
  }

  .workflow-panel .flow-copy p {
    font-size: 0.57rem;
    line-height: 1.35;
    -webkit-line-clamp: 3;
  }

  .workflow-panel .flow-num {
    top: 10px;
    right: 10px;
  }

  .workflow-hint { font-size: 0.56rem; }
}

@media (max-width: 1180px) {
  .path-browser,
  .inspector,
  .workflow-panel {
    display: block;
    padding: 0;
  }

  .floating-panel.is-collapsed {
    height: 54px !important;
    min-height: 54px;
  }

  .floating-panel.is-collapsed::before {
    top: 17px;
    left: 16px;
    writing-mode: initial;
    transform: none;
  }

  .path-browser.is-collapsed::before { content: "Anwendungsfälle"; }
  .inspector.is-collapsed::before { content: "Erklärung"; }

  .discover-panel {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .discover-title > span { display: block; }
}

@media (max-width: 720px) {
  .discover-panel {
    grid-template-columns: 1fr;
  }

  .discover-title > span { display: none; }
  .discover-panel .map-actions { justify-content: space-between; }
  .layer-menu-details > summary { padding-inline: 8px; }
  .layer-menu-popover {
    right: auto;
    left: 0;
    width: min(306px, calc(100vw - 44px));
  }
}

/* Syntrail Pfad-Check: sage is reserved for the active route and its controls. */
:root {
  --trail-accent: #557963;
  --trail-accent-dark: #355640;
  --trail-accent-soft: #edf2ee;
  --trail-accent-border: #b8c9bc;
}

#syntrailTrailArrow path {
  fill: none;
  stroke: var(--trail-accent-dark);
  stroke-width: 1.45;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.map-trail-halo,
.map-trail-arrow {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
  pointer-events: none;
}

.map-trail-halo {
  stroke: rgba(251, 250, 247, 0.96);
  stroke-width: 6.2;
  opacity: 1;
}

.map-trail-halo.is-branch {
  stroke-width: 4.8;
  opacity: 0.84;
}

.map-trail-line,
.map-trail-line:not(.is-branch) {
  stroke: var(--trail-accent);
  stroke-width: 3.45;
  stroke-dasharray: 7 7;
  stroke-linecap: round;
  opacity: 1;
  filter: drop-shadow(0 1.5px 2px rgba(53, 86, 64, 0.2));
}

.map-trail-line.is-branch {
  stroke: var(--trail-accent);
  stroke-width: 1.75;
  stroke-dasharray: 4 5;
  opacity: 0.58;
}

.map-trail-line:not(.is-branch).is-revealing {
  stroke-dasharray: 7 7;
  stroke-dashoffset: 0;
  animation: syntrailRouteReveal 380ms ease-out both;
  animation-delay: var(--trail-delay, 0ms);
}

.map-trail-line.is-branch.is-revealing {
  stroke-dasharray: 4 5;
  stroke-dashoffset: 0;
  animation: syntrailBranchReveal 460ms ease-out both;
  animation-delay: var(--trail-delay, 0ms);
}

.map-trail-arrow {
  stroke: rgba(53, 86, 64, 0.001);
  stroke-width: 1.5;
  opacity: 1;
}

.map-trail-arrow.is-branch { opacity: 0.58; }

.map-trail-arrow.is-revealing {
  opacity: 0;
  animation: syntrailArrowReveal 220ms ease-out forwards;
  animation-delay: var(--arrow-delay, 420ms);
}

@keyframes syntrailRouteReveal {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes syntrailArrowReveal {
  to { opacity: 1; }
}

@keyframes syntrailBranchReveal {
  from { opacity: 0; }
  to { opacity: 0.58; }
}

.tool-node.is-active,
.system-node.is-active {
  box-shadow:
    0 9px 23px rgba(38, 34, 28, 0.16),
    0 0 0 1.5px rgba(109, 126, 105, 0.72);
}

.tool-node.is-active::after,
.system-node.is-active::after,
.map-hub[data-step]::after {
  background: var(--trail-accent-dark);
}

.tool-node.is-active:not([data-step])::after,
.system-node.is-active:not([data-step])::after {
  display: none;
}

[data-trail-role]::before {
  content: attr(data-trail-role);
  position: absolute;
  z-index: 14;
  width: max-content;
  padding: 3px 6px;
  color: var(--white);
  background: var(--trail-accent-dark);
  border-radius: 999px;
  box-shadow: 0 3px 9px rgba(72, 90, 70, 0.2);
  font-family: var(--font-body);
  font-size: 0.43rem;
  font-weight: 760;
  line-height: 1;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  top: 50%;
  right: auto;
  bottom: auto;
  left: auto;
  transform: translateY(-50%);
}

[data-trail-role-side="left"]::before {
  right: calc(100% + 8px);
}

[data-trail-role-side="right"]::before {
  left: calc(100% + 8px);
}

.inspector {
  --inspector-pad: 16px;
  background: rgba(255, 255, 255, 0.94);
}

.inspector-head {
  padding: 14px var(--inspector-pad) 0;
  border-bottom: 0;
}

.inspector-product-line {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
  color: var(--ink);
  font-size: 0.56rem;
  font-weight: 760;
  letter-spacing: 0.075em;
  line-height: 1;
  text-transform: uppercase;
}

.inspector-product-line > span:nth-child(2) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inspector-product-line > span:last-child {
  flex: 0 0 auto;
  margin-left: auto;
  color: var(--muted);
  font-weight: 660;
  letter-spacing: 0.02em;
  text-transform: none;
}

.inspector-product-mark {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  display: grid;
  place-items: center;
  color: var(--white);
  background: var(--trail-accent-dark);
  border-radius: 50%;
  font-size: 0.72rem;
  letter-spacing: 0;
}

.inspector-head .problem-meta {
  gap: 5px;
  margin-bottom: 8px;
}

.inspector-head .problem-meta span {
  padding: 3px 6px;
  color: rgba(20, 20, 20, 0.66);
  background: rgba(243, 239, 231, 0.72);
  font-size: 0.51rem;
}

.inspector-head h2 {
  max-width: 27ch;
  margin-bottom: 4px;
  overflow: visible;
  font-family: var(--font-display);
  font-size: clamp(1.02rem, 1.35vw, 1.25rem);
  font-weight: 650;
  line-height: 1.12;
  letter-spacing: -0.026em;
  -webkit-line-clamp: 3;
}

.inspector-promise {
  color: var(--muted);
  font-size: 0.61rem;
  line-height: 1.35;
}

.inspector-tabs {
  position: relative;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  min-height: 38px;
  margin-top: 10px;
  padding: 0;
  background: transparent;
  border-bottom: 1px solid rgba(20, 20, 20, 0.08);
  border-radius: 0;
}

.inspector-tabs button {
  position: relative;
  min-width: 0;
  min-height: 38px;
  padding-inline: 3px;
  color: rgba(20, 20, 20, 0.66);
  background: transparent;
  border-radius: 0;
  font-size: 0.58rem;
  font-weight: 680;
  white-space: nowrap;
}

.inspector-tabs button::after {
  content: "";
  position: absolute;
  right: 9px;
  bottom: -1px;
  left: 9px;
  height: 2px;
  background: var(--trail-accent);
  border-radius: 99px 99px 0 0;
  opacity: 0;
  transform: scaleX(0.35);
  transition: opacity 160ms ease, transform 160ms ease;
}

.inspector-tabs button[aria-selected="true"] {
  color: var(--ink);
  background: transparent;
  box-shadow: none;
}

.inspector-tabs button[aria-selected="true"]::after {
  opacity: 1;
  transform: scaleX(1);
}

.inspector-view {
  padding: 15px var(--inspector-pad) 18px;
}

.inspector-story-section {
  min-height: 100%;
  padding: 2px 1px 8px;
}

.inspector-section-heading {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding-bottom: 13px;
  border-bottom: 1px solid rgba(20, 20, 20, 0.07);
}

.inspector-section-heading > span {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  color: var(--trail-accent-dark);
  background: var(--trail-accent-soft);
  border-radius: 50%;
  font-size: 0.55rem;
  font-weight: 760;
  font-variant-numeric: tabular-nums;
}

.inspector-section-heading .card-label {
  color: var(--trail-accent-dark);
  font-size: 0.51rem;
  letter-spacing: 0.075em;
}

.inspector-section-heading h3 {
  margin-top: 2px;
  font-family: var(--font-display);
  font-size: 0.83rem;
  font-weight: 650;
  line-height: 1.2;
  letter-spacing: -0.015em;
}

.inspector .problem-copy,
.inspector .solution-copy {
  margin-top: 16px;
  color: var(--ink-soft);
  font-size: 0.75rem;
  line-height: 1.5;
}

.solution-metric {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  margin-top: 17px;
  padding: 12px;
  background: var(--trail-accent-soft);
  border-radius: 12px;
}

.solution-metric > span {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  color: var(--white);
  background: var(--trail-accent-dark);
  border-radius: 50%;
  font-size: 0.8rem;
}

.solution-metric p {
  color: var(--ink-soft);
  font-size: 0.64rem;
  line-height: 1.42;
}

.solution-metric strong {
  display: block;
  color: var(--ink);
  font-weight: 720;
}

.execution-tool-strip {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 15px;
  padding: 0 2px 13px;
  overflow-x: auto;
  scrollbar-width: none;
}

.execution-tool-strip::-webkit-scrollbar { display: none; }

.execution-tool {
  position: relative;
  min-width: 42px;
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 0;
  background: transparent;
  border: 0;
  cursor: pointer;
}

.execution-tool > span {
  color: var(--muted);
  font-size: 0.47rem;
  font-weight: 720;
  font-variant-numeric: tabular-nums;
}

.execution-tool img {
  width: 33px;
  height: 33px;
  padding: 6px;
  object-fit: contain;
  background: rgba(255, 255, 255, 0.98);
  border-radius: 9px;
  box-shadow:
    0 5px 13px rgba(38, 34, 28, 0.1),
    0 0 0 1px rgba(20, 20, 20, 0.045);
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.execution-tool:hover img,
.execution-tool:focus-visible img {
  transform: translateY(-2px);
  box-shadow:
    0 8px 18px rgba(38, 34, 28, 0.13),
    0 0 0 1.5px rgba(109, 126, 105, 0.52);
}

.execution-tool > i {
  position: absolute;
  right: -8px;
  bottom: 8px;
  color: var(--trail-accent-dark);
  font-size: 0.7rem;
  font-style: normal;
}

.execution-copy {
  margin-top: 3px;
  color: var(--ink-soft);
  font-size: 0.67rem;
  line-height: 1.46;
}

.agent-role-block {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(20, 20, 20, 0.07);
}

.agent-role-block .card-label { font-size: 0.51rem; }

.agent-role-list {
  gap: 5px;
  margin-top: 7px;
}

.agent-role-list span {
  padding: 4px 7px;
  color: var(--ink-soft);
  background: rgba(243, 239, 231, 0.82);
  border-radius: 999px;
  font-size: 0.54rem;
}

.focused-step-card {
  margin-top: 14px;
  padding: 11px;
  background: var(--trail-accent-soft);
  border-radius: 12px;
}

.focused-step-card > img {
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 4px 11px rgba(38, 34, 28, 0.09);
}

.benefit-copy {
  margin-top: 16px;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 640;
  line-height: 1.42;
  letter-spacing: -0.012em;
}

.human-review-line {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 10px;
  margin-top: 17px;
  padding-top: 15px;
  border-top: 1px solid rgba(20, 20, 20, 0.07);
}

.human-review-line > span {
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  color: var(--white);
  background: var(--ink);
  border-radius: 50%;
  font-size: 0.65rem;
}

.human-review-line .card-label { font-size: 0.51rem; }

.human-review-line p:last-child {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.65rem;
  line-height: 1.42;
}

.inspector-evidence {
  margin-top: 15px;
  border-top: 1px solid rgba(20, 20, 20, 0.08);
}

.inspector-evidence > summary {
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--ink-soft);
  font-size: 0.58rem;
  font-weight: 680;
  list-style: none;
  cursor: pointer;
}

.inspector-evidence > summary::-webkit-details-marker { display: none; }
.inspector-evidence > summary::after { content: "+"; color: var(--trail-accent-dark); font-size: 0.9rem; }
.inspector-evidence[open] > summary::after { content: "−"; }

.inspector-evidence-content {
  padding-bottom: 6px;
}

.inspector .trust-strip,
.inspector .source-card {
  margin: 0;
  padding: 12px 0;
  color: var(--ink-soft);
  background: transparent;
  border-radius: 0;
}

.inspector .source-card {
  border-top: 1px solid rgba(20, 20, 20, 0.07);
}

.inspector .trust-strip .card-label,
.inspector .source-card .card-label {
  color: var(--muted);
  font-size: 0.49rem;
}

.inspector .trust-strip > p:last-child,
.inspector .source-card p:not(.card-label) {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.61rem;
  line-height: 1.42;
}

.inspector .source-card a {
  display: inline-block;
  margin-top: 7px;
  color: var(--ink);
  font-size: 0.59rem;
  font-weight: 690;
  text-decoration: none;
}

.inspector-foot a {
  color: var(--trail-accent-dark);
}

@media (prefers-reduced-motion: reduce) {
  .map-trail-line.is-revealing,
  .map-trail-line.is-branch.is-revealing,
  .map-trail-arrow.is-revealing {
    animation: none;
    stroke-dashoffset: 0;
    opacity: 1;
  }
}

@media (max-width: 720px) {
  .inspector { --inspector-pad: 14px; }
  .inspector-product-line { font-size: 0.53rem; }
  .inspector-head h2 { font-size: 1.05rem; }
  .execution-tool-strip { gap: 10px; }
}

.map-hub {
  color: rgba(20, 20, 20, 0.64);
  background: rgba(251, 250, 247, 0.93);
  border: 1px solid rgba(20, 20, 20, 0.15);
  box-shadow: 0 2px 7px rgba(38, 34, 28, 0.05);
  opacity: 0.84;
}

.map-hub.is-active,
.map-hub.is-layer-active,
.map-hub.has-owned-tool {
  color: var(--trail-accent-dark);
  background: rgba(251, 250, 247, 0.98);
  border-color: var(--trail-accent-border);
  box-shadow: 0 3px 9px rgba(38, 34, 28, 0.07);
}

.map-stage:not(.is-neutral) .map-core {
  box-shadow: 0 13px 30px rgba(38, 34, 28, 0.16);
}

.map-stage.is-system .map-trail-line.is-branch {
  stroke: rgba(20, 20, 20, 0.46);
  opacity: 0.3;
  filter: none;
}

.map-stage.is-system .map-trail-halo.is-branch,
.map-stage.is-system .map-trail-arrow.is-branch {
  display: none;
}

.map-stage[data-layer="skills"] .system-node[data-layer-node="skills"]:not(.is-active):not(.is-layer-active),
.map-stage[data-layer="skills"] [data-layer-line="skills"]:not(.is-layer-active) {
  display: none;
  opacity: 0;
  pointer-events: none;
}

.system-node[data-layer-node="skills"].is-active,
.system-node[data-layer-node="skills"].is-layer-active {
  width: max-content;
  min-width: 0;
  max-width: 128px;
  height: 29px;
  min-height: 29px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 5px;
  padding: 5px 8px;
  color: var(--trail-accent-dark);
  background: rgba(251, 250, 247, 0.98);
  border: 1px solid var(--trail-accent-border);
  border-radius: 999px;
  box-shadow:
    0 0 0 3px rgba(251, 250, 247, 0.9),
    0 4px 12px rgba(38, 34, 28, 0.08);
}

.system-node[data-layer-node="skills"].is-active .system-node-label,
.system-node[data-layer-node="skills"].is-layer-active .system-node-label {
  position: static;
  max-width: 92px;
  padding: 0;
  overflow: hidden;
  color: var(--trail-accent-dark);
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  font-size: 0.49rem;
  opacity: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
  transform: none;
}

.inspector-head {
  padding-right: 66px;
}

.execution-layer-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 0.5rem;
}

.execution-layer-label > span:first-child {
  color: var(--ink-soft);
  font-weight: 740;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.execution-tool-strip {
  margin-top: 7px;
}

.capability-block {
  margin-top: 15px;
  padding-top: 13px;
  border-top: 1px solid rgba(20, 20, 20, 0.07);
}

.capability-block[hidden] { display: none; }

.capability-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 10px;
}

.capability-heading .card-label {
  color: var(--trail-accent-dark);
  font-size: 0.51rem;
}

.capability-heading p:last-child {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.55rem;
  line-height: 1.35;
}

.capability-heading > button {
  min-height: 28px;
  flex: 0 0 auto;
  padding: 5px 8px;
  color: var(--trail-accent-dark);
  background: transparent;
  border: 1px solid var(--trail-accent-border);
  border-radius: 999px;
  font-size: 0.49rem;
  font-weight: 690;
  cursor: pointer;
}

.capability-heading > button[aria-pressed="true"] {
  background: var(--trail-accent-soft);
}

.capability-list {
  display: grid;
  margin-top: 8px;
}

.capability-list > button {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 7px;
  align-items: start;
  padding: 8px 0;
  text-align: left;
  background: transparent;
  border: 0;
  border-top: 1px solid rgba(20, 20, 20, 0.055);
  cursor: pointer;
}

.capability-list > button > span:first-child {
  width: 17px;
  height: 17px;
  display: grid;
  place-items: center;
  color: var(--trail-accent-dark);
  background: var(--trail-accent-soft);
  border-radius: 50%;
  font-size: 0.53rem;
}

.capability-list strong,
.capability-list small {
  display: block;
}

.capability-list strong {
  color: var(--ink);
  font-size: 0.61rem;
  font-weight: 690;
}

.capability-list small {
  margin-top: 1px;
  color: var(--muted);
  font-size: 0.55rem;
  line-height: 1.35;
}

.focused-capability-symbol { display: none; }

.focused-step-card.is-capability > img { display: none; }

.focused-step-card.is-capability .focused-capability-symbol {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  color: var(--trail-accent-dark);
  background: rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  box-shadow: 0 4px 11px rgba(38, 34, 28, 0.08);
  font-size: 0.8rem;
}

/* Tool-Atlas: website integration, readable controls and progressive execution details. */

.discover-title h1 { font-size: 1.0625rem; }
.discover-panel .card-label { font-size: 0.75rem; }
.map-home { font-size: 0.875rem; }
.layer-menu-details > summary,
.discover-panel .map-actions > button {
  font-size: 0.8125rem;
}
.discover-panel .map-zoom output { font-size: 0.75rem; }

.path-browser-title h2 { font-size: 1.25rem; }
.path-total { font-size: 0.8125rem; }
.path-browser .search-field input,
.tool-search-field input {
  font-size: 0.9375rem;
}
.path-browser .filter-chip,
.selected-tool-chips button {
  font-size: 0.8125rem;
}
.path-tile-area { font-size: 0.8125rem; }
.path-tile h3 { font-size: 0.9375rem; }
.path-tile-match,
.path-browser-foot .filter-status,
.path-browser-foot button {
  font-size: 0.8125rem;
}

.inspector-product-line { font-size: 0.6875rem; }
.inspector-head .problem-meta span { font-size: 0.6875rem; }
.inspector-head h2 {
  font-size: clamp(1.125rem, 1.35vw, 1.3rem);
}
.inspector-promise { font-size: 0.75rem; }
.inspector-tabs button { font-size: 0.75rem; }
.inspector-section-heading .card-label,
.agent-role-block .card-label,
.human-review-line .card-label {
  font-size: 0.6875rem;
}
.inspector-section-heading h3 { font-size: 1rem; }
.inspector .problem-copy,
.inspector .solution-copy {
  font-size: 0.8125rem;
}
.solution-metric p,
.execution-copy {
  font-size: 0.75rem;
}
.execution-tool > span { font-size: 0.6875rem; }
.execution-layer-label { font-size: 0.6875rem; }
.agent-role-list span { font-size: 0.6875rem; }
.capability-heading .card-label,
.capability-heading p:last-child,
.capability-heading > button {
  font-size: 0.6875rem;
}
.capability-list strong { font-size: 0.75rem; }
.capability-list small { font-size: 0.6875rem; }
.benefit-copy { font-size: 0.9rem; }
.human-review-line p:last-child { font-size: 0.75rem; }
.inspector-evidence > summary { font-size: 0.75rem; }
.inspector .trust-strip .card-label,
.inspector .source-card .card-label,
.inspector .trust-strip > p:last-child,
.inspector .source-card p:not(.card-label),
.inspector .source-card a,
.inspector-foot {
  font-size: 0.6875rem;
}

.workflow-panel-head h2 { font-size: 1.0625rem; }
.workflow-panel-head > span { font-size: 0.8125rem; }
.workflow-panel .flow-copy strong { font-size: 0.9375rem; }
.workflow-panel .flow-copy p,
.workflow-hint {
  font-size: 0.875rem;
}

.map-hub {
  min-height: 31px;
  padding: 7px 11px;
  font-size: 0.8125rem;
}
.tool-node .tool-label,
.system-node-label,
.system-node-symbol {
  font-size: 0.75rem;
}
[data-trail-role]::before { font-size: 0.75rem; }

.path-list-scroll:focus-visible,
.inspector-view:focus-visible {
  outline: 2px solid var(--trail-accent);
  outline-offset: -3px;
}

@media (min-width: 1181px) {
  .topbar {
    position: relative;
    top: 0;
    width: 100%;
    max-width: none;
    min-height: 64px;
    height: 64px;
    display: grid;
    margin: 0;
    padding: 0 clamp(20px, 2.5vw, 40px);
    background: rgba(251, 250, 247, 0.96);
    border: 0;
    border-bottom: 1px solid rgba(20, 20, 20, 0.07);
    border-radius: 0;
    box-shadow: none;
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
  }

  .explorer-app.shell {
    height: calc(100dvh - 64px);
  }

  .spatial-workspace {
    --left-open: clamp(288px, 20vw, 336px);
    --right-open: clamp(360px, 26vw, 420px);
    --workflow-open: clamp(218px, 27vh, 258px);
  }

  .path-browser {
    bottom: var(--edge);
  }
}

/* Canonical inspector system: one deliberate font pairing, three text levels. */
.inspector {
  --inspector-pad: clamp(18px, 1.5vw, 24px);
  --inspector-type-title: 1.5rem;
  --inspector-type-section: 1.0625rem;
  --inspector-type-text: 0.9375rem;
  font-family: var(--font-body);
  font-weight: 500;
}

.inspector-panel-content {
  grid-template-rows: auto minmax(0, 1fr) 52px;
}

.inspector > .panel-toggle {
  top: 14px;
  right: 14px;
  width: 44px;
  height: 44px;
  font-size: var(--inspector-type-section);
}

.inspector-head {
  padding: 20px 76px 0 var(--inspector-pad);
}

.inspector-head .problem-meta {
  display: flex;
  gap: 0;
  margin-bottom: 13px;
  overflow: visible;
}

.inspector-head .problem-meta span {
  padding: 0;
  color: var(--muted);
  background: transparent;
  border-radius: 0;
  font-family: var(--font-body);
  font-size: var(--inspector-type-text);
  font-weight: 500;
  line-height: 1.45;
}

.inspector-head .problem-meta span + span::before {
  content: "·";
  margin: 0 7px;
  color: rgba(20, 20, 20, 0.34);
}

.inspector-head h2 {
  max-width: 26ch;
  display: block;
  margin: 0;
  overflow: visible;
  font-family: var(--font-display);
  font-size: var(--inspector-type-title);
  font-weight: 650;
  line-height: 1.18;
  letter-spacing: -0.02em;
  -webkit-line-clamp: unset;
}

.inspector-tabs {
  min-height: 44px;
  margin-top: 20px;
}

.inspector-tabs button {
  min-height: 44px;
  padding-inline: 6px;
  font-family: var(--font-body);
  font-size: var(--inspector-type-text);
  font-weight: 500;
  line-height: 1;
}

.inspector-tabs button[aria-selected="true"] {
  font-weight: 500;
}

.inspector-view {
  padding: 22px var(--inspector-pad) 24px;
}

.inspector-story-section {
  min-height: 0;
  padding: 0;
}

.inspector-section-heading {
  display: block;
  padding: 0;
  border-bottom: 0;
}

.inspector-section-heading h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--inspector-type-section);
  font-weight: 650;
  line-height: 1.4;
  letter-spacing: -0.01em;
}

.inspector .card-label {
  font-family: var(--font-body);
  font-size: var(--inspector-type-text);
  font-weight: 500;
  line-height: 1.45;
  letter-spacing: 0;
  text-transform: none;
}

.inspector .problem-copy,
.inspector .solution-copy,
.solution-metric p,
.execution-copy,
.human-review-line p,
.focused-step-card strong,
.focused-step-card p:last-child {
  font-family: var(--font-body);
  font-size: var(--inspector-type-text);
  font-weight: 500;
  line-height: 1.55;
  letter-spacing: 0;
}

#activeAutomation {
  font-family: var(--font-body);
  font-size: var(--inspector-type-text);
  font-weight: 500;
  line-height: 1.55;
  letter-spacing: 0;
}

.inspector .problem-copy,
.inspector .solution-copy {
  margin-top: 18px;
}

.solution-metric {
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 12px;
  margin-top: 20px;
  padding: 15px;
}

.solution-metric > span {
  width: 34px;
  height: 34px;
  font-size: var(--inspector-type-section);
}

.execution-layer-label,
.execution-tool > span,
.agent-role-list span,
.capability-heading p:last-child,
.capability-heading > button,
.capability-list strong,
.capability-list small {
  font-family: var(--font-body);
  font-size: var(--inspector-type-text);
  font-weight: 500;
  line-height: 1.45;
  letter-spacing: 0;
}

.execution-layer-label {
  justify-content: flex-start;
  margin-top: 18px;
}

.execution-layer-label > span:first-child {
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}

.execution-tool-strip {
  gap: 10px;
  margin-top: 11px;
  padding-bottom: 17px;
}

.execution-tool {
  min-width: 52px;
  gap: 6px;
}

.execution-tool img {
  width: 40px;
  height: 40px;
  padding: 7px;
  border-radius: 10px;
}

.execution-tool > i {
  right: -7px;
  bottom: 10px;
  font-size: var(--inspector-type-section);
}

.execution-copy {
  margin-top: 5px;
}

.capability-heading > button {
  min-height: 44px;
  padding: 8px 11px;
  font-weight: 500;
}

.capability-list > button {
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 9px;
  min-height: 48px;
  padding: 10px 0;
}

.capability-list > button > span:first-child {
  width: 24px;
  height: 24px;
  font-size: var(--inspector-type-text);
}

.solution-metric strong,
.capability-list strong,
.focused-step-card strong {
  font-weight: 650;
}

.benefit-copy {
  margin-top: 18px;
  font-family: var(--font-display);
  font-size: var(--inspector-type-section);
  font-weight: 650;
  line-height: 1.45;
  letter-spacing: -0.01em;
}

.human-review-line {
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 12px;
  margin-top: 22px;
  padding-top: 20px;
}

.human-review-line > span {
  width: 34px;
  height: 34px;
  font-size: var(--inspector-type-text);
}

.human-review-line p {
  align-self: center;
  margin: 0;
  color: var(--ink-soft);
}

.inspector .human-review-line p:last-child {
  margin: 0;
  color: var(--ink-soft);
  font-size: var(--inspector-type-text);
  line-height: 1.55;
}

.human-review-line p strong {
  color: var(--ink);
  font-weight: 650;
}

.inspector-evidence {
  margin-top: 20px;
}

.inspector-evidence > summary,
.inspector .trust-strip .card-label,
.inspector .source-card .card-label,
.inspector .trust-strip > p:last-child,
.inspector .source-card p:not(.card-label),
.inspector .source-card a,
.inspector-foot {
  font-family: var(--font-body);
  font-size: var(--inspector-type-text);
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: 0;
}

.inspector-foot {
  justify-content: flex-end;
  padding: 0 var(--inspector-pad);
}

.inspector-foot a {
  font-weight: 650;
}

.inspector .source-card a {
  font-weight: 650;
}

/* Readable explorer rails: primary search first, secondary controls on demand. */
.path-browser > .panel-toggle,
.workflow-panel > .panel-toggle {
  width: 44px;
  height: 44px;
}

.path-browser.is-collapsed > .panel-toggle,
.inspector.is-collapsed > .panel-toggle,
.workflow-panel.is-collapsed > .panel-toggle {
  top: 4px;
  right: 4px;
}

.path-browser-title {
  padding-right: 52px;
}

.path-browser .search-field,
.tool-search-field {
  min-height: 44px;
}

.path-browser .search-field input,
.tool-search-field input {
  height: 43px;
  line-height: 1.4;
}

.path-filter-details {
  margin-top: 8px;
  border-top: 1px solid rgba(20, 20, 20, 0.07);
}

.path-filter-details > summary {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--ink-soft);
  font-size: 0.875rem;
  font-weight: 600;
  list-style: none;
  cursor: pointer;
}

.path-filter-details > summary::-webkit-details-marker {
  display: none;
}

.path-filter-details > summary::after {
  content: "+";
  color: var(--muted);
  font-size: 1rem;
}

.path-filter-details[open] > summary::after {
  content: "−";
}

.path-filter-options {
  padding-bottom: 10px;
}

.path-filter-options .tool-search-field {
  margin-top: 0;
}

.selected-tool-chips button,
.path-browser .filter-chip {
  min-height: 36px;
}

.path-list-scroll {
  padding-top: 6px;
}

.path-grid {
  gap: 4px;
}

.path-tile {
  min-height: 82px;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 10px;
  padding: 11px 12px;
}

.path-tile-index {
  font-size: 0.8125rem;
}

.path-tile h3 {
  margin-top: 4px;
  line-height: 1.3;
}

.path-tile-match {
  margin-top: 5px;
  line-height: 1.35;
}

.path-browser-foot {
  min-height: 44px;
  padding-inline: 13px;
}

.workflow-panel-content {
  grid-template-rows: auto minmax(0, 1fr);
  padding: 16px 18px 12px;
}

.workflow-panel-head {
  align-items: center;
  padding-right: 44px;
}

.workflow-panel .flow-list {
  gap: 10px;
  margin-top: 13px;
  padding-bottom: 7px;
}

.workflow-panel .flow-step {
  min-height: 118px;
  width: 180px;
  flex: 1 0 180px;
  grid-template-columns: 40px minmax(0, 1fr);
  grid-template-rows: 42px minmax(48px, auto);
  gap: 9px;
  padding: 12px;
  border-radius: 13px;
}

.workflow-panel .flow-num {
  top: 11px;
  right: 11px;
  width: 26px;
  height: 26px;
  font-size: 0.75rem;
}

.workflow-panel .flow-logo {
  width: 40px;
  height: 40px;
  padding: 7px;
  border-radius: 10px;
}

.workflow-panel .flow-logo img {
  width: 26px;
  height: 26px;
}

.workflow-panel .flow-copy strong {
  padding-right: 28px;
  line-height: 1.35;
}

.workflow-panel .flow-copy p {
  line-height: 1.45;
  -webkit-line-clamp: 3;
}

.map-core span {
  font-size: 0.75rem;
}

.map-core strong {
  font-size: 1rem;
}

.discover-title > span {
  font-size: 0.8125rem;
}

.tool-node.is-active .tool-label,
.tool-node.is-step-focus .tool-label,
.system-node.is-active .system-node-label,
.system-node.is-layer-active .system-node-label {
  font-size: 0.8125rem;
}

@media (max-width: 1180px) {
  .workflow-panel {
    height: 230px;
  }
}

/* The system layer is a first-class surface beside the workflow. */
.system-panel {
  min-width: 0;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.9);
}

.system-panel-content {
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
}

.system-panel-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 16px;
  align-items: end;
  padding: 16px 62px 12px 18px;
  border-bottom: 1px solid rgba(20, 20, 20, 0.08);
}

.system-panel-head .card-label {
  color: var(--muted);
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: 0;
  text-transform: none;
}

.system-panel-head h2 {
  margin-top: 2px;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 650;
  line-height: 1.25;
  letter-spacing: -0.012em;
}

.system-panel-head > span {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.35;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.system-layer-list {
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: thin;
}

.system-layer-list > button {
  width: 100%;
  min-width: 0;
  min-height: 54px;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) 22px;
  gap: 11px;
  align-items: center;
  padding: 9px 14px 9px 18px;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-bottom: 1px solid rgba(20, 20, 20, 0.07);
  text-align: left;
  cursor: pointer;
}

.system-layer-list > button:hover,
.system-layer-list > button:focus-visible,
.system-layer-list > button[aria-pressed="true"] {
  background: var(--trail-accent-soft);
}

.system-layer-list > button:focus-visible {
  outline: 2px solid var(--trail-accent);
  outline-offset: -2px;
}

.system-layer-symbol {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(20, 20, 20, 0.09);
  border-radius: 10px;
  color: var(--trail-accent-dark);
  background: rgba(251, 250, 247, 0.86);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 650;
}

.system-layer-copy {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2px;
}

.system-layer-copy span {
  min-width: 0;
  color: var(--muted);
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.3;
}

.system-layer-copy strong {
  min-width: 0;
  display: -webkit-box;
  overflow: hidden;
  color: var(--ink-soft);
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1.35;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.system-layer-arrow {
  color: var(--muted);
  font-size: 0.9375rem;
  text-align: right;
}

.system-panel > .panel-toggle {
  width: 44px;
  height: 44px;
}

.system-panel.is-collapsed::before {
  content: "System";
  position: absolute;
  z-index: 20;
  top: 18px;
  left: 16px;
  color: var(--muted);
  font-size: 0.6875rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.system-panel.is-collapsed > .panel-toggle {
  top: 4px;
  right: 4px;
}

@media (min-width: 1181px) {
  .spatial-workspace {
    --system-open: var(--right-open);
    --system-used: var(--system-open);
  }

  .spatial-workspace[data-system-open="false"] {
    --system-used: var(--rail);
  }

  .workflow-panel {
    right: calc(var(--edge) + var(--system-used) + var(--gap));
  }

  .system-panel {
    position: absolute;
    top: auto;
    right: var(--edge);
    bottom: var(--edge);
    left: auto;
    width: var(--system-used);
    height: var(--workflow-used);
    display: block;
  }

  .system-panel.is-collapsed {
    width: var(--rail);
    height: var(--rail);
  }

  .system-panel.is-collapsed::before {
    display: none;
  }
}

@media (max-width: 1180px) {
  .spatial-workspace {
    grid-template-areas:
      "discover discover"
      "paths map"
      "inspector inspector"
      "system system"
      "workflow workflow";
  }

  .system-panel {
    position: relative;
    inset: auto;
    grid-area: system;
    width: auto;
    min-height: 260px;
    display: block;
  }

  .system-layer-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .system-layer-list > button:nth-child(odd) {
    border-right: 1px solid rgba(20, 20, 20, 0.07);
  }

  .system-panel.is-collapsed {
    min-height: 54px;
    height: 54px !important;
  }
}

@media (max-width: 820px) {
  .spatial-workspace {
    grid-template-areas:
      "discover"
      "map"
      "paths"
      "inspector"
      "system"
      "workflow";
  }

  .system-panel-head {
    grid-template-columns: minmax(0, 1fr);
  }

  .system-panel-head > span {
    text-align: left;
    white-space: normal;
  }

  .system-layer-list {
    grid-template-columns: 1fr;
  }

  .system-layer-list > button:nth-child(odd) {
    border-right: 0;
  }
}

/* Eight business clusters stay readable without turning the map into label cards. */
.map-hub {
  width: auto;
  min-width: 96px;
  max-width: 144px;
  min-height: 36px;
  line-height: 1.15;
  white-space: normal;
  text-wrap: balance;
}

@media (max-width: 560px) {
  .map-hub {
    min-width: 78px;
    max-width: 112px;
    min-height: 32px;
    padding: 6px 8px;
  }
}

/* Fullscreen action mode: the map remains the spatial context, actions become the focus. */
.workflow-panel-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.workflow-panel-actions > span {
  color: var(--muted);
  font-size: 0.8125rem;
  font-weight: 500;
  white-space: nowrap;
}

.workflow-panel-actions > button {
  min-height: 36px;
  padding: 0 12px;
  color: var(--white);
  background: var(--ink);
  border: 0;
  border-radius: 10px;
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
}

body.action-mode-open {
  overflow: hidden;
}

.spatial-workspace.is-action-mode > .floating-panel {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.985);
}

.spatial-workspace.is-action-mode .map-layer {
  filter: saturate(0.72);
}

.action-stage {
  position: fixed;
  inset: 0;
  width: 100vw;
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 0;
  overflow: hidden;
  color: var(--ink);
  background:
    radial-gradient(circle at 50% 45%, rgba(255, 255, 255, 0.69) 0 18%, rgba(251, 250, 247, 0.77) 48%, rgba(243, 239, 231, 0.86) 100%);
  border: 0;
  -webkit-backdrop-filter: blur(4px) saturate(82%);
  backdrop-filter: blur(4px) saturate(82%);
}

.action-stage::backdrop {
  background: rgba(20, 20, 20, 0.12);
}

.action-stage[open] {
  display: block;
}

.action-stage-shell {
  width: 100%;
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto auto;
  gap: clamp(12px, 1.4vw, 22px);
  padding: clamp(18px, 2vw, 32px);
}

.action-stage-head {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(260px, 1fr) minmax(260px, auto) auto;
  gap: clamp(14px, 2vw, 30px);
  align-items: center;
}

.action-stage-brand {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 650;
  letter-spacing: -0.028em;
}

.action-stage-heading {
  min-width: 0;
}

.action-stage-heading .card-label {
  font-size: 0.75rem;
  font-weight: 500;
}

.action-stage-heading h2 {
  margin-top: 2px;
  font-family: var(--font-display);
  font-size: clamp(1.45rem, 2.6vw, 2.35rem);
  font-weight: 650;
  line-height: 1.08;
  letter-spacing: -0.025em;
}

.action-stage-heading > p:last-child {
  max-width: 68ch;
  margin-top: 5px;
  color: var(--ink-soft);
  font-size: 0.875rem;
  line-height: 1.5;
}

.action-stage-meta {
  min-width: 0;
  display: grid;
  gap: 5px;
  justify-items: end;
}

.action-stage-meta span {
  max-width: 34ch;
  overflow: hidden;
  padding: 5px 9px;
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid rgba(20, 20, 20, 0.07);
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.action-stage-close {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0 15px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(20, 20, 20, 0.09);
  border-radius: 12px;
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
}

.action-stage-close span {
  font-size: 1.15rem;
}

.action-stage-axis {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 8px 12px;
  color: var(--muted);
  border-top: 3px solid rgba(201, 218, 233, 0.86);
  border-bottom: 3px solid rgba(216, 213, 204, 0.74);
  font-size: 0.75rem;
}

.action-stage-axis strong {
  margin-right: 7px;
  color: var(--ink);
  font-weight: 500;
}

.action-stage-content {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(122px, 0.55fr) minmax(0, 5fr) minmax(148px, 0.7fr);
  gap: clamp(12px, 1.3vw, 20px);
  align-items: center;
}

.action-entry,
.action-result {
  min-width: 0;
  min-height: 116px;
  display: grid;
  place-content: center;
  gap: 7px;
  padding: 16px;
  text-align: center;
  background: rgba(255, 255, 255, 0.64);
  border: 1px solid rgba(20, 20, 20, 0.075);
  border-radius: 20px;
  box-shadow: 0 12px 32px rgba(38, 34, 28, 0.07);
}

.action-entry span,
.action-result span {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

.action-entry strong,
.action-result strong {
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1.4;
}

.action-result {
  color: var(--white);
  background: var(--ink);
}

.action-result span {
  color: rgba(255, 255, 255, 0.58);
}

.action-stage-steps {
  min-width: 0;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(164px, 1fr);
  gap: 12px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 18px 3px 22px;
  list-style: none;
  scroll-snap-type: x proximity;
  scrollbar-color: rgba(20, 20, 20, 0.2) transparent;
  scrollbar-width: thin;
}

.action-stage-steps[data-action-count="6"] {
  grid-auto-columns: minmax(140px, 1fr);
}

.action-stage-step {
  position: relative;
  min-width: 0;
  scroll-snap-align: center;
}

.action-stage-step:not(:last-child)::after {
  content: "→";
  position: absolute;
  z-index: 4;
  top: 50%;
  right: -11px;
  width: 12px;
  color: var(--muted);
  font-size: 0.9rem;
  text-align: center;
  transform: translateY(-50%);
}

.action-stage-step.is-handoff:not(:last-child)::after {
  content: "⇢";
  color: var(--ink);
}

.action-step-button {
  width: 100%;
  min-width: 0;
  min-height: 186px;
  height: 100%;
  display: grid;
  grid-template-rows: auto auto minmax(46px, 1fr) auto;
  gap: 10px;
  padding: 14px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(20, 20, 20, 0.075);
  border-radius: 18px;
  box-shadow: 0 14px 36px rgba(38, 34, 28, 0.075);
  text-align: left;
  cursor: pointer;
  transition: background 180ms ease, border-color 180ms ease, transform 180ms ease;
}

.action-step-button:hover,
.action-step-button:focus-visible {
  background: rgba(255, 255, 255, 0.92);
  transform: translateY(-2px);
}

.action-step-button[aria-current="step"] {
  background: rgba(201, 218, 233, 0.84);
  border-color: rgba(20, 20, 20, 0.13);
}

.action-step-top {
  min-width: 0;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}

.action-step-number,
.action-step-actor {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 500;
}

.action-step-actor {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.action-resource {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 9px;
}

.action-resource-logo,
.action-resource-symbol {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  padding: 7px;
  object-fit: contain;
  background: rgba(251, 250, 247, 0.9);
  border: 1px solid rgba(20, 20, 20, 0.07);
  border-radius: 11px;
}

.action-resource-symbol {
  color: var(--ink);
  font-size: 1rem;
  font-weight: 500;
}

.action-resource-copy {
  min-width: 0;
}

.action-resource-copy span,
.action-resource-copy strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.action-resource-copy span {
  color: var(--muted);
  font-size: 0.6875rem;
}

.action-resource-copy strong {
  margin-top: 1px;
  font-size: 0.8125rem;
  font-weight: 500;
}

.action-step-button > strong {
  align-self: start;
  font-family: var(--font-display);
  font-size: 0.9375rem;
  font-weight: 650;
  hyphens: auto;
  line-height: 1.3;
  overflow-wrap: break-word;
}

.action-step-boundaries {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.action-step-boundaries span {
  padding: 4px 7px;
  color: var(--muted);
  background: rgba(243, 239, 231, 0.74);
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 500;
}

.action-step-boundaries .is-connector {
  color: var(--ink);
  background: rgba(201, 218, 233, 0.82);
}

.action-step-boundaries .is-handoff {
  color: var(--ink);
  background: rgba(216, 213, 204, 0.76);
}

.action-contract {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 13px 20px;
  padding: 16px 18px;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid rgba(20, 20, 20, 0.075);
  border-radius: 18px;
  box-shadow: 0 14px 38px rgba(38, 34, 28, 0.075);
}

.action-contract > div {
  min-width: 0;
}

.action-contract span,
.action-contract strong {
  display: block;
}

.action-contract span {
  color: var(--muted);
  font-size: 0.6875rem;
  font-weight: 500;
}

.action-contract strong {
  margin-top: 2px;
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.action-stage-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 18px;
  color: var(--muted);
  font-size: 0.75rem;
}

.action-stage-foot span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.action-stage-foot i {
  display: inline-block;
  width: 12px;
  height: 12px;
  flex: 0 0 auto;
}

.action-legend-actor {
  border-radius: 50%;
  background: var(--ink);
}

.action-legend-resource {
  background: var(--white);
  border: 1px solid var(--stone);
  border-radius: 4px;
}

.action-legend-connector {
  height: 3px !important;
  border-radius: 999px;
  background: var(--blue);
}

.action-legend-handoff {
  height: 0 !important;
  border-top: 1px dashed var(--ink);
}

@media (max-width: 1100px) {
  .action-stage-shell {
    overflow-y: auto;
    grid-template-rows: auto auto auto auto auto;
  }

  .action-stage-head {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .action-stage-meta {
    grid-column: 2;
    grid-row: 2;
    justify-items: start;
  }

  .action-stage-close {
    grid-column: 3;
    grid-row: 1 / span 2;
  }

  .action-stage-content {
    min-height: 310px;
    grid-template-columns: 120px minmax(0, 1fr) 138px;
  }
}

@media (max-width: 760px) {
  .workflow-panel-head {
    align-items: center;
  }

  .workflow-panel-actions > span {
    display: none;
  }

  .action-stage {
    overflow-y: auto;
    background: rgba(243, 239, 231, 0.94);
  }

  .action-stage-shell {
    height: auto;
    min-height: 100%;
    display: block;
    padding: 16px;
  }

  .action-stage-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .action-stage-brand,
  .action-stage-meta {
    display: none;
  }

  .action-stage-close {
    grid-column: 2;
    grid-row: 1;
    align-self: start;
  }

  .action-stage-axis {
    display: grid;
    gap: 5px;
    margin-top: 18px;
  }

  .action-stage-content {
    display: block;
    margin-top: 18px;
  }

  .action-entry,
  .action-result {
    min-height: 0;
    padding: 14px;
  }

  .action-stage-steps {
    display: grid;
    grid-auto-flow: row;
    grid-auto-columns: auto;
    gap: 8px;
    overflow: visible;
    padding: 12px 0;
  }

  .action-stage-step:not(:last-child)::after {
    top: auto;
    right: 50%;
    bottom: -10px;
    transform: translateX(50%) rotate(90deg);
  }

  .action-step-button {
    min-height: 0;
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-rows: auto auto auto;
  }

  .action-step-top {
    grid-column: 1 / -1;
  }

  .action-step-button > strong {
    align-self: center;
  }

  .action-step-boundaries {
    grid-column: 1 / -1;
  }

  .action-contract {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 18px;
  }

  .action-stage-foot {
    justify-content: flex-start;
    margin-top: 16px;
  }
}

@media (max-width: 440px) {
  .workflow-panel-actions > button {
    padding-inline: 9px;
  }

  .action-stage-heading h2 {
    font-size: 1.35rem;
  }

  .action-stage-heading > p:last-child {
    display: none;
  }

  .action-stage-close {
    width: 44px;
    overflow: hidden;
    justify-content: center;
    padding: 0;
    font-size: 0;
  }

  .action-stage-close span {
    font-size: 1.2rem;
  }

  .action-contract {
    grid-template-columns: 1fr;
  }
}

/* Panel drawers v2: readable system layer, clean edge states and direct resizing. */
.floating-panel {
  transition:
    width 220ms cubic-bezier(0.22, 1, 0.36, 1),
    height 220ms cubic-bezier(0.22, 1, 0.36, 1),
    right 220ms cubic-bezier(0.22, 1, 0.36, 1),
    bottom 220ms cubic-bezier(0.22, 1, 0.36, 1),
    border-radius 180ms ease,
    box-shadow 180ms ease;
}

.floating-panel.is-resizing,
.spatial-workspace.is-resizing-panels .floating-panel {
  transition: none;
}

.spatial-workspace.is-resizing-panels {
  cursor: grabbing;
  user-select: none;
}

.panel-toggle {
  width: 42px;
  height: 42px;
  color: var(--ink);
  background: rgba(247, 244, 238, 0.94);
  border: 1px solid rgba(20, 20, 20, 0.07);
  border-radius: 12px;
  box-shadow: 0 5px 14px rgba(38, 34, 28, 0.05);
  font-size: 1rem;
  font-weight: 500;
}

.panel-toggle:hover,
.panel-toggle:focus-visible {
  background: var(--white);
  border-color: rgba(20, 20, 20, 0.15);
}

.panel-toggle:focus-visible,
.panel-resize-handle:focus-visible {
  outline: 2px solid var(--trail-accent);
  outline-offset: 2px;
}

.panel-toggle:focus-visible {
  outline-offset: -3px;
}

.panel-resize-handle {
  position: absolute;
  z-index: 23;
  display: block;
  padding: 0;
  touch-action: none;
  background: transparent;
  border: 0;
  border-radius: 999px;
  cursor: grab;
}

.panel-resize-handle:active {
  cursor: grabbing;
}

.panel-resize-handle > span {
  position: absolute;
  display: block;
  background: rgba(20, 20, 20, 0.2);
  border-radius: 999px;
  opacity: 0.45;
  transition: background 150ms ease, opacity 150ms ease, transform 150ms ease;
}

.floating-panel:hover > .panel-resize-handle > span,
.panel-resize-handle:hover > span,
.panel-resize-handle:focus-visible > span,
.floating-panel.is-resizing > .panel-resize-handle > span {
  background: var(--trail-accent-dark);
  opacity: 1;
}

.panel-resize-handle[data-resize-edge="left"],
.panel-resize-handle[data-resize-edge="right"] {
  top: 68px;
  bottom: 16px;
  width: 18px;
  cursor: ew-resize;
}

.panel-resize-handle[data-resize-edge="left"] {
  left: 0;
}

.panel-resize-handle[data-resize-edge="right"] {
  right: 0;
}

.panel-resize-handle[data-resize-edge="left"] > span,
.panel-resize-handle[data-resize-edge="right"] > span {
  top: 50%;
  left: 50%;
  width: 3px;
  height: 32px;
  transform: translate(-50%, -50%);
}

.panel-resize-handle[data-resize-edge="top"] {
  top: 0;
  right: 68px;
  left: 18px;
  height: 18px;
  cursor: ns-resize;
}

.panel-resize-handle[data-resize-edge="top"] > span {
  top: 50%;
  left: 50%;
  width: 34px;
  height: 3px;
  transform: translate(-50%, -50%);
}

.floating-panel.is-collapsed > .panel-resize-handle {
  display: none;
}

.system-panel {
  container-type: inline-size;
  min-width: 0;
  overflow: hidden;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(244, 248, 245, 0.94));
}

.system-panel-content {
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
}

.system-panel-head {
  display: block;
  padding: 20px 68px 16px 22px;
  border-bottom: 0;
}

.system-panel-title {
  min-width: 0;
}

.system-panel-head .card-label {
  color: var(--muted);
  font-size: 0.8125rem;
  line-height: 1.3;
}

.system-panel-content h2 {
  max-width: none;
  margin-top: 4px;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 2vw, 1.875rem);
  font-weight: 650;
  line-height: 1.12;
  letter-spacing: -0.025em;
  white-space: normal;
  text-wrap: balance;
}

.system-panel-head > span {
  width: fit-content;
  max-width: 100%;
  display: block;
  margin-top: 12px;
  padding: 6px 9px;
  overflow: visible;
  color: var(--trail-accent-dark);
  background: var(--trail-accent-soft);
  border: 1px solid var(--trail-accent-border);
  border-radius: 999px;
  font-size: 0.75rem;
  line-height: 1.3;
  text-align: left;
  text-overflow: clip;
  white-space: normal;
}

.system-layer-list {
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  align-content: start;
  padding: 4px 12px 14px;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-gutter: stable;
}

.system-layer-list > button {
  width: 100%;
  min-width: 0;
  min-height: 86px;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) 18px;
  gap: 10px;
  align-items: center;
  padding: 10px 11px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid rgba(20, 20, 20, 0.075);
  border-radius: 14px;
  box-shadow: 0 8px 18px rgba(38, 34, 28, 0.035);
}

.system-layer-list > button:nth-child(odd) {
  border-right: 1px solid rgba(20, 20, 20, 0.075);
}

.system-layer-list > button:hover,
.system-layer-list > button:focus-visible,
.system-layer-list > button[aria-pressed="true"] {
  background: rgba(226, 237, 234, 0.94);
  border-color: rgba(71, 101, 88, 0.2);
}

.system-layer-copy strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 0.9375rem;
  line-height: 1.3;
  -webkit-line-clamp: 2;
}

.system-layer-arrow {
  align-self: start;
  margin-top: 2px;
}

.workflow-panel {
  container-type: inline-size;
}

.workflow-panel-actions > button {
  white-space: nowrap;
}

@container (max-width: 600px) {
  .workflow-panel-actions > span {
    display: none;
  }

  .workflow-panel-head h2 {
    white-space: nowrap;
  }
}

@media (min-width: 1181px) {
  .spatial-workspace {
    --left-panel-width: clamp(288px, 21vw, 368px);
    --inspector-panel-width: clamp(380px, 28vw, 480px);
    --system-panel-width: clamp(420px, 36vw, 560px);
    --workflow-panel-height: clamp(230px, 29vh, 300px);
    --system-panel-height: clamp(330px, 46vh, 380px);
    --rail: 60px;
    --system-rail: 156px;
    --left-open: var(--left-panel-width);
    --right-open: var(--inspector-panel-width);
    --workflow-open: var(--workflow-panel-height);
    --system-open: var(--system-panel-width);
    --left-used: var(--left-open);
    --right-used: var(--right-open);
    --workflow-used: var(--workflow-open);
    --system-used: var(--system-open);
    --system-height-used: var(--system-panel-height);
  }

  .spatial-workspace[data-paths-open="false"] {
    --left-used: var(--rail);
  }

  .spatial-workspace[data-inspector-open="false"] {
    --right-used: var(--rail);
  }

  .spatial-workspace[data-workflow-open="false"] {
    --workflow-used: var(--rail);
  }

  .spatial-workspace[data-system-open="false"] {
    --system-used: var(--system-rail);
    --system-height-used: var(--rail);
  }

  .path-browser {
    width: var(--left-used);
  }

  .inspector {
    right: var(--edge);
    bottom: calc(var(--edge) + var(--system-height-used) + var(--gap));
    width: var(--right-used);
  }

  .workflow-panel {
    right: calc(var(--edge) + var(--system-used) + var(--gap));
    height: var(--workflow-used);
  }

  .system-panel {
    right: var(--edge);
    bottom: var(--edge);
    width: var(--system-panel-width);
    height: var(--system-panel-height);
  }

  .path-browser.is-collapsed {
    bottom: var(--edge);
    width: var(--rail);
    height: auto;
  }

  .inspector.is-collapsed {
    top: var(--edge);
    bottom: calc(var(--edge) + var(--system-height-used) + var(--gap));
    width: var(--rail);
    height: auto;
  }

  .system-panel.is-collapsed {
    width: var(--system-rail);
    height: var(--rail);
  }

  .workflow-panel.is-collapsed {
    height: var(--rail);
  }

  .floating-panel.is-collapsed {
    border-radius: 16px;
    box-shadow: 0 10px 24px rgba(38, 34, 28, 0.07);
  }

  .path-browser.is-collapsed::before,
  .inspector.is-collapsed::before {
    top: 50%;
    left: 50%;
    display: block;
    writing-mode: vertical-rl;
    transform: translate(-50%, -50%) rotate(180deg);
  }

  .path-browser.is-collapsed::before {
    content: "Anwendungsfälle";
  }

  .inspector.is-collapsed::before {
    transform: translate(-50%, -50%);
  }

  .workflow-panel.is-collapsed::before,
  .system-panel.is-collapsed::before {
    top: 50%;
    left: 18px;
    display: block;
    writing-mode: initial;
    transform: translateY(-50%);
  }

  .workflow-panel.is-collapsed::before {
    content: "Aktionspfad";
  }

  .system-panel.is-collapsed::before {
    content: "Systemebene";
  }

  .floating-panel.is-collapsed > .panel-toggle {
    top: 8px;
    right: 8px;
  }
}

@media (max-width: 1180px) {
  .panel-resize-handle {
    display: none;
  }

  .system-panel {
    width: auto;
    height: auto;
    min-height: 0;
  }

  .system-panel-content {
    height: auto;
    overflow: visible;
  }

  .system-panel-head {
    padding: 22px 74px 16px 22px;
  }

  .system-panel-head > span {
    max-width: min(100%, 64ch);
  }

  .system-layer-list {
    overflow: visible;
    padding: 4px 14px 16px;
  }

  .path-browser.is-collapsed,
  .inspector.is-collapsed,
  .system-panel.is-collapsed,
  .workflow-panel.is-collapsed {
    height: 64px !important;
    min-height: 64px;
    overflow: hidden;
  }

  .floating-panel.is-collapsed::before {
    top: 50%;
    left: 18px;
    display: block;
    writing-mode: initial;
    transform: translateY(-50%);
  }

  .path-browser.is-collapsed::before {
    content: "Anwendungsfälle";
  }

  .inspector.is-collapsed::before {
    content: "Erklärung";
  }

  .system-panel.is-collapsed::before {
    content: "Systemebene";
  }

  .workflow-panel.is-collapsed::before {
    content: "Aktionspfad";
  }

  .floating-panel.is-collapsed > .panel-toggle {
    top: 10px;
    right: 10px;
  }
}

@media (max-width: 620px) {
  .system-panel-head {
    padding: 20px 68px 14px 18px;
  }

  .system-panel-content h2 {
    font-size: 1.5rem;
  }

  .system-layer-list {
    grid-template-columns: 1fr;
    padding-inline: 10px;
  }

  .system-layer-list > button {
    min-height: 82px;
  }
}

/* Canonical spacing layer shared with the Syntrail website. */
:root {
  --atlas-space-xs: 8px;
  --atlas-space-sm: 12px;
  --atlas-space-md: 16px;
  --atlas-space-lg: 24px;
  --atlas-edge: clamp(12px, 1.25vw, 20px);
  --atlas-gap: clamp(12px, 1vw, 16px);
  --panel-pad: clamp(16px, 1.25vw, 22px);
  --panel-list-gutter: 8px;
  --panel-control-reserve: 58px;
  --control-height: 44px;
}

.topbar {
  padding-inline: var(--panel-pad);
}

.back-link,
.layer-menu-details > summary,
.discover-panel .map-actions > button,
.workflow-panel-actions > button,
.selected-tool-chips button,
.path-browser .filter-chip {
  min-height: var(--control-height);
}

.back-link,
.layer-menu-details > summary,
.discover-panel .map-actions > button,
.workflow-panel-actions > button {
  padding-inline: var(--atlas-space-md);
}

.discover-panel .map-zoom button {
  min-height: 36px;
}

.path-browser-head {
  padding:
    var(--panel-pad)
    calc(var(--panel-pad) + var(--panel-control-reserve))
    var(--atlas-space-sm)
    var(--panel-pad);
}

.path-browser-title {
  padding-right: 0;
}

.path-list-scroll {
  padding:
    var(--atlas-space-xs)
    var(--panel-list-gutter)
    var(--atlas-space-sm);
}

.path-grid {
  gap: var(--space-4, 4px);
}

.path-tile {
  gap: var(--atlas-space-sm);
  padding: var(--atlas-space-sm) 10px;
}

.path-browser-foot {
  min-height: 52px;
  padding: var(--atlas-space-xs) var(--panel-pad);
}

.inspector-head {
  padding:
    var(--panel-pad)
    0
    0
    var(--inspector-pad);
}

.inspector-head .problem-meta,
.inspector-head h2 {
  padding-right: calc(var(--panel-pad) + var(--panel-control-reserve));
}

.inspector-tabs {
  width: calc(100% - var(--inspector-pad));
  margin-right: var(--inspector-pad);
}

.inspector-view {
  padding:
    var(--atlas-space-lg)
    var(--inspector-pad);
}

.inspector-foot {
  min-height: 52px;
  padding-inline: var(--inspector-pad);
}

.workflow-panel-content {
  padding:
    var(--atlas-space-md)
    var(--panel-pad)
    var(--atlas-space-sm);
}

.workflow-panel-head {
  gap: var(--atlas-space-sm);
  padding-right: var(--panel-control-reserve);
}

.workflow-panel .flow-list {
  gap: var(--atlas-space-sm);
  margin-top: var(--atlas-space-sm);
}

.system-panel-head {
  padding:
    var(--panel-pad)
    calc(var(--panel-pad) + var(--panel-control-reserve))
    var(--atlas-space-md)
    var(--panel-pad);
}

.system-layer-list {
  gap: var(--atlas-space-xs);
  padding:
    var(--atlas-space-xs)
    var(--atlas-space-sm)
    var(--atlas-space-md);
}

.action-stage-shell {
  padding: clamp(18px, 2vw, 32px);
}

@media (min-width: 1181px) {
  .spatial-workspace {
    --edge: var(--atlas-edge);
    --gap: var(--atlas-gap);
  }
}

@media (max-width: 1180px) {
  .explorer-app {
    padding-block: var(--atlas-space-lg) var(--space-48, 48px);
  }

  .spatial-workspace {
    gap: var(--atlas-space-lg);
  }

  .system-panel-head {
    padding:
      var(--panel-pad)
      calc(var(--panel-pad) + var(--panel-control-reserve))
      var(--atlas-space-md)
      var(--panel-pad);
  }
}

@media (max-width: 560px) {
  .shell {
    width: min(calc(100% - 40px), var(--shell));
  }

  .topbar {
    width: min(calc(100% - 40px), 1180px);
    margin-top: 20px;
  }

  .path-browser-head {
    padding:
      var(--atlas-space-md)
      calc(var(--atlas-space-md) + var(--panel-control-reserve))
      var(--atlas-space-sm)
      var(--atlas-space-md);
  }

  .path-list-scroll {
    padding-inline: 6px;
  }

  .path-tile {
    padding-inline: 10px;
  }

  .path-browser-foot {
    padding-inline: var(--atlas-space-md);
  }

  .inspector-head {
    padding-top: var(--atlas-space-md);
  }

  .inspector-view {
    padding-block: var(--atlas-space-md);
  }

  .workflow-panel-content {
    padding: var(--atlas-space-md);
  }

  .system-panel-head {
    padding:
      var(--atlas-space-md)
      calc(var(--atlas-space-md) + var(--panel-control-reserve))
      var(--atlas-space-sm)
      var(--atlas-space-md);
  }

  .system-layer-list {
    padding-inline: var(--atlas-space-xs);
  }
}

@container (max-width: 520px) {
  .workflow-panel-head {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .workflow-panel-head h2 {
    white-space: normal;
  }

  .workflow-panel-actions {
    width: 100%;
    justify-content: flex-start;
  }
}
