:root { --green: #1f6f4a; --ink: #1d2420; --muted: #6b7280; --bg: #f4f6f4; --card: #ffffff; }
* { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, system-ui, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--ink); }
#hdr { background: var(--green); color: #fff; padding: 18px 16px 14px; position: sticky; top: 0; z-index: 5; }
.hdr-title { font-size: 22px; font-weight: 700; }
.hdr-sub { font-size: 13px; opacity: .9; margin-top: 2px; }
/* v19: stop-card badges on their own row — readable even when several apply */
.stoptags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.stoptags .watchtag, .stoptags .favtag, .stoptags .freetag, .stoptags .beentag,
.stoptags .obadge, .stoptags .cbadge { margin-left: 0; }
#view { padding: 14px 14px 28px; max-width: 640px; margin: 0 auto; }
.card { background: var(--card); border-radius: 14px; padding: 14px; margin-bottom: 14px; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.row { display: flex; gap: 8px; }
#addr { flex: 1; font-size: 16px; padding: 12px; border: 1px solid #d1d5db; border-radius: 10px; }
.btn { background: var(--green); color: #fff; border: 0; border-radius: 10px; padding: 0 18px; font-size: 16px; font-weight: 600; }
.btn:active { transform: scale(.97); }
.muted { color: var(--muted); font-size: 12.5px; margin-top: 8px; }
.stop { background: var(--card); border-radius: 14px; padding: 14px; margin-bottom: 12px; box-shadow: 0 1px 3px rgba(0,0,0,.08); display: flex; gap: 12px; align-items: flex-start; }
.num { flex: 0 0 34px; height: 34px; border-radius: 50%; background: var(--green); color: #fff; font-weight: 700; display: flex; align-items: center; justify-content: center; font-size: 16px; }
.stop-body { flex: 1; min-width: 0; }
.stop-title { font-weight: 700; font-size: 16px; }
.stop-addr { font-size: 14px; margin-top: 2px; }
.stop-meta { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.stop-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.nav { background: #2563eb; color: #fff; text-decoration: none; border-radius: 10px; padding: 10px 16px; font-size: 15px; font-weight: 600; }
.rm { background: #f3f4f6; color: var(--muted); border: 0; border-radius: 10px; padding: 10px 14px; font-size: 15px; }
.whole { display: block; text-align: center; background: var(--green); color: #fff; text-decoration: none; border-radius: 14px; padding: 14px; font-size: 16px; font-weight: 700; margin: 4px 0 14px; }
h2.sect { font-size: 12.5px; color: var(--muted); margin: 22px 4px 10px; font-weight: 800;
  text-transform: uppercase; letter-spacing: .07em; }
.unp { background: var(--card); border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; font-size: 14px; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.unp a { color: #2563eb; }
.empty { text-align: center; color: var(--muted); padding: 30px 10px; font-size: 15px; }
.lbl { font-size: 13px; font-weight: 700; color: var(--muted); margin-bottom: 8px; }
.btnrow { margin-top: 8px; }
.ghost { flex: 1; background: #e9f2ec; color: var(--green); border: 0; border-radius: 10px; padding: 10px; font-size: 14px; font-weight: 600; }
.ghost:active { transform: scale(.97); }
.thumb { flex: 0 0 64px; width: 64px; height: 64px; border-radius: 10px; object-fit: cover; background: #e5e7eb; }
.thumb.zoomable { cursor: zoom-in; }

/* v11: full-screen photo lightbox */
#lightbox { position: fixed; inset: 0; z-index: 9999; background: rgba(0,0,0,.92);
  display: none; align-items: center; justify-content: center; }
#lightbox.open { display: flex; }
#lbImg { max-width: 100vw; max-height: 88vh; object-fit: contain; background: #000; }
#lbClose { position: absolute; top: 14px; right: 14px; width: 48px; height: 48px;
  border-radius: 999px; border: 0; background: rgba(255,255,255,.16); color: #fff;
  font-size: 22px; line-height: 1; cursor: pointer; }
#lbPrev, #lbNext { position: absolute; top: 50%; transform: translateY(-50%);
  width: 52px; height: 72px; border: 0; border-radius: 12px; background: rgba(255,255,255,.16);
  color: #fff; font-size: 34px; line-height: 1; cursor: pointer; }
#lbPrev { left: 10px; }
#lbNext { right: 10px; }
#lbCap { position: absolute; bottom: 16px; left: 0; right: 0; text-align: center;
  color: #e5e7eb; font-size: 14px; padding: 0 20px; }
.stop-items { font-size: 13px; margin-top: 4px; color: #374151; }
#foot { text-align: center; color: var(--muted); font-size: 12px; padding: 0 16px 30px; }
.obadge { font-size: 12px; font-weight: 700; margin-left: 8px; white-space: nowrap; }
.obadge.open { color: #15803d; }
.obadge.soon { color: #b45309; }
.obadge.done { color: #6b7280; }
/* v8: closing-soon badge — red pill so it stands out on the stop card */
.cbadge { font-size: 12px; font-weight: 700; margin-left: 8px; white-space: nowrap; }
.cbadge.hot { color: #b91c1c; background: #fee2e2; border-radius: 999px; padding: 2px 8px; }
/* v10: hours text colored by live open status */
.when { font-weight: 400; }
.when-open { color: #15803d; font-weight: 700; }
.when-hot { color: #b91c1c; font-weight: 700; }
.when-soon { color: #b45309; font-weight: 700; }
.when-done { color: #9ca3af; }

/* hunting-for filter */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.chip { border: 1px solid var(--line, #e2e8f0); background: #fff; border-radius: 999px;
  padding: 6px 12px; font-size: 13px; cursor: pointer; }
.chip.on { background: #0f172a; color: #fff; border-color: #0f172a; }
.shareline { margin-top: 10px; }

/* v6: done mode */
.donebtn { background: #e9f2ec; color: var(--green); border: 0; border-radius: 10px;
  padding: 10px 16px; font-size: 15px; font-weight: 700; min-height: 44px; }
.donebtn.on { background: var(--green); color: #fff; }
.stop.visited { opacity: .5; }
.stop.visited .num { background: #9ca3af; }
.stop.visited .thumb, .stop.visited .stop-items { display: none; }
.prog-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.prog-top strong { font-size: 15px; }
.prog-bar { background: #e5e7eb; border-radius: 999px; height: 12px; overflow: hidden; margin-top: 10px; }
.prog-fill { height: 100%; background: var(--green); border-radius: 999px; transition: width .25s; }

/* v6: watchlist */
#watchInput { flex: 1; font-size: 16px; padding: 12px; border: 1px solid #d1d5db; border-radius: 10px; }
.watch-banner { background: #fef9c3; border: 1px solid #fde047; border-radius: 14px;
  padding: 12px 14px; margin-bottom: 12px; font-size: 15px; font-weight: 700; }
.watch-banner .muted { margin-top: 4px; font-weight: 400; }
.stop.watched { outline: 2px solid #eab308; }
.watchtag { font-size: 12px; font-weight: 700; color: #92400e; background: #fef3c7;
  border-radius: 999px; padding: 2px 8px; margin-left: 8px; white-space: nowrap; }

/* v7: favorite sellers */
.star { background: #f3f4f6; border: 0; border-radius: 10px; padding: 10px 14px;
  font-size: 18px; line-height: 1; min-height: 44px; cursor: pointer; color: #9ca3af; }
.star:active { transform: scale(.94); }
.star.on { background: #fef3c7; color: #d97706; }
.favtag { font-size: 12px; font-weight: 700; color: #92400e; background: #fef3c7;
  border-radius: 999px; padding: 2px 8px; margin-left: 8px; white-space: nowrap; }

/* v12: free-box flag */
.freetag { font-size: 12px; font-weight: 700; color: #166534; background: #dcfce7;
  border-radius: 999px; padding: 2px 8px; margin-left: 8px; white-space: nowrap; }

/* v13: Mattoon opt-in checkmark + area tag */
.checkrow { display: flex; align-items: center; gap: 10px; margin-top: 10px;
  font-size: 15px; cursor: pointer; }
.checkrow input { width: 22px; height: 22px; accent-color: #1f6f4a; }
.areatag { font-size: 12px; font-weight: 700; color: #1e40af; background: #dbeafe;
  border-radius: 999px; padding: 2px 8px; margin-left: 8px; white-space: nowrap; }
.fav-banner { background: #fffbeb; border: 1px solid #fcd34d; border-radius: 14px;
  padding: 12px 14px; margin-bottom: 12px; font-size: 15px; font-weight: 700; }
.fav-banner .muted { margin-top: 4px; font-weight: 400; }
.stop.faved { outline: 2px solid #f59e0b; }

/* v9: gas cost estimate settings */
.gaslink { background: none; border: 0; cursor: pointer; font-size: 14px; padding: 2px 4px; }
.gaspanel { display: none; gap: 10px; align-items: center; margin-top: 10px; flex-wrap: wrap; }
.gaspanel.open { display: flex; }
.gaspanel label { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.gaspanel input { width: 84px; font-size: 15px; padding: 8px; border: 1px solid #d1d5db; border-radius: 8px; }
.gaspanel .btn { padding: 8px 16px; font-size: 14px; }

/* v17: print route — overlay view + print stylesheet */
#printdoc { display: none; }
#printactions { display: flex; gap: 10px; padding: 12px; max-width: 640px; margin: 0 auto; }
#printactions .btn { padding: 12px 22px; }
#printactions .ghost { flex: 0 0 auto; padding: 12px 22px; }
.p-title { font-size: 22px; font-weight: 700; text-align: center; margin: 8px 0 2px; }
.p-sub { text-align: center; color: #444; font-size: 14px; margin-bottom: 10px; }
.p-summary { text-align: center; font-size: 14px; background: #f3f4f6; border-radius: 10px; padding: 8px; margin: 0 auto 14px; max-width: 640px; }
.p-stop { display: flex; gap: 10px; padding: 10px 0; border-top: 1px solid #ddd; page-break-inside: avoid; }
.p-num { flex: 0 0 30px; height: 30px; border-radius: 50%; background: #1f6f4a; color: #fff; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.p-body { flex: 1; min-width: 0; }
.p-addr { font-weight: 700; font-size: 16px; }
.p-when { font-size: 13px; color: #1f6f4a; font-weight: 600; }
.p-items { font-size: 13px; }
.p-badges { margin-top: 4px; }
.p-badge { display: inline-block; font-size: 12px; font-weight: 700; background: #eef2ff; border-radius: 6px; padding: 2px 8px; margin: 2px 4px 2px 0; }
.p-done { font-size: 12px; color: #1f6f4a; font-weight: 700; }
.p-sect { font-size: 15px; font-weight: 700; margin: 16px 0 6px; }
.p-unp { font-size: 13px; padding: 6px 0; border-top: 1px dashed #ccc; }
.p-url { font-size: 11px; color: #555; word-break: break-all; }
.p-foot { margin-top: 16px; font-size: 12px; color: #888; text-align: center; }
.p-empty { text-align: center; color: #6b7280; padding: 40px 16px; font-size: 16px; }
@media print {
  body > *:not(#printdoc) { display: none !important; }
  #printdoc { display: block !important; max-width: 640px; margin: 0 auto; }
  #printactions { display: none !important; }
  .p-badge { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* v18: been-there checkmarks + open-in-Maps button */
.beentag { font-size: 12px; font-weight: 700; color: #1d4ed8; background: #dbeafe;
  border-radius: 6px; padding: 2px 8px; margin-left: 6px; white-space: nowrap; }
.mapbtn { display: block; text-align: center; background: #1d4ed8; color: #fff;
  text-decoration: none; border-radius: 14px; padding: 12px; font-size: 16px;
  font-weight: 700; margin: 10px 0 2px; }
.mapbtn:active { transform: scale(.98); }
.beenthere { background: var(--card); border-radius: 14px; padding: 4px 14px 10px;
  margin: 4px 0 14px; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.beenthere summary { font-weight: 700; font-size: 15px; padding: 10px 0; cursor: pointer; }
.bt-row { display: flex; align-items: center; gap: 8px; padding: 8px 0;
  border-top: 1px solid #eef0f2; font-size: 14px; }
.bt-check { color: var(--green); font-weight: 700; }
.bt-addr { flex: 1; min-width: 0; }
