/* Order tracker */
.wrap { width: 100%; max-width: 680px; margin: 0 auto; padding: 0 16px; }
.top { background: var(--cream); color: var(--ink); border-bottom: 3px solid var(--chili); }
.top .logo-img { width: 120px; margin: 4px 0; }
.top-inner { display: flex; align-items: center; justify-content: space-between; min-height: 64px; }
.brand { color: #fff; font-weight: 800; font-size: 1.15rem; text-decoration: none; }
.top .btn.ghost { color: var(--chili); border-color: var(--chili); }
.btn.small { min-height: 44px; }
.top-inner { gap: 12px; }
.top .btn.ghost:hover { background: rgba(30,75,184,.08); }

#app { padding-top: 18px; padding-bottom: 48px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); min-width: 0; overflow-wrap: anywhere; }
.card h2 { font-size: 1.05rem; margin-bottom: 10px; }

.loading, .center { text-align: center; padding: 56px 16px; color: var(--ink-soft); }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 4px solid var(--line); border-top-color: var(--chili); margin: 0 auto 12px; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.center .big { font-size: 2.6rem; margin-bottom: 8px; }
.center h1 { color: var(--ink); font-size: 1.4rem; margin-bottom: 6px; }

.status-card { background: var(--ink); color: #fff; border: 0; }
.status-card .code { font-size: .85rem; letter-spacing: .1em; text-transform: uppercase; opacity: .75; font-weight: 700; }
.status-card h1 { font-size: 1.55rem; line-height: 1.2; margin: 4px 0 8px; }
.status-card .eta { display: inline-block; background: var(--turmeric); color: #2b1c00; font-weight: 800; padding: 6px 14px; border-radius: 999px; }
.status-card .eta.late { background: #dbe5fb; color: #0f2a6b; }
.status-card.delivered { background: var(--leaf); }
.status-card.cancelled { background: var(--bad); }
.status-card p.sub { opacity: .9; margin-top: 8px; }

.steps { list-style: none; margin: 0; padding: 0; }
.step { position: relative; display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 12px; padding-bottom: 20px; }
.step:last-child { padding-bottom: 0; }
.step::before { content: ''; position: absolute; left: 16px; top: 34px; bottom: 0; width: 2px; background: var(--line); }
.step:last-child::before { display: none; }
.step.done::before { background: var(--leaf); }
.dot { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--paper); border: 2px solid var(--line); color: var(--ink-faint); font-weight: 800; z-index: 1; }
.step.done .dot { background: var(--leaf); border-color: var(--leaf); color: #fff; }
.step.active .dot { border-color: var(--turmeric); color: #8a5a00; background: var(--warn-soft); animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(242, 163, 27, .5); } 50% { box-shadow: 0 0 0 9px rgba(242, 163, 27, 0); } }
.step-title { font-weight: 700; padding-top: 5px; }
.step.todo .step-title { color: var(--ink-faint); font-weight: 600; }
.step-note { font-size: .86rem; color: var(--ink-soft); font-weight: 400; }
.step-time { font-size: .85rem; color: var(--ink-soft); padding-top: 7px; white-space: nowrap; }

.driver { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.driver .who { display: flex; gap: 12px; align-items: center; min-width: 0; flex: 1 1 200px; }
.driver .who > :last-child { min-width: 0; }
.avatar { flex: none; }
.avatar { width: 46px; height: 46px; border-radius: 50%; background: var(--turmeric); display: grid; place-items: center; font-size: 1.4rem; }
.driver .name { font-weight: 800; }
.driver .actions { display: flex; gap: 8px; flex-wrap: wrap; }

.pay-card.due { border-color: var(--chili); background: #f1f5ff; }
.pay-card.good { border-color: #bfe3cd; background: var(--leaf-soft); }
.pay-amount { font-size: 1.7rem; font-weight: 800; }
.pay-grid { display: grid; gap: 14px; justify-items: center; text-align: center; margin: 10px 0; }
.qr { width: 220px; height: 220px; border: 1px solid var(--line); border-radius: 12px; background: #fff; padding: 6px; }
.pay-actions { display: grid; gap: 10px; width: 100%; }
.pay-note { font-size: .88rem; color: var(--ink-soft); }
.alert { background: var(--bad-soft); color: #0f2a6b; border: 1.5px solid #c9d6f6; border-radius: var(--radius-sm); padding: 10px 12px; margin: 8px 0; font-weight: 600; }

.lines { display: grid; gap: 6px; }
.line { display: flex; justify-content: space-between; gap: 12px; min-width: 0; }
.line > :first-child { min-width: 0; overflow-wrap: anywhere; }
.line > :last-child { flex: none; white-space: nowrap; }
.line .muted, .muted { color: var(--ink-soft); font-size: .88rem; }
.sum { margin-top: 10px; padding-top: 10px; border-top: 1.5px dashed var(--line); display: grid; gap: 4px; }
.sum .row { display: flex; justify-content: space-between; }
.sum .grand { font-weight: 800; font-size: 1.1rem; }
.addr { margin-top: 12px; font-size: .9rem; color: var(--ink-soft); }

.stars { display: flex; gap: 6px; margin: 6px 0 12px; }
.star { width: 48px; height: 48px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--paper); font-size: 1.6rem; line-height: 1; cursor: pointer; color: var(--line); }
.star.on { color: var(--turmeric); border-color: var(--turmeric); background: var(--warn-soft); }
.thanks { color: var(--leaf); font-weight: 700; }

.help { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.lookup { text-align: left; max-width: 420px; margin: 18px auto 0; }
.status-card { overflow-wrap: anywhere; }
.stale { background: var(--warn-soft); color: #6b4700; border-radius: var(--radius-sm); padding: 8px 12px; font-size: .88rem; text-align: center; }

/* pickup + credit */
.pickup-card { display: flex; gap: 14px; align-items: center; }
.pickup-card > :not(.ico) { min-width: 0; }
.pickup-card .ico { font-size: 2rem; flex: none; }
.pickup-card .where { font-size: 1.35rem; font-weight: 900; line-height: 1.15; }
.pickup-card.ready { border: 2px solid var(--leaf); background: var(--leaf-soft); }
.pickup-card .actions { margin-top: 8px; display: flex; gap: 8px; flex-wrap: wrap; }
.credit { text-align: center; font-size: .85rem; color: var(--ink-faint); padding: 8px 16px calc(24px + env(safe-area-inset-bottom)); }
.credit a { color: var(--chili-dark); font-weight: 700; display: inline-block; padding: 11px 4px; }

.btn.danger, .btn.ghost.danger { color: var(--bad); border-color: var(--bad); }
.btn.ghost.danger:hover { background: var(--bad-soft); }
.help.actions { margin-top: -4px; }

/* safety net: never let a stray element widen the page on phones (root causes are fixed above) */
body { overflow-x: clip; }
