/* Dark by default: both legs are night flights and this page gets read at
   03:50 in a hallway and on a dark apron bus. The QR viewer is the one place
   that goes white, because scanners need the contrast. */
:root {
  --bg: #10131a;
  --card: #191d26;
  --card-2: #212632;
  --ink: #eef1f6;
  --muted: #98a1b3;
  --line: #2a3040;
  --accent: #4fa3ff;
  --accent-ink: #06121f;
  --ok: #3ecf8e;
  --warn: #ffb84d;
  --alert: #ff6b6b;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 10px 30px rgba(0, 0, 0, .3);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

header {
  max-width: 720px;
  margin: 0 auto;
  padding: 16px 18px 6px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.brand { font-weight: 700; font-size: 1.15rem; letter-spacing: -.01em; }
.auth-indicator { font-size: .8rem; color: var(--muted); }
.auth-indicator a { color: var(--accent); text-decoration: none; font-weight: 600; }

main {
  max-width: 720px;
  margin: 0 auto;
  padding: 4px 18px 60px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
}

h1 { font-size: 1.35rem; margin: 0 0 10px; letter-spacing: -.02em; }
h2 { font-size: 1.05rem; margin: 0 0 12px; letter-spacing: -.01em; }
h3 { font-size: .95rem; margin: 18px 0 8px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-size: .72rem; }
p { margin: 0 0 10px; }
.muted { color: var(--muted); }
.small { font-size: .82rem; }

/* Hero: the single next thing to do, and how long there is left. */
.now { border-color: #33507a; background: linear-gradient(180deg, #1b2434, var(--card)); }
.now .eyebrow { color: var(--accent); font-weight: 700; font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; }
.now .headline { font-size: 1.5rem; font-weight: 700; letter-spacing: -.02em; margin: 6px 0 2px; }
.countdown { font-variant-numeric: tabular-nums; font-size: 2.6rem; font-weight: 700; letter-spacing: -.03em; line-height: 1.05; }
.countdown.past { color: var(--alert); }
.countdown.soon { color: var(--warn); }

/* Leg header: flight, route, clock times. */
.leg-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.leg-flight { font-weight: 700; }
.leg-route { font-size: 1.25rem; font-weight: 700; letter-spacing: -.02em; margin: 2px 0; }
.leg-times { color: var(--muted); font-size: .9rem; font-variant-numeric: tabular-nums; }

.pill {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 600;
  background: var(--card-2);
  border: 1px solid var(--line);
  color: var(--muted);
  white-space: nowrap;
}
.pill.live { color: var(--ok); border-color: #2c5a45; }
.pill.warn { color: var(--warn); border-color: #6b5325; }
.pill.alert { color: var(--alert); border-color: #6b2f2f; }

/* The four things you look up at the airport. */
.facts-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin: 14px 0 4px; }
.fact {
  background: var(--card-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  cursor: pointer;
  text-align: left;
  color: inherit;
  font: inherit;
  width: 100%;
}
.fact:hover { border-color: #3a4459; }
.fact .k { color: var(--muted); font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; }
.fact .v { font-size: 1.5rem; font-weight: 700; letter-spacing: -.02em; line-height: 1.2; }
.fact .v.empty { font-size: .95rem; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.fact .src { font-size: .7rem; color: var(--muted); }

.notes { list-style: none; margin: 12px 0 0; padding: 0; color: var(--muted); font-size: .85rem; }
.notes li { padding-left: 14px; position: relative; margin-bottom: 4px; }
.notes li::before { content: "·"; position: absolute; left: 4px; }

/* Timeline of one leg: time, checkbox, label. */
.tl { list-style: none; margin: 6px 0 0; padding: 0; }
.tl li { display: grid; grid-template-columns: 58px 22px 1fr; gap: 10px; align-items: start; padding: 9px 0; border-top: 1px solid var(--line); }
.tl li:first-child { border-top: 0; }
.tl .t { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--ink); }
.tl .t.none { color: var(--muted); font-weight: 500; }
.tl li.done .lab, .tl li.done .t { color: var(--muted); text-decoration: line-through; text-decoration-thickness: 1px; }
.tl li.now { background: #1d2735; margin: 0 -10px; padding: 9px 10px; border-radius: 10px; }
.tl .lab { font-weight: 600; }
.tl .sub { color: var(--muted); font-size: .82rem; font-weight: 400; }
.tl .sub a { color: var(--accent); }
.tl input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--accent); margin: 2px 0 0; }
.deadline .t { color: var(--warn); }

/* QR vault. */
.qr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.qr-tile { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 8px; cursor: pointer; }
.qr-tile img { width: 100%; aspect-ratio: 1; object-fit: contain; display: block; }
.qr-tile .cap { color: #10131a; font-size: .75rem; font-weight: 600; margin-top: 6px; text-align: center; }
.qr-empty { border: 1px dashed var(--line); border-radius: 12px; padding: 16px; color: var(--muted); font-size: .85rem; }

.viewer { position: fixed; inset: 0; background: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 16px; z-index: 50; }
.viewer img { max-width: 100%; max-height: 78vh; object-fit: contain; }
.viewer .meta { color: #10131a; font-weight: 600; }
.viewer .hint { color: #55606f; font-size: .8rem; }

/* Update feed. */
.feed { list-style: none; margin: 12px 0 0; padding: 0; }
.feed li { border-top: 1px solid var(--line); padding: 9px 0; display: flex; gap: 10px; align-items: baseline; }
.feed li:first-child { border-top: 0; }
.feed .when { color: var(--muted); font-size: .78rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.feed .who { font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; color: var(--accent); }
.feed .txt { flex: 1; }
.feed .del { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 1rem; padding: 0 4px; }

/* Controls. */
input[type=text], input[type=time], textarea, select {
  width: 100%;
  background: var(--card-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  padding: 10px 12px;
  font: inherit;
}
textarea { min-height: 70px; resize: vertical; }
label.field { display: block; margin-bottom: 10px; }
label.field span { display: block; color: var(--muted); font-size: .78rem; margin-bottom: 4px; }

button.btn {
  background: var(--accent);
  color: var(--accent-ink);
  border: 0;
  border-radius: 10px;
  padding: 10px 14px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
button.btn.ghost { background: var(--card-2); color: var(--ink); border: 1px solid var(--line); font-weight: 600; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.links { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.links a {
  color: var(--ink);
  text-decoration: none;
  background: var(--card-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 12px;
  font-size: .82rem;
  font-weight: 600;
}

footer { max-width: 720px; margin: 0 auto; padding: 0 18px 40px; color: var(--muted); font-size: .8rem; }

dialog {
  background: var(--card);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  width: min(420px, 92vw);
}
dialog::backdrop { background: rgba(0, 0, 0, .6); }

/* Chips in the hero: what can be done right now, ticked with one tap. */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.chip {
  background: var(--card-2);
  border: 1px solid #33507a;
  border-radius: 999px;
  color: var(--ink);
  padding: 7px 12px;
  font: inherit;
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
}
.chip-when { color: var(--muted); font-weight: 500; }

/* The timeslot tile while the slot is actually valid. */
.fact.hot { border-color: var(--ok); background: #17281f; }
.fact.hot .v { color: var(--ok); }
