/* ParkWatch
   Read at arm's length, one-handed, in Florida sun. That rules out low
   contrast, thin weights, dark backgrounds and webfonts loaded over hotel
   wifi. Everything below follows from that. */

:root {
  --paper: #fafaf7;
  --card: #ffffff;
  --ink: #14171a;
  --ink-2: #5a6169;
  --rule: #d5d9dd;
  --go: #0b7a3b;
  --stop: #b3261e;
  --idle: #7a828a;
  --flag: #0b4f9e;
  --tap: 48px;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 17px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  padding-bottom: env(safe-area-inset-bottom);
}

main { padding: 16px 16px 96px; max-width: 720px; margin: 0 auto; }

/* ---------------------------------------------------------------- header */

.bar {
  position: sticky; top: 0; z-index: 20;
  background: var(--ink); color: var(--paper);
  padding: calc(10px + env(safe-area-inset-top)) 16px 0;
}

.mark {
  display: block; color: var(--paper); text-decoration: none;
  font-weight: 800; font-size: 15px; letter-spacing: .16em;
}
.mark span { opacity: .55; }

.bar nav { display: flex; gap: 4px; margin-top: 8px; }

.bar nav a {
  flex: 1; text-align: center;
  padding: 12px 4px; min-height: var(--tap);
  color: var(--paper); text-decoration: none;
  font-size: 14px; font-weight: 600; letter-spacing: .04em;
  border-bottom: 3px solid transparent;
  opacity: .6;
}
.bar nav a.on { opacity: 1; border-bottom-color: var(--paper); }

/* ----------------------------------------------------------------- strip */

.strip {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-size: 14px; color: var(--ink-2);
  padding: 10px 0 14px;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 16px;
}
.strip .stamp { margin-left: auto; font-variant-numeric: tabular-nums; }

.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.dot.live { background: var(--go); }
.dot.idle { background: var(--idle); }

/* --------------------------------------------------------------- filter */

.filter {
  display: flex; margin-bottom: 16px;
  border: 1px solid var(--rule); border-radius: 6px; overflow: hidden;
}
.filter a {
  flex: 1; min-height: var(--tap);
  display: flex; align-items: center; justify-content: center;
  text-decoration: none; color: var(--ink-2);
  font-size: 15px; font-weight: 600;
}
.filter a.on { background: var(--ink); color: var(--paper); }

/* ----------------------------------------------------------------- board */

/* minmax(0, 1fr): without it the implicit grid column is `auto`, whose minimum
   is content-driven, so a long ride name pushes the row (and the wait number)
   off the right of a phone screen. */
.board { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }

.row {
  min-width: 0;
  background: var(--card);
  border: 1px solid var(--rule);
  border-left: 6px solid var(--idle);
  border-radius: 4px;
}
.card { }  /* the <details>; fills the .row card */

/* Tappable header. Native <details> disclosure — no JS. */
summary.head {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; min-height: 64px;
  cursor: pointer; list-style: none;
  -webkit-tap-highlight-color: transparent;
}
summary.head::-webkit-details-marker { display: none; }

.chev {
  flex: none; width: 9px; height: 9px; margin-left: 2px;
  border-right: 2px solid var(--ink-2); border-bottom: 2px solid var(--ink-2);
  transform: rotate(-45deg); transition: transform .15s;
}
details[open] .chev { transform: rotate(45deg); }

.panel { padding: 2px 14px 14px; border-top: 1px solid var(--rule); }
svg.spark { display: block; width: 100%; height: auto; margin-top: 10px; }
.sparkline { fill: none; stroke: var(--ink); stroke-width: 2; vector-effect: non-scaling-stroke; }
.thrline { stroke: var(--go); stroke-width: 1.5; stroke-dasharray: 4 3; vector-effect: non-scaling-stroke; }
.sparkdot { fill: var(--flag); }
.hourline { stroke: var(--rule); stroke-width: 1; vector-effect: non-scaling-stroke; }
.hourlbl { fill: var(--ink-2); font: 10px system-ui, sans-serif; }
.sparkfill { fill: var(--go); opacity: .14; }
.axlbl { fill: var(--ink-2); font: 10px system-ui, sans-serif; }
.gcap { font-size: 13px; color: var(--ink-2); margin: 8px 0 0; font-variant-numeric: tabular-nums; }

/* the rail is the whole status language: colour first, text second */
.row.s-operating     { border-left-color: var(--go); }
.row.s-down          { border-left-color: var(--stop); }
.row.s-refurbishment { border-left-color: var(--idle); }
.row.s-closed        { border-left-color: var(--rule); }

/* At/below your threshold: the row lights up and carries a labelled TARGET pill
   so it is unmistakable, rather than leaning on the green rail (which every
   operating ride already has). */
.row.hit { background: #eaf7ef; border-color: #9ed9b6; border-left-color: var(--go); }

.who { min-width: 0; flex: 1; }
.name {
  display: block; font-weight: 650; font-size: 16px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.meta { display: block; font-size: 13px; color: var(--ink-2); margin-top: 2px; }

/* Re-arm link, shown under a silenced ride so it can alert again on demand. */
.rearm { margin-top: 2px; }
.rearm .link { min-height: 40px; padding: 6px 0; }

.val { display: flex; align-items: baseline; gap: 3px; flex: none; }

.num {
  font: 700 34px/1 ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.02em;
}
.unit { font-size: 12px; color: var(--ink-2); text-transform: uppercase; letter-spacing: .06em; }


.tag {
  font-size: 12px; font-weight: 700; letter-spacing: .07em;
  text-transform: uppercase; padding: 6px 9px; border-radius: 3px;
  white-space: nowrap;
}
.tag.down   { background: var(--stop); color: #fff; }
.tag.refurb { background: #e9ebed; color: var(--ink-2); }
.tag.closed { background: #e9ebed; color: var(--ink-2); }
.tag.target { background: var(--go); color: #fff; flex: none; }

/* ------------------------------------------------------------------ text */

.hd { font-size: 15px; letter-spacing: .1em; text-transform: uppercase;
      color: var(--ink-2); margin: 32px 0 10px; font-weight: 700; }
.parkhd { font-size: 13px; letter-spacing: .08em; text-transform: uppercase;
          color: var(--ink-2); font-weight: 700; margin: 18px 0 8px; }
.parkhd:first-of-type { margin-top: 4px; }
main > .hd:first-child { margin-top: 0; }

.fine { font-size: 14px; color: var(--ink-2); margin: 0 0 16px; }
.loginerr { font-size: 14px; font-weight: 600; color: #fff; background: var(--stop);
            padding: 10px 12px; border-radius: 4px; margin: 0 0 16px; }

/* Button-like links for the account hub. */
.navbtn { display: flex; align-items: center; justify-content: center;
          min-height: var(--tap); padding: 12px 16px; margin-bottom: 10px;
          text-decoration: none; border-radius: 4px; font-weight: 650;
          border: 1px solid var(--ink); color: var(--ink); }
.navbtn.primary { background: var(--ink); color: var(--paper); }

/* Highlighted callout (the iOS add-to-home-screen instruction). */
.note { font-size: 14px; line-height: 1.4; color: var(--ink);
        background: #fff4d6; border: 1px solid #e6d08a;
        padding: 12px 14px; border-radius: 4px; margin: 0 0 14px; }

.empty {
  background: var(--card); border: 1px solid var(--rule); border-radius: 4px;
  padding: 24px; text-align: center;
}
.empty p { margin: 0 0 14px; }

/* ------------------------------------------------------------------- log */

.log { list-style: none; margin: 0; padding: 0; }
.log li {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 0; border-bottom: 1px solid var(--rule); font-size: 15px;
}
.log.spaced li { padding: 14px 0; }
.log .t {
  font: 600 13px/1 ui-monospace, "SF Mono", Menlo, monospace;
  color: var(--ink-2); font-variant-numeric: tabular-nums; flex: none;
}
.log .m { flex: 1; min-width: 0; }
.log .fail { font-size: 12px; color: var(--stop); font-weight: 700; }

/* ----------------------------------------------------------------- forms */

.stack { display: grid; gap: 14px; margin-bottom: 24px; }
.stack label { display: grid; gap: 6px; font-size: 14px; font-weight: 600; color: var(--ink-2); }

input[type=text], input[type=password], input[type=date], input[type=number], select {
  width: 100%; min-height: var(--tap);
  padding: 10px 12px; font-size: 17px; color: var(--ink);
  background: var(--card); border: 1px solid var(--rule); border-radius: 4px;
}
input:focus-visible, select:focus-visible, button:focus-visible, .pick:focus-within {
  outline: 3px solid var(--flag); outline-offset: 2px;
}

button {
  min-height: var(--tap); padding: 12px 18px;
  font-size: 16px; font-weight: 650; font-family: inherit;
  color: var(--ink); background: var(--card);
  border: 1px solid var(--ink); border-radius: 4px; cursor: pointer;
}
button.primary { background: var(--ink); color: var(--paper); }
button.link {
  /* Keep the link look, but give it a real one-handed tap target. */
  min-height: var(--tap); padding: 0 8px; border: 0; background: none;
  color: var(--flag); font-size: 15px; text-decoration: underline;
}

.actions { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.actions form { flex: 1; }
.actions button { width: 100%; }
.inline { display: inline; margin-left: auto; }

/* ----------------------------------------------------------------- picks */

.picks { list-style: none; margin: 0 0 16px; padding: 0; }
.picks li {
  display: flex; align-items: center; gap: 12px;
  border-bottom: 1px solid var(--rule);
}
.pick {
  flex: 1; display: flex; align-items: center; gap: 12px;
  padding: 12px 0; min-height: var(--tap); cursor: pointer; min-width: 0;
}
.pick input { width: 24px; height: 24px; flex: none; accent-color: var(--ink); }
.pick span { overflow: hidden; text-overflow: ellipsis; }
/* Must be `input.thr`, not `.thr`: the generic `input[type=number]` rule above
   sets width:100% at specificity (0,1,1); a bare `.thr` is (0,1,0) and loses,
   so the box blew out to full width and crushed the ride-name label. */
input.thr { width: 82px; flex: none; text-align: center; font-variant-numeric: tabular-nums; }

.sticky {
  position: sticky; bottom: 0;
  padding: 12px 0 calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--paper) 70%, transparent);
}
.sticky button { width: 100%; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
