/* 5Sao Move — các trang luồng đặt xe: đặt xe (M1–M4), theo dõi đơn (M5–M6), đơn của tôi (M7), chính sách.
 * Dùng chung token, nút, ô nhập của styles.css. Khối nội dung là nền trắng viền 1 px; bóng chỉ cho lớp nổi và thẻ tóm tắt.
 */

.flow-page { background: var(--bg-alt); }
.flow-page main { padding: 24px 0 56px; }
.flow-page .site-footer { background: #fff; border-top: 1px solid var(--line); }

/* ---------- Thanh tiêu đề của luồng ---------- */
.flow-bar { position: sticky; top: var(--header-h); z-index: 1000; background: #fff; border-bottom: 1px solid var(--line); }
.flow-bar-inner { display: flex; align-items: center; gap: 8px; min-height: 56px; }
.flow-back { margin-left: -10px; }
.flow-heading { flex: 1; min-width: 0; }
.flow-heading h1 { font-size: 18px; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.flow-heading p { font-size: 13px; color: var(--muted); line-height: 1.35; }
.flow-call { display: none; color: var(--brand); }

/* ---------- Lưới trang ---------- */
.flow-grid { display: grid; gap: 24px; align-items: start; }
.flow-grid-map { grid-template-columns: 460px minmax(0, 1fr); }
.flow-grid-m3 { grid-template-columns: minmax(0, 1fr) 380px; }
.flow-panel { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 20px; min-width: 0; }

.map-pane {
  position: sticky; top: calc(var(--header-h) + 56px + 24px); isolation: isolate;
  height: calc(100vh - var(--header-h) - 56px - 48px); min-height: 420px; max-height: 760px;
  border-radius: var(--r); overflow: hidden; border: 1px solid var(--line); background: #E8EEF5;
}
.map-box { position: absolute; inset: 0; }
.map-box.leaflet-container { font-family: var(--font); }
.map-pane .map-hint { top: 14px; left: 14px; }
.map-close { display: none; position: absolute; top: 12px; right: 12px; z-index: 600; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow-pop); }
.map-close:hover { background: #fff; }
.map-pick {
  position: absolute; left: 14px; bottom: 14px; z-index: 600; width: min(420px, calc(100% - 80px));
  display: grid; gap: 2px; padding: 14px; border-radius: var(--r); background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow-pop);
}
.map-pick-name { font-weight: 600; }
.map-pick-addr { font-size: 13.5px; color: var(--muted); }
.map-pick .btn { margin-top: 10px; }
.mobile-only { display: none; }

/* ---------- Trường nhập ---------- */
.field { margin-top: 16px; min-width: 0; }
.field-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.field-row .field { margin-top: 12px; }
.opt { font-weight: 400; color: var(--muted); font-size: 13px; }
.textarea { min-height: 0; padding: 10px 12px; resize: vertical; line-height: 1.5; display: block; }
.counter { font-size: 12.5px; color: var(--muted); text-align: right; margin-top: 4px; }
.req { color: var(--danger); font-weight: 600; }
.label-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.label-row .counter { flex: none; margin: 0 0 6px; }
.autogrow { resize: none; overflow-y: hidden; max-height: 168px; }
.input:disabled { background: var(--bg-alt); color: var(--muted); }
.money-input, .unit-input { position: relative; }
.money-input .input, .unit-input .input { padding-right: 42px; font-variant-numeric: tabular-nums; }
.money-unit { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 14px; pointer-events: none; }
.money-lock { display: none; position: absolute; right: 13px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--muted); }
.money-input.is-locked .money-unit { display: none; }
.money-input.is-locked .money-lock { display: block; }
.money-input.is-locked .input { cursor: not-allowed; }
.check { display: flex; align-items: flex-start; gap: 10px; margin-top: 14px; font-size: 14.5px; line-height: 1.5; cursor: pointer; }
.check input { flex: none; width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--brand); }
.link-btn { border: 0; background: none; padding: 0; font: inherit; color: var(--brand); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-radio { position: relative; }
.chip-radio input { position: absolute; opacity: 0; pointer-events: none; }
.chip-radio span { display: block; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line-2); background: #fff; font-size: 14px; font-weight: 500; cursor: pointer; }
.chip-radio input:checked + span { border-color: var(--brand); color: var(--brand); background: var(--brand-tint); box-shadow: inset 0 0 0 1px var(--brand); }
.chip-radio input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
.switch { appearance: none; -webkit-appearance: none; position: relative; flex: none; width: 44px; height: 26px; margin: 0; border-radius: 999px; background: var(--line-2); cursor: pointer; transition: background-color .15s; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(16, 24, 40, .25); transition: transform .15s; }
.switch:checked { background: var(--brand); }
.switch:checked::after { transform: translateX(18px); }
.switch:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.warn-note { margin-top: 14px; padding: 10px 12px; border-radius: var(--r-sm); background: #FEF7E6; border: 1px solid #F5D9A0; color: #7A4B00; font-size: 14px; line-height: 1.5; }

/* ---------- M1. Chọn địa chỉ ---------- */
.m1-save { margin-bottom: 16px; display: grid; gap: 8px; }
.m1-save .field-label { margin: 0; }
.search-box {
  display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 6px 0 14px;
  border: 1px solid var(--line-2); border-radius: var(--r-sm); background: #fff;
}
.search-box:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(45, 92, 168, .15); }
.search-box > .ic { color: var(--brand); }
.search-input { flex: 1; min-width: 0; padding: 12px 0; border: 0; outline: none; background: transparent; font-size: 16.5px; font-weight: 500; }
.search-input::placeholder { color: #98A2B3; font-weight: 400; }
.search-input::-webkit-search-cancel-button { display: none; }
.search-clear { width: 36px; height: 36px; }
.m1-list { margin-top: 4px; }
.list-group { margin: 16px 0 2px; padding: 0 8px; font-size: 13px; font-weight: 600; letter-spacing: 0; color: var(--muted); }
.list-hint { padding: 12px 8px 4px; font-size: 14px; color: var(--muted); }
.place-list { list-style: none; margin: 4px 0 0; padding: 0; }
.place-list.tools { margin-top: 8px; padding-bottom: 4px; border-bottom: 1px solid var(--line); }
.place-row { display: flex; align-items: flex-start; gap: 12px; width: 100%; padding: 10px 8px; border: 0; border-radius: var(--r-sm); background: none; text-align: left; }
.place-row:hover { background: var(--bg-alt); }
.place-row > .ic { margin-top: 3px; color: var(--muted); }
.place-row.tool { align-items: center; }
.place-row.tool > .ic { margin-top: 0; color: var(--brand); }
.place-row.tool strong { color: var(--brand); }
.place-text { display: grid; min-width: 0; }
.place-text strong { font-weight: 500; font-size: 15px; }
.place-text small { font-size: 13px; color: var(--muted); line-height: 1.45; }
.place-row.has-error { background: #FEF3F2; }
.row-error { margin-top: 4px; font-size: 13.5px; color: var(--danger); line-height: 1.45; }

/* ---------- M2. Xác nhận vị trí & liên hệ ---------- */
.addr-card { display: grid; grid-template-columns: 16px minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 14px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--bg-alt); }
.addr-card.has-error { border-color: #FDA29B; background: #FEF3F2; }
.addr-card .text-btn { padding: 0; }
.addr-text { display: grid; min-width: 0; }
.addr-text strong { font-weight: 600; }
.addr-text span { font-size: 13.5px; color: var(--muted); line-height: 1.45; }
.stop-dot { width: 14px; height: 14px; margin-top: 4px; border-radius: 50%; }
.stop-dot.is-pickup { border: 4px solid var(--brand); background: #fff; }
.stop-dot.is-drop { background: var(--ink); }
.field-group { margin-top: 22px; }
.group-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.group-title { font-size: 15px; font-weight: 600; letter-spacing: 0; }
.group-head .text-btn { padding: 0; }
.drop-only { margin-top: 8px; }
.cod-lock { display: grid; gap: 10px; margin-top: 8px; padding: 12px; border-radius: var(--r-sm); background: var(--bg-alt); border: 1px solid var(--line); font-size: 14px; }
#m2-cod-msg { display: flex; gap: 8px; align-items: flex-start; color: var(--ink-2); }
#m2-cod-msg .ic { width: 16px; height: 16px; margin-top: 3px; color: var(--muted); }
.cod-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.cod-actions .btn .ic { width: 16px; height: 16px; }
.cod-strip { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 0 0; border: 0; border-top: 1px solid var(--line); background: none; color: var(--brand); font-weight: 600; font-size: 13.5px; text-align: left; }
.cod-strip .ic { width: 16px; height: 16px; }
.m2-actions { margin-top: 24px; }
/* Gói dịch vụ ở M2 điểm lấy: cùng ô chọn .plan-pick (styles.css) và bảng chọn #modal-plan với trang chủ và M3 */
.m2-plan { margin-top: 22px; }
.m2-plan .plan-pick-label { font-size: 15px; font-weight: 600; margin-bottom: 8px; }

/* ---------- M3. Chi tiết đơn ---------- */
.m3-main { min-width: 0; }
.blk { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 20px; }
.blk + .blk, .blk + .demo-panel { margin-top: 12px; }
.blk-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.blk h2 { font-size: 17px; letter-spacing: -0.01em; }
.blk-meta { font-weight: 500; font-size: 15px; color: var(--muted); }
.blk-head .text-btn { padding: 0; flex: none; }
.blk-row { display: none; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.sheet-close, .sheet-foot { display: none; }

/* Bước Xác nhận: khối Dịch vụ = dòng xe + ô chọn gói; khối Khuyến mãi = ô chọn mở bảng mã */
.blk-service .plan-pick-wrap { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.promo-pick-wrap { margin-top: 0; }
.promo-pick-save { color: #067647; }

/* Bước Xác nhận: tóm tắt hàng hóa, dịch vụ thêm, ghi chú đã nhập ở bước Hàng hóa */
.gsum { margin: 0; }
.gsum div { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 2px 12px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 14.5px; }
.gsum div:first-child { border-top: 0; padding-top: 0; }
.gsum dt { color: var(--muted); }
.gsum dd { margin: 0; overflow-wrap: anywhere; }
.gsum dd small { margin-left: 4px; color: var(--muted); font-size: 13px; }
#gsum-missing { margin-top: 10px; }

/* Lộ trình */
.rt-row { position: relative; display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 8px; align-items: start; }
.rt-row::before { content: ""; position: absolute; left: 10px; top: 34px; bottom: -16px; border-left: 1px dashed var(--line-2); }
.route-drops li:last-child .rt-row::before { display: none; }
.route-drops { list-style: none; margin: 0; padding: 0; }
.route-drops li { position: relative; background: #fff; border-radius: var(--r-sm); }
.route-drops li.is-dragging { z-index: 5; box-shadow: var(--shadow-pop); }
.rt-dot { position: relative; z-index: 1; display: grid; place-items: center; width: 22px; height: 22px; margin-top: 14px; font-size: 11px; font-weight: 700; color: #fff; }
.rt-dot::before { content: ""; position: absolute; border-radius: 50%; }
.rt-dot > span { position: relative; }
.rt-dot.is-pickup::before { inset: 4px; border: 4px solid var(--brand); background: #fff; }
.rt-dot.is-drop::before { inset: 5px; background: var(--ink); }
.rt-dot.has-num::before { inset: 1px; }
.rt-main { display: grid; gap: 1px; min-width: 0; width: 100%; margin: 2px 0; padding: 10px 12px; border: 1px solid transparent; border-radius: var(--r-sm); background: none; text-align: left; }
.rt-main:hover { background: var(--bg-alt); border-color: var(--line); }
.rt-label { font-size: 12.5px; color: var(--muted); }
.rt-name { font-weight: 600; font-size: 15.5px; }
.rt-addr { font-size: 13.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rt-contact { margin-top: 3px; font-size: 14px; }
.rt-extra { font-size: 13.5px; color: var(--ink-2); overflow-wrap: anywhere; }
.rt-error { margin-top: 3px; font-size: 13.5px; color: var(--danger); }
.rt-row.has-error .rt-main { border-color: #FDA29B; background: #FEF3F2; }
.rt-tools { display: flex; align-items: center; margin-top: 10px; }
.rt-grip { cursor: grab; touch-action: none; color: var(--muted); }
.rt-grip:active { cursor: grabbing; }
.rt-remove .ic, .rt-grip .ic { width: 18px; height: 18px; }
.route-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 20px; padding: 4px 0 0 30px; }
.quote-fail { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 10px; padding: 10px 12px; border-radius: var(--r-sm); background: #FEF3F2; }
.quote-fail .field-error { margin: 0; }

.vehicle-line { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.vehicle-name { font-weight: 600; }
.vehicle-spec { font-size: 14px; color: var(--muted); }

/* Hàng hóa */
.goods-row .field { margin-top: 0; }
.over-weight { margin-top: 10px; }
.cat-field { border: 0; padding: 0; margin: 18px 0 0; }
.cat-field legend { padding: 0; }
/* Loại hàng: chip có icon xếp theo dòng (gọn hơn lưới ô vuông, vẫn là chip có icon theo mục 9.2) */
.cat-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.cat { position: relative; }
.cat input { position: absolute; opacity: 0; pointer-events: none; }
.cat-box {
  display: inline-flex; align-items: center; gap: 7px; min-height: 38px; padding: 0 13px 0 10px;
  border: 1px solid var(--line-2); border-radius: 999px; background: #fff;
  font-size: 14px; font-weight: 500; line-height: 1.3; cursor: pointer; transition: border-color .15s;
}
.cat-box:hover { border-color: #98A2B3; }
.cat-box .ic { width: 18px; height: 18px; stroke-width: 1.8; color: var(--ink-2); }
.cat input:checked + .cat-box { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); background: var(--brand-tint); color: var(--brand); }
.cat input:checked + .cat-box .ic { color: var(--brand); }
.cat input:focus-visible + .cat-box { outline: 2px solid var(--brand); outline-offset: 2px; }
.photos { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.photo { position: relative; width: 72px; height: 72px; margin: 0; border-radius: var(--r-sm); }
.photo img { width: 100%; height: 100%; object-fit: cover; border-radius: var(--r-sm); border: 1px solid var(--line); }
.photo figcaption { position: absolute; left: 4px; bottom: 4px; padding: 0 5px; border-radius: 4px; background: rgba(16, 24, 40, .72); color: #fff; font-size: 11px; }
.photo-remove { position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; border-radius: 50%; background: rgba(16, 24, 40, .72); color: #fff; }
.photo-remove:hover { background: var(--ink); }
.photo-remove .ic { width: 14px; height: 14px; }
.photo-file { display: grid; place-items: center; width: 100%; height: 100%; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--bg-alt); font-weight: 600; color: var(--muted); }
/* Chưa có ảnh: một nút gọn thay cho ô vuông trống */
.photo-add { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px 0 12px; border: 1px dashed var(--line-2); border-radius: var(--r-sm); background: #fff; color: var(--brand); font-size: 14px; font-weight: 600; }
.photo-add:hover { border-color: var(--brand); }
.photo-add .ic { width: 18px; height: 18px; }
.photos .opt { font-size: 13px; }
.goods-foot { margin-top: 16px; }
.goods-foot .text-btn { padding: 0; }

/* Dịch vụ thêm */
.svc-list { list-style: none; margin: 0; padding: 0; }
.svc { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 12px 0; border-top: 1px solid var(--line); }
.svc:first-child { padding-top: 2px; border-top: 0; }
.svc:last-child { padding-bottom: 0; }
.svc-text { min-width: 0; }
.svc-name { display: flex; align-items: center; gap: 2px; font-weight: 500; }
.svc-price { font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.svc.is-on .svc-price { color: var(--ink); font-weight: 500; }
.svc-desc { margin-top: 4px; max-width: 36em; font-size: 13.5px; color: var(--ink-2); }
.info-btn { display: inline-grid; place-items: center; width: 28px; height: 28px; border: 0; border-radius: 6px; background: none; color: var(--danger); }
.info-btn:hover, .info-btn[aria-expanded="true"] { background: #FEF3F2; color: #912018; }
.info-btn .ic { width: 16px; height: 16px; }
.svc-toggle { display: grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line-2); background: #fff; color: var(--brand); }
.svc-toggle:hover { border-color: var(--brand); }
.svc-toggle.is-on { background: var(--brand); border-color: var(--brand); color: #fff; }
.svc-stepper { flex: none; }
.svc-stepper .icon-btn[disabled] { opacity: .4; cursor: not-allowed; }

/* Hóa đơn, thanh toán, khuyến mãi, điều khoản */
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; font-weight: 500; cursor: pointer; }
.invoice-form .field:first-of-type { margin-top: 14px; }
.pay-list { display: grid; gap: 8px; margin: 0; padding: 0; border: 0; }
.pay-opt { display: flex; align-items: flex-start; gap: 12px; padding: 12px; border: 1px solid var(--line-2); border-radius: var(--r-sm); cursor: pointer; }
.pay-opt input { flex: none; width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--brand); }
.pay-opt:has(input:checked) { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.pay-opt.is-disabled { background: var(--bg-alt); color: var(--muted); cursor: not-allowed; }
.pay-text { display: grid; }
.pay-text strong { font-weight: 600; font-size: 15px; }
.pay-text small { font-size: 13px; color: var(--muted); line-height: 1.45; }
/* Thanh toán không có mặc định: chưa chọn thì dòng tóm tắt (mobile) và chip ở thanh đáy nhắc khách chọn */
.collapsible.is-unset .blk-row-value, .bar-chip.is-unset { color: var(--brand); font-weight: 500; }
.bar-chip.is-unset { border-color: var(--brand); }
.promo-form { display: flex; gap: 8px; }
.promo-form .input { text-transform: uppercase; letter-spacing: .02em; }
.promo-form .input::placeholder { text-transform: none; letter-spacing: 0; }
.promo-chip { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px dashed var(--brand); border-radius: var(--r-sm); background: var(--brand-tint); }
.promo-text { flex: 1; display: grid; min-width: 0; }
.promo-text strong { letter-spacing: .02em; }
.promo-text small { font-size: 13px; color: var(--ink-2); line-height: 1.45; }
.promo-save { font-weight: 600; color: #067647; white-space: nowrap; font-variant-numeric: tabular-nums; }
.promo-chip .text-btn { padding: 0; flex: none; }
.promo-warn { color: var(--danger); }
/* Danh sách mã đang có trong bảng Khuyến mãi: mỗi mã một dòng, bên phải là số tiền giảm cho đơn này hoặc lý do chưa dùng được */
.promo-avail-title { font-size: 14px; font-weight: 600; color: var(--muted); margin-bottom: 8px; }
.promo-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.promo-opt {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 12px; align-items: center; width: 100%; padding: 10px 12px;
  border: 1px solid var(--line-2); border-radius: var(--r-sm); background: #fff; text-align: left; font: inherit; color: inherit; cursor: pointer;
  transition: border-color .15s;
}
.promo-opt:hover { border-color: #98A2B3; }
.promo-opt.is-selected { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); background: var(--brand-tint); }
.promo-opt:disabled { cursor: not-allowed; background: var(--bg-alt); color: var(--muted); }
.promo-opt[aria-busy="true"] { opacity: .6; }
.promo-opt-code { font-weight: 700; letter-spacing: .03em; font-size: 15px; }
.promo-opt-desc { grid-column: 1; font-size: 13.5px; color: var(--ink-2); line-height: 1.45; }
.promo-opt-cond { grid-column: 1; font-size: 12.5px; color: var(--muted); line-height: 1.4; }
.promo-opt:disabled .promo-opt-desc { color: var(--muted); }
.promo-opt-amt { grid-column: 2; grid-row: 1 / span 3; font-weight: 600; color: #067647; white-space: nowrap; font-variant-numeric: tabular-nums; font-size: 14.5px; text-align: right; }
.promo-opt.is-selected .promo-opt-amt { color: var(--brand); }
.promo-opt:disabled .promo-opt-amt { max-width: 9em; white-space: normal; color: var(--muted); font-weight: 500; font-size: 12.5px; line-height: 1.35; }
.promo-opt-amt:empty { display: none; }
.promo-empty { padding: 12px; border: 1px dashed var(--line-2); border-radius: var(--r-sm); font-size: 14px; color: var(--muted); text-align: center; }
.modal-panel .promo-form { margin: 0; }
.modal-panel h2[tabindex]:focus { outline: none; }
.blk-terms .check { margin-top: 0; }

/* Tóm tắt giá (cột phải) */
.m3-side { position: sticky; top: calc(var(--header-h) + 56px + 24px); min-width: 0; max-height: calc(100vh - var(--header-h) - 56px - 40px); overflow-y: auto; border-radius: var(--r); }
.side-card { overflow: hidden; background: #fff; border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-card); }
.side-map { position: relative; inset: auto; height: 200px; background: #E8EEF5; border-bottom: 1px solid var(--line); }
.side-body { padding: 16px 20px 20px; }
.side-route { font-size: 14px; color: var(--muted); }
.breakdown-list { margin: 12px 0 0; padding: 10px 0 0; border-top: 1px solid var(--line); font-size: 14px; }
.breakdown-list:empty { display: none; }
.breakdown-list div { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; }
.breakdown-list dt { color: var(--ink-2); }
.breakdown-list dd { margin: 0; white-space: nowrap; font-variant-numeric: tabular-nums; }
.breakdown-list .is-discount dd { color: #067647; }
.breakdown-list .bd-total { margin-top: 6px; padding-top: 8px; border-top: 1px solid var(--line); font-weight: 600; }
.side-body .bd-total { display: none; }
.total-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-top: 10px; padding-top: 12px; border-top: 1px solid var(--line); }
.total-label { font-weight: 600; white-space: nowrap; }
.total-value { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: baseline; gap: 0 8px; white-space: nowrap; }
.total-value s, .bar-total-value s { color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }
.total-value s:empty, .bar-total-value s:empty { display: none; }
.total-value strong { font-size: 26px; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.is-loading { opacity: .45; transition: opacity .15s; }
.quote-status { margin-top: 4px; font-size: 13px; color: var(--muted); }
.quote-status:empty { display: none; }
.side-body > .btn { margin-top: 14px; }
.side-note { margin-top: 10px; font-size: 13px; color: var(--muted); text-align: center; }
.book-bar { display: none; }
.sheet-backdrop { position: fixed; inset: 0; z-index: 1140; background: rgba(16, 24, 40, .5); }
body.sheet-open { overflow: hidden; }

/* Bảng demo */
.demo-panel { padding: 0 16px; border: 1px dashed #E0B252; border-radius: var(--r); background: #FFFBF0; font-size: 14px; }
.demo-panel summary { padding: 12px 0; font-weight: 600; color: #7A4B00; cursor: pointer; }
.demo-body { padding-bottom: 14px; }
.demo-facts { display: grid; gap: 4px; margin: 0 0 8px; padding-left: 18px; }
.demo-body .check { margin-top: 8px; font-size: 14px; }

/* ---------- Modal trong luồng ---------- */
.modal-wide { max-width: 640px; }
.van-photo { width: 100%; height: auto; aspect-ratio: 2 / 1; border-radius: var(--r-sm); background: #DCEBF8; }
.spec-compact { margin: 0; }
.spec-compact div { font-size: 14px; padding: 9px 0; }
.plain-steps, .plain-list { display: grid; gap: 6px; margin: 0; padding-left: 20px; color: var(--ink-2); font-size: 15px; }
.opt-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.opt-compare > div { display: grid; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-sm); }
.opt-compare span { font-size: 13px; color: var(--muted); }
.opt-compare strong { font-size: 20px; font-variant-numeric: tabular-nums; }
.opt-compare .is-better { border-color: var(--brand); background: var(--brand-tint); }
.opt-compare p { grid-column: 1 / -1; }
.checking { justify-items: center; text-align: center; }
.spinner { width: 32px; height: 32px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--brand); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- M4. OTP ---------- */
.otp-step { display: grid; gap: 6px; }
.otp-step .btn { margin-top: 8px; }
.otp-step .field-hint { margin-top: 0; }
.otp-sent { font-size: 15px; color: var(--ink-2); }
.otp-cells { position: relative; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; margin-top: 6px; }
.otp-cell { display: grid; place-items: center; height: 54px; border: 1px solid var(--line-2); border-radius: var(--r-sm); background: #fff; font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; }
.otp-cell.is-active { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(45, 92, 168, .15); }
.otp-input { position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; border: 0; opacity: .01; font-size: 16px; color: transparent; caret-color: transparent; background: transparent; }
.otp-status { font-size: 13.5px; color: var(--muted); }
.otp-status:empty { display: none; }
.otp-links { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 16px; margin-top: 4px; }
.otp-links .text-btn { padding: 0; }
.otp-links .text-btn[disabled] { color: var(--muted); text-decoration: none; cursor: default; }
.otp-help { font-size: 13.5px; color: var(--muted); }

/* ---------- Theo dõi đơn (M5, M6) và Đơn của tôi (M7) ---------- */
.page-grid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 24px; align-items: start; }
.page-side { position: sticky; top: calc(var(--header-h) + 24px); display: grid; gap: 12px; min-width: 0; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 20px; min-width: 0; }
.panel + .panel { margin-top: 12px; }
.panel h2 { font-size: 17px; letter-spacing: -0.01em; }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.panel-head .text-btn { padding: 0; }
.page-title { font-size: clamp(24px, 3vw, 30px); letter-spacing: -0.02em; }
.page-lead { margin-top: 6px; color: var(--ink-2); }

.success { text-align: left; }
.success-code { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 12px; }
.code-pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: var(--r-sm); background: var(--bg-alt); border: 1px solid var(--line); font-weight: 700; letter-spacing: .03em; font-variant-numeric: tabular-nums; }
.code-pill .icon-btn { width: 28px; height: 28px; margin-right: -6px; }
.code-pill .icon-btn .ic { width: 16px; height: 16px; }
.success-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.notice { margin-top: 14px; padding: 10px 12px; border-radius: var(--r-sm); background: var(--bg-alt); font-size: 14px; color: var(--ink-2); }
.kv { margin: 0; }
.kv div { display: flex; justify-content: space-between; gap: 16px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14.5px; }
.kv div:last-child { border-bottom: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; text-align: right; font-weight: 500; overflow-wrap: anywhere; }

.qr-box { display: grid; grid-template-columns: 168px minmax(0, 1fr); gap: 20px; align-items: start; }
.qr-img { width: 168px; height: 168px; padding: 8px; border: 1px solid var(--line); border-radius: var(--r-sm); background: #fff; }
.qr-img svg, .qr-img img { display: block; width: 100%; height: 100%; object-fit: contain; }
/* Tên gói kèm icon trong dòng chữ (theo dõi đơn, đơn của tôi) */
.plan-inline { display: inline-flex; align-items: center; gap: 5px; vertical-align: -3px; }
.plan-inline .ic { width: 16px; height: 16px; stroke-width: 1.9; color: var(--ink-2); }
.kv .copy-btn { width: 26px; height: 26px; margin: -6px -4px -6px 2px; vertical-align: middle; }
.kv .copy-btn .ic { width: 14px; height: 14px; }
.qr-count { font-weight: 700; font-variant-numeric: tabular-nums; color: #9A5B00; }

.status-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; }
.status-head .badge { font-size: 14px; padding: 4px 12px; }
.eta { margin-top: 8px; font-size: 15px; color: var(--ink-2); }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; gap: 10px; padding: 6px 0; font-size: 14.5px; }
.timeline li::before { content: ""; position: absolute; left: 9px; top: 22px; bottom: -8px; border-left: 2px solid var(--line); }
.timeline li:last-child::before { display: none; }
.tl-dot { position: relative; z-index: 1; width: 12px; height: 12px; margin: 5px 0 0 4px; border-radius: 50%; background: var(--line-2); }
.timeline li.is-done .tl-dot { background: var(--brand); }
.timeline li.is-done::before { border-color: var(--brand); }
.timeline li.is-current .tl-dot { background: #fff; border: 3px solid var(--brand); box-shadow: 0 0 0 4px rgba(45, 92, 168, .15); }
.timeline li.is-bad .tl-dot { background: var(--danger); }
.timeline li.is-pending { color: var(--muted); }
.tl-time { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }

.driver { display: flex; align-items: center; gap: 14px; }
.driver-avatar { display: grid; place-items: center; flex: none; width: 44px; height: 44px; border-radius: 50%; background: var(--brand-tint); color: var(--brand); font-weight: 700; }
.driver-text { flex: 1; min-width: 0; display: grid; }
.driver-text strong { font-weight: 600; }
.driver-text span { font-size: 14px; color: var(--muted); }
.plate { display: inline-block; padding: 1px 8px; border: 1px solid var(--ink); border-radius: 4px; color: var(--ink); font-weight: 600; font-size: 13px; letter-spacing: .03em; }

.stops-list { list-style: none; margin: 0; padding: 0; }
.stops-list > li { position: relative; display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 10px; padding: 10px 0; }
.stops-list > li::before { content: ""; position: absolute; left: 10px; top: 32px; bottom: -10px; border-left: 1px dashed var(--line-2); }
.stops-list > li:last-child::before { display: none; }
.stop-body { display: grid; gap: 2px; min-width: 0; }
.stop-body .rt-label { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.stop-body .badge { font-size: 12px; padding: 1px 8px; }
.stop-meta { font-size: 14px; color: var(--ink-2); }
.cod-due { margin-top: 6px; padding: 10px 12px; border-radius: var(--r-sm); background: #FEF7E6; border: 1px solid #F5D9A0; }
.cod-due strong { font-size: 20px; font-variant-numeric: tabular-nums; }
.hidden-stops { font-size: 14px; color: var(--muted); padding: 10px 0 0 32px; }

.verify-box { display: grid; gap: 10px; }
.verify-box .btn { justify-content: flex-start; }
.role-note { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: var(--r-sm); background: var(--brand-tint); color: var(--ink-2); font-size: 14px; }
.role-note .ic { width: 18px; height: 18px; margin-top: 2px; color: var(--brand); }
.track-map { position: relative; height: 280px; border-radius: var(--r); overflow: hidden; border: 1px solid var(--line); background: #E8EEF5; isolation: isolate; }
.track-map .leaflet-container { font-family: var(--font); }
.driver-pin { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--brand); border: 3px solid #fff; box-shadow: 0 2px 8px rgba(16, 24, 40, .35); color: #fff; font: 700 11px var(--font); }
.reason-list { display: grid; gap: 8px; margin: 0; padding: 0; border: 0; }
.reason-list label { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: var(--r-sm); cursor: pointer; font-size: 15px; }
.reason-list label:has(input:checked) { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.reason-list input { accent-color: var(--brand); width: 18px; height: 18px; margin: 0; }
.demo-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.empty { padding: 28px 12px; text-align: center; color: var(--muted); }
.empty .btn { margin-top: 14px; }

.tabs { display: flex; gap: 4px; padding: 3px; border-radius: var(--r-sm); background: var(--bg-alt); border: 1px solid var(--line); }
.tab { flex: 1; padding: 8px 12px; border: 0; border-radius: 6px; background: none; font-weight: 500; font-size: 14.5px; color: var(--ink-2); }
.tab[aria-selected="true"] { background: #fff; color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(16, 24, 40, .1); }
.order-list { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 10px; }
.order-card { display: grid; gap: 8px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r); background: #fff; }
.order-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; }
.order-code { font-weight: 700; letter-spacing: .02em; }
.order-route { display: grid; font-size: 15px; }
.order-route span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.order-route span + span::before { content: "→ "; color: var(--muted); }
.order-meta { font-size: 13.5px; color: var(--muted); }
.order-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.saved-list { list-style: none; margin: 0; padding: 0; }
.saved-list li { display: flex; align-items: flex-start; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.saved-list li:first-child { border-top: 0; padding-top: 0; }
.saved-list .ic { margin-top: 3px; color: var(--muted); }
.saved-text { flex: 1; min-width: 0; display: grid; }
.saved-text strong { font-weight: 600; font-size: 14.5px; }
.saved-text span { font-size: 13.5px; color: var(--muted); }
.saved-list .icon-btn { width: 34px; height: 34px; margin-top: -4px; }
.lookup { max-width: 460px; margin: 24px auto 0; }
.lookup .panel { padding: 28px 24px; }
.lookup form { display: grid; gap: 8px; margin-top: 18px; }
.lookup .btn { margin-top: 8px; }

/* Trang chính sách */
.doc { max-width: 760px; }
/* ---------- Tin tức ---------- */
.news { max-width: 1040px; }
.news-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; margin-top: 24px; }
.news-card { background: #fff; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.news-link { display: grid; color: inherit; height: 100%; }
.news-link:hover { text-decoration: none; }
.news-link:hover .news-title { color: var(--brand); }
.news-thumb { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: var(--bg-alt); }
.news-body { padding: 14px 16px 16px; }
.news-meta { font-size: 13px; color: var(--muted); }
.news-title { margin-top: 4px; font-size: 17px; line-height: 1.4; }
.news-excerpt { margin-top: 6px; font-size: 14.5px; color: var(--ink-2); }
.news-empty { grid-column: 1 / -1; padding: 32px 20px; border: 1px dashed var(--line-2); border-radius: var(--r); background: #fff; text-align: center; color: var(--ink-2); }
.news-empty p + p { margin-top: 4px; }
.news-empty .btn { margin-top: 16px; }
.doc section { padding: 28px 0; border-bottom: 1px solid var(--line); scroll-margin-top: calc(var(--header-h) + 16px); }
.doc section:last-child { border-bottom: 0; }
.doc h2 { font-size: 22px; }
.doc p, .doc li { color: var(--ink-2); }
.doc p { margin-top: 10px; }
.doc ul, .doc ol { margin: 10px 0 0; padding-left: 20px; display: grid; gap: 6px; }
.doc-table { width: 100%; margin-top: 14px; border-collapse: collapse; font-size: 14.5px; }
.doc-table th, .doc-table td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.doc-table th { font-weight: 600; background: var(--bg-alt); }
.doc-toc { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.pending { color: #9A5B00; font-weight: 500; }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .flow-grid-map { grid-template-columns: 420px minmax(0, 1fr); }
  .flow-grid-m3, .page-grid { grid-template-columns: minmax(0, 1fr) 340px; }
}

@media (min-width: 961px) {
  .mobile-only { display: none !important; }
}

@media (max-width: 960px) {
  .flow-page .flow-site-header { display: none; }
  .flow-bar { top: 0; }
  .flow-call { display: inline-grid; margin-right: -8px; }
  .flow-page main { padding: 16px 0 40px; }
  .mobile-only { display: block; }
  .flow-grid, .flow-grid-map, .flow-grid-m3, .page-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .page-side { position: static; }

  /* M1: bản đồ mở toàn màn hình khi chọn "Chọn từ bản đồ" */
  #v-m1 .map-pane { display: none; }
  #v-m1.show-map .map-pane {
    display: block; position: fixed; inset: 56px 0 0; z-index: 1050; height: auto; max-height: none; min-height: 0;
    border: 0; border-radius: 0;
  }
  #v-m1.show-map .map-close { display: inline-grid; }
  /* Thẻ chọn điểm chiếm đáy màn hình: bỏ nút zoom (đã có thao tác chụm), chuyển dòng ghi công bản đồ lên góc trên */
  #v-m1 .leaflet-control-zoom { display: none; }
  #v-m1 .leaflet-bottom.leaflet-right { top: 0; bottom: auto; left: 0; right: auto; }
  #v-m1.show-map .map-hint { top: 34px; max-width: calc(100% - 80px); }
  #v-m1.show-map .map-pick { left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); width: auto; }
  body.map-mode { overflow: hidden; }

  /* M2: bản đồ nhỏ ở đầu (bỏ nút +/−, chụm hai ngón để phóng to), nút Xác nhận cố định đáy */
  .m2-map-pane { order: -1; position: relative; top: auto; height: 180px; min-height: 0; }
  .m2-map-pane .map-hint { top: 10px; left: 10px; max-width: calc(100% - 20px); }
  #v-m2 .leaflet-control-zoom { display: none; }
  .m2-plan { margin-top: 18px; }
  .m2-panel { padding-bottom: 0; }
  .m2-actions {
    position: sticky; bottom: 0; z-index: 10; margin: 24px -20px 0; padding: 12px 20px calc(12px + env(safe-area-inset-bottom));
    background: #fff; border-top: 1px solid var(--line); border-radius: 0 0 var(--r) var(--r);
  }

  /* M3: bản đồ lộ trình ở đầu; tổng phí + Đặt đơn ở thanh đáy */
  .m3-side { order: -1; position: static; max-height: none; overflow: visible; }
  .side-card { box-shadow: none; }
  .side-map { height: 170px; border-bottom: 0; }
  .side-body { display: none; }
  /* Bước Hàng hóa (m3): không cần bản đồ, thanh đáy chỉ có giá + Tiếp tục. Bước Xác nhận (m4): thêm hàng chip thanh toán, khuyến mãi */
  body[data-view="m3"] .m3-side, body[data-view="m3"] .book-bar-chips { display: none; }
  body[data-view="m3"] main { padding-bottom: 96px; }
  body[data-view="m3"] .toast { bottom: 96px; }
  body[data-view="m4"] main { padding-bottom: 150px; }
  body[data-view="m4"] .toast { bottom: 150px; }
  .book-bar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 1050; display: grid; gap: 8px;
    padding: 8px 16px calc(10px + env(safe-area-inset-bottom)); background: #fff; border-top: 1px solid var(--line);
    box-shadow: 0 -6px 16px -10px rgba(16, 24, 40, .18);
  }
  .book-bar-chips { display: flex; gap: 8px; }
  .bar-chip { flex: 1; min-width: 0; padding: 6px 10px; border-radius: 999px; border: 1px solid var(--line-2); background: #fff; font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .book-bar-main { display: flex; align-items: center; gap: 12px; }
  .bar-total { flex: 1; min-width: 0; display: grid; gap: 0; padding: 0; border: 0; background: none; text-align: left; line-height: 1.3; }
  .bar-total-label { display: flex; align-items: center; gap: 4px; font-size: 12.5px; color: var(--muted); }
  .bar-total-label .ic { width: 14px; height: 14px; }
  .bar-total-value { display: flex; align-items: baseline; gap: 6px; }
  .bar-total-value strong { font-size: 20px; font-variant-numeric: tabular-nums; }
  .book-bar .btn { min-height: 48px; padding: 0 28px; }

  .collapsible { padding: 0; }
  .collapsible .blk-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 15px 16px; border: 0; border-radius: var(--r); background: none; text-align: left; }
  .blk-row-label { flex: none; font-weight: 600; }
  .blk-row-value { flex: 1; min-width: 0; text-align: right; font-size: 14px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .blk-row .ic { width: 16px; height: 16px; color: var(--muted); }
  .collapsible .blk-body { display: none; }
  .collapsible.is-open .blk-body {
    display: block; position: fixed; left: 0; right: 0; bottom: 0; z-index: 1150; max-height: 88vh; overflow: auto;
    padding: 16px 16px calc(16px + env(safe-area-inset-bottom)); border-radius: 16px 16px 0 0; background: #fff; box-shadow: var(--shadow-pop);
  }
  .sheet-close { display: inline-grid; margin-right: -8px; }
  .sheet-foot { display: block; margin-top: 18px; }

  .qr-box { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .track-map { height: 220px; }
}

@media (max-width: 600px) {
  .flow-panel, .blk, .panel { padding: 16px; }
  .collapsible { padding: 0; }
  .m2-actions { margin: 20px -16px 0; padding-left: 16px; padding-right: 16px; }
  .route-actions { padding-left: 0; }
  .lookup .panel { padding: 22px 16px; }
}

@media (max-width: 440px) {
  .field-row { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .goods-row .field + .field { margin-top: 14px; }
  .gsum div { grid-template-columns: 104px minmax(0, 1fr); }
  .modal-actions-row { grid-template-columns: 1fr; }
  .otp-cell { height: 48px; font-size: 20px; }
}
