/* Live screen owner. Solid content, glass only in navigation controls. */
#now-search {
  margin-bottom: 8px;
}
.app-shell:has([data-view="now"].navigation-current) .topbar .eyebrow {
  font-size: var(--live-brand-type, var(--type-caption));
  font-weight: 600;
  letter-spacing: 0;
  color: var(--muted);
}
.app-shell:has([data-view="now"].navigation-current) #view-title {
  font-size: var(--live-title-type, var(--type-title));
  font-weight: 700;
  letter-spacing: -0.02em;
}
.app-shell:has([data-view="now"].navigation-current) .topbar {
  flex-wrap: wrap;
  gap: 12px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
}
.app-shell[data-ride-mode] {
  --live-brand-type: var(--type-caption);
  --live-title-type: 1.5rem;
}
.live-navigation-capsule {
  display: flex;
  gap: 8px;
  padding: 0 4px;
  border: 0;
  border-radius: var(--radius-capsule);
  background: var(--glass-toolbar);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  box-shadow: var(--shadow-hairline);
}
.live-navigation-capsule button {
  padding: 10px;
  width: auto;
  min-width: 44px;
  min-height: 44px;
  border: 0;
  border-radius: var(--radius-capsule);
  background: transparent;
  color: var(--blue);
}
.live-navigation-capsule svg,
#now-search > .live-clock-bar svg,
#now-search > .live-quick-strip svg,
#now-search > .live-location-header svg,
#now-search > button svg,
#now-search > .live-map-actions svg,
.live-stop-input svg,
.live-quick-menu svg {
  width: 22px;
  height: 22px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.live-clock-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 12px;
  padding: 0 4px 4px;
}
.live-clock-bar > span {
  flex: 1;
  min-width: 80px;
  font-size: var(--type-caption);
  color: var(--muted);
}
.live-clock-bar time {
  font-size: var(--type-body);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.live-navigation-capsule [data-live-refresh] {
  display: flex;
  align-items: center;
  justify-content: center;
}
/* The status text stays available to assistive technology. */
.live-navigation-capsule [data-refresh-label] {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.live-navigation-capsule [data-live-refresh]:active {
  transform: scale(0.96);
  opacity: 0.7;
}
.live-navigation-capsule [data-live-refresh][aria-busy] svg {
  animation: refresh-turn 1s linear infinite;
}
@keyframes refresh-turn {
  to {
    transform: rotate(360deg);
  }
}
.live-quick-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 12px 0;
}
.live-quick-strip button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 6px 10px;
  border: 0;
  border-radius: var(--radius-capsule);
  background: var(--surface-primary);
  color: var(--blue);
  font-weight: 600;
}
.live-quick-strip .live-quick-trigger {
  flex-direction: column;
  min-width: 60px;
  font-size: var(--type-caption);
  touch-action: none;
  background: transparent;
}
.live-quick-destinations {
  overflow-x: auto;
  scrollbar-width: none;
  min-width: 0;
  flex: 1;
}
.live-quick-track {
  display: flex;
  width: max-content;
  min-width: 200%;
  animation: quick-loop 28s linear infinite;
  animation-play-state: paused;
}
.live-quick-group {
  flex: 1;
  display: flex;
  align-items: stretch;
  gap: 8px;
  padding-right: 8px;
}
.live-quick-strip[data-active="true"]:not([data-paused]) .live-quick-track {
  animation-play-state: running;
}
.live-quick-strip[data-paused] .live-quick-track {
  animation: none;
}
body:has(dialog[open]) .live-quick-track {
  animation-play-state: paused;
}
html[data-reduce-motion="true"] .live-quick-track { animation: none; }
html[data-reduce-motion="true"] .live-quick-group[aria-hidden] { display: none; }
@keyframes quick-loop {
  to {
    transform: translateX(-50%);
  }
}
@media (prefers-reduced-motion: reduce) {
  .live-quick-track,
  .live-navigation-capsule [data-live-refresh][aria-busy] svg {
    animation: none;
  }
  .live-quick-group[aria-hidden] {
    display: none;
  }
}
.live-quick-destinations button {
  flex: none;
  max-width: 240px;
  text-align: left;
}
.live-quick-destinations button span {
  overflow-wrap: anywhere;
}
.live-quick-destinations button.quick-tracking {
  color: var(--surface-primary);
  background: var(--blue);
  transform: scale(0.97);
}
.live-quick-popover {
  position: fixed;
  inset: auto;
  margin: 0;
  padding: 6px;
  width: max-content;
  max-width: calc(100vw - 16px);
  max-height: min(60dvh, 400px);
  overflow-y: auto;
  border: 1px solid var(--separator);
  border-radius: var(--radius-group);
  background: var(--surface-elevated);
  color: var(--text-primary);
  box-shadow: var(--shadow);
}
.live-quick-popover button {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  width: 100%;
  padding: 10px 14px;
  border: 0;
  border-radius: var(--radius-control);
  background: transparent;
  color: var(--blue);
  text-align: left;
}
.live-quick-popover svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  flex: none;
}
.live-quick-popover button.quick-tracking {
  background: var(--blue-soft);
}
.live-location-header {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  padding: 8px 16px;
  margin: 0 0 12px;
  border-radius: var(--radius-vehicle);
  background: var(--surface-primary);
  line-height: 1.45;
  font-size: var(--type-secondary);
}
.live-location-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}
.live-location-copy small {
  color: var(--muted);
  font-size: var(--type-caption);
}
.live-location-header > svg {
  color: var(--blue);
}
[data-location-dot][data-quality="available"] {
  background: var(--live);
}
[data-location-dot][data-quality="low"] {
  background: var(--warning);
}
[data-location-dot][data-quality="missing"] {
  background: var(--danger);
}
.live-stop-search,
.live-stop-input {
  width: 100%;
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  margin: 0 0 12px;
  background: var(--fill-tertiary);
  color: var(--muted);
  border: 0;
  border-radius: var(--radius-small);
  font-size: var(--type-body);
  text-align: left;
}
.live-stop-input input {
  width: 100%;
  min-width: 0;
  background: transparent;
  border: 0;
  outline-offset: 4px;
  min-height: 44px;
}
.live-map-host .route-map {
  border-radius: var(--radius-vehicle);
  background: var(--surface-primary);
  overflow: hidden;
}
.live-map-host .route-map svg {
  height: 280px;
}
.live-map-host .route-map > p {
  padding: 6px 12px;
}
.live-map-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: space-between;
  padding: 8px 0;
}
.live-map-actions button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 12px;
  flex: 1;
  border: 0;
  border-radius: var(--radius-capsule);
  background: var(--blue-soft);
  color: var(--blue);
  font-size: var(--type-secondary);
  font-weight: 600;
}
.live-update-status:empty {
  display: none;
}
.live-quick-menu {
  display: grid;
  gap: 8px;
}
.live-quick-menu .native-row {
  grid-template-columns: 24px minmax(0, 1fr) auto;
}
.live-direction-segments {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 4px 0 8px 56px;
}
.live-direction-segments button {
  min-height: 44px;
  min-width: 44px;
  max-width: 100%;
  padding: 8px 14px;
  flex: 0 1 auto;
  border: 0;
  border-radius: var(--radius-capsule);
  background: var(--fill-tertiary);
  color: var(--text);
  font-size: var(--type-caption);
  font-weight: 600;
  overflow-wrap: anywhere;
}
.live-direction-segments button[aria-pressed="true"] {
  background: var(--color-accent-strong);
  color: var(--color-on-accent);
}
.live-nearby-arrival .transport-badge {
  padding: 2px 6px;
  border-radius: var(--radius-small);
}
.live-nearby-arrival > b {
  font-size: var(--type-arrival);
}
.live-nearby-arrival > span > small {
  display: block;
}
.live-arrival-imminent {
  animation: live-arrival-pulse 1.6s ease-in-out infinite;
}
@keyframes live-arrival-pulse {
  50% {
    opacity: 0.45;
  }
}
@media (prefers-reduced-motion: reduce) {
  .live-arrival-imminent {
    animation: none;
  }
}
/* Inset-grouped cards sit on the grouped background without outlines;
   increased-contrast modes keep the separator. */
html:not([data-high-contrast="true"]) [data-view="now"] :is(.section-block, .hero-card) {
  border-color: transparent;
}
@media (prefers-contrast: more) {
  html [data-view="now"] :is(.section-block, .hero-card) {
    border-color: var(--separator);
  }
}
/* Boarding detection: one inset-grouped card of status and rider actions. */
.detection-card {
  margin: 0 0 12px;
  padding: 0 16px;
  border-radius: var(--radius-vehicle);
  background: var(--surface-primary);
}
.detection-card > * + * {
  border-top: 1px solid var(--separator);
}
.detection-card .detection-stage {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  margin: 0;
  padding: 10px 0;
  color: var(--text);
  font-size: var(--type-secondary);
}
.detection-card .detection-stage::before {
  content: "";
  width: 8px;
  height: 8px;
  flex: none;
  border-radius: var(--radius-round);
  background: var(--muted);
}
.detection-card .detection-stage:is([data-detection-phase="moving"], [data-detection-phase="candidate"], [data-detection-phase="confirming"])::before {
  background: var(--live);
}
.detection-card .detection-stage:is([data-detection-phase="permission"], [data-detection-phase="disabled"])::before {
  background: var(--warning);
}
.choose-ride-action,
.motion-permission button {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  padding: 10px 0;
  border: 0;
  background: transparent;
  color: var(--blue);
  font-size: var(--type-body);
  text-align: left;
}
.motion-permission button {
  grid-template-columns: 24px minmax(0, 1fr);
}
.choose-ride-action svg,
.motion-permission svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}
.choose-ride-action .chevron {
  color: var(--muted);
}
.motion-permission .source-note,
p.motion-permission {
  margin: 0;
  padding: 0 0 10px 34px;
  font-size: var(--type-caption);
  color: var(--muted);
}
p.motion-permission {
  padding: 10px 0;
}
.idle-status {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 2px;
  margin: 0 2px 10px;
  color: var(--muted);
  font-size: var(--type-caption);
  line-height: 1.5;
}
.idle-status p {
  margin: 0;
}
.idle-status .idle-state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.idle-state::before {
  content: "";
  width: 6px;
  height: 6px;
  flex: none;
  border-radius: var(--radius-round);
  background: currentColor;
}
.idle-status[data-detecting="true"] .idle-state::before {
  animation: live-state-breathe 2.4s ease-in-out infinite;
}
@keyframes live-state-breathe {
  50% {
    opacity: 0.35;
    transform: scale(0.8);
  }
}
@media (prefers-reduced-motion: reduce) {
  .idle-status[data-detecting="true"] .idle-state::before {
    animation: none;
  }
}
html[data-reduce-motion="true"] .idle-status .idle-state::before,
html[data-app-hidden="true"] .idle-status .idle-state::before {
  animation: none;
}
.nearby-guide .nearby-row {
  grid-template-columns: 48px minmax(0, 1fr) auto;
  gap: 12px;
  min-height: 64px;
}
.nearby-guide .mode-symbol.enhanced-mode {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-row);
  display: grid;
  grid-template-rows: 24px auto;
  place-items: center;
  line-height: 1;
}
.nearby-guide .mode-symbol.enhanced-mode svg {
  width: 22px;
  height: 22px;
}
.nearby-guide .mode-symbol.enhanced-mode small {
  font-size: 0.5rem;
  font-weight: 750;
  margin: 0;
  color: currentColor;
  white-space: nowrap;
}
.north3-inline,
.kintetsu-inline {
  margin: 0 0 7px 56px;
  padding-top: 3px;
}
.north3-inline > div,
.kintetsu-inline > div {
  min-height: 35px;
}
.north3-inline span b,
.kintetsu-inline span b {
  color: var(--text);
}
.announcement-assist {
  width: 100%;
  margin: 10px 0 0;
  text-align: left;
  display: grid;
  gap: 2px;
}
.announcement-assist span {
  font-weight: 750;
}
.announcement-assist small {
  color: var(--muted);
  font-size: var(--type-caption);
  font-weight: 550;
}

.station-direction-heading {
  font-size: var(--type-secondary);
  color: var(--muted);
  margin: 18px 0 8px;
}
.arrival-position-compact {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  padding: 6px 0;
  min-height: 0;
  font-size: var(--type-caption);
  color: var(--muted);
}
.arrival-position-compact span {
  color: var(--text);
}

/* Station sign header and departure-board rows on rail station screens. */
.station-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 4px 0 6px;
}
.station-number {
  display: grid;
  place-items: center;
  align-content: center;
  width: 46px;
  height: 46px;
  flex: none;
  border: 4px solid var(--line-color);
  border-radius: var(--radius-round);
  background: var(--surface-primary);
  color: var(--text);
  font-size: 1.0625rem;
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.station-number small {
  font-size: 0.625rem;
  font-weight: 800;
}
.station-lines {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}
.station-arrivals .arrival-line {
  grid-template-columns: 3.6rem minmax(0, 1fr) minmax(4.2rem, auto);
  gap: 2px 10px;
  min-height: 60px;
  padding: 10px 16px;
}
.station-arrivals .station-service {
  justify-items: start;
  gap: 1px;
}
.station-clock {
  font-size: var(--type-body);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}
.station-category {
  font-weight: 600;
}
.station-category[data-category="express"] {
  color: var(--color-danger);
}
.station-destination {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.station-destination > b {
  font-size: var(--type-body);
  overflow-wrap: anywhere;
}
.station-arrivals .arrival-source,
.station-arrivals .arrival-approach {
  grid-column: 2 / -1;
}
.station-arrivals .arrival-position-compact {
  padding: 0;
}
.station-arrivals .station-direction-heading {
  margin: 16px 0 2px;
  padding: 0 16px;
  font-size: var(--type-caption);
  font-weight: 650;
  text-transform: none;
}
.itinerary-line {
  display: inline-flex;
  margin-right: 6px;
  vertical-align: -0.15em;
}
.inline-line-badges {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 3px;
  vertical-align: -0.2em;
}
.inline-line-badges .line-badge.small {
  min-height: 1.35em;
  font-size: 0.75rem;
}

/* Bus check-in: entry row, stop switcher, wheel picker and gesture hint. */
.checkin-action > span:nth-child(2) {
  display: grid;
}
.checkin-action small {
  color: var(--muted);
  font-size: var(--type-caption);
}
.checkin {
  display: grid;
  gap: 14px;
  padding-bottom: 8px;
}
.checkin-stops {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}
.checkin-stops button {
  display: grid;
  flex: none;
  min-height: 44px;
  padding: 6px 12px;
  border: 0;
  border-radius: var(--radius-row);
  background: var(--surface-secondary);
  color: var(--text);
  font-size: var(--type-secondary);
  font-weight: 600;
  text-align: left;
}
.checkin-stops button small {
  color: var(--muted);
  font-size: var(--type-caption);
  font-weight: 400;
}
.checkin-stops button[aria-pressed="true"] {
  background: var(--color-accent-strong);
  color: var(--color-on-accent);
}
.checkin-stops button[aria-pressed="true"] small {
  color: inherit;
}
.wheel-picker {
  position: relative;
  height: 220px;
  border-radius: var(--radius-group);
  background: var(--surface-secondary);
  overflow: hidden;
  perspective: 600px;
  outline: none;
}
.wheel-track:focus-visible {
  box-shadow: var(--shadow-focus);
}
.wheel-track {
  height: 100%;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  padding: 88px 0;
  box-sizing: border-box;
  scrollbar-width: none;
  overscroll-behavior: contain;
  -webkit-mask-image: linear-gradient(transparent, var(--text) 32%, var(--text) 68%, transparent);
  mask-image: linear-gradient(transparent, var(--text) 32%, var(--text) 68%, transparent);
}
.wheel-track::-webkit-scrollbar {
  display: none;
}
.wheel-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 44px;
  padding: 0 16px;
  scroll-snap-align: center;
  font-size: var(--type-body);
  white-space: nowrap;
  cursor: pointer;
  transform-origin: center center;
  backface-visibility: hidden;
}
.wheel-row > span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
}
.wheel-row[aria-selected="true"] {
  font-weight: 650;
}
.wheel-band {
  position: absolute;
  left: 8px;
  right: 8px;
  top: 88px;
  height: 44px;
  border-radius: var(--radius-compact);
  background: var(--fill-tertiary);
  pointer-events: none;
}
.checkin-gesture {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}
.checkin-gesture p {
  display: grid;
  margin: 0;
}
.checkin-gesture small {
  color: var(--muted);
  font-size: var(--type-caption);
}
.checkin-shake {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-round);
  background: color-mix(in srgb, var(--color-accent) 14%, transparent);
  color: var(--color-accent);
}
.checkin-shake svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  animation: checkin-shake 2.4s ease-in-out infinite;
}
@keyframes checkin-shake {
  0%, 60%, 100% { transform: rotate(0); }
  66% { transform: rotate(-14deg); }
  72% { transform: rotate(12deg); }
  78% { transform: rotate(-10deg); }
  84% { transform: rotate(6deg); }
}
@media (prefers-reduced-motion: reduce) {
  .checkin-shake svg {
    animation: none;
  }
}
.checkin-gesture[data-motion="denied"] .checkin-shake {
  color: var(--muted);
  background: var(--surface-secondary);
}
.checkin [data-checkin-confirm] {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.checkin [data-checkin-confirm] svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

/* ATS (Auto transportation system) Beta: the situation card on Now. */
.ats-card {
  margin: 0 0 12px;
  padding: 0 16px 8px;
  border-radius: var(--radius-vehicle);
  background: var(--surface-primary);
}
.ats-head {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--text);
  font: inherit;
  text-align: start;
}
.ats-head > svg {
  width: 22px;
  height: 22px;
  color: var(--color-ats);
}
.ats-name {
  font-weight: 800;
  letter-spacing: 0.02em;
}
.ats-beta {
  display: inline-block;
  padding: 1px 6px;
  border-radius: var(--radius-capsule);
  background: var(--color-ats);
  color: var(--color-on-accent);
  font-size: 0.6875rem;
  font-weight: 800;
  line-height: 1.4;
  vertical-align: middle;
}
.ats-level {
  padding: 1px 7px;
  border-radius: var(--radius-capsule);
  background: var(--color-ats-soft);
  color: var(--text);
  font-size: var(--type-caption);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.ats-mode-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-inline-start: auto;
  min-width: 0;
  color: var(--muted);
  font-size: var(--type-caption);
}
.ats-mode-chip svg {
  width: 15px;
  height: 15px;
  flex: none;
}
.ats-mode-chip span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ats-head .chevron {
  color: var(--muted);
}
.ats-scene {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 0 2px;
}
.ats-scene > svg {
  flex: none;
  width: 30px;
  height: 30px;
  padding: 6px;
  border-radius: var(--radius-row);
  background: var(--color-ats-soft);
  color: var(--color-ats);
}
.ats-scene > span {
  display: grid;
  flex: 1;
  min-width: 0;
  line-height: 1.3;
}
.ats-scene > .ats-action {
  flex: none;
}
.ats-scene b {
  overflow-wrap: anywhere;
}
.ats-scene small,
.ats-note {
  color: var(--muted);
  font-size: var(--type-caption);
}
.ats-note {
  margin: 6px 0 0;
}
.ats-actions,
.ats-routes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.ats-action,
.ats-route {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  min-width: 44px;
  max-width: 100%;
  padding: 6px 12px;
  border: 0;
  border-radius: var(--radius-capsule);
  background: var(--fill-tertiary);
  color: var(--text);
  font: inherit;
  font-size: var(--type-caption);
  font-weight: 700;
}
.ats-action svg,
.ats-route svg {
  flex: none;
  width: 16px;
  height: 16px;
  color: var(--color-ats);
}
.ats-route span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ats-live {
  display: grid;
  gap: 6px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}
.ats-live li {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.ats-live li > span:not(.line-badge) {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ats-live b {
  flex: none;
  font-variant-numeric: tabular-nums;
}

/* The ATS sheet. */
.ats-sheet-head {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.ats-sheet-head > svg {
  flex: none;
  width: 40px;
  height: 40px;
  padding: 8px;
  border-radius: var(--radius-row);
  background: var(--color-ats);
  color: var(--color-on-accent);
}
.ats-sheet-head h3 {
  margin: 0;
  font-size: 1.0625rem;
}
.ats-sheet-head p,
.ats-status {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: var(--type-caption);
}
.ats-status {
  margin: 12px 0 0;
  color: var(--text);
  font-weight: 700;
}
.ats-sheet-label {
  margin: 18px 4px 6px;
  color: var(--muted);
  font-size: var(--type-caption);
  font-weight: 600;
}
.ats-level-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: start;
}
.ats-level-row > span:nth-child(2) {
  display: grid;
  flex: 1;
  min-width: 0;
}
.ats-level-row[disabled] {
  opacity: 0.55;
}
.ats-level-badge {
  flex: none;
  min-width: 44px;
  padding: 2px 6px;
  border-radius: var(--radius-capsule);
  background: var(--color-ats-soft);
  color: var(--text);
  font-size: var(--type-caption);
  font-weight: 800;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.ats-level-row[aria-checked="true"] .ats-level-badge {
  background: var(--color-ats);
  color: var(--color-on-accent);
}
.ats-dev {
  margin-inline-start: 6px;
  padding: 0 6px;
  border-radius: var(--radius-capsule);
  background: var(--fill-secondary);
  font-size: 0.6875rem;
  font-style: normal;
}
.ats-modes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.ats-mode {
  display: grid;
  justify-items: center;
  gap: 4px;
  min-height: 84px;
  min-width: 44px;
  padding: 10px 6px;
  border: 2px solid transparent;
  border-radius: var(--radius-row);
  background: var(--surface-primary);
  color: var(--text);
  font: inherit;
  text-align: center;
}
.ats-mode svg {
  width: 26px;
  height: 26px;
  color: var(--color-ats);
}
.ats-mode b {
  font-size: var(--type-caption);
  overflow-wrap: anywhere;
}
.ats-mode small {
  color: var(--muted);
  font-size: 0.6875rem;
}
.ats-mode[aria-checked="true"] {
  border-color: var(--color-ats);
}
.ats-home-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.ats-home-row > svg {
  flex: none;
  width: 22px;
  height: 22px;
  color: var(--color-ats);
}
.ats-home-row > span {
  display: grid;
  min-width: 0;
}
.run-mode-row,
.ats-settings-row {
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: start;
}
.run-mode-row > span:nth-child(2),
.ats-settings-row > span {
  display: grid;
  flex: 1;
  min-width: 0;
}
.run-mode-icon svg,
.ats-settings-row > svg {
  width: 24px;
  height: 24px;
  color: var(--color-ats);
}
:is(.ats-card, .ats-sheet, .ats-settings, .run-mode-row) svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
button.setting-row:is(.ats-level-row, .ats-settings-row),
.ats-sheet button.setting-row,
.arrival-sheet button.setting-row {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--separator);
  background: transparent;
  color: var(--text);
  font: inherit;
  text-align: start;
}
.ats-sheet button.setting-row:last-child,
.arrival-sheet button.setting-row:last-child,
button.setting-row.ats-settings-row:last-child {
  border-bottom: 0;
}
.ats-sheet button.setting-row[data-ats-home-save] {
  color: var(--blue);
}
.ats-sheet button.setting-row.destructive {
  color: var(--color-danger);
}
.ats-level-row small {
  color: var(--muted);
  font-size: var(--type-caption);
}
.ats-card > .detection-card {
  margin: 8px -16px -8px;
  border-top: 1px solid var(--separator);
  border-radius: 0 0 var(--radius-vehicle) var(--radius-vehicle);
  background: transparent;
}
/* Inside the ATS card the detection state is a caption under the situation. */
.ats-card > .detection-card .detection-stage {
  min-height: 0;
  padding: 6px 0;
  color: var(--muted);
  font-size: var(--type-caption);
}
.ats-card > .detection-card {
  margin-top: 4px;
}
.ats-card .choose-ride-action small {
  display: none;
}
.ats-card > .detection-card {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  column-gap: 12px;
  padding: 0 16px;
}
.ats-card > .detection-card > :not(.choose-ride-action) {
  grid-column: 1 / -1;
}
.ats-card > .detection-card > .choose-ride-action {
  min-width: 0;
}
.ats-card > .detection-card > .choose-ride-action {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  font-size: var(--type-caption);
  font-weight: 700;
}
.ats-card > .detection-card > .choose-ride-action .chevron {
  display: none;
}
.ats-card > .detection-card > .choose-ride-action svg {
  width: 20px;
  height: 20px;
}
.ats-card > .detection-card > .choose-ride-action + .choose-ride-action {
  border-top: 0;
}

/* Now status: the clock, a row of status icons in the manner of the iPhone
   status bar (location, ATS, motion sensor, live data, mode), and the
   situation in one line. One tap opens ATS. */
.now-status {
  margin: 4px 0 12px;
  border-radius: var(--radius-vehicle);
  background: var(--surface-primary);
}
.now-status-main {
  display: grid;
  gap: 2px;
  width: 100%;
  min-height: 44px;
  padding: 10px 16px 10px;
  border: 0;
  border-radius: inherit;
  background: none;
  color: var(--text);
  font: inherit;
  text-align: start;
}
.now-status-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  min-width: 0;
}
.now-status-top time {
  font-size: var(--type-body);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.now-status-day {
  color: var(--muted);
  font-size: var(--type-caption);
  white-space: nowrap;
}
.status-icons {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-inline-start: auto;
}
.status-icon {
  display: inline-flex;
  align-items: center;
  gap: 1px;
  color: var(--text);
}
.status-icon svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.status-icon b {
  font-size: 0.6875rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
/* Location: solid when precise, outlined when coarse, faint when absent. */
.status-icon[data-indicator="location"][data-state="precise"] {
  color: var(--color-accent);
}
.status-icon[data-indicator="location"][data-state="precise"] svg path {
  fill: currentColor;
}
.status-icon[data-indicator="location"]:is([data-state="missing"], [data-state="denied"], [data-state="stale"], [data-state="loading"]) {
  color: var(--muted);
  opacity: 0.55;
}
.status-icon[data-indicator="ats"] {
  color: var(--color-ats);
}
.status-icon[data-indicator="ats"][data-level="0"] {
  color: var(--muted);
}
.status-icon[data-indicator="motion"]:is([data-state="off"], [data-state="denied"], [data-state="idle"]) {
  color: var(--muted);
  opacity: 0.55;
}
.status-icon[data-indicator="live"] svg rect {
  fill: currentColor;
  stroke: none;
}
.status-icon[data-indicator="live"][data-level="0"] svg rect,
.status-icon[data-indicator="live"][data-level="1"] svg :is(.bar-2, .bar-3, .bar-4),
.status-icon[data-indicator="live"][data-level="2"] svg :is(.bar-3, .bar-4),
.status-icon[data-indicator="live"][data-level="3"] svg .bar-4 {
  opacity: 0.25;
}
.status-icon[data-indicator="mode"] {
  color: var(--muted);
}
/* The microphone in use: orange, as iOS marks it. */
.status-icon[data-indicator="mic"] {
  color: var(--color-warning);
}
.status-icon[data-indicator="mic"] svg .fillable {
  fill: currentColor;
}
.now-status-scene {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  margin-top: 4px;
}
.now-scene-icon svg {
  display: block;
  width: 30px;
  height: 30px;
  padding: 6px;
  border-radius: var(--radius-row);
  background: var(--color-ats-soft);
  color: var(--color-ats);
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.now-status[data-ats-scene="unknown"] .now-scene-icon svg,
.now-status[data-ats-scene="off"] .now-scene-icon svg {
  background: var(--fill-tertiary);
  color: var(--muted);
}
.now-scene-copy {
  display: grid;
  flex: 1;
  min-width: 0;
  line-height: 1.3;
}
.now-scene-copy b {
  overflow-wrap: anywhere;
}
.now-scene-copy small {
  color: var(--muted);
  font-size: var(--type-caption);
  overflow-wrap: anywhere;
}
.now-status-scene .chevron {
  color: var(--muted);
}
.now-status-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 16px 12px;
}
.now-status-actions[hidden] {
  display: none;
}
.now-status-actions svg,
.ats-sensor-row svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.ats-sensor-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.ats-sensor-row > svg {
  flex: none;
  width: 22px;
  height: 22px;
  color: var(--color-ats);
}
.ats-sensor-row > span {
  display: grid;
  min-width: 0;
}
.ats-sensor-row small {
  color: var(--muted);
  font-size: var(--type-caption);
}
@media (prefers-reduced-motion: reduce) {
  .status-icon[data-indicator="ats"][data-scanning] svg {
    animation: none;
  }
}
.status-icon[data-location-dot] {
  background: none;
}
.ats-sensor-row.setting-row {
  justify-content: flex-start;
}
.ats-sensor-row > span {
  flex: 1;
  text-align: start;
}

/* ATS in motion (ats-motion.js). Springs follow UIKit's default spring
   (a slight overshoot that settles); everything stops under reduced motion. */
.now-status {
  --ats-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ats-ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}
.now-status-main {
  position: relative;
  overflow: hidden;
}
.now-scene-icon {
  position: relative;
  display: grid;
  flex: none;
  place-items: center;
}
.now-scene-icon svg {
  position: relative;
  z-index: 1;
  /* Opaque, so the ring behind shows only as a rim (no masks: WebKit). */
  background: color-mix(in srgb, var(--color-ats) 12%, var(--surface-primary));
  transition: background-color 0.4s var(--ats-ease), color 0.4s var(--ats-ease);
}
/* Confidence ring: a rounded square outline that fills clockwise. */
/* (No registered custom property is animated: WebKit can crash on it.) */
.now-scene-icon::before {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: var(--radius-control);
  background: conic-gradient(var(--color-ats) calc(var(--ats-confidence, 0) * 1%), color-mix(in srgb, var(--color-ats) 14%, transparent) 0);
  transition: opacity 0.4s var(--ats-ease);
}
.now-status:is([data-ats-scene="unknown"], [data-ats-scene="off"]) .now-scene-icon::before {
  opacity: 0;
}
/* Sensing: rings ripple out from the icon, as AirDrop does. */
.now-scene-icon::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 1.5px solid var(--color-ats);
  border-radius: var(--radius-row);
  opacity: 0;
  pointer-events: none;
}
.now-status[data-ats-scanning] .now-scene-icon::after {
  animation: ats-ripple 1.8s var(--ats-ease) infinite;
}
.now-status[data-ats-scanning] .now-scene-icon svg {
  animation: ats-breathe 1.8s ease-in-out infinite;
}
@keyframes ats-ripple {
  0% {
    opacity: 0.55;
    transform: scale(1);
  }
  100% {
    opacity: 0;
    transform: scale(1.9);
  }
}
@keyframes ats-breathe {
  50% {
    transform: scale(0.9);
  }
}
/* A new scene: the icon pops in, the copy rises out of a blur. */
.now-status-scene.ats-scene-enter .now-scene-icon svg {
  animation: ats-icon-in 0.55s var(--ats-spring) both;
}
.now-status-scene.ats-scene-enter .now-scene-copy {
  animation: ats-copy-in 0.45s var(--ats-ease) both;
}
.now-status-scene.ats-scene-enter .now-scene-copy small {
  animation: ats-copy-in 0.45s 0.06s var(--ats-ease) both;
}
@keyframes ats-icon-in {
  from {
    opacity: 0;
    transform: scale(0.55) rotate(-12deg);
  }
}
@keyframes ats-copy-in {
  from {
    opacity: 0;
    transform: translateY(7px);
  }
}
/* A ride locks in: the ring flashes full and a glow spreads. */
.now-status-scene.ats-scene-enter[data-enter="lock"] .now-scene-icon::before {
  animation: ats-lock-ring 0.9s var(--ats-ease);
}
.now-status-scene.ats-scene-enter[data-enter="lock"] .now-scene-icon::after {
  border-width: 3px;
  animation: ats-ripple 0.9s 0.1s var(--ats-ease) 1;
}
@keyframes ats-lock-ring {
  0% {
    opacity: 0;
    transform: scale(0.8);
  }
  60% {
    opacity: 1;
    transform: scale(1.08);
  }
}
/* The hold before a new scene takes over. */
.ats-hold {
  position: absolute;
  inset-inline: 16px;
  bottom: 3px;
  height: 2px;
  border-radius: var(--radius-tiny);
  background: var(--color-ats);
  opacity: 0.45;
  transform: scaleX(0);
  transform-origin: left;
}
.ats-hold.run {
  animation: ats-hold linear forwards;
}
@keyframes ats-hold {
  to {
    transform: scaleX(1);
  }
}
/* A status icon that changed bounces once; signal bars light in turn. */
.status-icon.ats-pop svg {
  animation: ats-pop 0.5s var(--ats-spring);
}
.status-icon[data-indicator="live"].ats-pop svg rect {
  transform-box: fill-box;
  transform-origin: bottom;
  animation: ats-bar 0.4s var(--ats-ease) both;
}
.status-icon[data-indicator="live"].ats-pop svg .bar-2 {
  animation-delay: 0.06s;
}
.status-icon[data-indicator="live"].ats-pop svg .bar-3 {
  animation-delay: 0.12s;
}
.status-icon[data-indicator="live"].ats-pop svg .bar-4 {
  animation-delay: 0.18s;
}
@keyframes ats-pop {
  0% {
    transform: scale(0.7);
  }
  60% {
    transform: scale(1.15);
  }
}
@keyframes ats-bar {
  from {
    transform: scaleY(0.2);
  }
}
/* The ATS glyph in the status bar: a soft sweep instead of a blink. */
.status-icon[data-indicator="ats"][data-scanning] svg {
  animation: ats-sweep 1.6s ease-in-out infinite;
}
@keyframes ats-sweep {
  0%,
  100% {
    opacity: 1;
    transform: rotate(0);
  }
  50% {
    opacity: 0.45;
    transform: rotate(-14deg) scale(0.92);
  }
}
/* The ATS sheet: sensor rows arrive one after another. */
.ats-sheet .ats-sensor-row {
  animation: ats-row-in 0.4s calc(var(--i, 0) * 45ms) var(--ats-ease, ease) both;
}
@keyframes ats-row-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}
.ats-level-row .ats-level-badge,
.ats-mode svg {
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.ats-level-row[aria-checked="true"] .ats-level-badge,
.ats-mode[aria-checked="true"] svg {
  transform: scale(1.08);
}
.ats-level-row:active .ats-level-badge,
.ats-mode:active svg {
  transform: scale(0.92);
}
/* Riding: the trip the timetable identified fades in under the hero. */
.trip-found {
  animation: ats-copy-in 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
@media (prefers-reduced-motion: reduce) {
  .now-status *,
  .now-status *::before,
  .now-status *::after,
  .ats-sheet .ats-sensor-row,
  .trip-found {
    animation: none !important;
    transition: none !important;
  }
  .ats-hold {
    display: none;
  }
}

/* Arrival sheet: a check (or home) that springs in, then the next leg. */
.arrival-hero {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 12px 0 16px;
  text-align: center;
}
.arrival-hero > svg {
  width: 56px;
  height: 56px;
  padding: 12px;
  border-radius: var(--radius-round);
  background: var(--color-ats-soft);
  color: var(--color-ats);
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  animation: ats-icon-in 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
.arrival-hero h3 {
  margin: 0;
  font-size: var(--type-title3, 1.25rem);
}
.arrival-hero p {
  margin: 0;
  color: var(--muted);
}
.arrival-connection {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: start;
}
.arrival-connection > span:not(.line-badge):not(.chevron) {
  display: grid;
  flex: 1;
  min-width: 0;
}
.arrival-connection small {
  color: var(--muted);
  font-size: var(--type-caption);
}
.arrival-sheet .screen-action-group {
  margin-top: 16px;
}
@media (prefers-reduced-motion: reduce) {
  .arrival-hero > svg {
    animation: none;
  }
}

/* The map's own expand button, top right as in Apple Maps. */
.live-map-frame {
  position: relative;
}
.map-expand {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-row);
  background: var(--glass-toolbar);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  box-shadow: var(--shadow-hairline);
  color: var(--blue);
}
.map-expand svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Riding: plan onward from the stop the rider gets off at. */
.ride-plan-onward {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  min-height: 48px;
  margin-top: 8px;
}
.ride-plan-onward svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
