/* Runner app (/runner) and till handover (/handover).
   Phone-first: one column, big targets, one obvious next action. Reads the
   theme tokens from styles.css; everything here is scoped to .rn / .ho so the
   shopper and portal styles are untouched. */

.rn, .ho { background: var(--bg); min-height: 100vh; }
.rn button, .ho button { font: inherit; }

/* ---------- Top bar ---------- */
.rn-bar { background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: env(safe-area-inset-top, 0px); z-index: 10; }
.rn-bar-in { align-items: center; display: flex; gap: 10px; margin: 0 auto; max-width: 560px; padding: 10px 16px; }
.rn-brand { align-items: center; color: var(--text); display: inline-flex; gap: 8px; }
.rn-logo { display: block; height: 30px; width: 30px; }
.rn-logo rect, .rn-logo path { fill: var(--brand); }
.rn-logo circle { fill: var(--surface); }
.rn-word { font-size: 1.15rem; font-weight: 800; letter-spacing: -0.02em; }
.rn-word span { color: var(--brand); }
.rn-pill { background: var(--accent-soft); border-radius: 999px; color: var(--accent); font-size: 0.74rem; font-weight: 700; padding: 3px 9px; }
.rn-spacer { flex: 1; }
.rn-who { color: var(--muted); font-size: 0.9rem; }

/* ---------- Layout ---------- */
.rn-main { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; margin: 0 auto; max-width: 560px; padding: 16px 16px calc(40px + env(safe-area-inset-bottom, 0px)); }
#app { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
#app[hidden] { display: none; }
.rn-card { background: var(--surface); border-radius: 22px; display: grid; gap: 12px; padding: 18px; }
.rn-h1 { font-size: 1.5rem; letter-spacing: -0.02em; }
.rn-h2 { font-size: 1.2rem; letter-spacing: -0.01em; }
.rn-meta { color: var(--muted); font-size: 0.9rem; }
.rn-section-head { align-items: baseline; display: flex; justify-content: space-between; margin-bottom: 10px; }
.rn-stack { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.rn-empty { background: var(--surface); border-radius: 18px; color: var(--muted); padding: 22px 18px; text-align: center; }
.rn-row { display: flex; flex-wrap: wrap; gap: 10px; }
.rn-row > * { flex: 1 1 140px; }
.rn-center { justify-self: center; }
.rn-note { background: var(--surface-2); border-radius: 12px; font-size: 0.92rem; padding: 10px 12px; }
.rn-msg { font-size: 0.92rem; font-weight: 600; min-height: 0; }
.rn-msg:empty { display: none; }
.rn-msg.error { color: var(--danger); }
.rn-msg.ok { color: var(--success); }

/* ---------- Buttons ---------- */
.rn-primary, .rn-secondary, .rn-danger {
  align-items: center; background-image: none; border-radius: 14px; display: inline-flex; font-weight: 700;
  gap: 8px; justify-content: center; min-height: 52px; padding: 0 18px; text-decoration: none; width: 100%;
}
.rn-primary { background: var(--ink); border: 1px solid var(--ink); color: var(--ink-contrast); }
.rn-secondary { background: var(--surface); border: 1px solid var(--border-strong); color: var(--text); }
.rn-danger { background: var(--danger); border: 1px solid var(--danger); color: #fff; }
.rn-primary:hover, .rn-secondary:hover, .rn-danger:hover { box-shadow: none; filter: brightness(1.08); }
.rn-link { background: transparent; background-image: none; border: 0; color: var(--accent); font-weight: 600; min-height: 44px; padding: 0 6px; }
.rn-link:hover { box-shadow: none; filter: none; text-decoration: underline; }
.rn-icon { background: var(--surface-2); background-image: none; border: 0; border-radius: 12px; color: var(--text); flex: none; height: 48px; min-height: 48px; padding: 0; width: 48px; }

/* ---------- Sign in ---------- */
.rn-form { display: grid; gap: 6px; }
.rn-form label { font-size: 0.88rem; font-weight: 600; margin-top: 6px; }
.rn-form .rn-primary { margin-top: 12px; }

/* ---------- Job cards ---------- */
.rn-job-head, .rn-active-head { align-items: flex-start; display: flex; gap: 10px; justify-content: space-between; }
.rn-job-store { font-size: 1.05rem; }
.rn-code { background: var(--surface-2); border-radius: 8px; font-size: 0.8rem; font-variant-numeric: tabular-nums; font-weight: 700; letter-spacing: 0.06em; padding: 3px 8px; }
.rn-facts { color: var(--muted); display: flex; flex-wrap: wrap; font-size: 0.92rem; gap: 6px 14px; }

.rn-steps { counter-reset: none; display: flex; gap: 6px; list-style: none; margin: 0; padding: 0; }
.rn-steps li { align-items: center; background: var(--surface-2); border-radius: 999px; color: var(--muted); display: flex; flex: 1; font-size: 0.8rem; font-weight: 600; gap: 6px; justify-content: center; padding: 6px 8px; white-space: nowrap; }
.rn-steps li span { align-items: center; background: var(--surface); border-radius: 50%; display: inline-flex; font-size: 0.72rem; height: 18px; justify-content: center; width: 18px; }
.rn-steps li.done { color: var(--text); }
.rn-steps li.now { background: var(--ink); color: var(--ink-contrast); }
.rn-steps li.now span { color: var(--ink); }

.rn-progress { align-items: center; display: flex; flex-wrap: wrap; font-size: 0.92rem; gap: 6px 10px; }
.rn-bar-track { background: var(--surface-2); border-radius: 999px; flex: 1 1 120px; height: 8px; overflow: hidden; }
.rn-bar-track span { background: var(--success); display: block; height: 100%; transition: width 0.2s ease; }

.rn-scan { align-items: center; display: flex; gap: 8px; }
.rn-scan input { flex: 1; min-height: 48px; }
.rn-scan .rn-secondary { flex: none; min-height: 48px; width: auto; }

.rn-picks { display: grid; gap: 8px; list-style: none; margin: 0; padding: 0; }
.rn-pick { align-items: center; background: var(--surface-2); background-image: none; border: 1px solid transparent; border-radius: 14px; color: var(--text); display: flex; font-weight: 400; gap: 12px; justify-content: flex-start; min-height: 60px; padding: 10px 12px; text-align: left; width: 100%; }
.rn-pick:hover { box-shadow: none; filter: none; border-color: var(--border-strong); }
.rn-pick.on { background: var(--success-soft); }
.rn-pick.on .rn-pick-text strong { text-decoration: line-through; text-decoration-thickness: 1px; }
.rn-tick { align-items: center; background: var(--surface); border: 2px solid var(--border-strong); border-radius: 8px; color: #fff; display: inline-flex; flex: none; height: 26px; justify-content: center; width: 26px; }
.rn-pick.on .rn-tick { background: var(--success); border-color: var(--success); }
.rn-pick-text { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }

.rn-ask { background: var(--warn-soft); border-radius: 14px; color: var(--text); display: grid; gap: 10px; padding: 12px 14px; }

.rn-qr { background: #fff; border-radius: 16px; display: block; height: auto; justify-self: center; max-width: 100%; padding: 10px; width: 240px; }
.rn-bigcode { font-size: 2rem; font-variant-numeric: tabular-nums; font-weight: 800; letter-spacing: 0.1em; text-align: center; }
.rn-address { font-size: 1.05rem; font-weight: 600; }

.rn-fail { display: grid; gap: 10px; }
.rn-fail fieldset { border: 0; display: grid; gap: 6px; margin: 0; padding: 0; }
.rn-fail legend { font-weight: 700; margin-bottom: 6px; }
.rn-radio { align-items: center; background: var(--surface-2); border-radius: 12px; cursor: pointer; display: flex; gap: 10px; min-height: 48px; padding: 0 12px; }
.rn-radio input { height: 20px; margin: 0; min-height: 0; width: 20px; }
.rn-fail textarea { min-height: 80px; }

.rn-camera { align-items: center; background: rgba(0, 0, 0, 0.92); display: flex; flex-direction: column; gap: 16px; inset: 0; justify-content: center; padding: 16px; position: fixed; z-index: 50; }
.rn-camera video { border-radius: 16px; max-height: 70vh; max-width: 100%; }
.rn-camera .rn-secondary { max-width: 320px; }

/* ---------- Till handover ---------- */
.ho-main { display: grid; gap: 16px; margin: 0 auto; max-width: 560px; padding: 16px 16px 40px; }
.ho-status { border-radius: 22px; display: grid; gap: 4px; padding: 22px 20px; text-align: center; }
.ho-status.paid { background: var(--success-soft); color: var(--success); }
.ho-status.unpaid { background: var(--warn-soft); color: var(--warn); }
.ho-status strong { font-size: 2.4rem; font-weight: 800; letter-spacing: 0.02em; line-height: 1.1; }
.ho-status span { color: var(--text); font-weight: 600; }
.ho-code { font-size: 1.8rem; font-variant-numeric: tabular-nums; font-weight: 800; letter-spacing: 0.1em; }
.ho-items { display: grid; gap: 0; list-style: none; margin: 0; padding: 0; }
.ho-items li { align-items: baseline; border-top: 1px solid var(--border); display: flex; gap: 12px; justify-content: space-between; padding: 10px 0; }
.ho-items li:first-child { border-top: 0; }
.ho-qty { font-variant-numeric: tabular-nums; font-weight: 800; white-space: nowrap; }
.ho-privacy { color: var(--muted); font-size: 0.85rem; text-align: center; }

@media (min-width: 900px) {
  .rn-main, .ho-main { padding-top: 32px; }
}

/* Weighed items: the reading from the store's scale. */
.rn-weigh { align-items: center; display: flex; gap: 8px; margin: -2px 0 6px 44px; font-size: 0.9rem; }
.rn-weigh input { min-height: 44px; padding: 0 10px; text-align: right; width: 96px; }

.rn-google { margin-bottom: 6px; }
.rn-or { align-items: center; color: var(--muted, #6b7280); display: flex; font-size: 0.85rem; gap: 10px; margin: 10px 0; }
.rn-or::before, .rn-or::after { border-top: 1px solid var(--border, #e5e7eb); content: ""; flex: 1; }

/* Base location: a two-line card above the jobs, the form, the "outside" group. */
.rn-base { align-items: center; background: var(--surface, #fff); border-radius: 16px; display: flex; gap: 12px; margin-bottom: 12px; padding: 12px 14px; }
.rn-base-icon { align-items: center; background: var(--accent-soft, rgba(194,65,12,.1)); border-radius: 12px; color: var(--accent, #c2410c); display: flex; flex: none; height: 40px; justify-content: center; width: 40px; }
.rn-base-text { display: flex; flex: 1; flex-direction: column; line-height: 1.25; min-width: 0; }
.rn-base-cap { color: var(--muted, #6b7280); font-size: 0.78rem; font-weight: 600; letter-spacing: 0.02em; text-transform: uppercase; }
.rn-base-name { display: -webkit-box; font-size: 1rem; overflow: hidden; overflow-wrap: anywhere; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.rn-base-radius { background: var(--surface-2, #f3f4f6); border-radius: 999px; flex: none; font-size: 0.85rem; font-weight: 700; padding: 4px 10px; }
.rn-base-btn { background: transparent; border: 1px solid var(--border-strong, #d1d5db); border-radius: 999px; color: var(--text, #111827); flex: none; font: inherit; font-size: 0.9rem; font-weight: 600; min-height: 36px; padding: 0 14px; }
.rn-base-btn.is-primary { background: var(--accent, #c2410c); border-color: var(--accent, #c2410c); color: var(--accent-contrast, #fff); }
.rn-base-form { margin-bottom: 12px; }
.rn-h3 { font-size: 1.05rem; margin: 0; }
.rn-dist { color: var(--accent, #c2410c); font-size: 0.88rem; font-weight: 600; margin: 4px 0 2px; }
.rn-far { margin-top: 6px; }
.rn-far > summary { color: var(--muted, #6b7280); cursor: pointer; font-weight: 600; padding: 10px 2px; }
.rn-job-far { opacity: 0.8; }
/* A long place name must truncate, not widen the page (grid tracks size to content). */
.rn-main > *, #app > *, .rn-stack > *, #poolSection > * { min-width: 0; }
