@layer base {
  :root {
    --mix-canvas: #e8efed;
    --mix-surface: #fbfcfa;
    --mix-ink: #17231f;
    --mix-slate: #52645e;
    --mix-line: #c9d5d1;
    --mix-brand: #41685d;
    --mix-brand-deep: #2f4f46;
    --mix-action: #d9683a;
    --mix-support: #8fb8ad;
    --mix-danger: #a8412a;
    --mix-on-brand: #fbfcfa;
    --mix-brand-soft-bg: #dce8e4;
    --mix-brand-soft-border: #a8beb7;
    --font-body: "Albert Sans", sans-serif;
    --font-structure: "Albert Sans", sans-serif;
    --font-action: "Albert Sans", sans-serif;
    --font-mono: ui-monospace, "SFMono-Regular", menlo, monospace;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-pill: 999px;
    --shadow-sm: 0 8px 22px rgba(23, 35, 31, 0.08);
    --shadow-lg: 0 24px 64px rgba(23, 35, 31, 0.2);

    color: var(--mix-ink);
    background: var(--mix-canvas);
    font: 400 16px/1.5 var(--font-body);
  }

  * { box-sizing: border-box; }
  body { margin: 0; min-width: 320px; background: var(--mix-canvas); }
  button, input, select, textarea { font: inherit; }
  button, select { cursor: pointer; }
  button:disabled { cursor: not-allowed; opacity: 0.52; }
  :focus-visible { outline: 3px solid color-mix(in srgb, var(--mix-action) 68%, white); outline-offset: 3px; }
  [hidden] { display: none !important; }
}

.shell { min-height: 100dvh; }
.shell-topbar {
  position: sticky;
  z-index: 70;
  top: 0;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 24px;
  min-height: 68px;
  padding: 12px clamp(18px, 4vw, 64px);
  border-bottom: 1px solid var(--mix-line);
  background: color-mix(in srgb, var(--mix-canvas) 94%, transparent);
  backdrop-filter: blur(10px);
}
.shell-brand { color: var(--mix-ink); font: 700 20px/1 var(--font-action); letter-spacing: -0.03em; text-decoration: none; }
.shell-brand span { color: var(--mix-brand); font-weight: 500; }
.shell-auth { display: flex; align-items: center; gap: 12px; color: var(--mix-slate); font-size: 13px; }
.shell-auth button { border: 0; color: var(--mix-brand-deep); background: transparent; font-weight: 700; }
.route-mark { display: flex; align-items: center; max-width: 460px; }
.route-mark::before, .route-mark::after { width: 50%; height: 1px; background: var(--mix-brand-soft-border); content: ""; }
.route-mark i, .login-route i { width: 8px; height: 8px; flex: 0 0 auto; border: 2px solid var(--mix-brand); border-radius: 50%; background: var(--mix-canvas); }
.shell-main { width: 100%; padding: clamp(24px, 4vw, 56px) clamp(18px, 4vw, 64px); }
.shell-footer { padding: 24px clamp(18px, 4vw, 64px); color: var(--mix-slate); font-size: 13px; }
.build-commit { opacity: .7; font-variant-numeric: tabular-nums; }

.btn, .back-link, .mode-switch button, .section-nav button {
  min-height: 40px;
  border: 1px solid var(--mix-brand-soft-border);
  border-radius: var(--radius-md);
  padding: 9px 14px;
  color: var(--mix-brand-deep);
  background: var(--mix-surface);
  font: 700 13px/1.2 var(--font-action);
}
.btn-primary { border-color: var(--mix-action); color: white; background: var(--mix-action); }
.btn-secondary { color: var(--mix-brand-deep); background: transparent; }
.btn-danger { border-color: var(--mix-danger); color: white; background: var(--mix-danger); }
.btn:hover:not(:disabled), .walk-button:hover { border-color: var(--mix-brand); background: var(--mix-brand-soft-bg); }
.btn-primary:hover:not(:disabled) { border-color: #bd5229; color: white; background: #bd5229; }
input, select, textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--mix-line);
  border-radius: var(--radius-md);
  padding: 9px 11px;
  color: var(--mix-ink);
  background: var(--mix-surface);
}
textarea { resize: vertical; }

.catalog-section { padding: 18px 0 24px; border-top: 1px solid var(--mix-line); }
.catalog-section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 12px; }
.catalog-section-head h2 { margin: 0; font-size: 18px; }
.catalog-grid { grid-template-columns: 1fr; gap: 0; }
.catalog-section .walk-list { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }

.access-state { min-height: calc(100dvh - 180px); display: grid; place-items: center; padding: 40px 0; }
.login-card { position: relative; width: min(520px, 100%); padding: clamp(28px, 6vw, 58px); border: 1px solid var(--mix-line); border-radius: var(--radius-xl); background: var(--mix-surface); box-shadow: var(--shadow-sm); text-align: left; }
.login-card h1 { max-width: 12ch; margin-bottom: 14px; font-size: clamp(36px, 7vw, 64px); line-height: 0.98; letter-spacing: -0.04em; }
.login-card > p { max-width: 42ch; color: var(--mix-slate); }
.login-card form { display: grid; gap: 12px; margin-top: 28px; }
.login-route { position: absolute; top: 30px; right: 30px; display: flex; align-items: center; width: 116px; }
.login-route::before { width: 100%; height: 1px; background: var(--mix-brand-soft-border); content: ""; }
.login-route i:nth-child(2) { transform: translateY(10px); }
.login-route i:nth-child(3) { transform: translateY(-7px); }
.share-link { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-top: 14px; }

html {
  scroll-padding-top: 90px;
}

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

.shell-topbar,
.shell-main,
.shell-footer {
  grid-column: 1;
}

.shell-topbar {
  pointer-events: none;
}

.shell-topbar > * {
  pointer-events: auto;
}

.wm-main {
  width: min(1520px, 100%);
  max-width: none;
  min-width: 0;
}

.wm-main h1,
.wm-main h2,
.wm-main h3,
.wm-main p {
  margin-top: 0;
}

.wm-main h1 {
  margin-bottom: 4px;
  font-size: 30px;
  line-height: 1.08;
}

.wm-main h2 {
  margin-bottom: 8px;
  font-size: 19px;
}

.wm-main h3 {
  font-size: 15px;
}

.busy-status {
  position: fixed;
  z-index: 80;
  top: 78px;
  left: 50%;
  display: flex;
  align-items: center;
  gap: 9px;
  max-width: min(420px, calc(100vw - 32px));
  min-height: 40px;
  padding: 9px 12px;
  overflow: hidden;
  border: 1px solid var(--mix-brand-soft-border);
  border-radius: var(--radius-md);
  color: var(--mix-ink);
  background: var(--mix-surface);
  box-shadow: var(--shadow-sm);
  font: 600 13px/1.3 var(--font-structure);
  pointer-events: none;
  text-overflow: ellipsis;
  transform: translateX(-50%);
  white-space: nowrap;
}

.busy-status::before {
  width: 13px;
  height: 13px;
  flex: 0 0 auto;
  border: 2px solid var(--mix-line);
  border-top-color: var(--mix-brand);
  border-radius: 50%;
  animation: wm-busy-spin 700ms linear infinite;
  content: '';
}

@keyframes wm-busy-spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .busy-status::before { animation: none; }
}

.wm-head,
.workspace-head,
.workspace-actions,
.workspace-identity,
.transport,
.dialog-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.wm-head,
.workspace-head {
  justify-content: space-between;
}

.catalog-head {
  margin-bottom: 22px;
}

.eyebrow,
.count,
.rail-label,
.map-status,
.summary-list dt {
  margin-bottom: 5px;
  color: var(--mix-slate);
  font: 400 11px/1.3 var(--font-mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 16px;
}

.world-card,
.panel {
  min-width: 0;
  border: 1px solid var(--mix-line);
  border-radius: var(--radius-xl);
  background: color-mix(in srgb, var(--mix-surface) 94%, transparent);
  box-shadow: var(--shadow-sm);
}

.world-card {
  padding: 18px;
}

.world-card-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.world-card-head h2 {
  margin: 0;
}

.count {
  white-space: nowrap;
}

.walk-list,
.stop-list {
  display: grid;
  gap: 8px;
}

.walk-button {
  display: grid;
  gap: 3px;
  width: 100%;
  min-height: 58px;
  padding: 11px 12px;
  border: 1px solid var(--mix-line);
  border-radius: var(--radius-md);
  color: var(--mix-ink);
  background: var(--mix-surface);
  text-align: left;
  cursor: pointer;
}

.walk-button:hover,
.walk-button:focus-visible {
  border-color: var(--mix-brand-soft-border);
  box-shadow: var(--shadow-sm);
}

.walk-button span {
  font: 600 15px/1.2 var(--font-structure);
}

.walk-button small,
.empty-copy,
.inspector-head p,
.callout {
  color: var(--mix-slate);
}

.workspace-head {
  position: sticky;
  top: 68px;
  z-index: 30;
  margin: -10px -8px 0;
  padding: 12px 8px;
  background: color-mix(in srgb, var(--mix-canvas) 88%, transparent);
  backdrop-filter: blur(16px) saturate(1.2);
}

.workspace-identity {
  min-width: 0;
  align-items: start;
}

.workspace-identity h1 {
  max-width: 28ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-identity p {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  color: var(--mix-slate);
  font-size: 13px;
}

.back-link {
  min-height: 44px;
  padding: 0 8px;
  border: 0;
  color: var(--mix-brand-deep);
  background: transparent;
  font: 700 13px var(--font-action);
  white-space: nowrap;
  cursor: pointer;
}

.workspace-actions {
  justify-content: flex-end;
  flex-wrap: wrap;
}

.mode-switch {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--mix-line);
  border-radius: var(--radius-md);
  background: var(--mix-surface);
}

.mode-switch button,
.section-nav button {
  min-height: 38px;
  border: 0;
  border-radius: 6px;
  padding: 8px 13px;
  color: var(--mix-slate);
  background: transparent;
  font: 700 13px/1 var(--font-action);
  cursor: pointer;
  white-space: nowrap;
}

.mode-switch button.active {
  color: var(--mix-on-brand);
  background: var(--mix-brand);
}

.mode-switch button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.walk-picker select,
.wm-field input,
.wm-field textarea,
.wm-field select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--mix-line);
  border-radius: var(--radius-md);
  padding: 9px 11px;
  color: var(--mix-ink);
  background: var(--mix-surface);
  font: 400 14px/1.35 var(--font-structure);
}

.walk-picker select {
  width: 180px;
}

.wm-main .btn-primary {
  color: white;
  background: var(--mix-action);
  box-shadow: 0 8px 18px color-mix(in srgb, var(--mix-action) 24%, transparent);
}

.dirty {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--mix-ink);
  font-weight: 700;
}

.dirty::before {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--mix-action);
  content: '';
}

.message:not(:empty) {
  display: block;
  margin: 8px 0;
}

.section-nav {
  position: sticky;
  top: 150px;
  z-index: 24;
  display: flex;
  gap: 4px;
  margin: 8px 0 14px;
  padding: 5px;
  overflow-x: auto;
  border: 1px solid var(--mix-line);
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--mix-surface) 94%, transparent);
  scrollbar-width: none;
}

.section-nav button {
  min-height: 40px;
}

.section-nav button.active {
  color: var(--mix-brand-deep);
  background: var(--mix-brand-soft-bg);
}

.workspace-grid {
  display: grid;
  --wm-rail-w: 270px;
  --wm-inspector-w: 390px;

  grid-template-columns: minmax(360px, 1fr) var(--wm-rail-w) var(--wm-inspector-w);
  gap: 12px;
  height: min(720px, calc(100dvh - 230px));
  min-height: 560px;
}

@media (min-width: 1305px) {
  .workspace-grid > .map-panel { grid-row: 1; grid-column: 1; }
  .workspace-grid > .stop-rail { grid-row: 1; grid-column: 2; }
  .workspace-grid > .inspector,
  .workspace-grid > .simulator-panel { grid-row: 1; grid-column: 3; }

  .workspace-grid.stop-rail-hidden .inspector {
    grid-column: 2 / 4;
  }
}

.map-panel {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--mix-line);
  border-radius: var(--radius-xl);
  background: color-mix(in srgb, var(--mix-support) 22%, var(--mix-canvas));
  box-shadow: var(--shadow-sm);
}

#workspace-map {
  width: 100%;
  height: 100%;

  --map-ring: #FFFFFF;
  --map-accent: #4342A1;
  --map-on-accent: #FFFFFF;
  --map-contrast: #33383F;
}

#workspace-map[data-map-scheme='satellite'] {
  --map-ring: #10121A;
  --map-accent: #C6C5FF;
  --map-on-accent: #14152B;
  --map-contrast: #EEF0F6;
}

.add-menu-toggle {
  box-sizing: border-box;
  display: flex;
  width: 100%;
  min-height: 38px;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 14px;
}

/* A chevron that points down when collapsed and up when open, so the control reads as a
   disclosure rather than a plain button. */
.add-menu-caret {
  width: 8px;
  height: 8px;
  flex: none;
  border-right: 1.5px solid currentcolor;
  border-bottom: 1.5px solid currentcolor;
  margin-top: -3px;
  transform: rotate(45deg);
  transition: transform 150ms ease-out;
}

.add-menu-toggle[aria-expanded='true'] .add-menu-caret {
  margin-top: 3px;
  transform: rotate(-135deg);
}



.add-menu-panel {
  box-sizing: border-box;
  display: flex;
  width: 100%;
  margin-top: 6px;
  flex-direction: column;
  gap: 2px;
  padding: 6px;
  border: 1px solid var(--mix-line);
  border-radius: var(--radius-lg);
  background: var(--mix-canvas);
}

.add-menu-panel[hidden] {
  display: none;
}

.add-menu-item {
  box-sizing: border-box;
  width: 100%;
  display: flex;
  min-height: 44px;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 1px;
  margin: 0;
  padding: 7px 10px;
  border: 0;
  border-radius: var(--radius-md);
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.add-menu-item:hover,
.add-menu-item:focus-visible {
  background: color-mix(in srgb, var(--mix-brand) 8%, transparent);
}

.add-menu-item[aria-pressed='true'] {
  background: color-mix(in srgb, var(--mix-brand) 14%, transparent);
}

.add-menu-item-label {
  color: var(--mix-ink);
  font: 600 13px var(--font-structure);
}

.add-menu-item-note {
  color: var(--mix-slate);
  font: 400 12px var(--font-structure);
}

.add-menu-item-soon {
  cursor: default;
}

.add-menu-item-soon .add-menu-item-label,
.add-menu-item-soon .add-menu-item-note {
  color: var(--mix-slate);
}

.add-menu-search {
  display: flex;
  gap: 6px;
  padding: 6px 10px 8px;
}

.add-menu-search input {
  box-sizing: border-box;
  min-width: 0;
  flex: 1;
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid var(--mix-line);
  border-radius: var(--radius-md);
  color: var(--mix-ink);
  background: var(--mix-canvas);
  font: 400 13px var(--font-structure);
}

.add-menu-search input:focus-visible {
  border-color: var(--mix-brand);
}

#workspace-map.adding-stop {
  cursor: crosshair;
}

.walk-candidate-marker span {
  display: block;
  width: 14px;
  height: 14px;
  border: 2px solid var(--map-accent);
  border-radius: 50%;
  background: var(--map-ring);
}

.walk-candidate-marker.focused span {
  border-width: 3px;
  background: var(--map-accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--map-accent) 26%, transparent);
}

.candidate-list {
  display: flex;
  margin: 12px 0;
  flex-direction: column;
  gap: 4px;
  padding: 0;
  list-style: none;
}

.candidate-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px;
  border-radius: var(--radius-md);
}

.candidate-row.focused {
  background: color-mix(in srgb, var(--mix-brand) 10%, transparent);
}

.candidate-focus {
  display: flex;
  min-width: 0;
  min-height: 44px;
  flex: 1;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 1px;
  border: 0;
  border-radius: var(--radius-md);
  padding: 4px 6px;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.candidate-focus:hover,
.candidate-focus:focus-visible {
  background: color-mix(in srgb, var(--mix-brand) 8%, transparent);
}

.candidate-name {
  overflow: hidden;
  max-width: 100%;
  color: var(--mix-ink);
  font: 600 13px var(--font-structure);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.candidate-note {
  color: var(--mix-slate);
  font: 400 11px var(--font-mono);
  letter-spacing: 0.04em;
}

.candidate-count {
  margin: 2px 0 0;
  color: var(--mix-slate);
  font: 400 11px var(--font-mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.candidate-add {
  flex: none;
  min-height: 36px;
  padding: 0 12px;
}

.wm-splitter {
  z-index: 2;
  width: 12px;
  grid-row: 1;
  justify-self: start;
  margin-left: -12px;
  border-radius: 999px;
  cursor: col-resize;
  touch-action: none;
  /* A hairline at rest so the handle is discoverable without a hover hunt. */
  background: linear-gradient(var(--mix-line), var(--mix-line)) center / 2px 44px no-repeat;
  transition: background-size 150ms ease-out, background-color 150ms ease-out;
}

.wm-splitter[data-splitter='rail'] {
  grid-column: 2;
}

.wm-splitter[data-splitter='inspector'] {
  grid-column: 3;
}

.wm-splitter:hover,
.wm-splitter:focus-visible {
  background-color: var(--mix-brand-soft-border);
  background-size: 2px 100%;
}

/* Rail hidden means the inspector spans columns 2-3, so the rail handle already sits on
   its left edge and moves it 1:1. A second handle would land inside the inspector. */
.workspace-grid.stop-rail-hidden .wm-splitter[data-splitter='inspector'] {
  display: none;
}


.map-style {
  position: absolute;
  z-index: 500;
  top: 12px;
  right: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  border: 1px solid var(--mix-line);
  border-radius: var(--radius-md);
  color: var(--mix-slate);
  background: color-mix(in srgb, var(--mix-surface) 94%, transparent);
  box-shadow: var(--shadow-sm);
  font: 600 12px var(--font-structure);
}

.map-style select {
  min-height: 32px;
  border: 0;
  color: var(--mix-ink);
  background: transparent;
  font: 600 12px var(--font-structure);
}

.map-status {
  position: absolute;
  z-index: 500;
  left: 12px;
  bottom: 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 8px 10px;
  border: 1px solid var(--mix-line);
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--mix-surface) 92%, transparent);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(10px);
}

.route-key,
.legend-route {
  width: 20px;
  height: 4px;
  border-radius: 4px;
  background: var(--mix-brand);
}

.stop-rail,
.inspector,
.simulator-panel {
  min-height: 0;
  overflow: auto;
  padding: 14px;
}

.panel-head {
  padding: 2px 4px 10px;
  border-bottom: 1px solid var(--mix-line);
}

.panel-head h2 {
  margin: 0;
}

.stop-actions,
.map-edit-actions {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.stop-actions { grid-template-columns: minmax(0, 1fr); }

.map-edit-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.map-edit-actions .btn[aria-pressed="true"] {
  border-color: var(--mix-brand);
  background: var(--mix-brand-soft-bg);
}

.destructive-actions {
  margin-top: 24px;
  padding-top: 14px;
  border-top: 1px solid var(--mix-line);
}

.rail-row button {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  width: 100%;
  min-height: 58px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  padding: 8px;
  color: var(--mix-ink);
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.rail-row button:hover {
  background: color-mix(in srgb, var(--mix-brand) 6%, transparent);
}

.rail-row.selected button {
  border-color: var(--mix-brand-soft-border);
  background: var(--mix-brand-soft-bg);
}

.rail-row.visited .rail-index {
  color: var(--mix-on-brand);
  background: var(--mix-brand);
}

.rail-row.visited .nav-dot {
  background: var(--mix-brand);
}

.rail-row strong,
.rail-row small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rail-row strong {
  font-size: 13px;
}

.rail-row small {
  margin-top: 3px;
  color: var(--mix-slate);
  font: 400 10px var(--font-mono);
}

.rail-index {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 2px solid var(--mix-brand);
  border-radius: 50%;
  color: var(--mix-brand-deep);
  background: var(--mix-surface);
  font: 700 12px var(--font-action);
}

.nav-dot {
  width: 12px;
  height: 12px;
  margin-left: 8px;
  border: 3px solid var(--mix-surface);
  border-radius: 50%;
  background: var(--mix-support);
  box-shadow: 0 0 0 1px var(--mix-brand);
}

.rail-label {
  margin: 10px 8px 0;
  padding-top: 12px;
  border-top: 1px solid var(--mix-line);
}

.inspector-head {
  padding-bottom: 10px;
  border-bottom: 1px solid var(--mix-line);
}

.inspector-head h2 {
  margin-bottom: 6px;
}

.inspector-head p:last-child {
  margin-bottom: 0;
  font: 400 15px/1.45 var(--font-body);
}

.wm-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 6px;
  margin-top: 13px;
  color: var(--mix-ink);
  font: 600 13px/1.3 var(--font-structure);
}

.wm-field > span:first-child {
  color: var(--mix-ink);
}

.wm-field textarea {
  min-height: 100px;
  resize: vertical;
  font-family: var(--font-body);
  font-size: 16px;
}

.wm-field small {
  color: var(--mix-slate);
  font: 400 12px/1.4 var(--font-structure);
}

.coordinate-pair,
.test-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.trigger-coordinates {
  margin-top: 14px;
  border: 1px solid var(--mix-line);
  border-radius: var(--radius-md);
  padding: 10px;
}

.trigger-coordinates legend,
.trigger-vertex > span {
  color: var(--mix-ink);
  font: 600 12px/1.3 var(--font-structure);
}

.trigger-coordinates p {
  margin-bottom: 0;
  color: var(--mix-slate);
  font: 400 12px/1.4 var(--font-structure);
}

.trigger-vertex {
  grid-template-columns: auto repeat(2, minmax(0, 1fr));
  align-items: end;
}

.trigger-vertex > span {
  padding-bottom: 12px;
}

.input-unit {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.input-unit span {
  color: var(--mix-slate);
  font: 400 11px var(--font-mono);
}

.inspector-actions,
.transport {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.walk-tags {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--mix-line);
}

.walk-tags-head,
.walk-tags li,
.walk-tag-add {
  display: flex;
  align-items: center;
  gap: 8px;
}

.walk-tags-head {
  justify-content: space-between;
}

.walk-tags-head h3 {
  margin: 0;
}

.walk-tags-head span {
  color: var(--mix-slate);
  font: 400 11px var(--font-mono);
}

.walk-tags ul {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 12px 0;
  padding: 0;
  list-style: none;
}

.walk-tags li {
  padding: 5px 7px 5px 10px;
  border: 1px solid var(--mix-brand-soft-border);
  border-radius: var(--radius-pill);
  background: var(--mix-brand-soft-bg);
  font: 600 12px var(--font-structure);
}

.walk-tags li button {
  min-width: 32px;
  min-height: 32px;
  padding: 0;
  border: 0;
  color: var(--mix-brand-deep);
  background: transparent;
  cursor: pointer;
}

.walk-tag-add {
  margin-top: 9px;
}

.walk-tag-add :is(input, select) {
  min-width: 0;
  flex: 1;
}

.stop-audio-preview {
  display: grid;
  gap: 7px;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid var(--mix-line);
  border-radius: var(--radius-md);
  background: var(--mix-canvas);
}

.stop-audio-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.stop-audio-rate {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--mix-slate);
  font: 500 12px var(--font-structure);
}

.stop-audio-rate select {
  min-height: 36px;
  padding: 6px 28px 6px 9px;
}

.stop-audio-timeline {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.stop-audio-timeline input {
  width: 100%;
  accent-color: var(--mix-brand);
}

.stop-audio-timeline output {
  min-width: 70px;
  color: var(--mix-slate);
  font: 400 11px var(--font-mono);
  text-align: right;
}

.stop-audio-preview p {
  margin: 0;
  color: var(--mix-slate);
  font: 400 12px/1.4 var(--font-structure);
}

.stop-sources {
  margin-top: 14px;
  padding: 12px 0;
  border-top: 1px solid var(--mix-line);
  border-bottom: 1px solid var(--mix-line);
}

.stop-sources-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.stop-sources-head h3,
.stop-sources p {
  margin: 0;
}

.stop-sources-head span,
.stop-sources a small {
  color: var(--mix-slate);
  font: 400 10px/1.3 var(--font-mono);
}

.stop-sources ul {
  display: grid;
  gap: 2px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

.stop-sources a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 40px;
  padding: 7px 8px;
  border-radius: var(--radius-md);
  color: var(--mix-brand-deep);
  font: 600 13px/1.3 var(--font-structure);
  text-decoration: none;
}

.stop-sources a:hover,
.stop-sources a:focus-visible {
  background: var(--mix-brand-soft-bg);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.stop-sources p {
  margin-top: 8px;
  color: var(--mix-slate);
  font: 400 12px/1.4 var(--font-structure);
}

.summary-list {
  display: grid;
  gap: 0;
  margin: 14px 0;
}

.summary-list > div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--mix-line);
}

.summary-list dt,
.summary-list dd {
  margin: 0;
}

.summary-list dd {
  color: var(--mix-ink);
  text-align: right;
  font-weight: 600;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
  color: var(--mix-slate);
  font: 400 11px var(--font-mono);
}

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

.legend-stop,
.legend-nav {
  display: inline-block;
  width: 13px;
  height: 13px;
  border: 2px solid var(--mix-brand);
  border-radius: 50%;
}

.legend-nav {
  width: 9px;
  height: 9px;
  border: 0;
  background: var(--mix-support);
  box-shadow: 0 0 0 1px var(--mix-brand);
}

.route-editor {
  margin: 16px 0;
  padding: 14px;
  border: 1px solid var(--mix-line);
  border-radius: var(--radius-lg);
  background: var(--mix-canvas);
}

.route-editor .wm-field:first-child {
  margin-top: 0;
}

.route-anchor-list {
  display: grid;
  gap: 6px;
  margin-top: 12px;
}

.route-anchor-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--mix-line);
  border-radius: var(--radius-md);
  padding: 8px 10px;
  color: var(--mix-ink);
  background: var(--mix-surface);
  text-align: left;
  cursor: pointer;
}

.route-anchor-row.selected {
  border-color: var(--mix-brand-soft-border);
  background: var(--mix-brand-soft-bg);
}

.route-cues {
  display: grid;
  gap: 7px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--mix-line);
}

.route-cues > div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.route-cues h3 { margin: 0; }

.route-cue-row {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 7px 9px;
  border: 1px solid var(--mix-line);
  border-radius: var(--radius-md);
  color: var(--mix-ink);
  background: var(--mix-surface);
  text-align: left;
}

.route-cue-row small { color: var(--mix-slate); }
.route-cue-row.unassigned { border-color: var(--mix-danger); }

.route-anchor-row small,
.route-help,
.route-stale p,
.route-review p {
  margin-bottom: 0;
  color: var(--mix-ink);
}

.route-stale,
.route-review {
  margin-top: 16px;
  padding: 14px;
  border: 1px solid var(--mix-brand-soft-border);
  border-radius: var(--radius-lg);
  color: var(--mix-ink);
  background: var(--mix-brand-soft-bg);
}

.route-stale strong,
.route-review h3 {
  display: block;
  margin-bottom: 6px;
}

/* Qualified with .leaflet-marker-icon because Leaflet sets `display: block` on it at
   equal specificity and loads after this file — an unqualified rule loses, and the dot
   renders in the corner of the icon box instead of on its coordinate. */
.leaflet-marker-icon.walk-route-anchor {
  display: grid;
  place-items: center;
}

.walk-route-anchor span {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 3px solid var(--map-ring);
  border-radius: 5px;
  color: var(--map-on-accent);
  background: var(--map-accent);
  box-shadow: 0 3px 9px rgba(26, 26, 26, 0.28);
  font: 700 10px var(--font-action);
}

.walk-route-anchor.selected span {
  outline: 4px solid color-mix(in srgb, var(--mix-action) 55%, transparent);
}

.arc-list {
  margin-top: 18px;
}

.arc-beat {
  position: relative;
  margin-top: 12px;
  padding: 12px 12px 14px 42px;
  border: 1px solid var(--mix-line);
  border-radius: var(--radius-lg);
  background: var(--mix-canvas);
}

.arc-beat > span {
  position: absolute;
  top: 14px;
  left: 13px;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  color: var(--mix-on-brand);
  background: var(--mix-brand);
  font: 700 10px var(--font-action);
}

.arc-beat .wm-field:first-of-type {
  margin-top: 0;
}

.callout {
  margin-top: 16px;
  padding: 12px;
  border: 1px solid var(--mix-line);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--mix-support) 18%, transparent);
  font: 400 15px/1.45 var(--font-body);
}

.readiness {
  display: grid;
  gap: 8px;
  margin: 16px 0;
}

.ready {
  display: flex;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--mix-line);
  border-radius: var(--radius-md);
  color: var(--mix-brand-deep);
  background: var(--mix-brand-soft-bg);
  font-weight: 600;
}

.feed {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.feed > div {
  padding: 10px 11px;
  border: 1px solid var(--mix-line);
  border-radius: var(--radius-md);
  background: var(--mix-canvas);
  font: 400 15px/1.45 var(--font-body);
}

.metrics {
  margin-top: 14px;
  color: var(--mix-slate);
  font-size: 12px;
}

.access-state {
  padding: 80px 20px;
  text-align: center;
}

.leaflet-marker-icon.walk-stop-marker,
.leaflet-marker-icon.walk-nav-marker,
.leaflet-marker-icon.walk-listener-marker,
.leaflet-marker-icon.walk-trigger-center,
.leaflet-marker-icon.walk-trigger-vertex {
  display: grid;
  place-items: center;
  border-radius: 50%;
}

.walk-stop-marker.moving span {
  cursor: move;
  outline: 4px solid color-mix(in srgb, var(--mix-action) 55%, transparent);
}

.walk-trigger-center span,
.walk-trigger-vertex span {
  display: block;
  border: 3px solid var(--map-ring);
  border-radius: 50%;
  background: var(--mix-action);
  box-shadow: 0 1px 6px rgba(26, 26, 26, 0.28);
}

.walk-trigger-center span {
  width: 18px;
  height: 18px;
  cursor: move;
}

.walk-trigger-vertex span {
  width: 12px;
  height: 12px;
  cursor: grab;
}

.walk-listener-marker span {
  display: block;
  width: 20px;
  height: 20px;
  border: 4px solid var(--map-ring);
  border-radius: 50%;
  background: var(--map-contrast);
  box-shadow: 0 0 0 3px var(--mix-action), 0 3px 8px rgba(26, 26, 26, 0.24);
}

.walk-stop-marker span {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 3px solid var(--map-ring);
  border-radius: 50%;
  color: var(--map-on-accent);
  background: var(--map-accent);
  box-shadow: 0 3px 12px rgba(26, 26, 26, 0.24);
  font: 700 12px var(--font-action);
}

.walk-nav-marker span {
  display: block;
  width: 14px;
  height: 14px;
  border: 3px solid var(--map-ring);
  border-radius: 50%;
  background: var(--map-contrast);
  box-shadow: 0 0 0 1px var(--map-accent);
}

.walk-stop-marker.selected span,
.walk-nav-marker.selected span {
  outline: 4px solid color-mix(in srgb, var(--mix-action) 55%, transparent);
}

.visited {
  opacity: 0.55;
}

dialog {
  width: min(430px, calc(100vw - 32px));
  border: 1px solid var(--mix-line);
  border-radius: var(--radius-xl);
  padding: 22px;
  color: var(--mix-ink);
  background: var(--mix-surface);
  box-shadow: var(--shadow-lg);
}

dialog::backdrop {
  background: rgba(15, 15, 20, 0.5);
  backdrop-filter: blur(3px);
}

.dialog-actions {
  flex-wrap: wrap;
  margin-top: 18px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 1304px) {
  .wm-splitter { display: none; }

  .workspace-grid {
    grid-template-columns: minmax(0, 1fr);
    height: auto;
    min-height: 0;
  }

  .map-panel {
    height: 520px;
  }

  .stop-rail {
    max-height: 360px;
  }
}

@media (max-width: 900px) {
  .walk-tags li button {
    min-width: 44px;
    min-height: 44px;
  }

  .workspace-head {
    position: static;
    align-items: stretch;
    flex-direction: column;
  }

  .workspace-actions {
    justify-content: flex-start;
  }

  .workspace-actions .btn-primary,
  .walk-picker,
  .walk-picker select {
    width: 100%;
  }

  .mode-switch {
    width: 100%;
  }

  .mode-switch button {
    flex: 1;
    min-height: 44px;
  }

  .section-nav {
    position: static;
    margin-inline: -2px;
  }

  .section-nav button {
    min-height: 44px;
  }

  .workspace-grid {
    display: flex;
    flex-direction: column;
    height: auto;
    min-height: 0;
  }

  .map-panel {
    order: 1;
    height: min(54dvh, 420px);
    min-height: 320px;
  }

  .stop-rail {
    order: 2;
    max-height: 360px;
  }

  .inspector,
  .simulator-panel {
    order: 3;
    max-height: none;
  }

  .coordinate-pair,
  .test-options {
    grid-template-columns: 1fr;
  }

  .wm-main :is(.btn, button, select, input) {
    min-height: 44px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .wm-main *,
  .wm-main *::before,
  .wm-main *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
