/* Rounds: a route sheet for walking sessions. Read outdoors on a phone, often in sun:
   high contrast, large tap targets, one typeface built for legibility. */
@import url('https://fonts.googleapis.com/css2?family=Atkinson+Hyperlegible:wght@400;700&display=swap');

:root {
  --paper: #f7f6f2;
  --card: #ffffff;
  --ink: #16201b;
  --muted: #56615b;
  --rule: #d9ddd7;
  --sign: #1d5b3f;      /* road-sign green, the one accent */
  --sign-ink: #ffffff;
  --a: #1d5b3f;
  --b: #8a5a12;
  --done: #e7efe9;
  --r: 6px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #111614; --card: #19201c; --ink: #edf1ee; --muted: #a3ada7; --rule: #2c3530;
    --sign: #5fae86; --sign-ink: #0c130f; --a: #7cc59f; --b: #e0b066; --done: #1c2b23;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 17px/1.45 'Atkinson Hyperlegible', system-ui, sans-serif;
}
main { max-width: 760px; margin: 0 auto; padding: 16px 16px 120px; }
h1, h2, h3 { line-height: 1.2; margin: 0; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
a { color: var(--sign); }
button, input, select, textarea { font: inherit; color: inherit; }
button {
  min-height: 44px; padding: 8px 16px; border-radius: var(--r); cursor: pointer;
  border: 1px solid var(--rule); background: var(--card);
}
button.go { background: var(--sign); color: var(--sign-ink); border-color: var(--sign); font-weight: 700; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 3px solid var(--sign); outline-offset: 2px;
}
label { display: block; font-weight: 700; margin: 12px 0 4px; }
input[type=password], input[type=text], select, textarea {
  width: 100%; min-height: 44px; padding: 8px 10px; border: 1px solid var(--muted);
  border-radius: var(--r); background: var(--card);
}
textarea { min-height: 110px; resize: vertical; }
.muted { color: var(--muted); }
.err { color: #b3261e; font-weight: 700; }

/* Header */
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 0 16px; }
.top nav { display: flex; gap: 8px; }
.top nav button { min-height: 40px; padding: 6px 12px; }

/* Session list */
.filters { display: flex; gap: 8px; margin-bottom: 12px; }
.area { margin: 24px 0 8px; font-size: 1rem; color: var(--muted); }
.row {
  display: grid; grid-template-columns: 3.2rem 1fr auto; gap: 12px; align-items: center;
  width: 100%; text-align: left; padding: 12px; margin: 0 0 8px; background: var(--card);
  border: 1px solid var(--rule); border-radius: var(--r);
}
.row .id { font-weight: 700; color: var(--sign); }
.row .counts { text-align: right; white-space: nowrap; }
.row.started { border-left: 5px solid var(--sign); }

/* Session view */
.bar {
  position: sticky; top: 0; z-index: 2; background: var(--paper); padding: 10px 0;
  border-bottom: 1px solid var(--rule); display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.timer { font-size: 1.6rem; font-weight: 700; font-variant-numeric: tabular-nums; min-width: 6ch; }
.tip { background: var(--card); border: 1px solid var(--rule); border-radius: var(--r); padding: 12px; margin: 16px 0; }
.stop { margin: 28px 0 8px; }
.biz {
  display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 10px; padding: 12px;
  background: var(--card); border: 1px solid var(--rule); border-radius: var(--r); margin-bottom: 8px;
}
.biz.done { background: var(--done); }
.biz input[type=checkbox] { width: 28px; height: 28px; margin: 4px 0 0 4px; accent-color: var(--sign); }
.biz .name { font-weight: 700; }
.tier { display: inline-block; min-width: 1.6em; font-weight: 700; }
.tier.A { color: var(--a); } .tier.B { color: var(--b); }
.biz .meta { font-size: .92rem; color: var(--muted); }
.biz .out { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.biz .out select { flex: 1 1 12rem; width: auto; }
.biz .out input { flex: 2 1 14rem; width: auto; }
details.cs { margin: 6px 0 0; color: var(--muted); font-size: .92rem; }
details.cs summary { display: block; padding: 12px 0; cursor: pointer; }
.end { margin-top: 32px; }
.copied { color: var(--sign); font-weight: 700; margin-left: 8px; }

/* Login */
body.login main { max-width: 360px; padding-top: 18vh; }
body.login button { width: 100%; margin-top: 16px; }

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

/* Phone fixes */
.biz > div { min-width: 0; overflow-wrap: anywhere; }
.biz .out select, .biz .out input { min-width: 0; flex-basis: 100%; }
.top { flex-wrap: wrap; }
.top nav { flex-wrap: wrap; }
.top nav button { font-size: .9rem; padding: 6px 10px; }

/* Walking order, next stop, map */
.num { display: inline-block; min-width: 1.7em; color: var(--muted); font-variant-numeric: tabular-nums; }
.biz.next { border: 2px solid var(--sign); }
.leg { margin: 0 0 8px 54px; font-size: .9rem; color: var(--muted); }
.dir { display: inline-block; margin-top: 8px; padding: 10px 0; font-weight: 700; }
.nextb { flex: 1 1 100%; text-align: left; font-weight: 700; color: var(--sign); background: var(--card); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
details.map { margin: 12px 0; background: var(--card); border: 1px solid var(--rule); border-radius: var(--r); }
details.map summary { display: block; padding: 14px 12px; font-weight: 700; cursor: pointer; }
#map { height: 60vh; min-height: 320px; }
.small { font-size: .85rem; padding: 0 12px; }
.pin { background: var(--sign); color: var(--sign-ink); border: 2px solid #fff; border-radius: 50%; font: 700 12px/22px 'Atkinson Hyperlegible', sans-serif; text-align: center; box-shadow: 0 1px 3px rgba(0,0,0,.4); }
.pin.pdone { background: #8a938e; }

/* Compact cards: tap the name to log an outcome */
.biz .name { display: flex; gap: 10px; align-items: baseline; width: 100%; min-height: 44px; padding: 0; border: 0; background: none; text-align: left; font-weight: 700; font-size: 1.05rem; cursor: pointer; }
.biz .num { display: inline-flex; gap: 2px; min-width: 2.6em; color: var(--muted); }
.biz .num .tier { min-width: 0; }
.biz .got { display: block; font-weight: 400; font-size: .9rem; color: var(--sign); }
.biz .more { display: none; }
.biz.open .more { display: block; }
.biz .meta { margin-top: 2px; }
.bar { gap: 8px; }

details.tip summary { display: block; cursor: pointer; }
details.tip p { margin: 8px 0 0; }

.walk { display: inline-flex; align-items: center; justify-content: center; flex: 1 1 100%; min-height: 48px; border-radius: var(--r); text-decoration: none; background: var(--sign); color: var(--sign-ink); font-weight: 700; }
.walk[hidden] { display: none; }
.route { margin: 12px 0; line-height: 2.4; }
.route .rl { display: inline-block; padding: 4px 10px; margin-right: 6px; border: 1px solid var(--rule); border-radius: var(--r); background: var(--card); line-height: 1.6; }

/* Brand and finish */
.brand { display: flex; align-items: center; gap: 10px; }
.brand img { border-radius: 8px; }
.row, .biz, .tip, .route .rl { box-shadow: 0 1px 0 var(--rule); }
.row:active, .biz .name:active, button:active { transform: translateY(1px); }
.biz.done { opacity: .75; }
.biz.next { box-shadow: 0 0 0 3px color-mix(in srgb, var(--sign) 18%, transparent); }
.bar { backdrop-filter: none; background: color-mix(in srgb, var(--paper) 94%, transparent); }
.tier.B { color: #a8690c; }
@media (prefers-reduced-motion: reduce) { .row:active, button:active { transform: none; } }

.aonly { display: flex; align-items: center; gap: 8px; font-weight: 700; margin: 8px 0; white-space: nowrap; }
.aonly input { width: 24px; height: 24px; accent-color: var(--sign); }

.acts { display: flex; gap: 8px; align-items: center; margin-top: 10px; flex-wrap: wrap; }
.acts button { flex: 1 1 6rem; }
.acts .dir { flex: 1 1 100%; margin: 0; }
