/* track-changes.css — standalone track-change alerts page.
   Layout only; colors and type come from styles.css variables so this page
   can't drift from the rest of the app. The border-left accent colors mirror
   the old feed cards (held = a change, early = a fresh posting) so the visual
   vocabulary carries over for anyone used to the corner feed. */

body.tcp-page {
  margin: 0;
  min-height: 100vh;
  background: var(--bg, #0e1116);
  color: var(--text);
  overflow-y: auto;
}

.tcp-header {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: calc(12px + env(safe-area-inset-top)) 16px 12px;
  border-bottom: 1px solid var(--panel-border);
  position: sticky;
  top: 0;
  background: var(--bg, #0e1116);
  z-index: 2;
}
.tcp-header h1 {
  font-size: 16px;
  margin: 0;
  font-weight: 600;
}
.tcp-meta {
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.tcp-filter {
  display: flex;
  gap: 6px;
  padding: 10px 16px;
}
.tcp-filter button {
  background: rgba(22, 27, 34, 0.85);
  border: 1px solid var(--panel-border);
  border-radius: 4px;
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  padding: 4px 12px;
  cursor: pointer;
  transition: background-color 0.12s, border-color 0.12s, color 0.12s;
}
.tcp-filter button:hover { background: rgba(22, 27, 34, 1); border-color: #484f58; }
.tcp-filter button.active { color: var(--text); border-color: #484f58; }

.tcp-main { padding: 0 16px calc(24px + env(safe-area-inset-bottom)); }

.tcp-list { list-style: none; margin: 0; padding: 0; }

.tcp-row {
  display: grid;
  grid-template-columns: 84px 110px 1fr auto;
  align-items: center;
  gap: 12px;
  background: rgba(22, 27, 34, 0.95);
  border: 1px solid var(--panel-border);
  border-left: 3px solid var(--held);
  border-radius: 4px;
  padding: 9px 12px;
  margin-bottom: 6px;
  font-size: 13px;
}
.tcp-row.tc-posted { border-left-color: var(--early); }

.tcp-time { display: flex; flex-direction: column; line-height: 1.3; }
.tcp-clock { font-variant-numeric: tabular-nums; }
.tcp-age { color: var(--muted); font-size: 10px; }

.tcp-train { display: flex; flex-direction: column; line-height: 1.3; }
.tcp-num { font-weight: 600; font-variant-numeric: tabular-nums; }
.tcp-branch { color: var(--muted); font-size: 10px; }

.tcp-where { color: var(--text); }

.tcp-detail {
  display: flex;
  align-items: center;
  gap: 6px;
  font-variant-numeric: tabular-nums;
}
.tcp-track {
  display: inline-block;
  min-width: 26px;
  text-align: center;
  padding: 2px 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.07);
  font-weight: 600;
}
.tcp-track.tcp-was { color: var(--muted); font-weight: 400; }
.tcp-arrow { color: var(--muted); }

.tcp-empty {
  color: var(--muted);
  text-align: center;
  padding: 32px 0;
  font-size: 13px;
}

/* Narrow screens: the four-column grid stops fitting well under ~560px, so
   stack the metadata above the change itself rather than letting the track
   numbers wrap mid-cell. */
@media (max-width: 560px) {
  .tcp-row {
    grid-template-columns: 1fr auto;
    row-gap: 4px;
  }
  .tcp-time { grid-column: 1; flex-direction: row; gap: 6px; align-items: baseline; }
  .tcp-train { grid-column: 2; grid-row: 1; flex-direction: row; gap: 6px; align-items: baseline; justify-self: end; }
  .tcp-where { grid-column: 1; grid-row: 2; }
  .tcp-detail { grid-column: 2; grid-row: 2; justify-self: end; }
}
