/* Shared express editor: explicit theme tokens, scoped controls, no legacy overrides. */
.express-config,
#cc-express-modal {
  --express-selected: #91c7ff;
  --express-selection-fill: rgba(10, 132, 255, .15);
  --express-passing: #d0b4ff;
  --express-passing-fill: rgba(175, 120, 255, .16);
  color: var(--ui-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-optical-sizing: auto;
}
html.cityrail-light-ui .express-config,
html.cityrail-light-ui #cc-express-modal {
  --express-selected: #0059b5;
  --express-selection-fill: rgba(0, 103, 210, .08);
  --express-passing: #7340b5;
  --express-passing-fill: rgba(115, 64, 181, .08);
}
#cfg-express-disclosure .express-config {
  padding: 0;
}
.express-config {
  font-size: 13px;
  line-height: 1.5;
}
.express-config .express-enable-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 0;
  cursor: pointer;
  padding: 10px 0;
}
.express-enable-row strong {
  display: block;
  color: var(--ui-text);
  font-size: 14px;
  font-weight: 650;
}
.express-switch {
  position: relative;
  flex: 0 0 42px;
  height: 26px;
}
.express-switch input {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
.express-switch > span {
  display: block;
  height: 26px;
  border-radius: 20px;
  background: var(--ui-line);
  transition: background 160ms ease;
}
.express-switch > span::before {
  content: '';
  position: absolute;
  left: 3px;
  top: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .2);
  transition: transform 180ms var(--ui-ease-out);
}
.express-switch input:checked + span {
  background: var(--ui-accent);
}
.express-switch input:checked + span::before {
  transform: translateX(16px);
}
.express-switch input:focus-visible + span {
  outline: 2px solid var(--ui-focus);
  outline-offset: 3px;
}
.express-switch input:disabled + span {
  opacity: .5;
}
.express-config .express-note {
  margin: 10px 2px 16px;
  color: var(--ui-muted);
  font-size: 12px;
  line-height: 1.6;
}
.express-settings {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}
.express-settings:disabled .express-section {
  opacity: .5;
}
.express-section + .express-section {
  margin-top: 20px;
}
.express-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.express-config h4 {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  letter-spacing: -.01em;
}
.express-count {
  flex-shrink: 0;
  color: var(--ui-muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.express-config-button {
  font: inherit;
  cursor: pointer;
  border: 1px solid var(--ui-line);
  border-radius: 10px;
  background: var(--ui-card);
  color: var(--ui-text);
  -webkit-tap-highlight-color: transparent;
}
.express-config-button:disabled {
  cursor: not-allowed;
}
.express-station-list {
  display: grid;
  gap: 6px;
  max-height: 320px;
  overflow-y: auto;
  overflow-anchor: none;
  padding: 3px;
  margin: -3px;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}
.express-station-row {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 56px;
  padding: 6px 10px;
  border: 1px solid var(--ui-line);
  border-radius: 12px;
  background: var(--ui-card);
}
.express-station-index {
  color: var(--ui-muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.express-station-name {
  overflow-wrap: anywhere;
  font-size: 13px;
  font-weight: 550;
}
.express-station-choices {
  display: flex;
  gap: 4px;
}
.express-config .express-station-choice {
  min-width: 46px;
  min-height: 44px;
  padding: 6px 8px;
  border-color: transparent;
  background: var(--ui-field);
  color: var(--ui-muted);
  font-size: 12px;
  white-space: nowrap;
}
.express-config .express-station-choice[aria-pressed="true"] {
  color: var(--express-selected);
  background: var(--express-selection-fill);
  border-color: color-mix(in srgb, var(--express-selected) 35%, transparent);
}
.express-config .express-station-choice[data-kind="overtake"][aria-pressed="true"] {
  color: var(--express-passing);
  background: var(--express-passing-fill);
  border-color: color-mix(in srgb, var(--express-passing) 35%, transparent);
}
.express-station-choice:focus-visible {
  outline: 2px solid var(--ui-focus);
  outline-offset: 2px;
}
.express-config .express-station-choice:disabled {
  cursor: default;
}
.express-config .express-station-choice[data-kind="overtake"]:disabled {
  opacity: .45;
}
.express-config .express-field-label {
  display: block;
  margin: 0 0 8px;
  color: var(--ui-text);
  font-size: 13px;
  font-weight: 650;
}
.express-config select {
  width: 100%;
  min-height: 42px;
  padding: 8px 12px;
  border: 1px solid var(--ui-line);
  border-radius: 10px;
  background: var(--ui-field);
  color: var(--ui-text);
  font: inherit;
}
.express-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
#cc-express-modal {
  position: fixed;
  inset: 0;
  z-index: 30000;
  display: grid;
  place-items: center;
  padding: 16px;
}
#cc-express-modal.hidden {
  display: none;
}
.express-backdrop {
  position: absolute;
  inset: 0;
  background: var(--material-scrim,rgba(0, 0, 0, .4));
  backdrop-filter: blur(5px);
}
#cc-express-modal .cc-express-dialog {
  box-sizing: border-box;
  min-width: 0;
  max-width: 100%;
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(620px, calc(100vw - 32px));
  max-height: calc(var(--ui-layout-height, 100dvh) - 32px);
  overflow: hidden;
  border: 1px solid var(--ui-line);
  border-radius: 22px;
  background: var(--material-panel,var(--ui-surface));
  -webkit-backdrop-filter: var(--material-blur,none);
  backdrop-filter: var(--material-blur,none);
  box-shadow: var(--ui-shadow);
}
.express-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  gap: 16px;
  padding: 20px 22px 16px;
  border-bottom: 1px solid var(--ui-line);
}
.express-modal-header h3 {
  margin: 0;
  font-size: 18px;
  line-height: 1.4;
  letter-spacing: -.02em;
}
.express-close-button {
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 23px;
  font-weight: 400;
}
.express-modal-body {
  min-height: 0;
  overflow: auto;
  padding: 20px 22px;
  overscroll-behavior: contain;
}
.cc-express-cell {
  white-space: nowrap;
}
.cc-express-open {
  border: 1px solid var(--ui-line);
  padding: 4px 10px;
  background: var(--ui-card);
  color: var(--ui-muted);
  cursor: pointer;
}
.cc-express-open.on {
  color: var(--ui-text);
  font-weight: 650;
}
@media (max-width:760px), (pointer:coarse) and (min-width:560px) and (max-height:520px) and (orientation:landscape) {
  #cc-express-modal {place-items:var(--ui-task-align,center);padding:var(--ui-sheet-top) var(--ui-sheet-right) var(--ui-sheet-bottom) var(--ui-sheet-left);}
  #cc-express-modal .cc-express-dialog {
    width:var(--ui-sheet-width,100%);
    max-height:calc(var(--ui-layout-height) - var(--ui-sheet-top) - var(--ui-sheet-bottom));
    border-radius:var(--ui-panel-radius);
  }
  .express-modal-header {
    padding: 16px;
  }
  .express-modal-body {
    padding: 16px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .express-switch > span,
  .express-switch > span::before {
    transition: none;
  }
}
@media (prefers-reduced-transparency: reduce) {
  .express-backdrop {
    backdrop-filter: none;
    background: rgba(0, 0, 0, .6);
  }
}

@media (pointer: coarse) {
  .express-config button, .express-config select, #cc-express-modal button { min-height:44px; }
  .express-config select { font-size:16px; }
  .express-close-button { flex-basis:44px; width:44px; height:44px; }
  /* The whole enable row is a label; preserve its larger toggle target. */
  .express-enable-row { min-height:44px; }
}

/* A single segmented selector keeps each service's settings in the same place. */
.express-tier-tabs {
  display: grid;
  grid-template-columns: repeat(4,minmax(0,1fr));
  gap: 3px;
  padding: 4px;
  margin-bottom: 16px;
  border-radius: 14px;
  background: var(--ui-card);
  border: 1px solid var(--ui-line);
}
.express-config .express-tier-tab {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  white-space: nowrap;
  min-height: max(44px, calc(44px / var(--ui-desktop-scale, 1)));
  min-width: 0;
  padding: 8px 3px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--ui-muted);
  font-size: 15px;
  font-weight: 600;
  transition: background 120ms ease, color 120ms ease;
}
.express-config .express-tier-tab[aria-selected="true"] {
  background: var(--ui-selected-fill);
  color: var(--ui-selected-text);
  border-color: var(--ui-selected-border);
  font-weight: 700;
  box-shadow: var(--ui-selected-shadow);
}
.express-tier-tab[data-tier="limited"]::before,
.express-tier-tab[data-tier="direct"]::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  flex-shrink: 0;
  border-radius: 50%;
  background: #bf5af2;
}
.express-tier-tab[data-tier="direct"]::before { background: #00b8d9; }
.express-config .express-local-summary { padding: 16px; line-height: 1.65; }
.express-config .express-enable-row[hidden],
.express-config .express-settings[hidden],
.express-config .express-tier-tab:active { opacity: .82; }
.express-config .express-tier-tab:focus-visible { outline: 2px solid var(--ui-focus); outline-offset: 1px; }
@media (prefers-reduced-motion: reduce) {
  .express-config .express-tier-tab { transition: none; }
}

@media (max-width: 360px) {
  .express-config .express-tier-tab {
    font-size: 14px;
    padding-inline: 1px;
  }
}
