/* Same look as Trains (~/rtt/rtt/static/style.css): iOS dark, system font, grey cards. */
:root {
  --bg: #000;
  --card: #1c1c1e;
  --card-2: #2c2c2e;
  --line: #38383a;
  --text: #fff;
  --muted: #8e8e93;
  --green: #30d158;
  --amber: #ff9f0a;
  --red: #ff453a;
  --blue: #0a84ff;
  --radius: 18px;
  --gutter: 16px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; font-size: 17px; font: -apple-system-body; }
body {
  margin: 0; background: var(--bg); color: var(--text); font-size: 1rem; line-height: 1.35;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) 0 env(safe-area-inset-left);
  min-height: 100vh;
}
body::before {
  content: ""; position: fixed; top: 0; left: 0; right: 0; z-index: 20;
  height: env(safe-area-inset-top); background: var(--bg);
}
main { max-width: 640px; margin: 0 auto; padding: 16px var(--gutter) 32px; }
body.has-tabs main { padding-bottom: calc(100px + env(safe-area-inset-bottom)); }
a { color: var(--blue); text-decoration: none; }
button { font: inherit; cursor: pointer; }

.muted { color: var(--muted); }
.small { font-size: 0.765rem; }
.amber { color: var(--amber); }
.bad-text { color: var(--red); font-weight: 600; }
.grow { flex: 1; min-width: 0; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.empty { color: var(--muted); text-align: center; padding: 40px 0; }
.footnote { color: var(--muted); font-size: 0.765rem; text-align: center; margin: 18px 8px 0; }

/* Headings */
.title-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 8px 0 18px; }
.title-row.left { align-items: center; justify-content: flex-start; }
.title-row p { margin: 2px 0 0; }
h1.big { font-size: 2rem; font-weight: 800; letter-spacing: -0.02em; margin: 0; }
h1.mid { font-size: 1.647rem; font-weight: 800; margin: 0; }
.round-btn {
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  width: 44px; height: 44px; border-radius: 50%; background: var(--card); color: var(--text); font-size: 1.4rem;
}
.pager { display: flex; gap: 6px; }

/* Cards and grouped rows */
.card, .group, .push-box { background: var(--card); border-radius: var(--radius); margin-bottom: 18px; }
.card { padding: 14px 16px; }
.card.attention { background: #2a2310; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.card-title { font-size: 1rem; font-weight: 700; margin: 0 0 8px; }
.group { overflow: hidden; }
.group-head { display: flex; justify-content: space-between; align-items: baseline; padding: 13px 16px 8px; font-weight: 700; }
.row { display: flex; align-items: center; gap: 12px; padding: 13px 16px; color: var(--text); border-top: 1px solid var(--bg); }
.group > .row:first-child { border-top: 0; }
.row-title { display: block; font-weight: 600; }
.row-sub { display: block; color: var(--muted); font-size: 0.765rem; margin-top: 2px; }
.row.static { font-size: 0.882rem; align-items: baseline; }
.row.static > :last-child { flex: 1; text-align: right; min-width: 0; overflow-wrap: anywhere; }
.row.static > .grow { flex: 0 0 auto; }
.chev { color: var(--muted); font-size: 1.412rem; line-height: 1; }
.empty-row { color: var(--muted); font-size: 0.882rem; margin: 0; padding: 4px 16px 14px; }
.link-card { display: flex; justify-content: space-between; align-items: center; gap: 8px; background: var(--card); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 18px; color: var(--text); font-weight: 600; }
.link-card .muted { font-weight: 400; font-size: 0.882rem; }

.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; background: var(--muted); }
.dot.green { background: var(--green); }
.dot.amber { background: var(--amber); }
.dot.red { background: var(--red); }

/* To check */
.section-label { font-size: 0.882rem; font-weight: 700; margin: 0 4px 8px; }
.check { background: #2a2310; border-radius: var(--radius); padding: 14px 16px; margin-bottom: 10px; }
.check-head { display: flex; justify-content: space-between; gap: 8px; }
.check-host { color: #ffd60a; font-weight: 700; font-size: 0.882rem; }
.check-title { font-weight: 600; margin-top: 4px; }
.check-text { color: #e5e5ea; font-size: 0.882rem; margin-top: 4px; white-space: pre-line; overflow-wrap: anywhere; }
.check-actions { margin-top: 10px; display: flex; }
.go { flex: 1; min-height: 44px; border: 0; border-radius: 12px; background: var(--green); color: #000; font-weight: 700; }
.more-link { display: block; text-align: center; font-weight: 600; padding: 8px 0 14px; }

/* Last night */
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; text-align: center; }
.tile { background: var(--card-2); border-radius: 12px; padding: 10px 4px; }
.tile b { display: block; font-size: 1.3rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.tile b.good { color: var(--green); }
.tile b.late { color: var(--amber); }
.tile span { color: var(--muted); font-size: 0.765rem; }

/* Events */
.ev { display: flex; gap: 12px; align-items: flex-start; padding: 12px 16px; border-top: 1px solid var(--bg); }
.group > .ev:first-child, .group-head + .ev { border-top: 0; }
.ev.quiet { opacity: 0.6; }
.ev.hot { background: #2a2310; }
.ev-icon { width: 30px; height: 30px; border-radius: 8px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; background: var(--card-2); color: var(--muted); }
.ev-icon.p3 { color: var(--blue); }
.ev-icon.p4 { background: var(--amber); color: #000; }
.ev-icon.p5 { background: var(--red); color: #fff; }
.ev-title { font-weight: 600; font-size: 0.882rem; overflow-wrap: anywhere; }
.ev-text { color: var(--muted); font-size: 0.765rem; margin-top: 2px; white-space: pre-line; overflow-wrap: anywhere; }
.ev-meta { color: var(--muted); font-size: 0.706rem; margin-top: 3px; font-style: italic; }
.ev-time { color: var(--muted); font-size: 0.765rem; font-variant-numeric: tabular-nums; flex-shrink: 0; }
.row-action { display: flex; padding: 0 16px 12px 58px; background: #2a2310; }
.day { color: var(--muted); font-size: 0.765rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; margin: 6px 4px 8px; }
.chips { display: flex; gap: 8px; overflow-x: auto; margin-bottom: 14px; padding-bottom: 2px; }
.chip { display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px; border-radius: 999px; background: var(--card); color: var(--text); font-size: 0.882rem; font-weight: 600; white-space: nowrap; }
.chip.on { background: var(--blue); }

/* Archive chart */
.bars { display: block; width: 100%; height: 56px; margin-top: 6px; }
.bars rect { fill: #3a3a3c; }
.bars rect.last { fill: var(--green); }
.bars-axis { display: flex; justify-content: space-between; margin-top: 4px; }

/* Digest */
.digest-para { margin: 0 0 10px; font-size: 0.882rem; color: #e5e5ea; white-space: pre-line; overflow-wrap: anywhere; }
.digest-label { color: var(--text); }

/* Tab bar */
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; display: flex; justify-content: space-around;
  background: #121214; border-top: 1px solid var(--line); padding: 6px 0 calc(6px + env(safe-area-inset-bottom));
}
.tabs a { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 72px; min-height: 44px; justify-content: center; color: var(--muted); font-size: 0.647rem; font-weight: 600; }
.tabs a.on { color: var(--blue); }
.tab-icon { position: relative; display: flex; }
.badge { position: absolute; top: -4px; right: -12px; background: var(--red); color: #fff; border-radius: 999px; font-size: 0.647rem; padding: 0 5px; line-height: 1.4; }

/* Login */
.login { display: flex; flex-direction: column; gap: 10px; margin-top: 20px; }
.login label { color: var(--muted); font-size: 0.882rem; }
.login input { font: inherit; color: var(--text); background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.login button { min-height: 48px; border: 0; border-radius: 12px; background: var(--blue); color: #fff; font-weight: 700; }

/* Notifications on this phone (web push), as in Trains */
.push-box { padding: 14px 16px; }
.push-box h2 { font-size: 1rem; margin: 0 0 6px; }
.push-state { font-size: 0.882rem; margin: 0; }
.push-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.push-actions button { font-weight: 600; color: var(--text); background: var(--card-2); border: 0; border-radius: 999px; padding: 10px 16px; }
.push-actions button.subtle { color: var(--muted); background: none; }
.push-actions:not(:has(button:not([hidden]))) { display: none; }
.push-warning { background: #331313; color: #ffb4ae; border-radius: var(--radius); padding: 12px 16px; margin: 0 0 18px; font-size: 0.882rem; line-height: 1.4; }
.push-warning b { color: var(--red); }
.signout { display: flex; justify-content: center; }
.signout button { background: none; border: 0; color: var(--muted); font-size: 0.882rem; padding: 12px; }
