/* 75H — screens. Mobile-first, large tap targets. */
:root {
  --bg: #f1f5f9; --card: #ffffff; --ink: #0f172a; --muted: #64748b; --line: #e2e8f0;
  --brand: #0f172a; --accent: #0284c7; --ok: #16a34a; --warn: #d97706; --bad: #dc2626; --skip: #94a3b8;
  --radius: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }
a { color: var(--accent); text-decoration: none; }
h1 { font-size: 1.35rem; margin: 0; }
h2 { font-size: 1.05rem; margin: 0 0 .6rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; padding: 3rem 1rem; }
.wrap { max-width: 880px; margin: 0 auto; padding: 0 12px 90px; }

/* Top bar */
.top { position: sticky; top: 0; z-index: 1000; background: var(--brand); color: #fff;
  padding: calc(10px + env(safe-area-inset-top)) 14px 10px; display: flex; align-items: center; gap: 10px; }
.top a, .top button.link { color: #cbd5e1; }
.top .title { flex: 1; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.logo { font-weight: 900; letter-spacing: .5px; color: #fff !important; }

/* Cards and lists */
.card { background: var(--card); border-radius: var(--radius); padding: 14px; margin: 12px 0;
  box-shadow: 0 1px 2px rgba(15,23,42,.06); }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.list { list-style: none; margin: 0; padding: 0; }
.list > li { border-top: 1px solid var(--line); padding: 10px 0; }
.list > li:first-child { border-top: 0; }
.route-card { display: block; color: inherit; }
.route-card .name { font-weight: 700; }

/* Buttons and inputs */
button, .btn { font: inherit; border: 0; border-radius: 10px; padding: 10px 14px; cursor: pointer;
  background: #e2e8f0; color: var(--ink); display: inline-flex; align-items: center; gap: 6px; justify-content: center;
  min-height: 44px; }
button.primary, .btn.primary { background: var(--accent); color: #fff; }
button.ok { background: var(--ok); color: #fff; }
button.danger { background: #fee2e2; color: var(--bad); }
button.link { background: none; padding: 4px 6px; min-height: 0; color: var(--accent); }
button:disabled { opacity: .5; cursor: default; }
button.big { width: 100%; font-size: 1.05rem; font-weight: 700; padding: 14px; }
input, select, textarea { font: inherit; width: 100%; padding: 10px 12px; border: 1px solid #cbd5e1;
  border-radius: 10px; background: #fff; color: var(--ink); min-height: 44px; }
textarea { min-height: 140px; }
label { display: block; font-size: .85rem; color: var(--muted); margin: 10px 0 4px; }
.code-input { font-family: ui-monospace, Menlo, monospace; letter-spacing: 1px; text-transform: uppercase; }

/* Tags and status */
.tag { display: inline-block; font-size: .75rem; padding: 2px 8px; border-radius: 999px; background: #e0f2fe; color: #075985; }
.badge { display: inline-block; font-size: .75rem; padding: 2px 8px; border-radius: 999px; background: #dcfce7; color: #166534; }
.warn { color: var(--warn); font-size: .85rem; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0; }
.chip { border-radius: 999px; padding: 6px 12px; min-height: 0; background: #e2e8f0; font-size: .85rem; }
.chip.on { background: var(--ink); color: #fff; }
.tabs { display: flex; gap: 6px; margin-bottom: 10px; }
.tabs button { flex: 1; }
.tabs button.on { background: var(--ink); color: #fff; }

/* Map */
.map { height: 42vh; min-height: 260px; border-radius: var(--radius); overflow: hidden; margin: 12px 0; z-index: 0; }
.run-map { height: 46vh; }
.pin { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; color: #fff;
  font: 700 12px/1 -apple-system, sans-serif; border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.4); background: #64748b; }
.pin.done { background: var(--ok); }
.pin.skipped { background: var(--skip); }
.pin.next { background: var(--accent); width: 36px; height: 36px; font-size: 14px; border-width: 3px; }
.pin.warn { background: var(--warn); }
.me-dot { width: 18px; height: 18px; border-radius: 50%; background: #2563eb; border: 3px solid #fff; box-shadow: 0 0 0 6px rgba(37,99,235,.25); }

/* Run screen */
.next-card { border: 2px solid var(--accent); }
.next-card .addr { font-size: 1.15rem; font-weight: 700; }
.btn-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.btn-grid .full { grid-column: 1 / -1; }
.stop-line { display: flex; gap: 10px; align-items: flex-start; }
.num { flex: none; width: 28px; height: 28px; border-radius: 50%; background: #e2e8f0; display: grid; place-items: center; font-weight: 700; font-size: .8rem; }
.num.done { background: var(--ok); color: #fff; }
.num.skipped { background: var(--skip); color: #fff; }
.num.next { background: var(--accent); color: #fff; }
.banner { background: #fef3c7; border: 1px solid #fcd34d; border-radius: var(--radius); padding: 12px; margin: 12px 0; }
.banner.info { background: #e0f2fe; border-color: #7dd3fc; }
.progress { height: 8px; background: #e2e8f0; border-radius: 99px; overflow: hidden; }
.progress > div { height: 100%; background: var(--ok); }

/* Tables (summary / print / review) */
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; padding: 6px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .75rem; text-transform: uppercase; color: var(--muted); letter-spacing: .3px; }
.table-scroll { overflow-x: auto; }
.review td input { min-height: 38px; padding: 6px 8px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; }
.stat { background: var(--bg); border-radius: 10px; padding: 10px; }
.stat b { display: block; font-size: 1.25rem; }
.code-box { font: 700 1.2rem/1.6 ui-monospace, Menlo, monospace; background: #0f172a; color: #e2e8f0;
  padding: 14px; border-radius: 10px; word-break: break-all; text-align: center; letter-spacing: 1px; }

.toast { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: #0f172a; color: #fff; padding: 12px 18px; border-radius: 12px; z-index: 2000; max-width: 92vw; box-shadow: 0 6px 20px rgba(0,0,0,.25); }
.toast.bad { background: var(--bad); }

/* Printing */
.print-only { display: none; }
@media print {
  @page { margin: 12mm; }
  body { background: #fff; font-size: 11pt; }
  .top, .no-print, .toast { display: none !important; }
  .print-only { display: block; }
  .wrap { max-width: none; padding: 0; }
  .card { box-shadow: none; padding: 0; margin: 0 0 8px; }
  .leg { page-break-inside: avoid; break-inside: avoid; margin-bottom: 10pt; }
  .leg + .leg.break { page-break-before: always; break-before: page; }
  th, td { border-bottom: 1px solid #999; }
  .box { display: inline-block; width: 14px; height: 14px; border: 1.5px solid #000; }
  a { color: #000; }
}
.box { display: inline-block; width: 16px; height: 16px; border: 2px solid #475569; border-radius: 3px; }
