/* EnFeed ส่งสินค้า (แอปคนขับ) — v0.29.0 จัดวางหน้าจอเท่านั้น หน้าตาชิ้นส่วนทั้งหมดมาจาก /static/ds/components.css
   (ผู้ใช้ขอ 11 พ.ย. "redesign ทุกหน้า": แอปขนส่งแบบมาตรฐาน สีเขียวอมฟ้า ไอคอน SVG ไม่ใช้อิโมจิ ตัวหนังสือน้อยลง) */

/* ── Boot ─────────────────────────────────────────────────────────────── */
.boot { display: flex; flex-direction: column; gap: var(--sp-2); padding-top: var(--sp-2); }
.boot-note { padding: var(--sp-6) var(--sp-4); text-align: center; color: var(--text-2); }

/* ── Header: brand + plate chip; the plate hides with the brand on pushed screens (touch) ── */
.appbar .head-plate {
  display: inline-block; flex: 0 1 auto; min-width: 0; margin-left: var(--sp-1);
  overflow: hidden; text-overflow: ellipsis; line-height: 21px;
}
@media (max-width: 767.98px), (hover: none) and (pointer: coarse) {
  .brand[hidden] + .head-plate { display: none; }
}
/* v0.30.1: logo + EnFeed + ส่งสินค้า + plate + logout need 364 px (measured, normal text); the plate shortens first ("รถทดส…"),
   below 21.25em (340 px, or 425 px with large phone text) "ส่งสินค้า" steps aside so the plate stays readable */
@media (max-width: 21.25em) { .appbar .brand__role { display: none; } }
/* Below 1024 px the app bar row sits on the content column so header and cards share one left edge */
@media (min-width: 600px) and (max-width: 1023.98px) {
  .appbar__row { max-width: var(--content-max); }
}
/* Desktop chrome: the top menu already has หน้าแรก */
@media (min-width: 768px) and (hover: hover), (min-width: 768px) and (pointer: fine) {
  .appbar #mineBtn { display: none !important; }
}

/* ── Trip step track on white (replaces the old "ขั้น n/6") ──────────── */
.flow-head { margin: 0 0 var(--sp-2); padding: var(--sp-3) var(--sp-2) 10px; background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-1); }
.flow-head .step-track__step { padding: 0; }   /* five steps share a phone's width */
@media (max-width: 374.98px) { .flow-head .step-track__step { font-size: var(--fs-12); } }   /* 360 px phones: "ออกเดินทาง" on one line */
@media (max-width: 599.98px) {
  .flow-head { margin: calc(-1 * var(--sp-2)) calc(-1 * var(--sp-2)) var(--sp-2); border-radius: 0; box-shadow: inset 0 -1px 0 var(--divider); }
  .page-head + .stack > .status-band--bleed:first-child { margin-top: calc(-1 * var(--sp-2)); }   /* live banner joins the app bar */
}

/* ── Bottom action bar: labels may wrap rather than spill; home CTA sits above the tab bar on touch ──
   (the page clearance under a fixed bar lives in ds/components.css: body.has-actionbar .page) */
.actionbar__inner > .btn { white-space: normal; line-height: 1.2; }
@media (max-width: 767.98px), (hover: none) and (pointer: coarse) and (max-width: 1023.98px) {
  .actionbar--tabs { bottom: calc(var(--tabbar-h) + var(--safe-b)); padding-bottom: 12px; }
  body.cta-tabs .page { padding-bottom: calc(var(--tabbar-h) + var(--actionbar-h) + var(--safe-b) + var(--sp-4)); }
  body.cta-tabs .toasts { bottom: calc(var(--tabbar-h) + var(--actionbar-h) + var(--safe-b) + 12px); }
}
/* iPad landscape (touch, from 1024 px): the home CTA is a card in the aside, the tab bar still sits at the bottom */
@media (hover: none) and (pointer: coarse) and (min-width: 1024px) {
  body.cta-tabs .page { padding-bottom: calc(var(--tabbar-h) + var(--safe-b) + var(--sp-6)); }
}
/* Phone on its side: two fixed bars would leave ~200 px of page, so the home CTA joins the page under the greeting */
@media (orientation: landscape) and (max-height: 500px) {
  .actionbar--tabs { position: static; padding: var(--sp-3); border-radius: var(--r-lg); box-shadow: var(--shadow-1); }
  body.cta-tabs .page { padding-bottom: calc(var(--tabbar-h) + var(--safe-b) + var(--sp-6)); }
  body.cta-tabs .toasts { bottom: calc(var(--tabbar-h) + var(--safe-b) + 12px); }
}

.hint-line { display: flex; align-items: flex-start; gap: var(--sp-2); padding: var(--sp-1) var(--sp-2); color: var(--text-2); font-size: var(--fs-14); line-height: var(--lh-snug); }
.hint-line .ico { width: 20px; height: 20px; margin-top: 1px; color: var(--ink-600); }
.kv-sub { display: block; font-size: var(--fs-13); font-weight: var(--fw-regular); color: var(--text-3); }
.list-none { padding: var(--sp-6) var(--sp-4); text-align: center; }
.list-none__title { font-weight: var(--fw-semibold); }
.list-none__text { margin-top: 2px; color: var(--text-2); font-size: var(--fs-14); }
.app-ver { padding: var(--sp-3) var(--sp-2); text-align: center; color: var(--text-3); font-size: var(--fs-13); }

/* ── Login ───────────────────────────────────────────────────────────── */
.portal-back { margin: 0 0 var(--sp-1) calc(-1 * var(--sp-2)); }
.login-head { padding: var(--sp-2) var(--sp-2) var(--sp-3); }
.login-head__title { font-size: var(--fs-24); font-weight: var(--fw-bold); line-height: var(--lh-tight); }
/* v0.31.2 ก่อนเข้าระบบ (เลือกชื่อ / ใส่ PIN): พื้นหลังถาดไข่ (/static/tray/tray.css) — ทั้งหน้าอยู่บนแผ่นกระดาษรอง
   แผ่นกระดาษ = กล่องของหน้าเอง (ไม่ยื่นออก) · มือถือเว้นขอบจอ 6 px และเนื้อหาห่างขอบแผ่น 10 px แบบหน้าแรก */
.tray-on .page.tray-sheet { margin-top: var(--sp-4); margin-bottom: var(--sp-4); }
.tray-on .page.tray-sheet::before { inset: 0; border-radius: 22px; }
@media (max-width: 599px) {
  .tray-on .page.tray-sheet { margin-top: var(--sp-3); padding-left: var(--sp-4); padding-right: var(--sp-4); }
  .tray-on .page.tray-sheet::before { inset: 0 6px; border-radius: 18px; }
}
.search-field { position: relative; margin: 0 0 var(--sp-2); }
.search-field > .ico { position: absolute; left: 14px; top: 50%; width: 20px; height: 20px; transform: translateY(-50%); color: var(--ink-500); pointer-events: none; }
.search-field .input { padding-left: 44px; }
.avatar--test { background: var(--warning-100); color: var(--warning-600); }
.login-list .chip { flex: none; }
/* v0.30.0 name list for older eyes: a 48 px initial, the name at 18 px, the plate under the name (never squeezing it) */
.login-list .row { min-height: 4.5rem; }
.login-list .avatar { width: 48px; height: 48px; font-size: var(--fs-18); }
.login-list .row__title { font-size: var(--fs-18); }
.login-list .row__meta { margin-top: 2px; }
.login-list .rows--inset > li + li { background-size: calc(100% - 76px) 1px; }

/* PIN */
.pin-screen { display: flex; flex-direction: column; gap: var(--sp-4); max-width: 400px; margin: 0 auto; padding: var(--sp-4) 0 var(--sp-6); }
.pin-who { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.pin-who__name { font-size: var(--fs-18); font-weight: var(--fw-bold); line-height: var(--lh-snug); }
.pin-who__hint { color: var(--text-2); font-size: var(--fs-14); }
.pin-error { justify-content: center; text-align: center; }
@media (orientation: landscape) and (max-height: 520px) {
  .pin-screen { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: var(--sp-6); row-gap: var(--sp-3); max-width: 720px; align-items: center; padding-top: var(--sp-2); }
  .pin-screen > * { grid-column: 1; }
  .pin-screen > .pin-box { grid-column: 2; grid-row: 1 / span 3; }
}

/* ── Camera (plate + sheet) ──────────────────────────────────────────── */
.cam { position: relative; width: 100%; overflow: hidden; border-radius: var(--r-lg); background: var(--ink-900); color: var(--white); }
.cam video, .cam__shot { display: block; width: 100%; height: 100%; object-fit: cover; }
.cam--plate { aspect-ratio: 4 / 3; max-height: 52vh; }
.cam--sheet { width: min(100%, calc(58vh * 3 / 4)); aspect-ratio: 3 / 4; margin: 0 auto; }
@supports not (aspect-ratio: 1 / 1) { .cam--plate { height: 52vh; } .cam--sheet { height: 58vh; } }
/* v0.31.0: กรอบรูปป้าย ~2:1 กว้าง 58% ของช่องกล้อง (ป้ายที่ยืนห่าง ~1 ก้าวพอดีกรอบ) — เหลือง = ยังไม่พร้อม, เขียว = กดถ่ายได้
   โค้ดตรวจป้ายค้นตามกรอบนี้ (guideRoi ใน app.js อ่านตำแหน่งจริงบนจอ) */
.cam__plate-guide {
  position: absolute; inset: 30.5% 21%; border: 4px solid var(--warning-500); border-radius: var(--r-md);
  box-shadow: 0 0 0 999px rgba(14, 17, 20, 0.38); pointer-events: none; transition: border-color var(--dur-2) var(--ease-out);
}
.cam__plate-guide--ready { border-color: var(--success-500); }
/* ไฟฉาย: มีเฉพาะมือถือที่เปิดจากหน้าเว็บได้ (ส่วนใหญ่ Android) — มุมขวาบน ไม่ทับแถบสถานะด้านล่าง */
.cam__torch {
  position: absolute; top: var(--sp-3); right: var(--sp-3); display: grid; place-items: center; width: var(--tap); height: var(--tap);
  border: 0; border-radius: 50%; background: rgba(14, 17, 20, 0.62); color: var(--white); cursor: pointer;
}
.cam__torch .ico { width: 24px; height: 24px; }
.cam__torch[aria-pressed="true"] { background: var(--warning-500); color: var(--ink-900); }
.cam__torch[hidden] { display: none; }
/* หน้าผลตรวจ/หน้าพิมพ์เอง: รูปที่ถ่ายย่อลง (สูงไม่เกิน 26% ของจอ) ให้ปุ่มและบรรทัด "จะบันทึกเป็น" อยู่ในจอเดียว (จอ 320 px) */
.cam.cam--thumb { width: min(100%, calc(26vh * 4 / 3)); margin: 0 auto; }
/* แตะรูปย่อ = เปิดรูปเต็มจอ (อ่านตัวหนังสือบนป้ายได้ชัด) — ปุ่มแว่นขยายมุมขวาล่าง ขนาดนิ้วแตะ */
.cam__zoom { position: relative; display: block; width: 100%; height: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; }
.cam__zoom-ico {
  position: absolute; right: var(--sp-2); bottom: var(--sp-2); display: grid; place-items: center; width: var(--tap); height: var(--tap);
  border-radius: 50%; background: rgba(14, 17, 20, 0.62); color: var(--white);
}
.cam__zoom-ico .ico { width: 22px; height: 22px; }
/* หน้าพิมพ์ทะเบียนเอง: ตัวใหญ่ อ่านง่าย + บอกทันทีว่าจะบันทึกเป็นอะไร */
.plate-check { margin-top: var(--sp-3); }
.type-plate { margin-top: var(--sp-3); }
.type-plate__input { font-size: var(--fs-20); letter-spacing: 0.04em; }
.type-plate__preview { display: flex; align-items: flex-start; gap: var(--sp-2); margin-top: var(--sp-2); font-weight: var(--fw-semibold); line-height: var(--lh-snug); }
.type-plate__preview .ico { width: 20px; height: 20px; flex: none; margin-top: 2px; }
.type-plate__preview.is-ok { color: var(--success-700); }
.type-plate__preview.is-bad { color: var(--danger-600); }
.type-plate__preview .plate { margin: 0 var(--sp-1); }
.type-plate__match { display: flex; align-items: flex-start; gap: var(--sp-2); margin-top: var(--sp-1); line-height: var(--lh-snug); }
.type-plate__match .ico { width: 20px; height: 20px; flex: none; margin-top: 2px; }
.type-plate__match.is-ok { color: var(--success-700); }
.type-plate__match.is-warn { color: var(--warning-700); }
.cam__quad { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.cam__corners { position: absolute; inset: 6% 7%; pointer-events: none; }
.cam__corners i { position: absolute; width: 34px; height: 34px; border: 4px solid rgba(255, 255, 255, 0.9); }
.cam__corners i:nth-child(1) { left: 0; top: 0; border-right: 0; border-bottom: 0; border-radius: 10px 0 0 0; }
.cam__corners i:nth-child(2) { right: 0; top: 0; border-left: 0; border-bottom: 0; border-radius: 0 10px 0 0; }
.cam__corners i:nth-child(3) { right: 0; bottom: 0; border-left: 0; border-top: 0; border-radius: 0 0 10px 0; }
.cam__corners i:nth-child(4) { left: 0; bottom: 0; border-right: 0; border-top: 0; border-radius: 0 0 0 10px; }
.cam__status {
  position: absolute; left: var(--sp-3); right: var(--sp-3); bottom: var(--sp-3); display: flex; align-items: center; gap: var(--sp-2);
  min-height: 40px; padding: 8px 12px; border-radius: var(--r-md); background: rgba(14, 17, 20, 0.76); color: var(--white);
  font-size: var(--fs-14); font-weight: var(--fw-semibold); line-height: var(--lh-snug);
  transition: background-color var(--dur-2) var(--ease-out);
}
.cam__status .ico { width: 20px; height: 20px; flex: none; }
.cam__status--ok { background: var(--success-600); }
.cam__status--bad { background: var(--danger-600); }
.cam__error { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--sp-2); height: 100%; padding: var(--sp-6) var(--sp-5); text-align: center; }
.cam.cam--off { width: 100%; height: auto; min-height: 0; aspect-ratio: auto; max-height: none; }
.cam--off .cam__error { padding: var(--sp-8) var(--sp-5); }
.cam__error .ico { width: 40px; height: 40px; color: var(--ink-300); }
.cam__error-title { font-weight: var(--fw-semibold); }
.cam__error-text { font-size: var(--fs-14); color: rgba(255, 255, 255, 0.8); }
.cam-for { display: flex; align-items: center; gap: var(--sp-2); min-width: 0; padding: var(--sp-1) var(--sp-2) var(--sp-2); font-weight: var(--fw-semibold); }
.cam-for .ico { width: 20px; height: 20px; color: var(--ink-600); }
.cam-for span { min-width: 0; overflow-wrap: anywhere; }
.alt-actions { display: flex; flex-direction: column; gap: var(--sp-2); margin-top: var(--sp-3); }
.alt-actions .btn { width: 100%; }
.alt-actions .plate { margin-left: var(--sp-1); }
.file-btn { position: relative; overflow: hidden; }
.file-btn input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.cam ~ .hint-line { margin-top: var(--sp-2); }
.cam ~ .file-btn { margin-top: var(--sp-2); }

/* ── Farm / customer pickers ─────────────────────────────────────────── */
.veh .row { padding-bottom: var(--sp-2); }
.veh__check { padding: 0 var(--sp-4) var(--sp-3) 68px; }
.veh__check .notice { margin-left: -52px; }
.veh__check .chip { white-space: normal; }
.route-pick__body { display: flex; flex-direction: column; padding: var(--sp-2) var(--sp-4) var(--sp-4); }
.route-pick__note { display: flex; gap: 6px; margin-top: 6px; }
.route-pick__note .ico { width: 16px; height: 16px; margin-top: 1px; flex: none; }
.route-pick__link { display: grid; place-items: center; height: 28px; margin-top: var(--sp-2); color: var(--ink-400); }
.route-pick__link .ico { width: 20px; height: 20px; }
#trayHint { margin-top: var(--sp-3); }
.done-count { padding: 0 var(--sp-1); }
.picker {
  display: flex; align-items: center; gap: var(--sp-3); width: 100%; min-height: 3.75rem; padding: 8px 12px 8px 8px;
  border: 1.5px solid var(--border-strong); border-radius: var(--r-md); background: var(--surface); color: var(--text);
  text-align: left; cursor: pointer; -webkit-tap-highlight-color: transparent;
  transition: border-color var(--dur-1) var(--ease-out), background-color var(--dur-1) var(--ease-out);
}
.picker:active { background: var(--ink-50); }
@media (hover: hover) { .picker:hover { border-color: var(--ink-600); } }
.picker__icon { display: grid; place-items: center; width: 44px; height: 44px; flex: none; border-radius: 10px; background: var(--ink-100); color: var(--ink-700); }
.picker__icon .ico { width: 24px; height: 24px; }
.picker.is-set .picker__icon { background: var(--brand-50); color: var(--brand-700); }
.picker__value { flex: 1 1 auto; min-width: 0; font-weight: var(--fw-semibold); line-height: var(--lh-snug); overflow-wrap: anywhere; }
.picker__ph { flex: 1 1 auto; min-width: 0; color: var(--text-3); }
.picker__chev { width: 20px; height: 20px; flex: none; color: var(--ink-500); }
.picker-sheet { height: min(85vh, 640px); }
.picker-search { position: sticky; top: 0; z-index: 1; margin: 0; padding-bottom: var(--sp-2); background: var(--surface); }
.picker-list { margin: 0 calc(-1 * var(--sp-5)); }
.picker-opt[aria-current] .row__title { color: var(--primary); }
.picker-opt__on { width: 22px; height: 22px; flex: none; color: var(--primary); }
.picker-add .row__title { color: var(--primary); }
.start-kv { padding: var(--sp-3) var(--sp-4); border-radius: var(--r-md); background: var(--ink-100); }
.start-kv dt { display: inline-flex; align-items: center; gap: var(--sp-2); }
.start-kv dt .ico { width: 20px; height: 20px; color: var(--ink-600); }
.start-kv dd { font-size: var(--fs-16); }
.start-kv + .notice, .start-kv ~ .hint-line { margin-top: var(--sp-3); }

/* GPS help */
.gps-help { display: flex; align-items: center; gap: var(--sp-3); }
.gps-help__icon { display: grid; place-items: center; width: 48px; height: 48px; flex: none; border-radius: 50%; background: var(--brand-50); color: var(--brand-700); }
.gps-help__icon .ico { width: 26px; height: 26px; }
.gps-help__icon--warn { background: var(--warning-100); color: var(--warning-600); }
.gps-help__lead { font-size: var(--fs-16); line-height: var(--lh-snug); }
.howto { margin: var(--sp-4) 0 0; padding-left: 1.4em; line-height: 1.75; }
.howto li + li { margin-top: var(--sp-2); }
.howto__sep { width: 16px; height: 16px; margin: 0 2px; color: var(--ink-400); vertical-align: -3px; }
.howto__ico { width: 18px; height: 18px; vertical-align: -4px; color: var(--ink-700); }
.gps-help + .btn { margin-top: var(--sp-5); }
.gps-help__note { margin-top: var(--sp-1); text-align: center; }

/* ── Waiting on the server (corners / reading) ───────────────────────── */
.work { display: flex; flex-direction: column; align-items: center; gap: var(--sp-3); padding: var(--sp-2) 0; }
.work__img { position: relative; width: min(100%, 420px, calc(52vh * 3 / 4)); aspect-ratio: 3 / 4; overflow: hidden; border-radius: var(--r-lg); background: var(--ink-900); }
.work__img img { display: block; width: 100%; height: 100%; object-fit: cover; opacity: 0.6; }
.work__scan {
  position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--brand-300);
  box-shadow: 0 0 14px 3px rgba(120, 220, 207, 0.55); animation: drv-scan 1.8s var(--ease-std) infinite alternate;
}
@keyframes drv-scan { from { top: 0; } to { top: calc(100% - 3px); } }
.work__label { display: flex; align-items: center; gap: var(--sp-2); font-size: var(--fs-16); font-weight: var(--fw-semibold); }
.work__label .ico { width: 22px; height: 22px; color: var(--primary); }
.work__note { max-width: 32ch; color: var(--text-2); font-size: var(--fs-14); text-align: center; }

/* ── Check corners ───────────────────────────────────────────────────── */
.corner-card { padding: var(--sp-2); }
.corner-wrap { display: flex; justify-content: center; padding: 0; border-radius: var(--r-md); background: var(--ink-900); touch-action: none; }
.corner-wrap canvas { display: block; max-width: 100%; border-radius: var(--r-md); }
.corner-legend { display: flex; flex-wrap: wrap; gap: 4px var(--sp-4); padding: 10px var(--sp-2) 4px; color: var(--text-2); font-size: var(--fs-13); }
.corner-legend span { display: inline-flex; align-items: center; gap: 6px; }
.swatch { display: inline-block; width: 12px; height: 12px; flex: none; border-radius: 50%; }
.swatch--ok { background: var(--brand-600); }       /* found corners drawn by /static/corners.js (v0.29.0 tokens) */
.swatch--guess { background: var(--warning-500); }  /* guessed corners drawn by /static/corners.js */
.form-pick__warn { margin-bottom: var(--sp-3); }
.form-pick__note { margin-top: 10px; }
.form-pick.is-unsure .choice__box { border-color: var(--warning-500); }

/* ── Check numbers ───────────────────────────────────────────────────── */
.check-banner { position: sticky; top: calc(var(--chrome-top) + var(--safe-t) + var(--sp-2)); z-index: var(--z-sticky); margin-bottom: var(--sp-2); }
.check-banner .notice { box-shadow: var(--shadow-2); }
/* v0.30.0: route + a small sheet photo + ถ่ายใหม่ = one context zone, so the first fields show above the fold
   and the bottom bar keeps a single main action (บันทึก) */
.sheet-zone { padding: var(--sp-3) var(--sp-4) var(--sp-4); }
.result-route { padding: var(--sp-1) 0 var(--sp-3); font-size: var(--fs-16); }
.sheet-row { display: flex; align-items: center; gap: var(--sp-3); }
.sheet-mini {
  position: relative; flex: none; width: 64px; height: 80px; padding: 0; overflow: hidden;
  border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--ink-100); cursor: zoom-in;
}
.sheet-mini__img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center top; }
.sheet-mini__zoom {
  position: absolute; right: 4px; bottom: 4px; width: 24px; height: 24px; padding: 4px;
  border-radius: 50%; background: rgba(16, 24, 32, 0.72); color: var(--white);
}
.sheet-row__main { flex: 1 1 auto; min-width: 0; }
.sheet-row__title { font-weight: var(--fw-semibold); line-height: var(--lh-snug); }
.sheet-row__sub { margin-top: 2px; color: var(--text-2); font-size: var(--fs-14); line-height: var(--lh-snug); }
.sheet-row .btn { flex: none; }
.check-zone { overflow: hidden; }                         /* v0.30.0: เลขที่ใบ / สินค้า / ถาด */
.item { padding: var(--sp-3) var(--sp-4) var(--sp-4); }
.item + .item { border-top: 1px solid var(--divider-strong); }
.item__head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); min-height: 28px; }
.item__label { min-width: 0; font-weight: var(--fw-semibold); line-height: var(--lh-snug); overflow-wrap: anywhere; }
.item__tag { flex: none; }
/* the cell as written on paper: a tinted strip (not a second input box), the editable value right under it */
.item__crop { display: block; width: 100%; height: 72px; margin: var(--sp-2) 0; padding: 4px; object-fit: contain; border: 0; border-radius: var(--r-md); background: var(--ink-150); }
.item__why { margin-top: 6px; color: var(--text-2); font-size: var(--fs-14); line-height: var(--lh-snug); }
.item__acts { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-top: 10px; }
.add-row { padding: 14px var(--sp-4) var(--sp-4); border-top: 1px solid var(--divider); }
@media (min-width: 600px) {
  .item { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: var(--sp-4); align-items: center; }
  .item__head, .item__why, .item__acts { grid-column: 1 / -1; }
  .item__crop { margin: var(--sp-2) 0 0; height: 48px; }
  .item .conf { margin-top: var(--sp-2); }
}

/* ── Saved ───────────────────────────────────────────────────────────── */
.done-card { display: flex; flex-direction: column; align-items: center; padding: var(--sp-5) var(--sp-4) var(--sp-6); text-align: center; }
.done-card__art { width: 168px; margin-bottom: var(--sp-2); }
.done-card__title { font-size: var(--fs-20); font-weight: var(--fw-bold); color: var(--success-600); }
.done-card__sub { display: inline-flex; align-items: center; gap: 6px; margin-top: var(--sp-1); color: var(--text-2); }
.done-card__sub .ico { width: 18px; height: 18px; }
.warn-list { margin: 4px 0 0; padding-left: 1.2em; color: var(--ink-800); }

/* ── Home ────────────────────────────────────────────────────────────── */
.home-head { display: flex; align-items: center; gap: var(--sp-3); min-width: 0; padding: var(--sp-3) var(--sp-2); }
.home-head__text { min-width: 0; }
.home-head__name { font-size: var(--fs-20); font-weight: var(--fw-bold); line-height: var(--lh-snug); overflow-wrap: anywhere; }
.home-head__name:focus { outline: none; }
.home-head__date { color: var(--text-2); font-size: var(--fs-14); }
.home-today { font-variant-numeric: tabular-nums; }
@media (max-width: 599.98px) {
  .home-head { margin: calc(-1 * var(--sp-2)) calc(-1 * var(--sp-2)) 0; padding: var(--sp-3) var(--sp-4); background: var(--surface); }
  .home-head + .status-band--bleed { margin-top: calc(-1 * var(--sp-2)); }
}
@media (min-width: 1024px) {
  .home .status-band { padding: var(--sp-5) var(--sp-6) var(--sp-4); }
  .home .status-band__art { width: 168px; }
}
button.card__more { border: 0; background: none; font-family: inherit; cursor: pointer; }
/* v0.30.1: "เดือนนี้ของฉัน" stays on one line — the month link needs 371 px in full (measured), so below 23.25em it reads
   "พ.ย. 2569", and below 20.5em (320 px phones) only the arrow is left (the title already says this month) */
.ym-short { display: none; }
@media (max-width: 23.25em) { .ym-long { display: none; } .ym-short { display: inline; } }
@media (max-width: 20.5em) { .ym-short { display: none; } }
#monthCard .card__more { min-width: var(--tap); justify-content: center; }

/* ── สรุปของฉัน / เที่ยว ─────────────────────────────────────────────── */
.month-bar { display: flex; align-items: center; justify-content: center; gap: var(--sp-2); margin: 0 0 var(--sp-2); }
.month-bar__label { min-width: 150px; text-align: center; font-size: var(--fs-18); font-weight: var(--fw-bold); }
@media (max-width: 599.98px) {
  .month-bar { margin: calc(-1 * var(--sp-2)) calc(-1 * var(--sp-2)) var(--sp-2); padding: 2px var(--sp-2); background: var(--surface); box-shadow: inset 0 -1px 0 var(--divider); }
}
.month-lead { display: flex; flex-direction: column; gap: var(--sp-4); padding-top: var(--sp-4); }
.month-lead .metric__delta { color: var(--text-2); }
.month-kv { padding-top: var(--sp-3); border-top: 1px solid var(--divider); }
@media (min-width: 600px) {
  .month-lead { flex-direction: row; align-items: flex-start; gap: var(--sp-6); }
  .month-lead .metric { flex: 0 0 220px; }
  .month-kv { flex: 1 1 auto; padding: 0 0 0 var(--sp-6); border-top: 0; border-left: 1px solid var(--divider); }
}
.card__head--sub { min-height: 44px; margin-top: var(--sp-1); border-top: 1px solid var(--divider); }
.card__head--sub .card__title { font-size: var(--fs-14); }
.card__note.num { margin-right: 0; }
.owed-none { display: flex; align-items: center; gap: 6px; }
.owed-none .ico { width: 18px; height: 18px; color: var(--success-600); }
.rating-sum { display: flex; align-items: center; gap: var(--sp-3); }
.rating-sum__avg { font-size: var(--fs-40); font-weight: var(--fw-bold); line-height: 1; font-variant-numeric: tabular-nums; }
.rating-sum__side { display: flex; flex-direction: column; gap: 2px; }
.rating-sum__n { color: var(--text-2); font-size: var(--fs-14); }
.rating-tags__label { margin: var(--sp-4) 0 var(--sp-2); }
.rating-empty { display: flex; align-items: center; gap: var(--sp-3); }
.rating-empty__text { color: var(--text-2); }
.rating-card .chip b { margin-left: 2px; color: var(--text); }

/* Daily km: one series in --chart-1, 4 px rounded tops, 2 px gaps, the peak labelled, tap or point for any day */
.kmc__read { min-height: 22px; margin-bottom: var(--sp-2); color: var(--text-2); font-size: var(--fs-14); font-variant-numeric: tabular-nums; }
.kmc__read b { color: var(--text); }
.kmc__plot {
  position: relative; display: grid; grid-template-columns: repeat(var(--n, 31), minmax(0, 1fr)); column-gap: 2px; align-items: end;
  height: 128px; padding-top: 20px; border-bottom: 1px solid var(--chart-grid); cursor: crosshair; touch-action: pan-y; border-radius: 2px;
}
.kmc__col { display: flex; align-items: flex-end; justify-content: center; height: 100%; }
.kmc__bar { width: 100%; max-width: 24px; border-radius: 4px 4px 0 0; background: var(--chart-1); transition: background-color var(--dur-1) var(--ease-out); }
.kmc__bar.is-zero { height: 2px !important; border-radius: 0; background: var(--chart-grid); }
.kmc__col.is-active .kmc__bar:not(.is-zero) { background: var(--primary-press); }
.kmc__peak { position: absolute; top: 0; transform: translateX(-50%); color: var(--text-2); font-size: var(--fs-12); font-weight: var(--fw-semibold); font-variant-numeric: tabular-nums; white-space: nowrap; }
.kmc__axis { display: flex; justify-content: space-between; margin-top: 6px; color: var(--chart-axis); font-size: var(--fs-13); font-variant-numeric: tabular-nums; }

button.order__link { width: 100%; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.trip-route { margin-bottom: var(--sp-4); }
.trip-route .plate { margin-left: auto; }
.trip-stops .timeline__title { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.trip-stops .timeline__note { margin-top: var(--sp-2); }
