/*
 * meet.css
 * spikefan.com's one page (plans/SPIKEFAN-MEET-DAY-PLAN.md §4, row B4).
 *
 * Phone first, one scroll, no sign-in (plans/ROSTER-SHARING-PLAN.md's UI RULE): the picker and the map both
 * reachable with a thumb, the map about half the screen, the Find me control and its one-line readout under
 * it, and every explanation folded away behind a `?` so the page itself stays short.
 *
 * Written in the spirit of live-edge/public/live.css rather than copied from it: that page has a race clock
 * and a splits table, this one has a list of courses and a readout. The tokens and the .map-host size are the
 * shared part; the rest is this page's own furniture.
 *
 * courseMap.js injects the map's own styles (the course line, the mile markers, the title over the map, the
 * tap readout, the fit button), so nothing here styles anything inside #mapHost — only the box it lives in.
 * The app's shared-styles.css is deliberately NOT loaded: it is not on the copy list and is not copied here.
 */

:root {
  --ink: #1b1b1b;
  --muted: #5a5a5a;
  --line: #e2e2e2;
  --paper: #ffffff;
  --page: #f4f5f7;
  --accent: #0b6bcb;
  --accent-soft: #eef4fb;
  --go: #28a745;
  --stop: #d92b2b;
  --warn-bg: #fff8e6;
  --warn-line: #f0d9a0;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--page);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

.wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 10px 12px 28px;
}

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

.head {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
}

.head h1 {
  margin: 0;
  font-size: 1.2rem;
  line-height: 1.2;
}

.head-sub {
  margin: 2px 0 0;
  font-size: 0.9rem;
  color: var(--muted);
}

/* The `?` buttons: small, obvious, and the only place the long explanations live (the UI RULE). */
.help-btn {
  margin-left: 6px;
  width: 22px;
  height: 22px;
  padding: 0;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 20px;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--line);
  border-radius: 50%;
  cursor: pointer;
  touch-action: manipulation;
  vertical-align: middle;
}

.help {
  margin: 8px 0 0;
  padding: 8px 10px;
  font-size: 0.85rem;
  line-height: 1.35;
  color: var(--ink);
  background: var(--accent-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
}

/* ---------------------------------------------------------------- cards, notes, warnings */

.card {
  margin-top: 10px;
  padding: 8px 10px 10px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.note {
  margin: 6px 0 0;
  font-size: 0.82rem;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.warn {
  margin: 8px 0 0;
  padding: 8px 10px;
  font-size: 0.85rem;
  background: var(--warn-bg);
  border: 1px solid var(--warn-line);
  border-radius: 8px;
}

.foot {
  margin: 12px 0 0;
  font-size: 0.78rem;
  color: var(--muted);
  text-align: center;
}

/* ---------------------------------------------------------------- the picker */

.picker-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.search {
  flex: 1 1 auto;
  min-width: 0;
  font: inherit;
  /* 16px or larger, or iOS Safari zooms the whole page on focus. */
  font-size: 1rem;
  padding: 9px 10px;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.count {
  flex: 0 0 auto;
  font-size: 0.78rem;
  color: var(--muted);
  white-space: nowrap;
}

/* The list is short today (4 courses) and capped in height for the day it is not, so the map is never pushed
   off the screen by the picker. */
.list {
  margin-top: 8px;
  max-height: 40vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* One row is one button, so the whole row is the tap target: read one-handed at a meet. */
.course-row {
  display: block;
  width: 100%;
  margin-bottom: 6px;
  padding: 9px 10px;
  font: inherit;
  text-align: left;
  color: inherit;
  background: var(--paper);
  border: 1px solid var(--line);
  border-left: 4px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  touch-action: manipulation;
}

.course-row:last-child { margin-bottom: 0; }
.course-row:active { background: var(--accent-soft); }

.course-row.is-chosen {
  border-left-color: var(--accent);
  background: var(--accent-soft);
}

.course-name {
  display: block;
  font-weight: 600;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.course-meta {
  display: flex;
  gap: 8px;
  margin-top: 2px;
  font-size: 0.82rem;
  color: var(--muted);
}

.course-dist {
  flex: 0 0 auto;
  font-variant-numeric: tabular-nums;
}

.course-town {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------------------------------------------------------------- the map */

.map-host {
  height: 50vh;
  min-height: 240px;
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: #dfe3e8;
}

/* ---------------------------------------------------------------- find me */

.find-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.find-btn {
  flex: 1 1 auto;
  min-height: 44px;
  font: inherit;
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  background: var(--go);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  touch-action: manipulation;
}

.find-btn.is-on { background: var(--stop); }
.find-btn:active { filter: brightness(0.94); }

.readout {
  margin: 8px 0 0;
  font-size: 0.92rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

[hidden] { display: none !important; }

@media (min-width: 700px) {
  .map-host { height: 55vh; }
  .list { max-height: 30vh; }
}
