/* ============================================================================
   AVYO - APP TÀI XẾ (UI v2, Đợt 5)
   Dùng token/component dùng chung (tokens.css, components.css, motion.css). Mặc định giao diện TỐI (dịu mắt khi
   chạy đêm), có nút chuyển Sáng/Tối. Không còn mã hex viết cứng; chữ ≥ 13.5px, nút chạm ≥ 44-48px, tương phản AA.
   Các hàm JS (driver.js) chỉ đổi class/nội dung: .status.is-live|is-wait|is-error|is-off, .dv-power.is-online, body.is-online.
   ============================================================================ */
*, *::before, *::after { box-sizing: border-box; }

/* build 324: toast nổi trên thanh Home của iPhone (driver.html có viewport-fit=cover) */
:root { --toast-bottom: calc(24px + env(safe-area-inset-bottom, 0px)); }

body {
  position: relative;
  max-width: 440px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: auto;
  /* GIỮ NGUYÊN cách chừa vùng an toàn (safe-area) của bản trước */
  padding: calc(12px + env(safe-area-inset-top, 0px)) 14px calc(20px + env(safe-area-inset-bottom, 0px)) 14px;
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: 1.5;
  background: var(--color-bg);
  color: var(--color-text);
  touch-action: manipulation;
  -webkit-text-size-adjust: 100%;
  transition: background-color .3s var(--ease-standard), color .3s var(--ease-standard);
}
h1, h2, h3, p { margin: 0; }
button { font-family: inherit; }
a { -webkit-tap-highlight-color: transparent; }

/* ---------- Sắc thái icon (dùng chung ô icon) ---------- */
.tone-brand   { background: var(--color-primary-soft); color: var(--color-primary-text); }
.tone-accent  { background: var(--color-accent-soft); color: var(--color-accent-text); }
.tone-danger  { background: var(--color-danger-soft); color: var(--color-danger-text); }
.tone-info    { background: var(--color-info-soft); color: var(--color-info-text); }
.tone-success { background: var(--color-success-soft); color: var(--color-success-text); }
.tone-warning { background: var(--color-warning-soft); color: var(--color-warning-text); }

/* ---------- Thanh trên: logo + đổi giao diện ---------- */
.dv-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 0 12px; }
.dv-brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.dv-brand__mark { width: 40px; height: 40px; border-radius: 12px; flex: none; }
.dv-brand__word { font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.dv-brand__tag { padding: 3px 10px; border-radius: 999px; background: var(--color-primary-soft); color: var(--color-primary-text); font-size: 13px; font-weight: 700; }
.dv-theme {
  flex: none; width: 44px; height: 44px; padding: 0; display: grid; place-items: center;
  border: 1px solid var(--color-border); border-radius: 50%; background: var(--color-surface); color: var(--color-text-secondary);
  box-shadow: var(--shadow-1); cursor: pointer; -webkit-tap-highlight-color: transparent;
  transition: transform var(--dur-fast) var(--ease-standard), background-color var(--dur-base);
}
.dv-theme:active { transform: scale(.92); }
.dv-theme:focus-visible, .dv-row:focus-visible, .dv-logout:focus-visible, .modal-x:focus-visible, .dv-power:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--color-focus); }

/* ---------- Thẻ ---------- */
.dv-card { margin-bottom: 14px; padding: 16px; border: 1px solid var(--color-border); border-radius: 24px; background: var(--color-surface); box-shadow: var(--shadow-1); transition: background-color .3s, border-color .3s; }

/* ---------- Đăng nhập ---------- */
.dv-login { padding: 26px 20px 20px; text-align: center; }   /* JS đặt style.display = 'block' nên không dùng grid gap */
.dv-login > * { margin-bottom: 14px; }
.dv-login > *:last-child { margin-bottom: 0; }
.dv-login__mark { display: block; margin: 0 auto 12px; width: 72px; height: 72px; border-radius: 22px; box-shadow: var(--shadow-3); }
.dv-login__title { margin-bottom: 4px !important; font-size: 26px; font-weight: 800; line-height: 1.2; letter-spacing: -.02em; }
.dv-login__sub { margin-bottom: 20px !important; font-size: 15px; color: var(--color-text-secondary); }
.dv-login .av-field { text-align: left; }
.dv-login .av-input { min-height: 52px; }
.btn-cskh { min-height: 52px; white-space: normal; text-align: left; line-height: 1.3; }
.dv-login__dl {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 12px;
  border-radius: var(--radius-md); font-size: 15px; font-weight: 600; color: var(--color-primary-text); text-decoration: none;
}
.dv-login__dl[hidden] { display: none; }
.dv-login__dl:hover { text-decoration: underline; }
.dv-login__dl:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--color-focus); }

/* ---------- Khối bật/tắt nhận khách ---------- */
.status {
  display: flex; align-items: center; gap: 12px; margin: 0 0 12px; padding: 14px 16px;
  border: 1px solid var(--color-border); border-radius: 18px; background: var(--color-surface-2); color: var(--color-text-secondary);
  font-size: 16px; font-weight: 700; line-height: 1.35; text-align: left;
  transition: background-color .3s, color .3s;
}
.status__body { min-width: 0; overflow-wrap: anywhere; }
.status small { display: block; margin-top: 4px; font-size: 13.5px; font-weight: 500; line-height: 1.4; color: inherit; opacity: .92; }
.status .status__ic { flex: none; }
.status.is-live  { border-color: transparent; background: var(--color-success-soft); color: var(--color-success-text); }
.status.is-error { border-color: transparent; background: var(--color-danger-soft); color: var(--color-danger-text); }
.status.is-wait  { border-color: transparent; background: var(--color-warning-soft); color: var(--color-warning-text); }   /* build 324: đang chờ GPS lần đầu */
.off-dot, .live-dot { flex: none; width: 12px; height: 12px; border-radius: 50%; }
.off-dot { background: var(--color-danger); box-shadow: 0 0 0 4px var(--color-danger-soft); }
.live-dot { background: var(--color-success); animation: dvLivePulse 1.8s infinite ease-in-out; }
@keyframes dvLivePulse {
  0%   { transform: scale(.95); box-shadow: 0 0 0 0 var(--color-success); }
  70%  { transform: scale(1.1); box-shadow: 0 0 0 9px transparent; }
  100% { transform: scale(.95); box-shadow: 0 0 0 0 transparent; }
}

#driverMap { width: 100%; height: 260px; border: 1px solid var(--color-border); border-radius: 20px; background: var(--color-surface-2); overflow: hidden; }
.leaflet-control-attribution { display: none !important; }
.leaflet-container { font-family: var(--font-sans); }
.leaflet-bar a, .leaflet-touch .leaflet-bar a { width: 44px; height: 44px; line-height: 44px; font-size: 20px; }   /* nút zoom ≥ 44px */
.leaflet-touch .leaflet-bar { border: 1px solid var(--color-border); border-radius: 14px; overflow: hidden; box-shadow: var(--shadow-2); }
.leaflet-marker-icon.av-marker-wrap { background: transparent; border: 0; }
.leaflet-bar a, .leaflet-bar a:hover { background-color: var(--color-surface); color: var(--color-text); border-bottom-color: var(--color-border); }   /* nút zoom theo Sáng/Tối */
.leaflet-popup-content-wrapper { border-radius: 18px; background: var(--color-surface); color: var(--color-text); box-shadow: var(--shadow-3); }
.leaflet-popup-tip { background: var(--color-surface); box-shadow: none; }
.leaflet-container a.leaflet-popup-close-button { color: var(--color-text-muted); }
.dv-pop { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; }

.dv-coords { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 10px 0 14px; font-size: 13.5px; color: var(--color-text-muted); }
#coords { color: var(--color-text-secondary); font-variant-numeric: tabular-nums; }

/* Công tắc nhận khách: NÚT TO nhất màn hình, bấm 1 chạm (trạng thái mở = đỏ "TẮT NHẬN KHÁCH") */
.dv-power {
  display: flex; align-items: center; justify-content: center; gap: 14px; width: 100%; min-height: 76px; padding: 12px 20px;
  border: 0; border-radius: 26px; background: var(--grad-primary); color: var(--color-on-primary);
  font: 800 17px/1.25 var(--font-sans); letter-spacing: .01em; text-align: left; cursor: pointer;
  box-shadow: var(--shadow-inset-hi), var(--shadow-primary); -webkit-tap-highlight-color: transparent;
  transition: transform var(--dur-fast) var(--ease-standard), background-color .3s, box-shadow .3s;
}
.dv-power:active { transform: scale(.98); }
.dv-power__icon {
  flex: none; width: 48px; height: 48px; display: grid; place-items: center; border-radius: 50%;
  background: rgba(255, 255, 255, .2); background: color-mix(in srgb, currentColor 16%, transparent);
}
.dv-power__text { min-width: 0; }
.dv-power.is-online { background: var(--color-danger); color: var(--color-on-danger); box-shadow: var(--shadow-inset-hi), 0 12px 26px -10px var(--color-danger); }
.dv-power[disabled] { opacity: .6; pointer-events: none; }

/* ---------- Hồ sơ + thông tin xe + thống kê ---------- */
.dv-profile { display: flex; align-items: center; gap: 14px; padding-bottom: 14px; border-bottom: 1px dashed var(--color-border-strong); }
.dv-avatar { position: relative; flex: none; }
.driver-avatar { display: block; width: 68px; height: 68px; border: 3px solid var(--color-border-strong); border-radius: 50%; background: var(--color-surface-3); object-fit: cover; transition: border-color .3s; }
.dv-avatar__dot { position: absolute; right: 0; bottom: 2px; width: 18px; height: 18px; border: 3px solid var(--color-surface); border-radius: 50%; background: var(--color-text-muted); transition: background-color .3s; }
body.is-online .driver-avatar { border-color: var(--color-success); }
body.is-online .dv-avatar__dot { background: var(--color-success); }
.dv-profile__info { min-width: 0; }
.dv-profile__name { display: block; font-size: 19px; line-height: 1.25; overflow-wrap: anywhere; }
.dv-meta { display: flex; align-items: flex-start; gap: 6px; margin-top: 4px; font-size: 13.5px; line-height: 1.4; color: var(--color-text-secondary); }
.dv-meta .av-i { margin-top: 2px; color: var(--color-text-muted); }
.dv-meta > span:last-child { min-width: 0; overflow-wrap: anywhere; }
.dv-meta[hidden] { display: none; }
.dv-paycode { font-variant-numeric: tabular-nums; letter-spacing: .02em; color: var(--color-text); user-select: all; }   /* chạm giữ là chọn cả mã để sao chép */

.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.info-box { min-width: 0; padding: 12px; border: 1px solid var(--color-border); border-radius: 16px; background: var(--color-surface-2); font-size: 13.5px; }
.info-title { font-size: 13px; font-weight: 600; color: var(--color-text-muted); }
.info-value { display: flex; align-items: center; gap: 6px; margin-top: 3px; font-size: 15px; font-weight: 700; color: var(--color-primary-text); }
.small-text { display: block; margin-top: 3px; font-size: 13.5px; line-height: 1.4; color: var(--color-text-secondary); overflow-wrap: anywhere; }
.info-strong { color: var(--color-text); }

.dv-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.dv-stat { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 10px; border-radius: 16px; background: var(--color-surface-2); }
.dv-stat__ic { flex: none; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 12px; }
.dv-stat__tx { display: grid; min-width: 0; }
.dv-stat__label { font-size: 13px; line-height: 1.3; color: var(--color-text-muted); }
.dv-stat__value { font-size: 18px; font-weight: 800; line-height: 1.2; font-variant-numeric: tabular-nums; color: var(--color-text); overflow-wrap: anywhere; }

/* ---------- Danh sách tiện ích + đăng xuất + pháp lý ---------- */
.dv-list { padding: 4px 6px; }
.dv-row {
  display: flex; align-items: center; gap: 14px; width: 100%; min-height: 60px; padding: 8px 10px; border: 0; border-radius: 16px;
  background: transparent; color: var(--color-text); text-align: left; cursor: pointer; -webkit-tap-highlight-color: transparent;
  transition: background-color var(--dur-fast);
}
.dv-row + .dv-row { box-shadow: 0 -1px 0 var(--color-border); border-radius: 0; }
.dv-row:active { background: var(--color-primary-soft); }
.dv-row__ic { flex: none; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 14px; }
.dv-row__tx { flex: 1; min-width: 0; font-size: 16px; font-weight: 600; line-height: 1.3; }
.dv-row__go { color: var(--color-text-muted); }
.dv-logout {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 48px; margin-top: 2px; border: 0; border-radius: 16px;
  background: transparent; color: var(--color-text-secondary); font: 600 15px/1 var(--font-sans); cursor: pointer;
}
.dv-logout:hover, .dv-logout:active { background: var(--color-danger-soft); color: var(--color-danger-text); }
.dv-legal { margin-top: 6px; text-align: center; font-size: 13.5px; color: var(--color-text-muted); }
.dv-legal a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 6px; color: var(--color-info-text); }

/* ---------- Hộp thoại (JS mở/đóng bằng style.display = flex/none) ---------- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 99999; display: none; align-items: center; justify-content: center;
  padding: calc(16px + env(safe-area-inset-top, 0px)) 16px calc(16px + env(safe-area-inset-bottom, 0px));
  background: var(--color-overlay); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.modal-card {
  position: relative; width: 100%; max-width: 360px; max-height: 100%; overflow-y: auto; padding: 24px 20px 20px;
  border: 1px solid var(--glass-border); border-radius: 28px; background: var(--glass-bg-solid); box-shadow: var(--shadow-4);
  text-align: center; overscroll-behavior: contain; animation: dvModalIn .45s var(--ease-spring) both;
}
.modal-card--wide { max-width: 400px; }
@keyframes dvModalIn { from { opacity: 0; transform: translateY(16px) scale(.94); } to { opacity: 1; transform: none; } }
.modal-x { position: absolute; top: 12px; right: 12px; z-index: 2; width: 40px; height: 40px; padding: 0; display: grid; place-items: center; border: 0; border-radius: 50%; background: var(--color-surface-2); color: var(--color-text-secondary); cursor: pointer; }
.modal-x::after { content: ''; position: absolute; inset: -4px; }
.modal-icon { width: 64px; height: 64px; margin: 0 auto 12px; display: grid; place-items: center; border-radius: 50%; font-size: 0; line-height: 0; }
.modal-title { margin: 0 0 6px; font-size: 20px; font-weight: 700; line-height: 1.25; color: var(--color-text); }
.modal-desc { margin: 0 0 18px; font-size: 15px; line-height: 1.5; color: var(--color-text-secondary); }
.modal-actions { display: flex; gap: 10px; margin-top: 18px; }
.modal-actions button {
  flex: 1; min-height: 48px; padding: 0 14px; border: 0; border-radius: 16px; background: var(--grad-primary); color: var(--color-on-primary);
  font: 700 15px/1 var(--font-sans); letter-spacing: .02em; cursor: pointer; box-shadow: var(--shadow-inset-hi), var(--shadow-primary);
  -webkit-tap-highlight-color: transparent;
}
.modal-actions button:active { transform: scale(.97); }
.modal-actions .btn-cancel { background: var(--color-surface-3); color: var(--color-text-secondary); box-shadow: none; }
.modal-actions .btn-confirm-logout { background: var(--color-danger); color: var(--color-on-danger); box-shadow: var(--shadow-inset-hi), 0 8px 20px -8px var(--color-danger); }
.modal-actions button:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--color-surface), 0 0 0 5px var(--color-focus); }
.dv-qr { display: flex; justify-content: center; margin-bottom: 4px; }
#driverShareQrCanvas { padding: 12px; border: 1px solid var(--color-border); border-radius: 20px; background: #fff; box-shadow: var(--shadow-1); }   /* nền trắng bắt buộc để máy quét đọc được */

/* Nội dung động trong hộp thoại đánh giá khách / chat (driver.js) */
.dv-hint { margin: 4px 0 12px; font-size: 14.5px; line-height: 1.5; color: var(--color-text-secondary); text-align: center; }
.dv-hint--error { color: var(--color-danger-text); font-weight: 600; }
.dv-items { max-height: 50dvh; overflow-y: auto; text-align: left; overscroll-behavior: contain; }
.dv-item {
  display: block; width: 100%; margin: 0 0 8px; padding: 12px 14px; border: 1px solid var(--color-border); border-radius: 16px;
  background: var(--color-surface); color: var(--color-text); text-align: left; font: inherit; cursor: pointer;
}
.dv-item:active { background: var(--color-primary-soft); }
.dv-item:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--color-focus); }
.dv-item.is-done { opacity: .6; cursor: default; }
.dv-item__title { display: block; font-size: 15.5px; font-weight: 700; line-height: 1.35; }
.dv-item__title .is-rated { color: var(--color-success-text); font-weight: 600; }
.dv-item__sub { display: block; margin-top: 3px; font-size: 13.5px; line-height: 1.4; color: var(--color-text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dv-item__sub--wrap { white-space: normal; }
.dv-stars { display: flex; justify-content: center; gap: 2px; margin: 4px 0 14px; }
.dv-star { width: 52px; height: 52px; padding: 0; display: grid; place-items: center; border: 0; border-radius: 14px; background: none; color: var(--color-border-strong); cursor: pointer; -webkit-tap-highlight-color: transparent; }
.dv-star.is-on { color: var(--color-warning); }
.dv-star:active { transform: scale(1.15); }
.dv-star:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--color-focus); }
.modal-card .av-textarea { margin-bottom: 4px; text-align: left; font-size: 16px; }
.modal-card .av-input { text-align: left; }

.chat-message-list { display: flex; flex-direction: column; gap: 8px; max-height: 44dvh; margin-bottom: 12px; padding: 4px 2px; overflow-y: auto; text-align: left; overscroll-behavior: contain; }
.chat-bubble { max-width: 80%; padding: 10px 14px; border-radius: 18px; font-size: 15px; line-height: 1.45; word-break: break-word; }
.chat-bubble-customer { align-self: flex-end; border-bottom-right-radius: 5px; background: var(--color-primary); color: var(--color-on-primary); }
.chat-bubble-driver { align-self: flex-start; border-bottom-left-radius: 5px; background: var(--color-surface-3); color: var(--color-text); }
.chat-bubble-time { display: block; margin-top: 3px; font-size: 11.5px; opacity: .75; }
.chat-empty { margin: 8px 0; text-align: center; font-size: 14px; color: var(--color-text-muted); }
.chat-input-row { display: flex; gap: 8px; }
.chat-input-row .av-input { flex: 1; min-width: 0; }
/* build 323: khung chat với 1 khách cao ~90% màn hình (trước ~44dvh); lớp phủ bám vùng nhìn thấy (visualViewport, js/ui/pwa-viewport.js)
   để ô nhập luôn ở ngay trên bàn phím ảo. */
/* build 324: chừa vùng an toàn khi driver.html đã có viewport-fit=cover (giờ/pin, thanh Home) */
.modal-overlay--chat {
  --chat-pad-t: max(12px, calc(env(safe-area-inset-top, 0px) + 8px)); --chat-pad-b: max(12px, env(safe-area-inset-bottom, 0px));
  top: var(--vv-top, 0px); bottom: auto; height: var(--vv-h, 100dvh); padding: var(--chat-pad-t) 12px var(--chat-pad-b);
}
.modal-card--chat { display: flex; flex-direction: column; max-width: 480px; height: min(90dvh, calc(var(--vv-h, 100dvh) - var(--chat-pad-t, 12px) - var(--chat-pad-b, 12px))); max-height: none; overflow: hidden; }
.modal-card--chat .modal-icon { display: none; }
.modal-card--chat .modal-title { padding: 0 44px; }
.modal-card--chat #chatModalBody { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.modal-card--chat .dv-chat-sub { margin: 0 0 8px; font-size: 14px; }
.modal-card--chat .chat-message-list { flex: 1 1 auto; min-height: 0; max-height: none; }
.modal-card--chat .modal-actions { margin-top: 12px; }
.chat-send { flex: 0 0 auto; min-width: 48px; padding: 0 16px; display: inline-flex; align-items: center; gap: 6px; }

.chat-send { min-height: 48px; border: 0; border-radius: 16px; background: var(--grad-primary); color: var(--color-on-primary); font: 700 15px/1 var(--font-sans); cursor: pointer; box-shadow: var(--shadow-inset-hi), var(--shadow-primary); -webkit-tap-highlight-color: transparent; }
.chat-send:active { transform: scale(.97); }
.chat-send:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--color-surface), 0 0 0 5px var(--color-focus); }
.dv-empty { display: grid; justify-items: center; gap: 2px; }
.dv-empty__art { width: 150px; height: auto; }

/* ---------- Cảnh báo mất mạng ---------- */
.network-alert-box {
  position: fixed; top: calc(12px + env(safe-area-inset-top, 0px)); left: 50%; z-index: 100000; display: none; align-items: center; gap: 12px;
  width: calc(100% - 28px); max-width: 412px; padding: 14px 16px; border-radius: 20px; transform: translateX(-50%);
  background: var(--color-danger); color: var(--color-on-danger); box-shadow: var(--shadow-4); text-align: left; line-height: 1.4;
  animation: dvAlertPulse 1.6s infinite ease-in-out;
}
.network-alert-box b { display: block; font-size: 16px; }
.network-alert-box span { display: block; font-size: 14.5px; font-weight: 500; }
@keyframes dvAlertPulse { 0%, 100% { box-shadow: var(--shadow-4), 0 0 0 0 var(--color-danger); } 50% { box-shadow: var(--shadow-4), 0 0 0 8px transparent; } }

/* ---------- Đặt chuyến (feature/dat-chuyen): thẻ chuyến đang chạy + hộp thoại yêu cầu. Chỉ dùng token (xanh Grab). ---------- */
.dv-ride[hidden] { display: none; }
.dv-ride { border-color: var(--color-primary); }
.dv-ride__title { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; font-size: 16px; font-weight: 700; color: var(--color-primary-text); }
.dv-ride__who { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.dv-ride__avatar { flex: none; width: 48px; height: 48px; display: grid; place-items: center; border-radius: 50%; }
.dv-ride__who-text { display: grid; min-width: 0; }
.dv-ride__who-text b { font-size: 17px; font-weight: 700; color: var(--color-text); overflow-wrap: anywhere; }
.dv-ride__who-text span { font-size: 15px; color: var(--color-text-secondary); font-variant-numeric: tabular-nums; }
.dv-ride__actions { display: grid; gap: 10px; margin-top: 14px; }
.dv-ride__actions .dv-ride__cancel { color: var(--color-danger-text); }
.dv-ride__actions .dv-ride__cancel:hover { background: var(--color-danger-soft); }
.dv-trip { display: grid; gap: 8px; margin: 0 0 12px; padding: 12px 14px; border-radius: 16px; background: var(--color-surface-2); text-align: left; }
.dv-trip__line { display: flex; align-items: center; gap: 10px; font-size: 15px; line-height: 1.35; color: var(--color-text); }
.dv-trip__line > span:last-child { min-width: 0; overflow-wrap: anywhere; }
.dv-trip__ic { flex: none; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 10px; }
.dv-trip__meta { padding-left: 40px; font-size: 14.5px; color: var(--color-text-secondary); }
.dv-trip__meta b { font-size: 17px; font-weight: 700; color: var(--color-accent-text); font-variant-numeric: tabular-nums; }
.dv-countdown { display: block; width: 100%; height: 8px; margin: 4px 0 2px; border: 0; border-radius: 999px; overflow: hidden; -webkit-appearance: none; appearance: none; background: var(--color-surface-3); }
.dv-countdown::-webkit-progress-bar { background: var(--color-surface-3); }
.dv-countdown::-webkit-progress-value { background: var(--color-primary); border-radius: 999px; }
.dv-countdown::-moz-progress-bar { background: var(--color-primary); border-radius: 999px; }

/* ---------- Gói của tôi (Đợt D): dải nhắc gia hạn + thẻ gói. Chỉ dùng token; Sáng + Tối theo token. ---------- */
.dv-plan[hidden], .dv-plan-banner[hidden] { display: none; }
.dv-plan-banner { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 52px; margin-bottom: 14px; padding: 10px 14px; border: 0; border-radius: 18px; text-align: left; font: 600 14.5px/1.35 var(--font-sans); cursor: pointer; -webkit-tap-highlight-color: transparent; }
.dv-plan-banner.is-warn { background: var(--color-warning-soft); color: var(--color-warning-text); }
.dv-plan-banner.is-danger { background: var(--color-danger-soft); color: var(--color-danger-text); }
.dv-plan-banner.is-info { background: var(--color-info-soft); color: var(--color-info-text); }   /* build 324: dải "tin nhắn mới" */
.av-badge[hidden] { display: none; }
.dv-item__unread { margin-left: 6px; vertical-align: middle; }
.dv-plan-banner__ic { flex: none; display: grid; place-items: center; }
.dv-plan-banner__tx { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.dv-plan-banner__go { flex: none; font-weight: 700; text-decoration: underline; }
.dv-plan-banner:focus-visible, .dv-plan__renew summary:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--color-focus); }
.dv-plan--warn { border-color: var(--color-warning); }
.dv-plan--danger { border-color: var(--color-danger); }
.dv-plan__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; }
.dv-plan__title { display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 700; color: var(--color-text); }
.dv-plan__badge { display: inline-flex; align-items: center; padding: 5px 12px; border-radius: 999px; font-size: 13.5px; font-weight: 700; line-height: 1.3; }
.dv-plan__badge.is-ok { background: var(--color-success-soft); color: var(--color-success-text); }
.dv-plan__badge.is-info { background: var(--color-info-soft); color: var(--color-info-text); }
.dv-plan__badge.is-warn { background: var(--color-warning-soft); color: var(--color-warning-text); }
.dv-plan__badge.is-danger { background: var(--color-danger-soft); color: var(--color-danger-text); }
.dv-plan__note { margin: 8px 0 0; font-size: 14.5px; line-height: 1.5; color: var(--color-text-secondary); }
.dv-plan__renew { margin-top: 10px; border-top: 1px solid var(--color-border); }
.dv-plan__renew summary { display: flex; align-items: center; min-height: 48px; border-radius: 12px; font-size: 15px; font-weight: 600; color: var(--color-info-text); cursor: pointer; }
.dv-plan__renew-body { padding-bottom: 4px; }
.dv-plan__prices { display: grid; gap: 6px; margin: 10px 0 0; padding: 0; list-style: none; }
.dv-plan__prices li { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 10px 12px; border-radius: 12px; background: var(--color-surface-2); font-size: 15px; }
.dv-plan__prices b { font-variant-numeric: tabular-nums; color: var(--color-accent-text); }
.dv-plan__bank { display: grid; gap: 8px; margin: 12px 0 0; }
.dv-plan__bank dt { font-size: 13px; color: var(--color-text-muted); }
.dv-plan__bank dd { margin: 0; font-size: 16px; font-weight: 600; color: var(--color-text); overflow-wrap: anywhere; user-select: all; }
.dv-plan__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
/* Chuyển khoản tự động: chọn gói + mã QR VietQR (số tiền/nội dung điền sẵn) + chờ tiền về */
.dv-plan__choose { display: grid; gap: 8px; margin: 10px 0 0; }
.dv-plan__pick { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; padding: 10px 14px; border: 2px solid var(--color-input-border); border-radius: 14px; background: var(--color-surface); color: var(--color-text); font: 500 14px/1.3 var(--font-sans); text-align: left; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.dv-plan__pick b { font-size: 15.5px; font-variant-numeric: tabular-nums; color: var(--color-accent-text); }
.dv-plan__pick.is-on { border-color: var(--color-primary); background: var(--color-primary-soft); }
.dv-plan__pick:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--color-focus); }
.dv-plan__qrwrap { display: grid; justify-items: center; gap: 6px; margin: 14px 0 4px; text-align: center; }
.dv-plan__qr { padding: 12px; border: 1px solid var(--color-border); border-radius: 20px; background: #fff; box-shadow: var(--shadow-1); line-height: 0; }   /* nền trắng bắt buộc để app ngân hàng quét được */
.dv-plan__qr img, .dv-plan__qr canvas { max-width: 100%; height: auto; }
.dv-plan__qr.is-empty { padding: 0; border: 0; background: transparent; box-shadow: none; line-height: 1.5; }
.dv-plan__qr p { margin: 0; }

/* ---------- Splash tài xế (nền tối cố định, khớp ảnh chờ iOS) ---------- */
.dv-splash { background: var(--ink-950); }
.dv-splash__mark { border-radius: 28px; box-shadow: 0 18px 40px -16px #000; animation: av-pop .7s var(--ease-overshoot) both; }

/* ---------- Máy yếu / giảm chuyển động ---------- */
:root[data-perf="low"] .modal-overlay { -webkit-backdrop-filter: none; backdrop-filter: none; }
:root[data-perf="low"] .network-alert-box, :root[data-perf="low"] .live-dot { animation: none; }
@media (prefers-reduced-motion: reduce) {
  .network-alert-box, .live-dot, .modal-card { animation: none; }
  .dv-power, .dv-theme, .modal-actions button { transition: none; }
}

/* ============================================================================
   CỠ CHỮ TỐI THIỂU 16px CHO MỌI Ô NHẬP TRÊN THIẾT BỊ CẢM ỨNG (BẮT BUỘC)
   ============================================================================
   iPhone/iPad TỰ ĐỘNG PHÓNG TO cả trang mỗi khi chạm vào 1 ô nhập có cỡ chữ NHỎ HƠN 16px, và mức phóng đó
   giữ nguyên cả sau khi đóng bàn phím làm trang trôi ra ngoài khung. Hành vi cố định của iOS, không tắt được
   bằng CSS - để từ 16px trở lên là cách xử lý duy nhất. (Giữ nguyên quy tắc chốt chặn của bản trước.) */
@media (pointer: coarse) {
  input,
  select,
  textarea {
    font-size: 16px !important;
  }
}
