/* Route-calculation dock: a bar floating at the bottom of the graph that expands upward into
   a drawer. On phones it becomes a slim ink bar above the bottom nav (see responsive.css). */
.route-dock {
  position: relative;
  z-index: var(--z-dock);
  align-self: end;
  display: flex;
  flex-direction: column;
  min-width: 0;
  margin: 0 var(--space-7) var(--space-7);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  box-shadow: var(--shadow-dock);
  container: dock / inline-size;
}
.route-dock.is-expanded {
  height: var(--dock-height, 420px);
}
.route-dock-resize {
  display: none;
  flex: none;
  height: 14px;
  cursor: row-resize;
  touch-action: none;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.route-dock-resize::after {
  content: "";
  display: block;
  width: 36px;
  height: 4px;
  margin: 5px auto 0;
  border-radius: var(--radius-pill);
  background: var(--color-border-dashed);
}
.route-dock-resize:hover::after,
.route-dock-resize:focus-visible::after {
  background: var(--color-accent);
}
.route-dock-resize:focus-visible {
  outline-offset: -2px;
}
.route-dock.is-expanded .route-dock-resize {
  display: block;
}
.route-dock-content {
  display: none;
  flex: 1;
  min-height: 0;
  flex-direction: column;
}
.route-dock.is-expanded .route-dock-content {
  display: flex;
}
/* The toggle button's ::after covers the whole bar, so a click anywhere on it toggles while
   the button stays the single accessible control. */
.route-dock-bar {
  position: relative;
  cursor: pointer;
  border-radius: var(--radius-lg);
  flex: none;
  display: flex;
  align-items: center;
  gap: var(--space-8);
  min-height: 48px;
  padding: 0 var(--space-4) 0 var(--space-7);
}
.route-dock.is-expanded .route-dock-bar {
  border-top: 1px solid var(--color-border);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}
.route-dock-title {
  flex: none;
  font-size: var(--font-size-sm);
  font-weight: 700;
  white-space: nowrap;
}
.route-dock-summary {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: var(--space-8);
}
.route-terms {
  display: flex;
  gap: var(--space-7);
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
  white-space: nowrap;
}
.route-term b {
  color: var(--color-text);
  font: 500 var(--font-size-sm) var(--font-mono);
}
.route-term--total b {
  color: var(--color-accent-text);
}
.route-range {
  position: relative;
  flex: 1;
  min-width: 60px;
  height: 6px;
  border-radius: var(--radius-pill);
  background: var(--color-surface-2);
}
.route-range-reached,
.route-range-total {
  position: absolute;
  top: 0;
  height: 100%;
  border-radius: var(--radius-pill);
}
.route-range-reached {
  left: 0;
  z-index: 1;
  background: var(--color-text);
}
.route-range-total {
  background: var(--color-accent-range);
}
.route-dock-unavailable {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  min-width: 0;
  color: var(--color-attention);
  font-size: var(--font-size-sm);
}
.route-dock-unavailable .icon {
  width: 16px;
  height: 16px;
}
.route-dock-toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  flex: none;
  height: 36px;
  padding: 0 var(--space-6);
  border-radius: var(--radius-sm);
  font-size: var(--font-size-sm);
  white-space: nowrap;
}
.route-dock-toggle::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
}
.route-dock-bar:hover {
  background: var(--color-hover);
}
.route-dock-toggle:focus-visible {
  outline: none;
}
.route-dock-toggle:focus-visible::after {
  outline: 2px solid var(--color-accent);
  outline-offset: -2px;
}
.route-dock-toggle .icon {
  width: 16px;
  height: 16px;
}
@container dock (max-width: 720px) {
  .route-term--remaining {
    display: none;
  }
}
@container dock (max-width: 330px) {
  .route-dock-bar > .route-dock-title {
    display: none;
  }
}
@container dock (max-width: 520px) {
  .route-range,
  .route-dock-toggle span {
    display: none;
  }
  .route-dock-bar,
  .route-dock-summary {
    gap: var(--space-6);
  }
}

/* Drawer content */
.route-dock-tabs {
  flex: none;
  display: flex;
  gap: var(--space-2);
  padding: 0 var(--space-7);
  border-bottom: 1px solid var(--color-border);
}
.route-dock-tabs button {
  min-height: 40px;
  padding: 0 var(--space-4);
  border-bottom: 2px solid transparent;
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
  font-weight: 500;
}
.route-dock-tabs button[aria-selected="true"] {
  border-color: var(--color-accent);
  color: var(--color-text);
  font-weight: 700;
}
.route-dock-view {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: var(--space-6) var(--space-7) var(--space-7);
  font-size: var(--font-size-sm);
}
.route-dock-view:focus-visible {
  outline-offset: -2px;
}
.route-dock-view h3 {
  margin: var(--space-4) 0 var(--space-3);
  font: 700 var(--font-size-sm) var(--font-ui);
}
.route-dock-view h3:first-child {
  margin-top: 0;
}
.route-dock-view p {
  margin: var(--space-2) 0 var(--space-4);
  line-height: 1.5;
}
.route-dock-view .route-muted {
  color: var(--color-text-muted);
  font-size: var(--font-size-xs);
}
.route-calc-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-4);
  margin: var(--space-4) 0 var(--space-6);
}
.route-calc-term {
  min-width: 0;
  padding: var(--space-4) var(--space-5);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}
.route-calc-term:last-child {
  border-color: var(--color-accent-ring);
}
.route-calc-term small {
  display: block;
  color: var(--color-text-muted);
  font-size: var(--font-size-2xs);
  line-height: 1.3;
}
.route-calc-term strong {
  display: block;
  margin: 3px 0;
  color: var(--color-accent-text);
  font: 500 var(--font-size-base) var(--font-mono);
  overflow-wrap: anywhere;
}
.route-calc-term .bar-track {
  margin-top: 5px;
  height: 5px;
}
.route-option-card {
  padding: var(--space-4) 0;
  border-top: 1px solid var(--color-border);
}
.route-option-card h4 {
  margin: 0 0 3px;
  font-size: var(--font-size-sm);
}
.route-option-card h4 span {
  color: var(--color-text-muted);
  font: var(--font-size-xs) var(--font-mono);
}
.route-option-card p {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.route-page-head,
.route-page-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}
.route-page-actions {
  flex-wrap: wrap;
  margin: var(--space-4) 0;
}
.route-page-actions span {
  flex: 1 1 90px;
  min-width: 0;
  text-align: center;
  font-family: var(--font-mono);
  font-size: var(--font-size-xs);
}
.route-page-actions button {
  min-height: 36px;
  padding: 0 var(--space-6);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-sm);
  font-size: var(--font-size-sm);
}
.route-page-actions button:hover:not(:disabled) {
  background: var(--color-hover);
}
.route-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.route-list li {
  border-top: 1px solid var(--color-border);
}
.route-list button {
  width: 100%;
  padding: var(--space-4) var(--space-2);
  text-align: left;
}
.route-list button:hover {
  background: var(--color-hover);
}
.route-list strong {
  display: block;
  font-size: var(--font-size-sm);
  font-weight: 500;
}
.route-list small {
  display: block;
  color: var(--color-text-muted);
  font-size: var(--font-size-xs);
}
.route-detail-list {
  list-style: none;
  margin: var(--space-2) 0;
  padding: 0;
}
.route-detail-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-1) 0;
  border-bottom: 1px solid var(--color-border);
}
.route-detail-list button {
  min-height: 36px;
  color: var(--color-accent-text);
  font-family: var(--font-mono);
  font-size: var(--font-size-xs);
  text-align: left;
  overflow-wrap: anywhere;
}
.route-detail-list strong {
  flex: none;
  font: 500 var(--font-size-xs) var(--font-mono);
}
.route-choice-list {
  margin: var(--space-2) 0 var(--space-6);
  padding-left: var(--space-8);
  line-height: 1.6;
}
