/* Design tokens and global defaults */

:root {
  color-scheme: light;
  --ink: #152236;
  --muted: #64748b;
  --page: #f5f7fa;
  --line: #e4eaf0;
  --navy: #132339;
  --blue: #176bce;
  --soft: #f0f5fa;
  --radius: 16px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--page);
  font: 14px/1.45 ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  color: var(--ink);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

button:focus-visible,
select:focus-visible,
input:focus-visible {
  outline: 3px solid #a8d0ff;
  outline-offset: 2px;
}

/* Site header and page structure */

.topbar {
  background: #101d30;
  color: white;
  padding: 0 32px;
}

.top-inner {
  max-width: 1312px;
  margin: auto;
  display: flex;
  align-items: center;
  min-height: 69px;
  gap: 12px;
}

.brandmark {
  width: 35px;
  height: 35px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: #2e80e5;
  color: #fff;
}

.brand {
  font-size: 16px;
  font-weight: 780;
  letter-spacing: -.3px;
}

.brandline {
  font-size: 11px;
  color: #9fb1cc;
  letter-spacing: .04em;
}

.top-right {
  margin-left: auto;
  display: flex;
  gap: 12px;
  align-items: center;
}

.chip-top {
  padding: 6px 10px;
  border: 1px solid #45566e;
  border-radius: 20px;
  color: #d6e3f5;
  font-size: 11px;
  letter-spacing: .06em;
  font-weight: 700;
}

.sample-pulse {
  width: 7px;
  height: 7px;
  background: #f4b951;
  border-radius: 50%;
  display: inline-block;
  margin-right: 6px;
}

.date-top {
  color: #b2c1d5;
  font-size: 12px;
}

.main {
  max-width: 1312px;
  margin: 0 auto;
  padding: 29px 28px 65px;
}

.hero {
  display: flex;
  gap: 18px;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 25px;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: .11em;
  color: #3067ae;
  font-size: 11px;
  font-weight: 800;
  margin: 0 0 8px;
}

.hero h1 {
  font-size: 32px;
  line-height: 1.16;
  letter-spacing: -1px;
  font-weight: 800;
  margin: 0;
}

.hero p {
  color: var(--muted);
  margin: 8px 0 0;
  font-size: 13px;
}

.hero-meta {
  font-size: 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 13px;
  color: #66768a;
  white-space: nowrap;
}

.layout {
  display: grid;
  grid-template-columns: 292px minmax(0,1fr);
  align-items: start;
  gap: 22px;
}

.panel {
  background: white;
  border: 1px solid var(--line);
  box-shadow: 0 3px 14px rgba(21,34,54,.025);
  border-radius: var(--radius);
}

/* Sidebar: stops and route filters */

.sidebar {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.side-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.side-heading {
  font-size: 11px;
  color: #8190a2;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.stop-box {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px;
  background: #f5f8fb;
  border: 1px solid #e7edf5;
  border-radius: 12px;
}

.pin {
  display: grid;
  place-items: center;
  width: 35px;
  height: 35px;
  border-radius: 10px;
  background: #dfeefe;
  color: var(--blue);
  font-size: 17px;
  flex: none;
}

.stop-name {
  font-weight: 750;
  font-size: 13px;
  line-height: 1.3;
}

.small {
  font-size: 11px;
  color: #78879a;
}

.select-wrap {
  position: relative;
}

.select-wrap select {
  width: 100%;
  appearance: none;
  padding: 13px 32px 13px 12px;
  background: white;
  border: 1px solid #d8e2eb;
  border-radius: 10px;
  font-size: 13px;
  color: #1d3047;
  outline: 0;
}

.select-wrap:after {
  content: "⌄";
  position: absolute;
  right: 13px;
  top: 10px;
  color: #7b8899;
  font-size: 19px;
  pointer-events: none;
}

.hint {
  font-size: 11px;
  color: #8390a2;
}

.filter-set {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-button {
  border: 1px solid #dae4ec;
  background: #fff;
  border-radius: 9px;
  color: #4c6077;
  font-size: 13px;
  padding: 8px 12px;
  font-weight: 700;
  min-width: 43px;
  transition: background .15s;
}

.filter-button.active {
  color: white;
  background: #1b65c0;
  border-color: #1b65c0;
}

.filter-button:not(.active):hover {
  background: #f0f5fc;
}

.checkbox-row {
  display: flex;
  gap: 9px;
  align-items: start;
  color: #41556c;
  font-size: 12px;
  cursor: pointer;
}

.checkbox-row input {
  width: 16px;
  height: 16px;
  accent-color: var(--blue);
  margin: 1px 0 0;
  flex: none;
}

.sidebar-help {
  border-top: 1px solid #e8edf2;
  padding-top: 18px;
  color: #637589;
  font-size: 12px;
}

.help-title {
  font-weight: 750;
  color: #273f59;
  margin-bottom: 6px;
}

.legend {
  display: flex;
  gap: 7px;
  align-items: center;
  margin-top: 6px;
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #34845a;
}

.dot.amber {
  background: #db9837;
}

/* Arrivals board and bus cards */

.board {
  overflow: hidden;
}

.board-head {
  padding: 20px 22px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  border-bottom: 1px solid var(--line);
}

.board-title {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -.3px;
}

.board-sub {
  font-size: 12px;
  color: #8491a2;
  margin-top: 2px;
}

.board-actions {
  margin-left: auto;
  display: flex;
  gap: 10px;
  align-items: center;
}

.sort-label {
  font-size: 11px;
  color: #698098;
  background: #f3f7fb;
  border: 1px solid #e5edf4;
  padding: 7px 9px;
  border-radius: 7px;
  white-space: nowrap;
}

.btn-reset {
  border: 1px solid #d7e2ef;
  color: #2d5e9b;
  background: #fff;
  border-radius: 8px;
  font-weight: 700;
  font-size: 12px;
  padding: 8px 11px;
}

.table-labels {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) 170px 190px;
  gap: 14px;
  padding: 11px 48px 11px 22px;
  font-size: 10px;
  letter-spacing: .07em;
  text-transform: uppercase;
  font-weight: 800;
  color: #93a0b0;
  background: #fbfcfe;
}

.table-labels > span:last-child {
  display: none;
}

.bus-row {
  border-top: 1px solid #eaf0f5;
}

.bus-row:first-of-type {
  border-top: 0;
}

.bus-button {
  position: relative;
  width: 100%;
  border: 0;
  padding: 17px 48px 17px 22px;
  background: #fff;
  color: inherit;
  text-align: left;
  display: grid;
  align-items: center;
  grid-template-columns: minmax(0, 1.5fr) 170px 190px;
  gap: 14px;
}

.bus-button:hover {
  background: #f9fbfd;
}

.bus-row.open .bus-button {
  background: #f5f9ff;
}

.route-group {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.route-badge {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 47px;
  height: 47px;
  flex: none;
  border-radius: 11px;
  font-size: 19px;
  color: #fff;
  font-weight: 850;
  box-shadow: inset 0 -2px rgba(0,0,0,.13);
}

.dest {
  font-size: 14px;
  font-weight: 800;
  color: #23334b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.extra {
  font-size: 11px;
  color: #8997a7;
  margin-top: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.big-time {
  font-size: 21px;
  letter-spacing: -.6px;
  font-variant-numeric: tabular-nums;
  font-weight: 830;
  color: #15283b;
  line-height: 1.2;
}

.subtime {
  font-size: 11px;
  color: #8c99a8;
  margin-top: 4px;
}

/* Boarding Sched. and Exp. lines: the labels share one column, so the two times line up. */
.time-pair {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: .4em;
}

.late {
  color: #9b6022;
  font-weight: 730;
}

.early {
  color: #1c805d;
  font-weight: 730;
}

.ontime {
  color: #30677f;
  font-weight: 730;
}

.eta-label {
  font-size: 11px;
  color: #678198;
  font-weight: 670;
}

.not-served {
  font-size: 12px;
  color: #97a3b0;
  font-weight: 550;
}

.arrow {
  /* Keep the chevron inset fixed while the card width changes. */
  position: absolute;
  top: 50%;
  right: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  font-size: 20px;
  line-height: 1;
  color: #8da3b7;
  pointer-events: none;
  transform: translateY(-50%);
  transition: transform .15s;
}

.bus-row.open .arrow {
  transform: translateY(-50%) rotate(180deg);
}

/* Expanded journey and stop timeline */

.detail {
  background: #f8fbff;
  padding: 16px 20px 20px 81px;
  border-top: 1px solid #e2eaf3;
}

.detail-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.detail-head strong {
  font-size: 13px;
  color: #2b496a;
}

.detail-note {
  font-size: 11px;
  color: #7e8fa3;
}

.timeline {
  background: #fff;
  border: 1px solid #e4ebf3;
  border-radius: 11px;
  max-height: 345px;
  overflow: auto;
}

.timeline-line {
  display: grid;
  grid-template-columns: 20px minmax(200px,1fr) 100px 100px;
  gap: 11px;
  align-items: center;
  padding: 10px 13px;
  border-bottom: 1px solid #f0f3f7;
}

.timeline-line:last-child {
  border-bottom: 0;
}

.timeline-line.target {
  background: #eaf4ff;
}

.timeline-line.boarding {
  background: #f8fbff;
}

.timeline-dot {
  width: 9px;
  height: 9px;
  border: 2px solid #a8b8c9;
  background: #fff;
  border-radius: 50%;
  margin: 0 auto;
  position: relative;
}

.timeline-line.target .timeline-dot {
  background: #2173cf;
  border-color: #2173cf;
}

.timeline-line.boarding .timeline-dot {
  border-color: #2659a1;
  background: #2659a1;
}

.tl-name {
  font-size: 12px;
  font-weight: 640;
  color: #344c63;
}

.tl-id {
  color: #95a2b0;
  font-size: 10px;
}

.tl-time {
  font-size: 12px;
  font-weight: 780;
  color: #2f4e6d;
  font-variant-numeric: tabular-nums;
}

.tl-sched {
  font-size: 11px;
  color: #8797a8;
  font-variant-numeric: tabular-nums;
}

.note-strip {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 17px;
  background: #fff5e6;
  border: 1px solid #f7e6c6;
  border-radius: 10px;
  margin-top: 18px;
  color: #76552d;
  font-size: 12px;
}

.info-icon {
  font-weight: bold;
  background: #fff0ce;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  flex: none;
  text-align: center;
}

.empty {
  padding: 38px 20px;
  text-align: center;
  color: #6c7d91;
}

.empty strong {
  display: block;
  font-size: 16px;
  margin-bottom: 6px;
  color: #304861;
}

.metrics {
  display: flex;
  gap: 10px;
  margin-top: 17px;
}

.metric {
  background: #fff;
  border: 1px solid #e4eaf0;
  padding: 11px 16px;
  border-radius: 12px;
  min-width: 112px;
}

.metric b {
  font-size: 17px;
  display: block;
}

.metric span {
  font-size: 11px;
  color: #91a0b1;
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-top: 22px;
  color: #8996a6;
  font-size: 11px;
}

.route-strip {
  height: 4px;
  display: flex;
  background: #edf3f9;
}

.route-strip i {
  height: 100%;
  display: block;
}

/* No destination selected: the ETA column is removed and "Expected at" takes the
   right-hand column. Phones already use two columns, so only wider layouts change. */
.board.no-destination .table-labels > span:nth-child(3) {
  display: none;
}

@media (min-width:1001px) {
  .board.no-destination .bus-button,
  .board.no-destination .table-labels {
    grid-template-columns: minmax(0, 1.5fr) 170px;
  }
}

@media (min-width:761px) and (max-width:1000px) {
  .board.no-destination .bus-button,
  .board.no-destination .table-labels {
    grid-template-columns: minmax(0, 1fr) 132px;
  }
}

/* Responsive layout */

@media (max-width:1000px) {
  .layout {
    grid-template-columns: 255px minmax(0,1fr);
    gap: 14px;
  }
  .main {
    padding: 24px 16px;
  }
  .bus-button,
  .table-labels {
    grid-template-columns: minmax(0, 1fr) 132px 140px;
    gap: 8px;
    padding-left: 14px;
    padding-right: 48px;
  }
  .detail {
    padding-left: 18px;
  }
  .date-top {
    display: none;
  }
  .board-head {
    padding: 17px;
  }
  .big-time {
    font-size: 18px;
  }
}

@media (max-width:760px) {
  .topbar {
    padding: 0 14px;
  }
  .top-inner {
    min-height: 60px;
  }
  .brandline {
    display: none;
  }
  .chip-top {
    font-size: 10px;
  }
  .main {
    padding: 19px 12px 45px;
  }
  .hero {
    display: block;
    margin-bottom: 17px;
  }
  .hero h1 {
    font-size: 25px;
  }
  .hero-meta {
    display: inline-block;
    margin-top: 13px;
  }
  .layout {
    grid-template-columns: 1fr;
  }
  .sidebar {
    padding: 14px;
    gap: 14px;
  }
  .side-section {
    gap: 7px;
  }
  .side-section.routes {
    display: block;
  }
  .filter-set {
    margin-top: 9px;
  }
  .sidebar-help {
    display: none;
  }
  .board-head {
    padding: 15px;
  }
  .board-title {
    font-size: 16px;
  }
  .sort-label {
    display: none;
  }
  .table-labels {
    display: none;
  }
  .bus-button {
    grid-template-columns: minmax(0, 1fr) 100px;
    gap: 9px;
    padding: 13px 48px 13px 12px;
  }
  .destination-col {
    display: none;
  }
  .route-badge {
    width: 42px;
    height: 42px;
    font-size: 17px;
    border-radius: 10px;
  }
  .route-group {
    gap: 9px;
  }
  .dest {
    font-size: 13px;
  }
  .extra {
    font-size: 10px;
  }
  .big-time {
    font-size: 20px;
  }
  .detail {
    padding: 12px;
  }
  .timeline-line {
    grid-template-columns: 14px minmax(90px,1fr) 70px 70px;
    gap: 6px;
    padding: 10px 7px;
  }
  .tl-name {
    font-size: 11px;
  }
  .tl-id {
    font-size: 10px;
  }
  .timeline {
    max-height: 280px;
  }
  .metrics {
    display: none;
  }
  .footer {
    display: block;
  }
  .footer span {
    display: block;
    margin-bottom: 6px;
  }
  .note-strip {
    font-size: 11px;
  }
}

/* Production layout additions */

/* Additional production interface components */

.muted-brand {
  font-weight: 450;
  color: #8da7ca;
}

.top-settings {
  border: 1px solid #466078;
  color: #e3eeff;
  background: transparent;
  border-radius: 9px;
  padding: 8px 11px;
  font-size: 12px;
  font-weight: 750;
}

.top-settings:hover {
  background: #223853;
}

.service-count {
  color: #7f90a5;
  font-size: 13px;
  font-weight: 650;
}

.right-side {
  min-width: 0;
}

.lookup-wrap {
  position: relative;
}

.lookup-wrap input {
  width: 100%;
  padding: 12px;
  background: #fff;
  border: 1px solid #d8e2eb;
  border-radius: 10px;
  font-size: 13px;
  color: #1d3047;
  min-width: 0;
}

.lookup-wrap input:focus {
  outline: 2px solid #b5d4fa;
}

.suggestions {
  position: absolute;
  z-index: 100;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: white;
  border: 1px solid #d4e2ed;
  box-shadow: 0 8px 26px rgba(20,35,58,.14);
  max-height: 260px;
  overflow-y: auto;
  border-radius: 10px;
}

.suggestion {
  display: block;
  background: white;
  color: #20374f;
  width: 100%;
  text-align: left;
  padding: 10px;
  border: 0;
  border-bottom: 1px solid #edf1f5;
  font-size: 12px;
}

.suggestion:hover,
.suggestion:focus {
  background: #f0f5ff;
}

.suggestion strong {
  display: block;
}

.suggestion .small {
  display: block;
}

.linklike {
  border: 0;
  background: transparent;
  text-align: left;
  padding: 0;
  color: #2068b6;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  width: fit-content;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.linklike:hover {
  color: #073e83;
}

.chip-top.demo {
  border-color: #7c6539;
  color: #ffd787;
}

.chip-top.live {
  border-color: #368767;
  color: #b5f7d9;
}

.btn-reset {
  white-space: nowrap;
}

.data-warning {
  color: #9e4e20;
}

.note-strip[hidden] {
  display: none;
}

.note-strip.is-error {
  background: #fff1f0;
  color: #9b2c27;
  border-color: #f4d1cb;
}

.note-strip.is-success {
  background: #f0f8f4;
  color: #235c43;
  border-color: #d5e8dd;
}

.mini-source {
  font-size: 10px;
  color: #768ba0;
  line-height: 1.5;
}

.departure-sub {
  font-weight: 640;
  color: #4e7092;
}

.timing-source {
  display: inline-block;
  margin-top: 3px;
  font-size: 10px;
  color: #558370;
}

.rt-estimate {
  color: #a2732f;
}

.scheduled-flag {
  color: #8b94a3;
}

.timeline-line {
  grid-template-columns: 20px minmax(165px,1fr) 110px 85px;
}

.tl-name {
  white-space: normal;
}

.tl-source {
  font-size: 10px;
  color: #7c91a5;
}

.timeline-line.target {
  background: #eaf4ff;
}

.timeline-line:last-child {
  border-bottom: 0;
}

/* Expanded journey and stop timeline */

.detail {
  padding-right: 18px;
}

.detail-summary {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.detail-pill {
  border: 1px solid #dce8f4;
  background: #fff;
  border-radius: 8px;
  padding: 7px 9px;
  font-size: 11px;
  color: #62778f;
}

.info-note {
  font-size: 11px;
  color: #7b90a4;
  margin-top: 10px;
}

/* Phones show the countdown and delay label only; the times are in the open trip instead. */
.detail-pill.boarding-times,
.mobile-delay {
  display: none;
}

@media (max-width:760px) {
  .bus-button .time-pair {
    display: none;
  }
  .detail-pill.boarding-times {
    display: inline-block;
  }
  .mobile-delay {
    display: block;
    white-space: nowrap;
  }
}

.button-spinner {
  opacity: .7;
  cursor: wait;
}

.settings-dialog {
  padding: 0;
  border: 0;
  border-radius: 18px;
  box-shadow: 0 24px 85px #13283e55;
  width: min(480px,calc(100vw - 24px));
  max-height: 90vh;
  color: #20334a;
}

.settings-dialog::backdrop {
  background: rgba(13,28,46,.6);
}

.settings-card {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.settings-card p {
  color: #60758a;
  font-size: 13px;
  margin: 0;
  line-height: 1.55;
}

.dialog-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.dialog-top h2 {
  margin: 0;
  font-size: 21px;
}

.close-dialog {
  border: 0;
  background: #eff3f8;
  border-radius: 9px;
  font-size: 22px;
  width: 36px;
  height: 36px;
}

.field-label {
  font-size: 12px;
  font-weight: 800;
}

.key-control {
  display: flex;
  gap: 8px;
}

.key-control input {
  padding: 12px;
  border: 1px solid #d3dfec;
  border-radius: 9px;
  flex: 1;
  min-width: 0;
}

.key-control button {
  border: 1px solid #d3dfec;
  background: white;
  padding: 9px;
  border-radius: 9px;
}

.security-note {
  background: #f5f8fc;
  padding: 12px;
  border-radius: 9px;
}

.key-status {
  font-size: 12px;
  color: #5b7188;
}

.dialog-buttons {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.primary-action {
  background: #1b65c0;
  border: 0;
  border-radius: 9px;
  color: #fff;
  font-weight: 750;
  padding: 12px 17px;
}

.danger-action {
  border: 0;
  background: transparent;
  color: #ae3f43;
  font-weight: 650;
  padding: 8px;
  font-size: 12px;
}

button:disabled {
  opacity: .5;
  cursor: not-allowed;
}

.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid #ccd7e4;
  border-top-color: #276bc7;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  vertical-align: middle;
  margin-right: 8px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width:760px) {
  .top-settings {
    font-size: 11px;
    padding: 7px 8px;
  }
  .chip-top {
    max-width: 125px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .board-actions {
    gap: 5px;
  }
  .board-actions .btn-reset {
    font-size: 11px;
    padding: 7px 8px;
  }
  .board-sub {
    max-width: 220px;
  }
  .table-labels {
    display: none;
  }
  .timeline-line {
    grid-template-columns: 14px minmax(90px,1fr) 75px 65px;
  }
  .top-right {
    gap: 6px;
  }
  .detail-head {
    align-items: flex-start;
  }
  .settings-card {
    padding: 17px;
  }
}

@media (max-width:430px) {
  .brand {
    font-size: 14px;
  }
  .top-settings {
    font-size: 0;
    min-width: 33px;
  }
  .top-settings:first-letter {
    font-size: 16px;
  }
  .brandline {
    font-size: 10px;
  }
  .chip-top {
    font-size: 9px;
  }
  .board-title {
    font-size: 14px;
  }
  .board-actions .btn-reset:last-child {
    display: none;
  }
  .bus-button {
    grid-template-columns: minmax(0, 1fr) 83px;
    gap: 5px;
  }
  .big-time {
    font-size: 18px;
  }
  .dest {
    font-size: 12px;
  }
}

/* Clock synchronised by the local Node.js backend with MSL NTP (not by a browser NTP request). */

/* NTP clock display */

.stop-clock-strip {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 15px 22px;
  background: #f0f6ff;
  border-bottom: 1px solid #dae7f6;
  min-height: 88px;
}

.clock-caption {
  font-size: 10px;
  font-weight: 850;
  color: #486384;
  letter-spacing: .1em;
}

.clock-status {
  font-size: 11px;
  color: #417c63;
  margin-top: 7px;
  font-weight: 650;
}

.clock-status.local,
.clock-status.stale {
  color: #a16a25;
}

.clock-status .status-dot {
  display: inline-block;
  height: 7px;
  width: 7px;
  border-radius: 50%;
  background: #36a47d;
  margin-right: 5px;
}

.clock-status.local .status-dot,
.clock-status.stale .status-dot {
  background: #dd9a3a;
}

.stop-digital-clock {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
  font-size: 36px;
  font-weight: 850;
  letter-spacing: .02em;
  color: #173b68;
  line-height: 1.1;
  white-space: nowrap;
}

@media (max-width:760px) {
  .stop-clock-strip {
    padding: 13px 15px;
    min-height: 74px;
  }
  .stop-digital-clock {
    font-size: 27px;
  }
  .clock-caption {
    font-size: 9px;
  }
  .clock-status {
    font-size: 10px;
    max-width: 170px;
  }
}

@media (max-width:390px) {
  .stop-digital-clock {
    font-size: 24px;
  }
  .stop-clock-strip {
    gap: 6px;
  }
}

/* Appearance selector: dark by default, with an optional light or system preference. */

/* Appearance controls */

.appearance-settings {
  border: 0;
  padding: 0;
  margin: 0;
  min-width: 0;
}

.appearance-settings legend {
  font-size: 12px;
  font-weight: 800;
  padding: 0;
  margin-bottom: 9px;
}

.theme-options {
  display: grid;
  grid-template-columns: repeat(3,minmax(0,1fr));
  gap: 8px;
}

.theme-option {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 720;
  background: var(--surface,#fff);
  color: var(--ink);
}

.theme-option:has(input:checked) {
  background: var(--selected-bg,#eaf3ff);
  border-color: var(--blue);
  color: var(--selected-text,#1457a1);
}

.theme-option:focus-within {
  outline: 2px solid #6db6ff;
  outline-offset: 2px;
}

.theme-option input {
  accent-color: var(--blue);
  margin: 0;
  width: 15px;
  height: 15px;
}

.settings-card .appearance-help {
  font-size: 11px;
  color: var(--muted);
  margin-top: 9px;
}

.settings-divider {
  height: 1px;
  background: var(--line);
}

.settings-subheading {
  margin: 0;
  font-size: 13px;
  font-weight: 800;
}

/* Dark colour palette and component overrides */

html[data-theme="dark"] {
  color-scheme: dark;
  --ink: #edf3fc;
  --muted: #a1b0c4;
  --page: #0d1520;
  --surface: #182332;
  --line: #304154;
  --navy: #101d30;
  --blue: #76b7ff;
  --soft: #202f41;
  --selected-bg: #213e61;
  --selected-text: #d7ebff;
}

html[data-theme="light"] {
  color-scheme: light;
}

html[data-theme="dark"] body {
  background: var(--page);
  color: var(--ink);
}

html[data-theme="dark"] .topbar {
  background: #0a1422;
  border-bottom: 1px solid #263649;
}

html[data-theme="dark"] .eyebrow {
  color: #91c0ff;
}

html[data-theme="dark"] .hero-meta {
  background: #192637;
  border-color: var(--line);
  color: #b2c3d6;
}

html[data-theme="dark"] .panel {
  background: var(--surface);
  border-color: var(--line);
  box-shadow: 0 8px 28px rgba(0,0,0,.14);
}

html[data-theme="dark"] .side-heading {
  color: #9cafc9;
}

html[data-theme="dark"] .hint,
html[data-theme="dark"] .board-sub {
  color: #a4b4c6;
}

html[data-theme="dark"] .stop-box {
  background: #223246;
  border-color: var(--line);
}

html[data-theme="dark"] .pin {
  background: #294563;
  color: #afd4ff;
}

html[data-theme="dark"] .small {
  color: #a1b2c6;
}

html[data-theme="dark"] .select-wrap select,
html[data-theme="dark"] .lookup-wrap input,
html[data-theme="dark"] .key-control input {
  background: #121d2b;
  border-color: #3c5066;
  color: #f0f5fb;
}

html[data-theme="dark"] input::placeholder {
  color: #899cb1;
}

html[data-theme="dark"] .suggestions {
  background: #162638;
  border-color: #3e536a;
  box-shadow: 0 14px 30px rgba(0,0,0,.35);
}

html[data-theme="dark"] .suggestion {
  background: #162638;
  color: #e8f2ff;
  border-color: #34465a;
}

html[data-theme="dark"] .suggestion:hover,
html[data-theme="dark"] .suggestion:focus {
  background: #28435f;
}

html[data-theme="dark"] .filter-button,
html[data-theme="dark"] .btn-reset {
  background: #1a2a3c;
  border-color: #3a516b;
  color: #d7e8ff;
}

html[data-theme="dark"] .filter-button.active {
  background: #2369b8;
  border-color: #438cdb;
  color: #fff;
}

html[data-theme="dark"] .filter-button:not(.active):hover,
html[data-theme="dark"] .btn-reset:hover {
  background: #29425c;
}

html[data-theme="dark"] .checkbox-row {
  color: #c4d2e2;
}

html[data-theme="dark"] .sidebar-help {
  border-color: var(--line);
  color: #a8bbd0;
}

html[data-theme="dark"] .help-title {
  color: #e6f1ff;
}

html[data-theme="dark"] .linklike {
  color: #96caff;
}

html[data-theme="dark"] .linklike:hover {
  color: #c5e4ff;
}

html[data-theme="dark"] .board-head {
  border-color: var(--line);
}

html[data-theme="dark"] .sort-label {
  background: #203247;
  border-color: #3a4f65;
  color: #c7d6e8;
}

html[data-theme="dark"] .table-labels {
  background: #111c2a;
  color: #9eafc5;
}

html[data-theme="dark"] .bus-row {
  border-color: #2e4052;
}

html[data-theme="dark"] .bus-button {
  background: #182332;
  color: var(--ink);
}

html[data-theme="dark"] .bus-button:hover {
  background: #223348;
}

html[data-theme="dark"] .bus-row.open .bus-button {
  background: #243b54;
}

html[data-theme="dark"] .dest {
  color: #f0f6ff;
}

html[data-theme="dark"] .big-time {
  color: #f3f8ff;
}

html[data-theme="dark"] .extra,
html[data-theme="dark"] .subtime {
  color: #a4b4c7;
}

html[data-theme="dark"] .late {
  color: #ffbf79;
}

html[data-theme="dark"] .early {
  color: #82e8b7;
}

html[data-theme="dark"] .ontime {
  color: #83d1ef;
}

html[data-theme="dark"] .eta-label {
  color: #9dc4e5;
}

html[data-theme="dark"] .not-served {
  color: #b1bfd1;
}

html[data-theme="dark"] .arrow {
  color: #b2c2d6;
}

html[data-theme="dark"] .detail {
  background: #131f2e;
  border-color: #35485c;
}

html[data-theme="dark"] .detail-head strong {
  color: #e1edfb;
}

html[data-theme="dark"] .detail-note,
html[data-theme="dark"] .info-note {
  color: #aabbd0;
}

html[data-theme="dark"] .timeline {
  background: #1a293a;
  border-color: #394b61;
}

html[data-theme="dark"] .timeline-line {
  border-color: #314357;
}

html[data-theme="dark"] .timeline-line.target {
  background: #1c4264;
}

html[data-theme="dark"] .timeline-line.boarding {
  background: #263950;
}

html[data-theme="dark"] .timeline-dot {
  background: #1b2e41;
  border-color: #8ea7c4;
}

html[data-theme="dark"] .timeline-line.target .timeline-dot {
  background: #6bb0ff;
  border-color: #6bb0ff;
}

html[data-theme="dark"] .timeline-line.boarding .timeline-dot {
  background: #6ba1de;
  border-color: #6ba1de;
}

html[data-theme="dark"] .tl-name {
  color: #e5edf8;
}

html[data-theme="dark"] .tl-id,
html[data-theme="dark"] .tl-sched {
  color: #a4b4c8;
}

html[data-theme="dark"] .tl-time {
  color: #e5f2ff;
}

html[data-theme="dark"] .tl-source {
  color: #adbfce;
}

html[data-theme="dark"] .scheduled-flag {
  color: #b4bdcd;
}

html[data-theme="dark"] .rt-estimate {
  color: #ffce8a;
}

html[data-theme="dark"] .detail-pill {
  background: #24364a;
  border-color: #3c526a;
  color: #d1e0f1;
}

html[data-theme="dark"] .note-strip {
  background: #342b1e;
  border-color: #65502b;
  color: #ffe1a4;
}

html[data-theme="dark"] .info-icon {
  background: #604923;
  color: #ffdfaa;
}

html[data-theme="dark"] .note-strip.is-error {
  background: #3c2228;
  color: #ffd1cf;
  border-color: #80434d;
}

html[data-theme="dark"] .note-strip.is-success {
  background: #1a352d;
  color: #b5f4d2;
  border-color: #356652;
}

html[data-theme="dark"] .empty {
  color: #adc0d5;
}

html[data-theme="dark"] .empty strong {
  color: #f0f6fc;
}

html[data-theme="dark"] .metric {
  background: #182332;
  border-color: var(--line);
}

html[data-theme="dark"] .metric span {
  color: #aabbd0;
}

html[data-theme="dark"] .footer {
  color: #a0b0c3;
}

html[data-theme="dark"] .route-strip {
  background: #1d2c3e;
}

html[data-theme="dark"] .service-count {
  color: #adbed0;
}

html[data-theme="dark"] .data-warning {
  color: #ffc793;
}

html[data-theme="dark"] .mini-source {
  color: #9db6cd;
}

html[data-theme="dark"] .departure-sub {
  color: #abd2f8;
}

html[data-theme="dark"] .timing-source {
  color: #9fe0bf;
}

html[data-theme="dark"] .settings-dialog {
  background: #182637;
  color: #edf4fd;
  box-shadow: 0 26px 85px rgba(0,0,0,.75);
}

html[data-theme="dark"] .settings-card p {
  color: #becde0;
}

html[data-theme="dark"] .settings-card .appearance-help {
  color: #aebfd2;
}

html[data-theme="dark"] .close-dialog {
  background: #30465d;
  color: #f1f6ff;
}

html[data-theme="dark"] .key-control button {
  background: #243951;
  color: #e4f0ff;
  border-color: #3c526a;
}

html[data-theme="dark"] .security-note {
  background: #24374c;
  color: #c1d4e7;
}

html[data-theme="dark"] .key-status {
  color: #b7cbdd;
}

html[data-theme="dark"] .danger-action {
  color: #ffacae;
}

html[data-theme="dark"] .primary-action {
  background: #2678cf;
}

html[data-theme="dark"] .stop-clock-strip {
  background: #1a3149;
  border-color: #37536f;
}

html[data-theme="dark"] .clock-caption {
  color: #c1d9f3;
}

html[data-theme="dark"] .clock-status {
  color: #94ebc2;
}

html[data-theme="dark"] .clock-status.local,
html[data-theme="dark"] .clock-status.stale {
  color: #ffc682;
}

html[data-theme="dark"] .stop-digital-clock {
  color: #f3f9ff;
}
