/* ============================================================================
   Departure and arrival boards.
   ----------------------------------------------------------------------------
   Two looks. The standard one is the Hit Rail design system plus a few rows of
   its own. The board look takes the colours and layout of the departure boards
   on bahnhof.de — navy page, large times, bold destination, platform at the
   right — and nothing else: no logo, no typeface.

   Everything here is a class, never an inline style: the CSP drops style=""
   attributes, which is how the calendar once lost its colours.
   ========================================================================== */

.board-root { height: 100%; min-height: 0; }

/* ----------------------------------------------------- the board takes over */

.app.is-board-db { grid-template-columns: 1fr; }
.app.is-board-db .sidebar,
.app.is-board-db .topbar { display: none; }
.app.is-board-db .main { grid-template-rows: 1fr; }

/* ------------------------------------------------------------ category dots */

.cat-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-right: 6px;
  border-radius: 50%;
  vertical-align: baseline;
  background: #8a8d7a;
}
.cat--long     { background: #f0b400; }
.cat--regional { background: #2e9e6b; }
.cat--suburban { background: #1a7f3c; }
.cat--bus      { background: #c4287c; }
.cat--ship     { background: #2f7fc1; }
.cat--other    { background: #8a8d7a; }

/* ---------------------------------------------------------- the standard look */

.board-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-6);
  margin-bottom: var(--sp-5);
}
.board-tabs { min-width: 240px; }
.board-count {
  margin-left: 4px;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}
.board-date, .board-find { display: inline-flex; align-items: center; gap: var(--sp-3); }
.board-find { flex: 1; min-width: 260px; }
.board-find .field__input { min-width: 0; }
.board-find input[type="search"] { flex: 1; }
/* .field__input is width:100% in the design system, which stretched the time field
   across the bar and pushed the search box out of it. */
.board-find input[type="time"],
.board-date input[type="date"] { width: auto; flex: none; }
.board-filters { display: flex; flex-wrap: wrap; gap: var(--sp-3); margin-bottom: var(--sp-5); }
.board-sub { margin: 0 0 var(--sp-5); font-size: var(--fs-base); }

.board-table th { white-space: nowrap; }
.board-row { cursor: pointer; }
.board-row:hover td { background: var(--surface-2); }
.board-row.is-open td { background: var(--surface-2); }
.board-time { font-weight: var(--fw-semibold); white-space: nowrap; }
.board-via { margin-top: 2px; color: var(--text-muted); font-size: var(--fs-base); }
.board-live {
  display: inline-block;
  margin-left: var(--sp-3);
  padding: 0 5px;
  border-radius: var(--r-sm);
  background: var(--warn-bg);
  color: var(--warn-dark);
}
.board-route-row td { padding: var(--sp-5) var(--sp-8); background: var(--surface-2); }

.board-wait { max-width: 520px; padding: var(--sp-9) 0; }
.board-progress { display: block; width: 100%; height: 8px; margin: var(--sp-4) 0; }
.board-api { margin-top: var(--sp-9); }
.board-api p { margin: 0 0 var(--sp-4); }

.board-results { margin-top: var(--sp-5); display: grid; gap: 1px; }
.board-result {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--sp-4);
  padding: var(--sp-4) var(--sp-5);
  border-radius: var(--r-md);
  color: inherit;
  text-decoration: none;
}
.board-result:hover { background: var(--surface-2); }
.board-result__slug { margin-left: auto; color: var(--text-dim); font-size: var(--fs-sm); }
.board-popular { display: flex; flex-wrap: wrap; gap: var(--sp-3); }
.board-popular .chip { text-decoration: none; }

/* A route, in either look. */
.route { margin: 0; padding: 0; list-style: none; }
.route__stop {
  display: grid;
  grid-template-columns: 96px 1fr 48px;
  gap: var(--sp-5);
  padding: 3px 0;
}
.route__time { font-family: var(--font-mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.route__time small { color: var(--text-dim); }
.route__plat { text-align: right; color: var(--text-muted); }
.route__stop.is-here { font-weight: var(--fw-semibold); }
.route__stop.is-pass { color: var(--text-dim); }

/* ------------------------------------------------------------- the board look */

.dbboard {
  height: 100%;
  overflow-y: auto;
  background: #282d6a;
  color: #fff;
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
.dbboard__inner { max-width: 980px; margin: 0 auto; padding: 20px 24px 72px; }
.dbboard a { color: inherit; }

.db-top { display: flex; align-items: center; gap: 12px; padding: 4px 0 28px; }
.db-top .grow { flex: 1; }
.db-back { font-weight: 600; text-decoration: none; }
.db-back:hover { text-decoration: underline; }
.db-station { font-size: 15px; font-weight: 600; opacity: .8; }

.db-head { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 20px; margin: 4px 0 22px; }
.db-title { margin: 0; font-size: 44px; line-height: 1.1; font-weight: 700; letter-spacing: -.01em; }

/* small outlined buttons on navy */
.db-ctl, .db-switch, .db-more {
  padding: 6px 12px;
  border: 1px solid rgba(255, 255, 255, .55);
  border-radius: 6px;
  background: transparent;
  color: #fff;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.db-ctl:hover, .db-switch:hover, .db-more:hover { background: rgba(255, 255, 255, .14); }
.db-more { display: block; margin: 28px auto 0; padding: 12px 22px; font-size: 15px; }

.db-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 6px;
  padding: 10px 12px;
  margin-bottom: 18px;
  border-radius: 6px;
  background: #3a3f84;
}
.db-cat {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.db-cat:hover { background: rgba(255, 255, 255, .12); }
.db-cat.is-active { border-color: #fff; background: rgba(255, 255, 255, .1); }
.db-filters .cat-dot { width: 18px; height: 18px; margin: 0; border: 2px solid rgba(255, 255, 255, .85); }

.db-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 22px; margin-bottom: 22px; }
.db-controls .board-find { flex: 1; min-width: 280px; }
.db-lbl { font-size: 13px; font-weight: 600; opacity: .85; }
.db-input {
  padding: 6px 10px;
  border: 1px solid rgba(255, 255, 255, .55);
  border-radius: 6px;
  background: rgba(255, 255, 255, .08);
  color: #fff;
  font: inherit;
  font-size: 14px;
  color-scheme: dark;
}
.db-input::placeholder { color: rgba(255, 255, 255, .6); }
.db-input--grow { flex: 1; min-width: 0; }
.db-input:focus-visible, .db-ctl:focus-visible, .db-switch:focus-visible, .db-cat:focus-visible, .db-row:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

/* the column heads, aligned to the three columns of a row */
.db-cols, .db-row {
  display: grid;
  /* minmax(0, 1fr), not 1fr: a bare 1fr will not shrink below its longest unbreakable
     word, so one long station name widened the whole row past a phone's screen. */
  grid-template-columns: 150px minmax(0, 1fr) 84px;
  gap: 0 22px;
}
.db-via, .db-dest { overflow-wrap: anywhere; }
.db-cols {
  padding: 0 0 8px;
  border-bottom: 1px solid rgba(255, 255, 255, .6);
  font-size: 12px;
  line-height: 1.3;
  opacity: .9;
}
.db-cols__l { text-align: right; }
.db-cols__r { text-align: right; }

.db-list { margin: 0; padding: 0; list-style: none; }
.db-row {
  position: relative;
  padding: 18px 0 16px;
  border-bottom: 1px solid rgba(255, 255, 255, .45);
  cursor: pointer;
}
.db-row:hover { background: rgba(255, 255, 255, .05); }
.db-row__l { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.db-time { font-size: 30px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.board-live.db-live, .db-time .board-live {
  margin-left: 8px;
  padding: 1px 6px;
  background: #fff;
  color: #1c1f4a;
  font-size: 20px;
  font-weight: 700;
}
.db-via { font-size: 14px; line-height: 1.35; opacity: .9; }
.db-dest { margin-top: 2px; font-size: 26px; font-weight: 700; line-height: 1.2; }
.db-info {
  display: inline-block;
  margin-top: 8px;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(0, 0, 0, .32);
  font-size: 12px;
  font-weight: 600;
}
.db-plat { align-self: end; text-align: right; font-size: 30px; font-weight: 700; line-height: 1; }

/* the train label: a chip, as on the site */
.db-chip {
  padding: 2px 7px;
  border-radius: 3px;
  background: #5d6168;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
  white-space: nowrap;
}
.db-chip--suburban { padding: 2px 12px; border-radius: 999px; background: #1a7f3c; }
.db-chip--bus      { background: #c4287c; }
.db-chip--ship     { background: #2f7fc1; }

.db-route {
  grid-column: 1 / -1;
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 6px;
  background: rgba(0, 0, 0, .28);
  cursor: default;
}
.dbboard .route__stop { grid-template-columns: 118px 1fr 52px; padding: 4px 0; font-size: 15px; }
.dbboard .route__time small, .dbboard .route__plat { color: rgba(255, 255, 255, .75); }
.dbboard .route__stop.is-pass { color: rgba(255, 255, 255, .55); }

.db-note, .db-empty { margin: 22px 0 0; font-size: 13px; opacity: .8; list-style: none; }
.dbboard .board-wait { padding: 36px 0; }
.dbboard .field__hint { color: rgba(255, 255, 255, .75); }
.dbboard .status-msg { color: #1f221a; }
.dbboard .status-msg a { color: inherit; font-weight: 600; }

@media (max-width: 640px) {
  .db-title { font-size: 34px; }
  .db-cols, .db-row { grid-template-columns: 96px minmax(0, 1fr) 56px; gap: 0 12px; }
  .db-time, .db-plat { font-size: 24px; }
  .db-dest { font-size: 21px; }
  .dbboard__inner { padding: 14px 14px 56px; }
}
.is-board .db-cols { display: none; }
