:root {
  --ink: #202124; --muted: #5f6368; --line: #e0e3e7; --bg: #f6f7f8; --card: #ffffff;
  --red: #c5221f; --red-bg: #fce8e6; --amber: #b06000; --amber-bg: #fef7e0;
  --green: #188038; --green-bg: #e6f4ea; --blue: #1a73e8; --head: #202124;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ink: #e8eaed; --muted: #9aa0a6; --line: #3c4043; --bg: #17181a; --card: #202124;
    --red: #f28b82; --red-bg: #3c1f1e; --amber: #fdd663; --amber-bg: #3a3221;
    --green: #81c995; --green-bg: #1e3326; --blue: #8ab4f8; --head: #2d2f31;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.4 Roboto, Arial, sans-serif; }
[hidden] { display: none !important; }
button { font: inherit; cursor: pointer; }
h2 { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; margin: 0; }

.signin { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.signin-box { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 32px; max-width: 360px; width: 100%; text-align: center; }
.signin-box p { color: var(--muted); }
.btn { background: var(--head); color: #fff; border: 0; border-radius: 4px; padding: 10px 18px; font-weight: 500; }
.link { background: none; border: 0; color: var(--blue); padding: 0; }

.top { display: flex; align-items: center; gap: 16px; padding: 12px 20px; background: var(--head); color: #fff; position: sticky; top: 0; z-index: 2; flex-wrap: wrap; }
.brand { font-weight: 700; font-size: 18px; }
.signin .brand { color: var(--ink); margin-bottom: 8px; }
.top .day { color: #bdc1c6; }
.top .right { margin-left: auto; display: flex; align-items: center; gap: 16px; }
.top .link { color: #8ab4f8; }
.clock { font-family: 'Roboto Mono', monospace; font-size: 15px; }
.live { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: #bdc1c6; }
.live i { width: 8px; height: 8px; border-radius: 50%; background: #9aa0a6; }
.live.on i { background: #34a853; box-shadow: 0 0 0 0 rgba(52,168,83,.6); animation: pulse 2s infinite; }
.live.off i { background: #ea4335; }
@keyframes pulse { 70% { box-shadow: 0 0 0 6px rgba(52,168,83,0); } 100% { box-shadow: 0 0 0 0 rgba(52,168,83,0); } }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; padding: 16px 20px 0; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: 6px; padding: 12px 14px; }
.tile .n { font-size: 28px; font-weight: 700; line-height: 1.1; }
.tile .l { color: var(--muted); font-size: 12px; }
.tile.red { border-color: var(--red); background: var(--red-bg); }
.tile.red .n { color: var(--red); }
.tile.amber .n { color: var(--amber); }

.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; padding: 16px 20px; }
@media (max-width: 900px) { .cols { grid-template-columns: 1fr; } }
.col { background: var(--card); border: 1px solid var(--line); border-radius: 6px; padding: 4px 16px 16px; min-width: 0; }
.head { display: flex; align-items: baseline; gap: 10px; margin: 14px 0 8px; }
.sub { color: var(--muted); font-size: 12px; }

.text { border-top: 1px solid var(--line); padding: 8px 0; }
.text-row { display: grid; grid-template-columns: 1fr 56px 120px auto; gap: 8px; align-items: center; }
.text-row .who { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.text-row .first { font-family: 'Roboto Mono', monospace; }
.pill { font-size: 12px; font-weight: 500; padding: 2px 8px; border-radius: 10px; justify-self: start; }
.pill.now { background: var(--red-bg); color: var(--red); }
.pill.late { background: var(--red); color: #fff; }
.pill.sent { background: var(--green-bg); color: var(--green); }
.pill.wait { color: var(--muted); }
.text pre { margin: 8px 0 0; padding: 10px; background: var(--bg); border-radius: 4px; font: 12px/1.45 'Roboto Mono', monospace; white-space: pre-wrap; }
.small { font-size: 12px; border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: 4px; padding: 3px 8px; }

.flags { list-style: none; margin: 0; padding: 0; }
.flags li { padding: 7px 10px; border-radius: 4px; margin-bottom: 4px; }
.flags li.urgent { background: var(--red-bg); color: var(--red); font-weight: 500; }
.flags li.minor { background: var(--amber-bg); }
.flags li.none { color: var(--muted); }

.sched { margin: 0 20px 24px; background: var(--card); border: 1px solid var(--line); border-radius: 6px; }
.tabs { display: flex; gap: 4px; align-items: center; padding: 8px 12px 0; border-bottom: 1px solid var(--line); }
.tab { background: none; border: 0; padding: 8px 12px; border-bottom: 2px solid transparent; color: var(--muted); font-weight: 500; }
.tab.on { color: var(--ink); border-color: var(--ink); }
.tabs .sub { margin-left: auto; }
.table-wrap { overflow: auto; max-height: 70vh; }
#sched { border-collapse: collapse; font-size: 12px; width: 100%; }
#sched td { border-bottom: 1px solid var(--line); padding: 4px 8px; white-space: nowrap; }
#sched tr.title td { font-weight: 700; background: var(--bg); }
#sched tr.trip td { font-weight: 500; }
.flash { animation: flash 1.2s ease-out; }
@keyframes flash { from { background: var(--amber-bg); } }

@media (max-width: 600px) {
  .top, .tiles, .cols { padding-left: 16px; padding-right: 16px; }
  .sched { margin: 0 16px 24px; }
  .text-row { grid-template-columns: 1fr 48px auto; }
  .text-row .copy { display: none; }
}
