/* ROUTING — route option cards, maneuver glyphs, lane row. Prefix: .rt-
   Design v2: clean white cards (Google-like), accent bar in the route colour, line icons,
   selected = violet ring + soft tint. Tokens only; dark mode follows. */

.rt-options {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  min-width: 0;
}

/* ---------- card ---------- */
.rt-card {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: stretch;
  min-width: 0;
  min-height: 44px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-1);
  cursor: pointer;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease), transform 110ms var(--ease);
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.rt-card:hover { border-color: var(--line-strong); }
.rt-card:active { transform: scale(.985); }
.rt-card:focus-visible { outline: none; box-shadow: var(--focus-ring), var(--shadow-1); border-radius: var(--r-md); }
.rt-card.is-sel {
  border-color: transparent;
  background: color-mix(in srgb, var(--primary-soft) 58%, var(--surface));
  box-shadow: inset 0 0 0 1.5px var(--primary), var(--shadow-1);
}
.rt-card.is-sel:focus-visible { box-shadow: inset 0 0 0 1.5px var(--primary), var(--focus-ring); }

/* accent bar: the route's colour on the map (selected = main route, others = grey alternatives) */
.rt-strip {
  display: block;
  width: 4px;
  margin: 12px 0 12px 12px;
  border-radius: 4px;
  background: var(--route-alt);
  transition: background var(--dur) var(--ease);
}
.rt-card.is-sel .rt-strip { background: var(--rt-sel, var(--route-main)); }
.rt-strip-est { background: repeating-linear-gradient(180deg, var(--route-alt) 0 6px, transparent 6px 10px); }
.rt-card.is-sel .rt-strip-est { background: repeating-linear-gradient(180deg, var(--rt-sel, var(--route-main)) 0 6px, transparent 6px 10px); }

.rt-body {
  min-width: 0;
  padding: 12px 8px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* radio check (right) */
.rt-check {
  align-self: flex-start;
  margin: 12px 12px 0 0;
  width: 24px; height: 24px;
  display: grid; place-items: center;
  flex: 0 0 auto;
  border-radius: 50%;
  border: 1.5px solid var(--line-strong);
  background: var(--surface);
  color: transparent;
  transition: background var(--dur), border-color var(--dur), color var(--dur), transform var(--dur) var(--ease-bounce);
}
.rt-card.is-sel .rt-check {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--primary-ink);
  transform: scale(1.04);
}

.rt-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  min-width: 0;
}
.rt-label {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--fs-md);
  line-height: 1.3;
  color: var(--ink);
  min-width: 0;
  overflow-wrap: anywhere;
}
.rt-tags { display: inline-flex; flex-wrap: wrap; gap: 4px; min-width: 0; }
.rt-tag { white-space: normal; }

/* big duration: numbers large, units small */
.rt-main {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 10px;
  min-width: 0;
  margin-top: 2px;
}
.rt-dur {
  font-family: var(--font-num);
  font-weight: 700;
  font-size: var(--fs-sm);
  line-height: 1.15;
  color: var(--ink-2);
  overflow-wrap: anywhere;
}
.rt-dur b {
  font-weight: 800;
  font-size: 1.625rem;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin-right: 1px;
}
.rt-dist {
  font-size: var(--fs-sm);
  font-weight: 400;
  color: var(--ink-2);
  white-space: nowrap;
}
.rt-delta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--fs-sm);
  color: var(--ink-2);
  min-width: 0;
  overflow-wrap: anywhere;
}
div.rt-delta { display: flex; }
.rt-delta.rt-best { color: var(--ok); font-weight: 700; }
.rt-delta > svg { flex: 0 0 auto; }
.rt-via {
  font-size: var(--fs-sm);
  color: var(--ink-2);
  overflow-wrap: anywhere;
}
.rt-flags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin-top: 2px;
  font-size: var(--fs-xs);
  color: var(--ink-2);
  min-width: 0;
}
.rt-flag { display: inline-flex; align-items: center; gap: 5px; min-width: 0; }
.rt-flag > svg { flex: 0 0 auto; color: var(--ink-3); }
.rt-flag > span { min-width: 0; overflow-wrap: anywhere; }
.rt-flag-muted { color: var(--ink-3); }

.rt-warns {
  list-style: none;
  margin: 6px 0 0;
  padding: 8px 10px;
  border-radius: var(--r-sm);
  background: var(--sun-soft);
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: var(--fs-xs);
  line-height: 1.45;
  color: var(--ink);
  min-width: 0;
}
.rt-warns li { display: flex; gap: 6px; align-items: flex-start; min-width: 0; }
.rt-warns li > svg { flex: 0 0 auto; margin-top: 1px; color: var(--warn); }
.rt-warns li > span { min-width: 0; overflow-wrap: anywhere; }
.rt-notes { background: var(--sky-soft); }
.rt-notes li > svg { color: var(--info); }

/* ---------- compact rows ---------- */
.rt-compact { gap: 6px; }
.rt-c .rt-strip { margin: 10px 0 10px 10px; }
.rt-c .rt-body { padding: 9px 6px 9px 10px; gap: 2px; justify-content: center; }
.rt-c .rt-check { align-self: center; margin: 0 10px 0 0; width: 22px; height: 22px; }
.rt-c .rt-check svg { width: 12px; height: 12px; }
.rt-row {
  display: flex;
  align-items: baseline;
  gap: 6px 10px;
  min-width: 0;
}
.rt-c .rt-label {
  flex: 1 1 auto;
  min-width: 0;
  font-size: var(--fs-sm);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rt-c .rt-dur { font-size: var(--fs-xs); white-space: nowrap; flex: 0 0 auto; }
.rt-c .rt-dur b { font-size: var(--fs-lg); font-weight: 700; }
.rt-c .rt-sub { font-size: var(--fs-xs); align-items: center; }
.rt-c .rt-meta {
  flex: 1 1 auto;
  min-width: 0;
  color: var(--ink-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rt-ficons { display: inline-flex; align-items: center; gap: 4px; flex: 0 0 auto; color: var(--ink-3); }
.rt-ficon { display: inline-grid; }
.rt-c .rt-delta { font-size: var(--fs-xs); white-space: nowrap; flex: 0 0 auto; }
.rt-warn-dot { flex: 0 0 auto; align-self: center; display: inline-grid; color: var(--warn); }
.rt-cnote {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-top: 5px;
  padding: 6px 8px;
  border-radius: var(--r-xs);
  background: var(--sun-soft);
  font-size: var(--fs-xs);
  line-height: 1.45;
  color: var(--ink);
  min-width: 0;
}
.rt-cnote > span { display: flex; gap: 6px; align-items: flex-start; min-width: 0; }
.rt-cnote > span > span { min-width: 0; overflow-wrap: anywhere; }
.rt-cnote svg { flex: 0 0 auto; margin-top: 1px; }
.rt-cn-warn svg { color: var(--warn); }
.rt-cn-note svg { color: var(--info); }

/* ---------- loading / empty ---------- */
.rt-skel { cursor: default; box-shadow: none; }
.rt-skel .rt-strip { background: var(--line-strong); }
.rt-empty {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4) var(--sp-3) var(--sp-3);
  border-radius: var(--r-md);
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--ink-2);
  font-size: var(--fs-sm);
  min-width: 0;
}
.rt-empty > span:last-child { min-width: 0; overflow-wrap: anywhere; }
.rt-empty-ico {
  flex: 0 0 auto;
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: 12px;
  background: var(--surface-sunk);
  color: var(--ink-3);
}

/* ---------- maneuver glyph + lanes (shared with NAV) ---------- */
.rt-mi { flex: 0 0 auto; display: block; }
.rt-lanes {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  padding: 3px 6px;
  border-radius: var(--r-sm);
  background: color-mix(in srgb, var(--ink) 10%, transparent);
  max-width: 100%;
  overflow: hidden;
}
.rt-lane { color: var(--ink-3); opacity: .55; flex: 0 1 auto; min-width: 14px; }
.rt-lane.on { color: currentColor; opacity: 1; }
.rt-lanes .rt-lane + .rt-lane { border-left: 1.5px dashed color-mix(in srgb, var(--ink-4) 60%, transparent); padding-left: 2px; }

@media (min-width: 600px) {
  .rt-card:not(.rt-c) .rt-body { padding-left: var(--sp-4); }
}
@media (prefers-reduced-motion: reduce) {
  .rt-card, .rt-check, .rt-strip { transition: none; }
}
