:root {
  --primary: #F8CB46;
  --primary-light: #FBD96B;
  --primary-dark: #D9A400;
  --primary-ink: #7A6200;
  --primary-bg: rgba(248,203,70,0.15);
  --bg: #F5F5F5;
  --surface: #FFFFFF;
  --card: #FFFFFF;
  --card-hover: #EEEEEE;
  --text: #212121;
  --text-sec: #616161;
  --text-muted: #9E9E9E;
  --success: #22C55E;
  --success-bg: rgba(34,197,94,0.12);
  --error: #EF4444;
  --error-bg: rgba(239,68,68,0.12);
  --warning: #F59E0B;
  --warning-bg: rgba(245,158,11,0.12);
  --border: rgba(0,0,0,0.08);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-pill: 24px;
  --font: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body { font-family: var(--font); background: var(--bg); color: var(--text); min-height: 100vh; line-height: 1.5; }
  a { color: var(--primary-ink); text-decoration: none; }
img { max-width: 100%; display: block; }
button { cursor: pointer; border: none; font-family: inherit; font-size: inherit; }

.topbar { background: var(--surface); padding: 12px 16px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 100; }
.topbar .brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; }
.topbar .brand-mark { background: var(--primary); color: #212121; width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 800; }

.container { padding: 16px; max-width: 480px; margin: 0 auto; }

.bottom-nav { position: fixed; bottom: 0; left: 0; right: 0; background: var(--surface); border-top: 1px solid var(--border); display: flex; z-index: 100; padding-bottom: env(safe-area-inset-bottom); }
.bottom-nav a { flex: 1; display: flex; flex-direction: column; align-items: center; padding: 8px 4px; color: var(--text-sec); font-size: 11px; gap: 3px; transition: color 0.2s; }
.bottom-nav a.active { color: var(--primary-ink); }
.bottom-nav a svg { width: 22px; height: 22px; }

.card { background: var(--card); border-radius: var(--radius); padding: 16px; margin-bottom: 12px; border: 1px solid var(--border); }
.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }

.badge { display: inline-flex; align-items: center; padding: 4px 10px; border-radius: var(--radius-pill); font-size: 12px; font-weight: 600; }
.badge-success { background: rgba(34,197,94,0.15); color: var(--success); }
.badge-error { background: rgba(239,68,68,0.15); color: var(--error); }
.badge-warning { background: rgba(245,158,11,0.15); color: var(--warning); }
.badge-primary { background: rgba(248,203,70,0.15); color: var(--primary-ink); }
.badge-info { background: var(--primary-bg); color: var(--primary-ink); }

.btn { display: inline-flex; align-items: center; justify-content: center; padding: 12px 24px; border-radius: var(--radius-sm); font-weight: 600; font-size: 15px; transition: all 0.2s; gap: 8px; }
.btn-primary { background: var(--primary); color: #212121; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-success { background: var(--success); color: #fff; }
.btn-error { background: var(--error); color: #fff; }
.btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn-block { width: 100%; }
.btn-lg { padding: 16px 32px; font-size: 17px; border-radius: var(--radius); }
.btn:disabled { opacity: 0.5; pointer-events: none; }

.toggle-wrap { display: flex; align-items: center; justify-content: space-between; padding: 16px; background: var(--card); border-radius: var(--radius); margin-bottom: 16px; }
.toggle-label { font-size: 16px; font-weight: 600; }
.toggle-sub { font-size: 13px; color: var(--text-sec); margin-top: 2px; }
.toggle { width: 56px; height: 30px; background: var(--text-muted); border-radius: 15px; position: relative; cursor: pointer; transition: background 0.3s; flex-shrink: 0; }
.toggle.on { background: var(--success); }
.toggle::after { content: ''; position: absolute; width: 26px; height: 26px; background: #fff; border-radius: 50%; top: 2px; left: 2px; transition: transform 0.3s; }
.toggle.on::after { transform: translateX(26px); }

.offer-card { background: linear-gradient(135deg, var(--card), #FDF3D7); border: 1px solid var(--primary); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; position: relative; overflow: hidden; }
.offer-card::before { content: ''; position: absolute; top: -30px; right: -30px; width: 100px; height: 100px; background: rgba(248,203,70,0.1); border-radius: 50%; }
.offer-amount { font-size: 28px; font-weight: 800; color: var(--primary-ink); }
.offer-detail { font-size: 14px; color: var(--text-sec); margin: 4px 0 12px; }
.offer-meta { display: flex; gap: 12px; font-size: 12px; color: var(--text-sec); }

.countdown-circle { width: 64px; height: 64px; position: relative; margin: 0 auto 12px; }
.countdown-circle svg { transform: rotate(-90deg); }
.countdown-circle circle { fill: none; stroke-width: 4; }
.countdown-circle .bg { stroke: rgba(0,0,0,0.1); }
.countdown-circle .progress { stroke: var(--primary); stroke-linecap: round; transition: stroke-dashoffset 1s linear; }
.countdown-num { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 700; }

.address-line { font-size: 14px; color: var(--text-sec); line-height: 1.4; }
.distance-badge { display: inline-flex; align-items: center; gap: 4px; background: var(--primary-bg); color: var(--primary-ink); padding: 4px 10px; border-radius: var(--radius-pill); font-size: 12px; font-weight: 600; }

.map-container { width: 100%; height: 300px; background: var(--surface); border-radius: var(--radius); display: flex; align-items: center; justify-content: center; color: var(--text-sec); margin-bottom: 16px; position: relative; overflow: hidden; border: 1px solid var(--border); }
.map-container::before { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(0deg, transparent, transparent 20px, rgba(0,0,0,0.05) 20px, rgba(0,0,0,0.05) 21px), repeating-linear-gradient(90deg, transparent, transparent 20px, rgba(0,0,0,0.05) 20px, rgba(0,0,0,0.05) 21px); }
.map-placeholder { z-index: 1; text-align: center; }
.map-placeholder svg { width: 48px; height: 48px; margin-bottom: 8px; opacity: 0.5; }

.otp-grid { display: flex; gap: 10px; justify-content: center; margin: 16px 0; }
.otp-input { width: 48px; height: 56px; text-align: center; font-size: 24px; font-weight: 700; background: var(--surface); border: 2px solid var(--border); border-radius: var(--radius-sm); color: var(--text); outline: none; transition: border-color 0.2s; }
.otp-input:focus { border-color: var(--primary); }
.otp-input.filled { border-color: var(--success); }

.earning-big { text-align: center; padding: 24px 0; }
.earning-big .amount { font-size: 42px; font-weight: 800; color: var(--success); }
.earning-big .label { font-size: 14px; color: var(--text-sec); margin-top: 4px; }

.stats-row { display: flex; gap: 12px; margin-bottom: 16px; }
.stat-card { flex: 1; background: var(--card); border-radius: var(--radius-sm); padding: 14px; text-align: center; border: 1px solid var(--border); }
.stat-card .value { font-size: 22px; font-weight: 700; }
.stat-card .label { font-size: 12px; color: var(--text-sec); margin-top: 2px; }

.trip-item { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.trip-item:last-child { border-bottom: none; }
.trip-icon { width: 40px; height: 40px; border-radius: 50%; background: var(--surface); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.trip-info { flex: 1; min-width: 0; }
.trip-title { font-size: 14px; font-weight: 600; }
.trip-sub { font-size: 12px; color: var(--text-sec); }
.trip-amount { font-weight: 700; color: var(--success); font-size: 15px; }

.rating-stars { display: flex; gap: 4px; justify-content: center; margin: 12px 0; }
.rating-stars .star { font-size: 28px; color: var(--primary); cursor: pointer; transition: color 0.2s; }
.rating-stars .star.active { color: #F59E0B; }

.photo-capture { width: 100%; height: 200px; background: var(--surface); border: 2px dashed var(--border); border-radius: var(--radius); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: var(--text-sec); cursor: pointer; margin-bottom: 16px; }
.photo-capture svg { width: 40px; height: 40px; }
.photo-capture.has-photo { border-style: solid; border-color: var(--success); }

.empty-state { text-align: center; padding: 48px 24px; color: var(--text-sec); }
.empty-state svg { width: 80px; height: 80px; margin: 0 auto 16px; opacity: 0.4; }
.empty-state h3 { font-size: 18px; color: var(--text); margin-bottom: 8px; }
.empty-state p { font-size: 14px; }

.loading-skeleton { background: linear-gradient(90deg, var(--card) 25%, var(--surface) 50%, var(--card) 75%); background-size: 200% 100%; animation: shimmer 1.5s infinite; border-radius: var(--radius-sm); }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

.toast { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); background: var(--card); color: var(--text); padding: 12px 24px; border-radius: var(--radius); font-size: 14px; font-weight: 500; z-index: 1000; box-shadow: 0 8px 32px rgba(0,0,0,0.3); opacity: 0; transition: opacity 0.3s; pointer-events: none; }
.toast.show { opacity: 1; }
.toast.success { border-left: 4px solid var(--success); }
.toast.error { border-left: 4px solid var(--error); }
.toast.warning { border-left: 4px solid var(--warning); }

.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 200; display: none; align-items: flex-end; justify-content: center; }
.modal-overlay.show { display: flex; }
.modal-sheet { background: var(--surface); border-radius: 20px 20px 0 0; padding: 24px; width: 100%; max-width: 480px; max-height: 80vh; overflow-y: auto; }
.modal-handle { width: 40px; height: 4px; background: rgba(0,0,0,0.15); border-radius: 2px; margin: 0 auto 16px; }

.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 13px; font-weight: 600; color: var(--text-sec); margin-bottom: 6px; }
.form-input { width: 100%; padding: 12px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text); font-size: 15px; outline: none; transition: border-color 0.2s; }
.form-input:focus { border-color: var(--primary); }
.form-input::placeholder { color: var(--text-sec); }

.idle-illustration { text-align: center; padding: 48px 24px; }
.idle-illustration .pulse { width: 120px; height: 120px; border-radius: 50%;   background: rgba(248,203,70,0.1); display: flex; align-items: center; justify-content: center; margin: 0 auto 20px; position: relative; }
.idle-illustration .pulse::before { content: ''; position: absolute; inset: -10px; border-radius: 50%;   border: 2px solid rgba(248,203,70,0.2); animation: pulse-ring 2s infinite; }
@keyframes pulse-ring { 0% { transform: scale(0.9); opacity: 1; } 100% { transform: scale(1.3); opacity: 0; } }

.handoff-qr { text-align: center; padding: 24px; }
.handoff-qr .qr-box { width: 200px; height: 200px; background: #fff; border-radius: var(--radius); margin: 0 auto 16px; display: flex; align-items: center; justify-content: center; }
.handoff-qr .qr-box img { width: 180px; height: 180px; }

.list-empty { padding: 60px 20px; text-align: center; }

.hidden { display: none !important; }

.skeleton { background: linear-gradient(90deg, var(--card) 25%, var(--surface) 50%, var(--card) 75%); background-size: 200% 100%; animation: shimmer 1.5s infinite; border-radius: var(--radius-sm); }

.header { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 100; }
.header-title { font-size: 16px; font-weight: 700; }
.header-action-btn { width: 40px; height: 40px; border-radius: 50%; background: transparent; display: flex; align-items: center; justify-content: center; color: var(--text); }
.header-action-btn svg { width: 22px; height: 22px; }

.page-content { min-height: calc(100vh - 60px); }
.page-content.no-tabbar { padding-bottom: 24px; }

.error-state { text-align: center; padding: 48px 24px; color: var(--text-sec); }
.error-icon { font-size: 44px; margin-bottom: 12px; }
.error-title { font-size: 18px; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.error-text { font-size: 14px; margin-bottom: 16px; }

.countdown-wrapper { text-align: center; }
.countdown-circle { width: 96px; height: 96px; position: relative; margin: 0 auto 8px; }
.countdown-circle svg { transform: rotate(-90deg); }
.countdown-circle circle { fill: none; stroke-width: 6; }
.countdown-circle .track { stroke: rgba(0,0,0,0.08); }
.countdown-circle .progress { stroke: var(--primary); stroke-linecap: round; transition: stroke-dashoffset 0.3s linear; }
.countdown-number { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 26px; font-weight: 800; }
.countdown-text { font-size: 13px; color: var(--text-sec); }

.offer-route { position: relative; }
.offer-point { display: flex; gap: 10px; padding: 8px 0; }
.offer-point-label { font-size: 12px; color: var(--text-sec); text-transform: uppercase; letter-spacing: 0.4px; margin-bottom: 2px; }
.offer-point-address { font-size: 14px; font-weight: 600; }

.offer-earning { background: linear-gradient(135deg, rgba(248,203,70,0.18), rgba(248,203,70,0.06)); border: 1px solid var(--primary); border-radius: var(--radius); padding: 16px; text-align: center; }
.offer-earning-label { font-size: 13px; color: var(--text-sec); margin-bottom: 4px; }
.offer-earning-amount { font-size: 28px; font-weight: 800; color: var(--primary-ink); }

.offer-actions { display: flex; gap: 12px; }

.method-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 16px; }
.method-tab { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 8px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); cursor: pointer; transition: border-color 0.2s, background 0.2s; }
.method-tab.active { border-color: var(--primary); background: rgba(248,203,70,0.12); }
.method-icon { font-size: 22px; }
.method-label { font-size: 13px; font-weight: 600; }
.method-content { margin-bottom: 16px; }

.otp-box { width: 46px; height: 54px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); display: flex; align-items: center; justify-content: center; }
.otp-box input { width: 100%; height: 100%; border: none; background: transparent; text-align: center; font-size: 22px; font-weight: 700; outline: none; color: var(--text); }
.otp-box.filled { border-color: var(--primary); }
.otp-grid { display: flex; gap: 8px; justify-content: center; }
.otp-input { width: 44px; height: 52px; border: 1px solid var(--border); border-radius: var(--radius-sm); text-align: center; font-size: 22px; font-weight: 700; outline: none; color: var(--text); background: var(--surface); }
.otp-input:focus { border-color: var(--primary); }

.photo-capture-area { min-height: 200px; border: 2px dashed var(--border); border-radius: var(--radius); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; cursor: pointer; overflow: hidden; background: var(--card); padding: 16px; text-align: center; }
.photo-capture-area video, .photo-capture-area img { width: 100%; border-radius: var(--radius-sm); }
.camera-icon { font-size: 36px; }
.camera-text { font-size: 14px; color: var(--text-sec); }
.retake-btn { margin-top: 8px; padding: 8px 20px; border-radius: var(--radius-pill); background: var(--surface); border: 1px solid var(--border); font-size: 13px; font-weight: 600; }

.signature-pad-wrapper { position: relative; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 8px; }
.signature-pad-wrapper canvas { width: 100%; height: 180px; background: var(--surface); border-radius: var(--radius-sm); touch-action: none; }
.signature-pad-placeholder { position: absolute; inset: 8px; display: flex; align-items: center; justify-content: center; color: var(--text-sec); font-size: 14px; pointer-events: none; }
.signature-pad-clear { position: absolute; right: 16px; bottom: 16px; padding: 6px 14px; font-size: 12px; border-radius: var(--radius-pill); background: var(--surface); border: 1px solid var(--border); }

.success-screen { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 70vh; text-align: center; padding: 24px; gap: 8px; }
.success-checkmark { width: 90px; height: 90px; border-radius: 50%; background: rgba(34,197,94,0.15); color: var(--success); display: flex; align-items: center; justify-content: center; font-size: 48px; font-weight: 800; margin-bottom: 8px; }
.success-title { font-size: 24px; font-weight: 800; }
.success-subtitle { font-size: 15px; color: var(--text-sec); margin-bottom: 20px; }

.toast-container { position: fixed; top: 16px; left: 0; right: 0; display: flex; flex-direction: column; align-items: center; gap: 8px; z-index: 300; pointer-events: none; }
.rider-toast { background: var(--card); color: var(--text); padding: 10px 20px; border-radius: var(--radius-pill); font-size: 14px; font-weight: 600; box-shadow: 0 8px 32px rgba(0,0,0,0.25); opacity: 0; transform: translateY(-8px); transition: opacity 0.25s, transform 0.25s; max-width: 90%; }
.rider-toast.show { opacity: 1; transform: translateY(0); }
.rider-toast-success { border-left: 4px solid var(--success); }
.rider-toast-error { border-left: 4px solid var(--error); }
.rider-toast-warning { border-left: 4px solid var(--warning); }
.rider-toast-info { border-left: 4px solid var(--primary); }

.btn-danger { background: #EF4444; color: #fff; }
.btn-danger:hover { background: var(--error); }
.btn-secondary { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.btn-full { width: 100%; }
.btn-lg { padding: 14px 20px; font-size: 16px; }
.btn-sm { padding: 7px 12px; font-size: 13px; }

.text-lg { font-size: 17px; }
.text-sm { font-size: 14px; }
.text-xs { font-size: 12px; }
.text-secondary { color: var(--text-sec); }
.text-muted { color: var(--text-sec); }
.font-bold { font-weight: 800; }
.font-semibold { font-weight: 600; }
.flex-1 { flex: 1; min-width: 0; }
.py-4 { padding-top: 16px; padding-bottom: 16px; }
.py-6 { padding-top: 24px; padding-bottom: 24px; }
.mb-4 { margin-bottom: 16px; }
.mt-2 { margin-top: 8px; }

@media (min-width: 481px) {
  .container { padding: 24px; }
}
