/* A courier's tracking page: white, grey rules, a system font, numbers you can read in a hurry.
   The deadpan is the joke, so nothing here is styled for fun. The only colour in the piece is the
   dawn layer, and it is invisible for all but a few minutes a day.

   No dark mode on purpose: this page is a printed docket, and a docket is white. */

:root {
  --ink: #111;
  --mid: #555;
  --faint: #767676;
  --rule: #ddd;
  --rule-soft: #eee;
  --paper: #fff;
  --warm: 0;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

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

/* Fixed behind everything, opacity driven from app.js. At 0 the page is plain white, which is what
   it is for most of the day. */
#dawn {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: var(--warm);
  background: linear-gradient(180deg, #fff6ea 0%, #ffe6c6 38%, #ffcf9f 72%, #f9b183 100%);
}

#sheet {
  max-width: 660px;
  margin: 0 auto;
  padding: 20px 16px 48px;
}

h2 {
  margin: 0 0 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--faint);
}

p { margin: 0 0 2px; }
.muted { color: var(--mid); font-size: 13px; }
.strong { font-weight: 600; }

a { color: inherit; }

/* Anything clickable that is not a row: plain underlined text, at a finger-sized target. */
.link {
  appearance: none;
  border: 0;
  padding: 0;
  background: none;
  color: var(--ink);
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}
.link:hover, .link:focus-visible { color: var(--mid); }

/* --- docket head --- */

#bar {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--ink);
}
.mark {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.track-no {
  margin: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--mid);
}

.block {
  padding: 16px 0;
  border-bottom: 1px solid var(--rule);
}

#parties { display: grid; gap: 16px; }
@media (min-width: 520px) { #parties { grid-template-columns: 1fr 1fr; gap: 24px; } }

/* --- status --- */

.big {
  margin: 0 0 4px;
  font-size: 22px;
  line-height: 1.25;
  font-weight: 600;
  letter-spacing: -0.01em;
}
@media (min-width: 520px) { .big { font-size: 27px; } }
.sub { margin: 0 0 4px; font-size: 16px; color: var(--ink); }

#progress { margin: 18px 0 16px; }
#stages {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 0 0 6px;
  padding: 0;
  list-style: none;
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--faint);
}
#stages li:nth-child(2) { text-align: center; }
#stages li:nth-child(3) { text-align: right; }
#stages li.on { color: var(--ink); font-weight: 700; }
#stages li.done { color: var(--mid); }

#rail { height: 8px; border: 1px solid var(--ink); background: var(--paper); }
#fill { height: 100%; width: 0; background: var(--ink); transition: width 0.4s linear; }
/* The bar is the only "map" in the piece, so it never animates backwards over a round boundary. */
#fill.jump { transition: none; }

#facts { display: grid; gap: 10px; margin: 0 0 6px; }
@media (min-width: 520px) { #facts { grid-template-columns: repeat(3, 1fr); } }
#facts dt {
  font-size: 11px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--faint);
}
#facts dd {
  margin: 1px 0 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 16px;
}
#total-note { margin-top: 10px; font-size: 12px; }

/* --- checkpoints --- */

#lists .block:last-child, #lists.history-first #next { border-bottom: 0; }
.rows { margin: 0; padding: 0; list-style: none; }

.rows li {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 2px 10px;
  padding: 7px 0;
  border-bottom: 1px solid var(--rule-soft);
}
.rows li .t {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  color: var(--mid);
  padding-top: 1px;
}
.rows li .what { min-width: 0; }
.rows li .note { display: block; font-size: 13px; color: var(--mid); }
.rows li.note-row { grid-template-columns: 52px 1fr; color: var(--mid); font-size: 13px; }
.rows li.note-row .what { font-style: italic; }

/* An upcoming checkpoint is a link because watching someone else's delivery is the whole game. */
.rows a.where {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px dotted var(--faint);
  font-weight: 600;
}
.rows a.where:hover, .rows a.where:focus-visible { border-bottom: 1px solid var(--ink); }
.rows li b { font-weight: 600; }

.rows li.you { border-bottom: 2px solid var(--ink); border-top: 2px solid var(--ink); }
.rows li.you .what { font-weight: 600; }

#lists { display: flex; flex-direction: column; }
#lists.history-first #history { order: -1; }

#here {
  margin: 0;
  padding: 11px 0;
  border-top: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
  font-size: 14px;
  font-weight: 600;
}

footer {
  margin-top: 28px;
  padding-top: 16px;
  border-top: 1px solid var(--rule);
  color: var(--faint);
  font-size: 12px;
}
footer p { margin: 0 0 6px; }
/* The studio line is the last line of the docket, and the only one in the footer worth tapping, so
   its links carry a thumb-sized target in padding while the type stays as small as the fine print. */
.by { margin: 2px 0 0; }
.by a { display: inline-block; padding: 12px 0; }

/* --- address picker --- */

#picker {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 16px;
  background: rgba(255, 255, 255, 0.88);
}
#picker[hidden] { display: none; }
#picker-card {
  width: 100%;
  max-width: 520px;
  margin-top: 6vh;
  padding: 16px;
  border: 2px solid var(--ink);
  background: var(--paper);
  max-height: 84vh;
  display: flex;
  flex-direction: column;
}
#picker-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
#query {
  width: 100%;
  margin: 10px 0;
  padding: 10px;
  border: 1px solid var(--ink);
  border-radius: 0;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-size: 16px; /* anything smaller and iOS zooms the page on focus */
}
#results { flex: 1; overflow-y: auto; margin: 0 0 10px; padding: 0; list-style: none; }
#results li { border-bottom: 1px solid var(--rule-soft); }
#results button {
  display: block;
  width: 100%;
  padding: 10px 2px;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
#results button:hover, #results button:focus-visible { background: #f4f4f4; }
#results .sm { color: var(--mid); font-size: 13px; }
#locate-note { margin-top: 6px; }
