/* Scout. en route's settled look (CLAUDE.md): white surface, cool-gray cards, Atkinson Hyperlegible Next body 18/28,
   8pt spacing (4px half-steps inside components only), 44px+ touch targets. --accent is the trip's colour (set by JS). */
@font-face { font-family: 'Atkinson'; src: url('fonts/AtkinsonNextPlainZero-Regular.ttf') format('truetype'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Atkinson'; src: url('fonts/AtkinsonNextPlainZero-SemiBold.ttf') format('truetype'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Atkinson'; src: url('fonts/AtkinsonNextPlainZero-Bold.ttf') format('truetype'); font-weight: 700; font-display: swap; }

:root {
  --surface: #FFFFFF; --card: #F2F4F6; --line: #E1E6EA; --input-line: #7F8C96;
  --ink: #26303A; --text: #33312E; --soft: #5B6B75;
  --accent: #1F3A5F; --on-accent: #FFFFFF;
  --ok-bg: #E4EDD9; --ok-text: #3F5A27; --ok-line: #CBDCA8;
  --amber-bg: #F6E7C8; --amber-text: #7A5200; --amber-line: #EBD3A0;
  --gray-bg: #E1E6EA; --gray-text: #4A5560;
  --no-bg: #F3D9C9; --no-text: #6B2E1F; --no-line: #E6C1AD;
  --switch-off: #7D8B95;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--surface); color: var(--text);
  font-family: 'Atkinson', system-ui, -apple-system, sans-serif; font-size: 18px; line-height: 28px;
  font-variant-numeric: tabular-nums;
}
h1, h2, p { margin: 0; }
h1 { font-size: 24px; line-height: 32px; font-weight: 600; color: var(--ink); }
h2 { font-size: 20px; line-height: 28px; font-weight: 600; color: var(--ink); }
a { color: inherit; }
button, input, textarea { font: inherit; color: inherit; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.soft { color: var(--soft); }
.small { font-size: 16px; line-height: 24px; }
.mt { margin-top: 24px; }
.error { color: #8E3122; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* header + tabs */
.top { position: sticky; top: 0; z-index: 5; background: var(--surface); border-bottom: 1px solid var(--line);
  padding: calc(8px + env(safe-area-inset-top)) 16px 16px; }
.top-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 44px; }
.brand { font-weight: 700; letter-spacing: 0.02em; color: var(--accent); }
.brand.big { font-size: 24px; line-height: 32px; margin-bottom: 24px; }
.back { display: inline-flex; align-items: center; min-height: 44px; padding-right: 16px; font-weight: 600; text-decoration: none; color: var(--accent); }
.sync { font-size: 16px; line-height: 24px; padding: 4px 12px; border-radius: 16px; font-weight: 600; white-space: nowrap; }
.sync-ok { background: var(--ok-bg); color: var(--ok-text); }
.sync-wait { background: var(--amber-bg); color: var(--amber-text); }
.sync-off { background: var(--gray-bg); color: var(--gray-text); }
.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; display: grid; grid-template-columns: repeat(4, 1fr);
  background: var(--surface); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.tab { display: flex; align-items: center; justify-content: center; gap: 4px; min-height: 56px; text-decoration: none;
  font-weight: 600; color: var(--soft); border-top: 4px solid transparent; }
.tab.on { color: var(--accent); border-top-color: var(--accent); }
.count { display: inline-flex; min-width: 24px; height: 24px; align-items: center; justify-content: center; padding: 0 4px;
  border-radius: 12px; background: var(--amber-bg); color: var(--amber-text); font-size: 16px; }

/* page */
.page { padding: 16px 16px calc(96px + env(safe-area-inset-bottom)); max-width: 720px; margin: 0 auto; display: grid; gap: 16px; }
.page.narrow { max-width: 480px; padding-top: 48px; }
.stack { display: grid; gap: 8px; }
.stack button { margin-top: 8px; }
label { font-weight: 600; color: var(--ink); }
input, textarea { width: 100%; min-height: 48px; padding: 8px 16px; border: 1px solid var(--input-line); border-radius: 8px; background: var(--surface); }
textarea { resize: vertical; line-height: 28px; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 8px 24px; border-radius: 8px;
  border: 1px solid transparent; font-weight: 700; cursor: pointer; text-decoration: none; }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn.primary { background: var(--accent); color: var(--on-accent); }
.btn.secondary { background: var(--surface); border-color: var(--accent); color: var(--accent); width: 100%; }
.btn.plain { background: none; color: var(--accent); padding: 8px 0; justify-content: flex-start; }
.btn.small { min-height: 44px; font-size: 16px; }
.btn.rec { width: 100%; background: var(--ink); color: #FFFFFF; }
.file-btn { position: relative; overflow: hidden; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; min-height: 0; }
.flash { position: sticky; top: 0; z-index: 6; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 8px 16px; background: var(--ink); color: #FFFFFF; }
.flash .btn.plain { color: #FFFFFF; }

.list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.row { display: grid; gap: 4px; width: 100%; text-align: left; padding: 16px; min-height: 56px; background: var(--card);
  border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.row-title { font-weight: 600; color: var(--ink); }

/* days */
.tz { font-size: 16px; line-height: 24px; }
.chips { display: flex; gap: 8px; overflow-x: auto; margin: 0 -16px; padding: 4px 16px 8px; scroll-snap-type: x proximity; }
.chip { flex: 0 0 auto; display: grid; justify-items: center; min-width: 72px; padding: 8px; border-radius: 8px;
  background: var(--card); border: 1px solid var(--line); text-decoration: none; scroll-snap-align: start; }
.chip span, .chip small { font-size: 16px; line-height: 24px; color: var(--soft); }
.chip strong { font-weight: 600; color: var(--ink); white-space: nowrap; }
.chip.today { border: 2px solid var(--accent); }
.chip.today span { color: var(--accent); font-weight: 700; }
.chip.on { background: var(--accent); border-color: var(--accent); }
.chip.on span, .chip.on strong, .chip.on small { color: var(--on-accent); }
.stop { display: grid; grid-template-columns: 80px 1fr; gap: 16px; padding: 16px; min-height: 56px; background: var(--card);
  border: 1px solid var(--line); border-radius: 8px; text-decoration: none; }
.stop.now { border: 2px solid var(--accent); background: var(--surface); }
.now-tag { justify-self: start; font-size: 16px; line-height: 24px; font-weight: 700; color: var(--accent); }
.time { display: grid; align-content: start; font-weight: 600; color: var(--ink); }
.time small { font-weight: 400; color: var(--soft); font-size: 16px; line-height: 24px; }
.stop-main { display: grid; gap: 4px; min-width: 0; }
.badges { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.badges:empty { display: none; }
.pill { font-size: 16px; line-height: 24px; padding: 0 8px; border-radius: 12px; font-weight: 600; border: 1px solid transparent; }
.v-yes { background: var(--ok-bg); color: var(--ok-text); border-color: var(--ok-line); }
.v-maybe { background: var(--amber-bg); color: var(--amber-text); border-color: var(--amber-line); }
.v-no { background: var(--no-bg); color: var(--no-text); border-color: var(--no-line); }
.pill.book { background: var(--surface); color: var(--amber-text); border-color: var(--amber-text); }
.score { font-weight: 700; color: var(--ink); }
.score small { font-weight: 400; color: var(--soft); font-size: 16px; }
.meta { font-size: 16px; line-height: 24px; color: var(--soft); }
.meta.wait, .wait { color: var(--amber-text); }
.ok { color: var(--ok-text); }
.bad { color: #8E3122; }

/* a stop */
.when { font-weight: 600; color: var(--ink); }
.itin-note { padding: 8px 16px; border-left: 4px solid var(--line); color: var(--soft); }
.itin-note .label { display: block; font-size: 16px; line-height: 24px; font-weight: 600; }
.state { font-size: 16px; line-height: 24px; font-weight: 600; color: var(--soft); }
.state-wait { color: var(--amber-text); }
.state-ok { color: var(--ok-text); }
.card { display: grid; gap: 16px; padding: 16px; background: var(--card); border: 1px solid var(--line); border-radius: 8px; }
.card h2 .small { font-weight: 400; }
.verdicts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.vbtn { min-height: 56px; border-radius: 8px; border: 1px solid var(--input-line); background: var(--surface); font-weight: 700; cursor: pointer; }
.vbtn.on.v-yes { background: var(--ok-text); color: #FFFFFF; border-color: var(--ok-text); }
.vbtn.on.v-maybe { background: var(--amber-text); color: #FFFFFF; border-color: var(--amber-text); }
.vbtn.on.v-no { background: var(--no-text); color: #FFFFFF; border-color: var(--no-text); }
.scores { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.sbtn { min-height: 48px; border-radius: 8px; border: 1px solid var(--input-line); background: var(--surface); font-weight: 700; cursor: pointer; }
.sbtn.on { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.crit { display: grid; gap: 8px; }
.crit-label { font-weight: 600; color: var(--ink); }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; width: 100%; min-height: 56px; padding: 8px 0;
  background: none; border: 0; text-align: left; cursor: pointer; }
.switch-row > span:first-child { display: grid; }
.switch { flex: 0 0 auto; position: relative; width: 56px; height: 32px; border-radius: 16px; background: var(--switch-off); transition: background 0.15s; }
.switch::after { content: ''; position: absolute; top: 4px; left: 4px; width: 24px; height: 24px; border-radius: 50%; background: #FFFFFF; transition: transform 0.15s; }
.switch-row[aria-checked="true"] .switch { background: var(--ok-text); }
.switch-row[aria-checked="true"] .switch::after { transform: translateX(24px); }
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.ph { margin: 0; display: grid; gap: 4px; }
.ph img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; display: block; background: var(--line); }
.ph figcaption { font-size: 16px; line-height: 24px; font-weight: 600; }
.voices { gap: 16px; }
.voice { display: grid; gap: 8px; }
.voice small { margin-left: 8px; font-weight: 600; }
.voice audio { width: 100%; height: 48px; }

/* to book */
.book-row { display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: center; padding: 8px 16px; background: var(--card);
  border: 1px solid var(--line); border-radius: 8px; }
.book-main { display: grid; gap: 4px; padding: 8px 0; text-decoration: none; min-width: 0; }
.switch-row.compact { width: auto; gap: 8px; font-size: 16px; font-weight: 600; }
.clip { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: var(--soft); }

/* compare */
.segs { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--input-line); border-radius: 8px; overflow: hidden; }
.seg { min-height: 48px; background: var(--surface); border: 0; border-right: 1px solid var(--input-line); font-weight: 600; cursor: pointer; }
.seg:last-child { border-right: 0; }
.seg.on { background: var(--accent); color: var(--on-accent); }
.compare { grid-template-columns: 1fr; }
.cmp { display: grid; grid-template-columns: 80px 1fr; gap: 16px; padding: 16px; background: var(--card); border: 1px solid var(--line);
  border-radius: 8px; text-decoration: none; height: 100%; }
.thumb { width: 80px; height: 80px; border-radius: 8px; object-fit: cover; background: var(--line); display: block; }
.cmp-main { display: grid; gap: 4px; align-content: start; min-width: 0; }
.crits { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 16px; line-height: 24px; color: var(--soft); }
.crits strong { color: var(--ink); }
@media (min-width: 720px) { .compare { grid-template-columns: 1fr 1fr; } }

/* settings */
.crit-edit { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; }
.crit-edit input:only-of-type:last-child { grid-column: 1 / -1; }
