.service-title {
  display: flex;
  align-items: center;
  gap: 13px;
  margin: 12px 0 18px;
}
.service-title h2 {
  margin: 0;
  font-size: 1.6875rem;
}
.service-title p {
  margin: 2px 0 0;
}
.mode-symbol {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: var(--radius-control);
  background: var(--panel-2);
  color: var(--text);
  flex: 0 0 auto;
}
.mode-symbol svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.mode-symbol.subway {
  background: color-mix(
    in srgb,
    var(--transport-color) 12%,
    var(--surface-primary)
  );
  color: var(--transport-color);
}
.mode-symbol.rail {
  background: color-mix(
    in srgb,
    var(--transport-color) 12%,
    var(--surface-primary)
  );
  color: var(--transport-color);
}
.mode-symbol.bus {
  background: color-mix(
    in srgb,
    var(--transport-color) 12%,
    var(--surface-primary)
  );
  color: var(--transport-color);
}
.mode-symbol.info {
  background: var(--blue-soft);
  color: var(--blue);
}
.mode-symbol.muted {
  color: var(--muted);
}
.next-stop-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 0.75fr;
  border-top: 1px solid var(--separator);
  border-bottom: 1px solid var(--separator);
  padding: 15px 0;
  gap: 10px;
}
.next-stop-grid div {
  min-width: 0;
}
.next-stop-grid span {
  display: block;
  color: var(--muted);
  font-size: var(--type-caption);
  font-weight: 700;
  margin-bottom: 5px;
}
.next-stop-grid strong {
  display: block;
  font-size: 1.3125rem;
  line-height: 1.1;
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.next-stop-grid small {
  font-size: var(--type-caption);
  margin-left: 3px;
  color: var(--muted);
}
.ride-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 650;
}
.section-block {
  background: var(--panel);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  margin-bottom: 14px;
}
.section-block.compact {
  padding: 0;
  overflow: hidden;
}
.section-label {
  display: block;
  color: var(--muted);
  text-transform: none;
  font-size: 0.75rem;
  font-weight: 720;
  margin-bottom: 4px;
}
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 10px;
}
.section-heading :is(h2, h3) {
  margin: 0;
  font-size: 1.375rem;
  letter-spacing: -0.02em;
}
.plain-action,
.round-action {
  border: 0;
  background: transparent;
  color: var(--blue);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
}
.plain-action svg,
.round-action svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.round-action {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-round);
  background: var(--panel-2);
  justify-content: center;
  padding: 0;
}
.stop-list {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
}
.stop-list li {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  align-items: center;
  min-height: 52px;
  position: relative;
}
.stop-list li:not(:last-child)::before {
  content: "";
  position: absolute;
  left: 10px;
  top: 29px;
  bottom: -25px;
  width: 2px;
  background: var(--separator);
}
.rail-dot {
  width: 10px;
  height: 10px;
  border-radius: var(--radius-round);
  background: var(--panel);
  border: 2px solid var(--muted);
  z-index: 1;
}
.stop-list li.next .rail-dot {
  background: var(--blue);
  border-color: var(--blue);
  box-shadow: var(--shadow-focus-wide);
}
.stop-list li.passed {
  opacity: 0.45;
}
.stop-list b {
  display: block;
  font-size: 0.9375rem;
}
.stop-list small {
  display: block;
  color: var(--blue);
  font-size: var(--type-caption);
  margin-top: 2px;
}
.stop-list time {
  font-variant-numeric: tabular-nums;
  font-size: 0.875rem;
  font-weight: 720;
}
.source-note,
.privacy-note {
  color: var(--muted);
  font-size: var(--type-caption);
  line-height: 1.45;
  margin: 12px 0 0;
}
.confidence {
  margin-top: 12px;
  border-top: 1px solid var(--separator);
  padding-top: 10px;
  color: var(--muted);
  font-size: 0.75rem;
}
.confidence summary {
  color: var(--blue);
  font-weight: 700;
}
.nearby-row,
.native-row,
.choice-row,
.target-train {
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  display: grid;
  align-items: center;
}
.nearby-row {
  grid-template-columns: auto 1fr auto auto;
  gap: 12px;
  padding: 5px 0;
}
.nearby-row b,
.native-row b {
  display: block;
}
.nearby-row small,
.native-row small {
  display: block;
  color: var(--muted);
  font-size: 0.75rem;
  margin-top: 2px;
}
.nearby-row strong {
  font-size: 0.875rem;
}
.chevron {
  color: var(--muted);
  font-size: 1.5rem;
  font-weight: 300;
}
.native-row {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--separator);
}
.native-row:last-child {
  border-bottom: 0;
}
.native-row:has(> .system-symbol, > .mode-symbol, > .transport-icon) {
  grid-template-columns: auto minmax(0, 1fr) auto;
}
.native-row > .chevron,
.native-row > .chev {
  justify-self: end;
}
.screen-action-group {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  margin: 16px 0;
}
.screen-action-group > .primary-action,
.screen-action-group > .secondary-action {
  width: 100%;
  min-height: 48px;
  margin: 0;
  white-space: normal;
  text-align: center;
}
.native-row .mode-symbol {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-row);
}
.native-row .mode-symbol svg {
  width: 20px;
  height: 20px;
}
.train-group {
  margin-top: 14px;
}
.train-group > span {
  display: block;
  color: var(--muted);
  font-size: var(--type-caption);
  font-weight: 730;
  margin: 0 0 7px;
}
.train-rows {
  border-radius: var(--radius-group);
  background: var(--panel-2);
  overflow: hidden;
}
.train-row {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid var(--separator);
}
.train-row:last-child {
  border-bottom: 0;
}
.train-arrow {
  color: var(--blue);
  font-weight: 900;
}
.train-row b {
  display: block;
  font-size: 0.875rem;
}
.train-row small {
  display: block;
  color: var(--muted);
  font-size: var(--type-caption);
  margin-top: 2px;
}
.delay {
  font-size: var(--type-caption);
  color: var(--muted);
  font-weight: 700;
}
.delay.late {
  color: var(--orange);
}
.loading-line,
.fine-empty,
.empty-state {
  color: var(--muted);
  font-size: 0.8125rem;
  line-height: 1.45;
}
.empty-state {
  text-align: center;
  padding: 18px 8px;
}
.tabbar {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(9px + var(--safe-bottom));
  z-index: 30;
  width: min(calc(100% - 22px), 720px);
  height: 66px;
  border: 1px solid color-mix(in srgb, var(--separator) 80%, transparent);
  border-radius: var(--radius-surface);
  background: color-mix(in srgb, var(--panel) 82%, transparent);
  backdrop-filter: saturate(180%) blur(26px);
  -webkit-backdrop-filter: saturate(180%) blur(26px);
  box-shadow: var(--shadow-toast);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 5px;
}
.tab-button {
  border: 0;
  background: transparent;
  border-radius: var(--radius-vehicle);
  color: var(--muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: var(--type-caption);
  font-weight: 700;
  min-width: 0;
}
.tab-button svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.tab-button.active {
  color: var(--blue);
  background: var(--blue-soft);
}
#timetable-root,
#operations-root,
#settings-content {
  padding: 4px 0 20px;
}
/* iOS search field: filled, no outline. */
.native-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--fill-tertiary);
  border-radius: var(--radius-small);
  padding: 0 12px;
  margin-bottom: 12px;
  box-shadow: none;
}
.native-search input {
  min-height: 44px;
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 1rem;
}
/* Same 22px line magnifier as the "Now" search field (icons.js "search"),
   drawn as a mask so the glyph markup in the templates stays unchanged and
   the colour follows the theme. */
.native-search > span:first-child {
  flex: none;
  width: 22px;
  height: 22px;
  overflow: hidden;
  font-size: 0;
  color: transparent;
  background: var(--muted);
  -webkit-mask: var(--search-glyph) center / 22px 22px no-repeat;
  mask: var(--search-glyph) center / 22px 22px no-repeat;
}
.native-search {
  --search-glyph: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round'%3E%3Ccircle cx='10.6' cy='10.6' r='6.6'/%3E%3Cpath d='m15.4 15.4 5.1 5.1' stroke-width='2.2'/%3E%3C/svg%3E");
  min-height: 48px;
  gap: 10px;
}
@media (forced-colors: active) {
  .native-search > span:first-child {
    background: CanvasText;
  }
}
.native-section-label {
  font-size: 0.8125rem;
  color: var(--muted);
  font-weight: 700;
  margin: 18px 6px 8px;
}
.native-list,
.operation-card,
.settings-card {
  background: var(--panel);
  border-radius: var(--radius-inset);
  box-shadow: var(--shadow);
  overflow: hidden;
}
#operations-root > .native-list + .native-list {
  margin-top: 16px;
}
.operation-card [data-operation-save] svg {
  width: 21px;
  height: 21px;
  margin-inline-end: 8px;
  vertical-align: middle;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linejoin: round;
}
.operation-card [data-operation-save][aria-pressed="true"] svg {
  fill: currentColor;
}
.native-row {
  background: var(--panel);
}
.system-symbol {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-row);
  background: var(--panel-2);
}
.system-symbol svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
}
.system-symbol.subway {
  background: color-mix(
    in srgb,
    var(--transport-color) 12%,
    var(--surface-primary)
  );
  color: var(--transport-color);
}
.system-symbol.rail {
  background: color-mix(
    in srgb,
    var(--transport-color) 12%,
    var(--surface-primary)
  );
  color: var(--transport-color);
}
.system-symbol.bus {
  background: color-mix(
    in srgb,
    var(--transport-color) 12%,
    var(--surface-primary)
  );
  color: var(--transport-color);
}
.board-place {
  font-size: 1.875rem;
  margin: 10px 0;
}
.board-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.board-controls label,
.sheet-field,
.block-label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 650;
}
.board-controls select,
.sheet-field select,
.block-label select {
  min-height: 44px;
  border: 0;
  background-color: var(--panel);
  box-shadow: var(--shadow-hairline);
  border-radius: var(--radius-row);
  padding: 11px 32px 11px 11px;
}
.board-summary {
  display: flex;
  justify-content: space-between;
  margin: 18px 0 8px;
  color: var(--muted);
  font-size: 0.75rem;
}
.hour-table {
  background: var(--panel);
  border-radius: var(--radius-inset);
  overflow: hidden;
}
.hour-row {
  display: grid;
  grid-template-columns: 52px 1fr;
  border-bottom: 1px solid var(--separator);
  padding: 0;
}
.hour-row:last-child {
  border-bottom: 0;
}
.hour-row > strong {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1px;
  background: var(--surface-secondary);
  font-size: 1.25rem;
  font-variant-numeric: tabular-nums;
}
.hour-row > strong small {
  font-size: var(--type-caption);
  margin-left: 0;
  color: var(--muted);
}
.hour-row > div {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 10px;
  padding: 6px 10px;
}
/* Minutes read like a printed timetable: plain figures, express in red. */
.minute-cell {
  border: 0;
  background: transparent;
  border-radius: var(--radius-compact);
  min-width: 44px;
  min-height: 44px;
  padding: 4px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text);
}
.minute-cell:disabled {
  color: var(--text);
  opacity: 1;
}
.minute-cell:not(:disabled):active {
  background: var(--fill-tertiary);
}
.minute-cell b {
  font-size: 1.125rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}
.minute-cell small,
.minute-cell span {
  font-size: 0.6875rem;
  color: var(--muted);
}
.minute-cell.express b,
.minute-cell.express small {
  color: var(--color-danger);
}
.source-caption {
  font-size: var(--type-caption);
  color: var(--muted);
}

/* Native interaction states without animating layout or painting shadows. */
button,
a,
input,
select,
summary {
  -webkit-tap-highlight-color: transparent;
}
button {
  touch-action: manipulation;
}
html[data-input-modality="pointer"]
  :is(button, a, input, select, summary):focus {
  outline: none;
}
button:focus:not(:focus-visible),
summary:focus:not(:focus-visible),
a:focus:not(:focus-visible) {
  outline: none;
}
button:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}
.primary-action,
.secondary-action,
.round-action,
.arrival-stop {
  transition:
    transform 0.16s ease,
    opacity 0.16s ease;
}
.primary-action:active,
.secondary-action:active,
.round-action:active,
.arrival-stop:active {
  transform: scale(0.98);
  opacity: 0.78;
}
.round-action,
.plain-action,
.location-pill,
.sheet-close {
  min-width: 44px;
  min-height: 44px;
}
.native-row,
.choice-row,
.target-train {
  min-height: 52px;
}
.section-block,
.hero-card {
  border: 0.5px solid var(--separator);
}
.sheet {
  max-height: min(82dvh, 760px);
}
.sheet[open] {
  animation: sheet-appear 0.28s cubic-bezier(0.22, 0.8, 0.25, 1);
}
.sheet-heading {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px 12px;
  background: var(--panel);
  border-bottom: 1px solid var(--separator);
}
.sheet-heading h2 {
  margin: 0;
  font-size: 1.125rem;
}
.sheet-heading button,
.sheet-header button {
  min-width: 44px;
  min-height: 44px;
}
@keyframes sheet-appear {
  from {
    opacity: 0;
    transform: translateY(22px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@media (max-width: 520px) {
  .sheet {
    top: auto;
    bottom: calc(8px + var(--safe-bottom));
    margin: 0 auto;
  }
}
@media (prefers-reduced-motion: reduce) {
  .sheet[open] {
    animation: none;
  }
}

/* Route plates listed under a stop name. */
.row-line-badges {
  display: flex !important;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}

/* Mode picker: iOS checkmark list. */
.run-mode-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 24px;
  align-items: center;
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  text-align: left;
}
.run-mode-row + .run-mode-row {
  border-top: 1px solid var(--separator);
}
.run-mode-check {
  color: var(--color-accent);
  font-size: 1.125rem;
  font-weight: 700;
  text-align: right;
}
/* PiP source video: kept in the page (Safari will not present a hidden
   video) but too small and faint to see. */
.pip-source {
  position: fixed;
  left: 0;
  bottom: 0;
  width: 2px;
  height: 2px;
  opacity: 0.02;
  pointer-events: none;
}

/* Today's timetable: departures already gone are dimmed. */
.minute-cell.passed {
  opacity: 0.42;
}
