:root {
  --blue: #1f4e9c;
  --ink: #102033;
  --row: #d7e6f6;
  --yellow: #f5d800;
  --muted: #3d4d60;
  color-scheme: light only;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  height: 100svh;
  background: #f4f7fb;
  color: var(--ink);
  font-family: "Liberation Sans", "Segoe UI", Arial, sans-serif;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  min-height: 100%;
  cursor: none;
  overflow: hidden;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-width: 0;
  padding: 0.85rem 1.2rem 0.75rem;
  background: var(--blue);
  color: #fff;
}

.heading { min-width: 0; }

h1, p { margin: 0; }

h1 {
  font-size: clamp(1.8rem, 4.6vh, 3.4rem);
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.05;
}

#route {
  margin-top: 0.2rem;
  font-size: clamp(1.05rem, 2.4vh, 1.7rem);
  font-weight: 600;
  opacity: 0.95;
}

#clock {
  flex: 0 0 auto;
  font-size: clamp(1.6rem, 3.4vw, 4.2rem);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  line-height: 1;
}

.columns, .row, .empty {
  display: grid;
  grid-template-columns: minmax(3.6rem, 6rem) minmax(2.2rem, 3.6rem) minmax(0, 1fr) minmax(5.2rem, 8.5rem);
  align-items: center;
  column-gap: 0.8rem;
  padding: 0 1.2rem;
}

.line, .point, .destination, .over, .columns span { min-width: 0; }

.columns {
  padding-top: 0.45rem;
  padding-bottom: 0.35rem;
  color: var(--muted);
  font-size: clamp(0.85rem, 1.8vh, 1.15rem);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.columns span {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.columns span:last-child, .over { text-align: right; }

#rows {
  list-style: none;
  margin: 0;
  padding: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.row, .empty {
  flex: 1 1 0;
  min-height: 0;
  border-top: 1px solid rgba(31, 78, 156, 0.16);
}

.row:nth-child(odd), .empty { background: #fff; }
.row:nth-child(even) { background: var(--row); }

.line {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 4.4rem;
  height: clamp(2.2rem, 5.4vh, 3.6rem);
  padding: 0 0.7rem;
  border-radius: 0.45rem;
  color: #fff;
  font-size: clamp(1.5rem, 3.6vh, 2.5rem);
  font-weight: 800;
  letter-spacing: 0.02em;
}

.point, .destination, .minutes { color: var(--ink); }

.point {
  font-size: clamp(1.8rem, 4.5vh, 3.1rem);
  font-weight: 800;
}

.destination {
  overflow: hidden;
  font-size: clamp(1.35rem, 3.8vh, 2.7rem);
  font-weight: 650;
  font-weight: 700;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.over {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  min-width: 0;
}

.minutes {
  font-size: clamp(2.6rem, 7.2vh, 5.4rem);
  font-weight: 800;
  line-height: 0.9;
  font-variant-numeric: tabular-nums;
}

.mark, .note {
  min-height: 1.1em;
  font-size: clamp(0.75rem, 1.7vh, 1.05rem);
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.mark { color: var(--blue); font-size: clamp(0.95rem, 2vh, 1.35rem); }

.banner {
  display: none;
  align-items: center;
  min-height: 3.2rem;
  padding: 0.55rem 1.6rem;
  background: var(--yellow);
  color: #1a1a1a;
  font-size: clamp(1.15rem, 2.8vh, 1.8rem);
  font-weight: 800;
}

.banner.visible { display: flex; }

.empty {
  color: var(--muted);
  font-size: clamp(1.4rem, 3vh, 2rem);
  font-weight: 700;
}

@media (max-width: 720px) {
  header { padding: 0.7rem 0.75rem 0.55rem; }
  h1 { font-size: 1.45rem; }
  #route { font-size: 0.95rem; }
  #clock { font-size: 1.35rem; }

  .columns, .row, .empty {
    grid-template-columns: 2.7rem 2.6rem minmax(0, 1fr) 3.3rem;
    column-gap: 0.35rem;
    padding-left: 0.65rem;
    padding-right: 0.65rem;
  }

  .columns { font-size: 0.68rem; letter-spacing: 0; }

  .line {
    width: 2.55rem;
    min-width: 0;
    height: 1.65rem;
    padding: 0;
    font-size: 1rem;
    border-radius: 0.3rem;
  }

  .point { font-size: 1.15rem; }
  .destination { font-size: 1rem; font-weight: 700; }
  .minutes { font-size: 1.55rem; }
  .mark, .note { font-size: 0.68rem; }
  .mark { font-size: 0.8rem; }
}
