/* Map, legend, links, nodes, and the selected route. */

.stage-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) 58px;
  min-width: 0;
  min-height: 0;
  background: var(--bg);
}

.stage-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  padding: 6px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.legend {
  flex-wrap: wrap;
  gap: 2px 4px;
  color: var(--muted);
  font-size: 10px;
}

.layer-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 5px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: inherit;
  font: inherit;
  line-height: 1.2;
  cursor: pointer;
}

.layer-toggle:hover {
  background: var(--panel-3);
  color: var(--text);
}

.layer-toggle[aria-pressed="true"] {
  background: color-mix(in srgb, var(--panel-3) 88%, transparent);
}

.layer-toggle.off {
  background: transparent;
  opacity: 0.38;
  text-decoration: line-through;
}

.layer-toggle i {
  pointer-events: none;
}

.legend-node {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--node-repeater);
}

.legend-node.companion {
  border-radius: 2px;
  background: var(--node-companion);
  transform: rotate(45deg) scale(0.8);
}

.legend-line {
  display: inline-block;
  width: 20px;
  border-top: 2px solid var(--radio);
}

.legend-line.mqtt {
  border-color: var(--mqtt);
  border-top-style: dashed;
}

.legend-line.exchange {
  border-color: var(--warning);
  border-top-width: 3px;
}

.legend-line.route {
  border-color: var(--success);
  border-top-width: 3px;
}

.legend-label {
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 9px;
  font-style: normal;
}

.payload-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2px 4px;
  max-width: 420px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 8px;
}

.payload-legend .txt { color: #a78bfa; }
.payload-legend .group { color: #22d3ee; }
.payload-legend .req { color: #fbbf24; }
.payload-legend .response { color: #fb923c; }
.payload-legend .advert { color: #f472b6; }
.payload-legend .path { color: #60a5fa; }
.payload-legend .ack { color: var(--success); }
.payload-legend .layer-toggle {
  font-family: inherit;
  font-size: inherit;
}

.clock {
  gap: 8px;
  margin-left: auto;
  color: var(--muted);
  font-size: 10px;
}

.zoom-controls {
  display: flex;
  align-items: center;
  gap: 3px;
  margin-right: 4px;
}

.zoom-value {
  min-width: 78px;
  white-space: nowrap;
  padding: 4px 6px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: var(--panel-2);
  color: var(--muted);
  font-size: 9px;
  cursor: pointer;
}

.clock label {
  display: flex;
  align-items: center;
  gap: 5px;
}

.clock select {
  width: auto;
  min-width: 4.6em;
  padding: 4px 6px;
}

.clock strong {
  min-width: 54px;
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  text-align: right;
}

.clock strong.is-held {
  color: var(--subtle);
}

.icon-button {
  width: 26px;
  height: 26px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--panel-3);
}

.record-button {
  height: 26px;
  padding: 0 9px;
  border: 1px solid var(--line-strong);
  border-radius: 13px;
  background: var(--panel-3);
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.record-button.arming {
  color: var(--accent);
  border-color: var(--accent);
}

.record-button.recording {
  color: var(--danger);
  border-color: var(--danger);
}

.record-button:disabled {
  opacity: 0.7;
  cursor: progress;
}

.stage {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background-color: var(--bg);
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 24px 24px;
}

.stage.panning,
.stage[data-tool="pan"] {
  cursor: grab;
}

.stage.panning {
  cursor: grabbing;
}

.stage:focus {
  outline: none;
}

.stage.osm-mode {
  background-color: #0e1116;
  background-image: none;
}

.osm-tiles {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background: #0e1116;
  pointer-events: none;
}

.osm-tiles img {
  position: absolute;
  max-width: none;
  opacity: var(--osm-tile-opacity, 0.55);
  filter: grayscale(1) invert(1) brightness(0.72) contrast(0.85);
  user-select: none;
}

#network-svg {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  opacity: var(--network-opacity, 1);
  user-select: none;
  touch-action: none;
}

.map-coordinate-controls {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 3;
  display: flex;
  align-items: end;
  gap: 5px;
  padding: 6px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: color-mix(in srgb, var(--panel) 92%, transparent);
}

.map-coordinate-controls label {
  display: grid;
  gap: 2px;
  color: var(--muted);
  font-size: 9px;
}

.map-coordinate-controls input {
  width: 104px;
  padding: 4px 5px;
}

.map-coordinate-controls .button {
  min-height: 27px;
  padding: 4px 8px;
}

.map-coordinate-fields {
  display: flex;
  align-items: end;
  gap: 5px;
}

.map-coordinate-toggle {
  align-self: center;
  width: 16px;
  height: 16px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.map-coordinate-toggle::before {
  content: "";
  display: block;
  width: 0;
  height: 0;
  margin: 0 auto;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  border-left: 5px solid currentColor;
  transform: rotate(90deg);
}

.map-coordinate-controls.is-collapsed .map-coordinate-toggle::before {
  transform: none;
}

.map-coordinate-controls.is-collapsed .map-coordinate-toggle {
  display: flex;
  align-items: center;
  width: auto;
  height: auto;
}

.map-coordinate-controls.is-collapsed .map-coordinate-toggle::after {
  content: "Координаты";
  margin-left: 6px;
  color: var(--muted);
  font-size: 11px;
}

.map-coordinate-controls.is-collapsed {
  align-items: center;
  padding: 4px 8px;
}

.map-coordinate-controls.is-collapsed .map-coordinate-fields {
  display: none;
}

.map-coordinate-toggle:hover {
  color: var(--text);
}

.map-dim-control {
  position: absolute;
  bottom: 10px;
  left: 10px;
  z-index: 3;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 6px 8px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: color-mix(in srgb, var(--panel) 92%, transparent);
  color: var(--muted);
  font-size: 11px;
}

.map-dim-control label {
  display: flex;
  align-items: center;
  gap: 8px;
}

.map-dim-name {
  width: 64px;
  flex: 0 0 auto;
}

.map-dim-control input {
  width: 120px;
  accent-color: var(--radio);
}

.map-dim-control span {
  min-width: 36px;
  color: var(--text);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.line-width-control {
  bottom: 10px;
}

.line-width-control .map-dim-name {
  width: 78px;
}

.stage.osm-mode .line-width-control {
  bottom: 108px;
}

.osm-attribution {
  position: absolute;
  right: 4px;
  bottom: 4px;
  z-index: 3;
  padding: 2px 4px;
  border-radius: 2px;
  background: rgba(14, 17, 22, 0.78);
  color: var(--muted);
  font-size: 9px;
}

.osm-attribution a {
  color: inherit;
  text-decoration: none;
}

.osm-attribution a:hover {
  color: var(--text);
}

.link {
  cursor: pointer;
  stroke-width: 2;
}

.link.radio {
  stroke: var(--radio);
  opacity: var(--link-quality-opacity, 1);
  stroke-width: var(--link-traffic-width, 2px);
}

.link.radio.selected,
.link.radio.exchange,
.link.radio.exchange-lost,
.link.radio.event-link,
.link.radio.event-fan {
  stroke-width: var(--link-traffic-width, 2px);
}

.link.radio.silent,
.link.radio.dir-dead {
  stroke: var(--danger);
}

.link.radio.directed {
  marker-end: url(#arrow-link);
}

.link-direction {
  pointer-events: none;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.link-direction.halo {
  stroke: var(--bg);
  stroke-width: 5;
}

.link-direction.mark {
  stroke: var(--radio);
  stroke-width: 2.25;
}

.link-direction.mark.silent {
  stroke: var(--danger);
}

.link-unheard-segment {
  pointer-events: none;
  stroke: var(--danger);
  stroke-linecap: butt;
  stroke-width: var(--link-traffic-width, 2px);
}

.link-unheard-cross {
  pointer-events: none;
  stroke: var(--danger);
  stroke-width: 2.5;
  stroke-linecap: round;
}

.traffic-packet.lost {
  fill: var(--danger);
  stroke: var(--danger);
  stroke-opacity: 0.35;
}

.traffic-label.lost {
  fill: var(--danger);
}

.link.mqtt {
  stroke: var(--mqtt);
  stroke-dasharray: 7 5;
}

.link.mqtt.disabled {
  opacity: 0.28;
  stroke-dasharray: 2 6;
}

.link-hit {
  cursor: pointer;
  stroke: transparent;
  stroke-width: 14;
}

.link.selected {
  stroke-width: 4;
  opacity: 1;
}

.link.dimmed,
.link-label.dimmed,
.link-direction.dimmed,
.link-unheard-segment.dimmed,
.link-unheard-cross.dimmed {
  opacity: 0.16;
}

.stage.has-selection-focus .link.dimmed,
.stage.has-selection-focus .link-label.dimmed,
.stage.has-selection-focus .link-direction.dimmed,
.stage.has-selection-focus .link-unheard-segment.dimmed,
.stage.has-selection-focus .link-unheard-cross.dimmed {
  opacity: 0.07;
}

.link.exchange {
  stroke: var(--warning);
  stroke-width: 4;
  opacity: 1;
}

.link.mqtt.exchange {
  stroke-dasharray: 7 5;
}

.link.exchange-lost {
  stroke: var(--danger);
  stroke-width: 3;
  stroke-dasharray: 3 4;
  opacity: 0.9;
}

.link.event-link {
  stroke: var(--accent);
  stroke-width: 5;
  opacity: 1;
}

.link.event-link.lost,
.link.event-link.outcome-lost,
.link.event-link.outcome-blocked {
  stroke: var(--danger);
  stroke-dasharray: 3 4;
}

.link.event-link.outcome-delivered,
.link.event-link.outcome-ack,
.link.event-link.outcome-path {
  stroke: var(--success);
}

.link.event-link.outcome-duplicate {
  stroke: var(--warning);
  stroke-dasharray: 3 4;
}

.link.event-link.outcome-tx,
.link.event-fan {
  stroke-width: 3;
  opacity: 1;
}

.link.event-muted,
.link-label.event-muted,
.link-direction.event-muted,
.link-unheard-segment.event-muted,
.link-unheard-cross.event-muted,
.node.event-muted {
  opacity: 0.28;
}

.node.event-muted .node-pulse {
  animation: none;
  opacity: 0;
}

.node.event-target .node-shape {
  stroke: var(--accent);
  stroke-width: 3;
  stroke-dasharray: 3 2;
}

.node.event-focus.outcome-lost .node-shape,
.node.event-focus.outcome-blocked .node-shape {
  stroke: var(--danger);
}

.node.event-focus.outcome-delivered .node-shape,
.node.event-focus.outcome-ack .node-shape,
.node.event-focus.outcome-path .node-shape {
  stroke: var(--success);
}

.node.event-focus.outcome-duplicate .node-shape {
  stroke: var(--warning);
}

#stage.has-event-focus #traffic-layer,
.route-line.event-context,
.route-hop.event-context {
  opacity: 0.16;
}

.event-flow {
  fill: none;
  pointer-events: none;
  stroke: var(--accent);
  stroke-linecap: round;
  stroke-width: 3.5;
}

.event-flow.medium-mqtt {
  stroke: var(--mqtt);
  stroke-dasharray: 8 5;
}

.event-flow.medium-intent,
.event-flow.outcome-duplicate {
  stroke-dasharray: 4 4;
}

.event-flow.outcome-lost,
.event-flow.outcome-blocked {
  stroke: var(--danger);
  stroke-dasharray: 4 4;
}

.event-flow.outcome-duplicate {
  stroke: var(--warning);
}

.event-flow.outcome-delivered,
.event-flow.outcome-ack,
.event-flow.outcome-path {
  stroke: var(--success);
}

.event-flow.outcome-tx,
.event-flow.outcome-sent {
  stroke: var(--radio);
}

.event-flow.medium-mqtt:not(.outcome-lost):not(.outcome-blocked) {
  stroke: var(--mqtt);
}

.event-stop {
  pointer-events: none;
  stroke: var(--danger);
  stroke-linecap: round;
  stroke-width: 2.5;
}

.event-badge {
  pointer-events: none;
}

.event-caption {
  fill: var(--text);
  font-size: 10px;
  font-weight: 700;
  paint-order: stroke;
  stroke: var(--bg);
  stroke-width: 3px;
  text-anchor: middle;
}

.event-badge.outcome-lost .event-caption,
.event-badge.outcome-blocked .event-caption {
  fill: var(--danger);
}

.event-badge.outcome-duplicate .event-caption {
  fill: var(--warning);
}

.event-badge.outcome-delivered .event-caption,
.event-badge.outcome-ack .event-caption,
.event-badge.outcome-path .event-caption {
  fill: var(--success);
}

.traffic-packet.halted {
  fill: var(--warning);
}

.link-label {
  fill: var(--muted);
  font-size: 10px;
  pointer-events: none;
}

.antenna-pattern {
  fill: color-mix(in srgb, var(--radio) 30%, transparent);
  stroke: color-mix(in srgb, var(--radio) 85%, white);
  stroke-width: 1.25;
}

.antenna-pattern.is-directional {
  cursor: grab;
}

.antenna-pattern.is-omni {
  pointer-events: none;
}

.antenna-pattern.is-selected {
  fill: color-mix(in srgb, var(--accent) 38%, transparent);
  stroke: var(--accent);
  stroke-width: 1.6;
}

.antenna-pattern.is-dimmed {
  opacity: 0.35;
}

.antenna-boresight,
.antenna-north {
  pointer-events: none;
}

.antenna-boresight {
  stroke: var(--text);
  stroke-width: 1.4;
}

.antenna-knob {
  fill: var(--text);
}

.antenna-north {
  fill: var(--muted);
  font-size: 10px;
  text-anchor: middle;
}

.stage.turning-antenna,
.stage.turning-antenna .antenna-pattern {
  cursor: grabbing;
}

.node {
  cursor: grab;
}

.stage[data-tool="connect"] .node {
  cursor: crosshair;
}

.node-hit {
  fill: transparent;
}

.node:active {
  cursor: grabbing;
}

.node-shape {
  stroke: var(--line-strong);
  stroke-width: 2;
}

.coverage-ring-track,
.coverage-ring {
  fill: none;
  stroke-width: 4;
  pointer-events: none;
}

.coverage-ring-track {
  stroke: color-mix(in srgb, var(--muted) 45%, transparent);
}

.coverage-ring {
  stroke: var(--accent);
  stroke-linecap: round;
}

.node.repeater .node-shape {
  fill: var(--node-repeater);
}

.node.companion .node-shape {
  fill: var(--node-companion);
}

.node.selected .node-shape {
  stroke: var(--text);
  stroke-width: 3;
}

.node.event-focus .node-shape {
  stroke: var(--accent);
  stroke-width: 5;
}

.node.event-from .node-shape {
  stroke: var(--warning);
  stroke-width: 4;
}

.node.dimmed {
  opacity: 0.34;
}

.stage.has-selection-focus .node.dimmed {
  opacity: 0.14;
}

.node.dimmed .node-pulse {
  animation: none;
  opacity: 0;
}

.node.on-exchange .node-shape {
  stroke: var(--warning);
  stroke-width: 3;
}

.node.exchange-unheard {
  opacity: 0.5;
}

.node.exchange-dead-end {
  opacity: 0.7;
  filter: grayscale(1);
}

.node.on-route .node-shape {
  stroke: var(--success);
  stroke-width: 3;
}

.node.on-route-ack .node-shape {
  stroke: var(--route-ack);
}

#overlay-layer {
  pointer-events: none;
}

.route-line {
  fill: none;
  stroke-width: 3.5;
  stroke-linecap: round;
  filter: drop-shadow(0 0 1px #0d0f12) drop-shadow(0 0 1px #0d0f12);
}

.route-line.kind-ack,
.route-line.kind-ack.is-focus { stroke-width: 5.5; }
.route-line.is-focus { stroke-width: 4.5; }
.route-line.is-dim,
.route-hop.is-dim { opacity: 0.28; }

.route-line.mqtt {
  stroke-dasharray: 6 4;
}

.route-hop {
  fill: currentColor;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 9px;
  font-weight: 700;
  paint-order: stroke;
  stroke: var(--bg);
  stroke-width: 3px;
  text-anchor: middle;
}

.node.connect-source .node-shape {
  stroke: var(--warning);
  stroke-width: 4;
}

.node-label,
.node-subtitle {
  text-anchor: middle;
}

.node-label {
  fill: var(--text);
  font-size: 12px;
  font-weight: 700;
}

.node-subtitle {
  fill: var(--muted);
  font-size: 9px;
}

.mqtt-mark {
  fill: var(--mqtt);
  stroke: var(--bg);
  stroke-width: 2;
}

.traffic-packet {
  pointer-events: none;
  stroke: var(--bg);
  stroke-width: 2;
}

.traffic-packet.radio {
  fill: var(--radio);
}

.traffic-packet.mqtt {
  fill: var(--mqtt);
}

.traffic-packet.type-txt-msg {
  fill: #a78bfa;
}

.traffic-packet.type-grp-txt,
.traffic-packet.type-grp-data {
  fill: #22d3ee;
}

.traffic-packet.type-req,
.traffic-packet.type-anon-req {
  fill: #fbbf24;
}

.traffic-packet.type-response {
  fill: #fb923c;
}

.traffic-packet.type-advert {
  fill: #f472b6;
}

.traffic-packet.type-raw-custom {
  fill: #94a3b8;
}

.traffic-packet.type-path {
  fill: #60a5fa;
}

.traffic-packet.type-ack {
  fill: var(--success);
}

.traffic-label {
  fill: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 9px;
  paint-order: stroke;
  pointer-events: none;
  stroke: var(--bg);
  stroke-width: 3px;
}

.node-pulse {
  fill: none;
  opacity: 0;
  pointer-events: none;
  stroke: var(--radio);
  stroke-width: 2;
}

.node.active .node-pulse {
  animation: pulse 0.75s ease-out infinite;
}

@keyframes pulse {
  0% {
    r: 22px;
    opacity: 0.7;
  }
  100% {
    r: 45px;
    opacity: 0;
  }
}

#coverage-layer {
  pointer-events: none;
}

.coverage-cell {
  fill: hsl(var(--coverage-hue, 152) 58% 42%);
  fill-opacity: 0.23;
  stroke: none;
}

.coverage-limit {
  fill: none;
  stroke: rgba(232, 236, 242, 0.36);
  stroke-width: 1.25;
  stroke-dasharray: 5 4;
}

.coverage-chips,
.coverage-chips.tour-spot {
  position: absolute;
  top: 12px;
  right: 12px;
  bottom: auto;
  left: auto;
  z-index: 6;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.coverage-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 240px;
  padding: 6px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: var(--panel-2);
  color: var(--text);
  font-size: 11px;
  cursor: pointer;
}

.coverage-chip i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: hsl(var(--coverage-hue, 152) 58% 42%);
  flex: none;
}

.coverage-chip:hover {
  filter: brightness(1.12);
}

.coverage-tip {
  position: absolute;
  z-index: 4;
  max-width: 280px;
  padding: 8px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: var(--panel-2);
  color: var(--text);
  font-size: 11px;
  line-height: 1.35;
  pointer-events: none;
}

.coverage-tip-card + .coverage-tip-card {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.coverage-tip-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
}

.coverage-tip-title i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: hsl(var(--coverage-hue, 152) 58% 42%);
  flex: none;
}

.coverage-tip-meta {
  color: var(--muted);
}

.stage-message {
  position: absolute;
  top: 12px;
  left: 50%;
  z-index: 2;
  max-width: 420px;
  padding: 8px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: var(--panel-2);
  color: var(--muted);
  font-size: 11px;
  transform: translateX(-50%);
}

.route-inspector {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 3;
  display: flex;
  flex-direction: column;
  width: min(380px, calc(100% - 24px));
  max-height: 42%;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: color-mix(in srgb, var(--panel) 94%, transparent);
  font-size: 11px;
  line-height: 1.45;
}

.route-inspector.is-collapsed {
  max-height: none;
}

.route-inspector-bar {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
  padding: 4px 4px 4px 6px;
  border-bottom: 1px solid var(--line);
  cursor: grab;
  user-select: none;
  touch-action: none;
}

.route-inspector.is-collapsed .route-inspector-bar {
  border-bottom: 0;
}

.route-inspector.is-dragging .route-inspector-bar {
  cursor: grabbing;
}

.route-inspector-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.04em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.route-inspector-collapse,
.route-inspector-close {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.route-inspector-collapse::before {
  content: "";
  display: block;
  width: 0;
  height: 0;
  margin: 0 auto;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  border-left: 5px solid currentColor;
  transform: rotate(90deg);
  transition: transform 180ms ease;
}

.route-inspector-collapse[aria-expanded="false"]::before {
  transform: none;
}

.route-inspector-body {
  min-height: 0;
  padding: 6px 10px 8px;
  overflow: auto;
}

.route-inspector.is-collapsed .route-inspector-body {
  display: none;
}

.route-inspector-collapse:hover,
.route-inspector-close:hover {
  color: var(--text);
}

.route-kicker {
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.route-event-message {
  margin: 3px 0 7px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 650;
}

.route-path {
  color: var(--success);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
}

.route-choice {
  display: block;
  width: 100%;
  margin: 4px 0 0;
  padding: 5px 7px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.route-choice.is-selected {
  border-color: var(--route-color, var(--success));
  background: color-mix(in srgb, var(--route-color, var(--success)) 16%, transparent);
}

.route-choice .route-path { color: var(--route-color, var(--success)); }
.route-choice.kind-ack .route-path { font-weight: 700; }

.route-exchange {
  margin-top: 4px;
  color: var(--warning);
  font-size: 10px;
}

.route-note {
  margin-top: 4px;
  color: var(--subtle);
  font-size: 10px;
}

.tour {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 4;
  display: flex;
  flex-direction: column;
  width: min(340px, calc(100% - 24px));
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel) 96%, transparent);
  box-shadow: 0 12px 32px rgb(0 0 0 / 35%);
}

.tour-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 6px 6px 12px;
  border-bottom: 1px solid var(--line);
}

.tour-kicker {
  flex: 1;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.tour-icon {
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.tour-icon:hover {
  color: var(--text);
}

.tour-art {
  height: 108px;
  margin: 10px 12px 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background:
    linear-gradient(180deg, rgb(255 255 255 / 3%), transparent 40%),
    var(--panel-3);
}

.tour-art svg {
  display: block;
  width: 100%;
  height: 100%;
}

.tour-title {
  margin: 10px 12px 0;
  font-size: 15px;
  font-weight: 650;
}

.tour-text {
  margin: 6px 12px 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.tour-wait {
  margin: 8px 12px 0;
  color: var(--warning);
  font-size: 12px;
  line-height: 1.4;
}

.tour-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px 12px;
}

.tour-nav .button {
  flex: 1;
}

.tour-progress {
  flex: 0 0 auto;
  color: var(--subtle);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.tour-spot {
  position: relative;
  z-index: 5;
  border-radius: 6px;
  animation: tour-spot-blink 1.8s ease-in-out infinite;
}

@keyframes tour-spot-blink {
  0%,
  100% {
    box-shadow: inset 0 0 0 2px rgb(251 113 133 / 45%);
  }
  50% {
    box-shadow: inset 0 0 0 4px #fb7185;
  }
}

.tour-arrow {
  position: fixed;
  inset: 0;
  z-index: 26;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: visible;
}

.tour-shade {
  position: fixed;
  inset: 0;
  z-index: 25;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.tour-welcome {
  position: fixed;
  inset: 2.5vh 2.5vw;
  z-index: 40;
  display: flex;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--panel);
  box-shadow: 0 24px 64px rgb(0 0 0 / 55%);
}

.tour-welcome-card {
  width: 100%;
  overflow: auto;
  padding: 48px 56px 40px;
}

.tour-welcome-close {
  position: absolute;
  top: 14px;
  right: 14px;
}

.tour-welcome-kicker {
  margin: 0;
  color: var(--accent);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.tour-welcome-card h2 {
  margin: 8px 0 0;
  font-size: 32px;
  line-height: 1.15;
}

.tour-welcome-lead {
  margin: 14px 0 0;
  max-width: 68ch;
  color: var(--text);
  font-size: 16px;
  line-height: 1.5;
}

.tour-welcome-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 22px;
}

.tour-feature {
  display: grid;
  grid-template-columns: 132px 1fr;
  gap: 12px;
  align-items: center;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
}

.tour-feature svg {
  width: 100%;
  height: 72px;
  border-radius: 6px;
  background: var(--panel-3);
}

.tour-feature h3 {
  margin: 0;
  font-size: 15px;
}

.tour-feature p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

@media (max-width: 860px) {
  .tour-welcome-grid,
  .tour-feature {
    grid-template-columns: 1fr;
  }
}

#tour-begin {
  margin-top: 24px;
  padding: 10px 16px;
  font-size: 14px;
}

.tour-dim {
  position: absolute;
  inset: 0;
  z-index: 3;
  background: rgb(6 8 10 / 62%);
  pointer-events: none;
  transition: opacity 800ms ease;
}

.tour-dim.is-fade {
  opacity: 0;
}

.tour.is-intro {
  animation: tour-card-pulse 1.15s ease-in-out 3;
}

@keyframes tour-card-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgb(96 165 250 / 0%);
  }
  45% {
    box-shadow:
      0 0 0 3px var(--accent),
      0 0 28px rgb(96 165 250 / 55%);
  }
}

#tour-next:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

#tour-next.is-waiting {
  animation: tour-next-blink 1.8s ease-in-out infinite;
}

@keyframes tour-next-blink {
  0%,
  100% {
    filter: brightness(1);
    box-shadow: 0 0 0 0 rgb(37 99 235 / 0%);
  }
  50% {
    filter: brightness(1.25);
    box-shadow: 0 0 0 4px rgb(96 165 250 / 45%);
  }
}

