/* ธีมกลาง ใช้ร่วมกันทั้งหน้า LIFF (ช่าง) และเว็บคอนโซล
   สีมาจากโลโก้ LubeWatch — แก้ที่นี่ที่เดียวมีผลทั้งสองหน้า */
:root {
    /* สีจากโลโก้ LubeWatch: น้ำเงินเข้ม + ทอง */
    --navy: #183048;
    --gold: #b99a6b;
    /* ไล่สีจบที่ทองเข้ม เพราะทองสว่างตัวหนังสือขาวอ่านไม่ออก (2.7:1)
       ทุกจุดบนไล่สีนี้ผ่าน AA กับตัวหนังสือขาว */
    --grad: linear-gradient(135deg, #183048 0%, #2c5379 45%, #8a6b3e 100%);

    --bg: #f4f6f8; --card: #ffffff; --ink: #1c2733; --muted: #64748b;
    --brand: #183048; --brand-ink: #ffffff; --line: #e2e8f0;
    --ok: #15803d; --warn: #b45309; --err: #b91c1c;
  }
  @media (prefers-color-scheme: dark) {
    :root {
      --bg: #0f172a; --card: #1e293b; --ink: #e2e8f0; --muted: #94a3b8;
      /* พื้นมืด ใช้ทองสว่างเป็นสีตัวอักษร/เส้นขอบแทนน้ำเงินที่จะจมไปกับพื้น */
      --brand: #d9be8e; --brand-ink: #17233a; --line: #334155;
      --ok: #4ade80; --warn: #fbbf24; --err: #f87171;
    }
  }
  * { box-sizing: border-box; }
  body {
    margin: 0; background: var(--bg); color: var(--ink);
    font-family: -apple-system, "Segoe UI", Roboto, "Noto Sans Thai", sans-serif;
    font-size: 16px; line-height: 1.5;
  }
  main { max-width: 640px; margin: 0 auto; padding: 16px; }
  .card {
    background: var(--card); border: 1px solid var(--line); border-radius: 12px;
    padding: 16px; margin-bottom: 12px;
  }
  h1 { font-size: 1.3rem; margin: 0 0 4px; }
  h2 { font-size: 1.05rem; margin: 0 0 10px; }
  p.hint { color: var(--muted); font-size: .85rem; margin: 4px 0 12px; }
  label { display: block; font-size: .85rem; color: var(--muted); margin: 10px 0 4px; }
  input, select, textarea {
    width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px;
    background: var(--bg); color: var(--ink); font-size: 1rem; font-family: inherit;
  }
  button {
    width: 100%; padding: 12px; margin-top: 14px; border: 0; border-radius: 8px;
    background: var(--grad); color: #fff; font-size: 1rem; font-weight: 600;
    cursor: pointer; font-family: inherit;
  }
  button.ghost { background: transparent; color: var(--brand); border: 1px solid var(--line); }
  .tile .n { font-variant-numeric: tabular-nums; }
  button:disabled { opacity: .5; cursor: wait; }
  .msg { margin-top: 12px; font-size: .9rem; white-space: pre-wrap; }
  .msg.err { color: var(--err); } .msg.ok { color: var(--ok); }
  .topbar {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    margin-bottom: 12px; background: var(--grad); color: #fff;
    padding: 12px 14px; border-radius: 12px;
  }
  .topbar .who { font-size: .85rem; color: rgba(255,255,255,.8); }
  .topbar .badge { border-color: rgba(255,255,255,.5); color: #fff; }
  .topbar button.ghost { background: rgba(255,255,255,.14); color: #fff; border-color: rgba(255,255,255,.35); }
  /* ป้ายสถานะบนแถบน้ำเงิน ต้องใช้สีอ่อน — แดง/ส้มเข้มบนน้ำเงินอ่านไม่ออก
     (จอกว้างแถบบนเป็นสีขาว จะสลับกลับไปใช้สีปกติในบล็อกท้ายไฟล์) */
  .topbar .badge.due  { color: #ffb4a8; border-color: #ffb4a8; }
  .topbar .badge.warn { color: #f5c877; border-color: #f5c877; }
  .topbar .badge.ok   { color: #9fe0b8; border-color: #9fe0b8; }
  .topbar button { width: auto; margin: 0; padding: 8px 14px; }
  /* ตัดบรรทัดได้ แต่ปุ่มไม่ยืด — เห็นครบทุกแท็บโดยไม่ต้องเลื่อนหา
     (เคยลองเลื่อนแนวนอนแถวเดียว แล้วแท็บหลังๆ หายไปนอกจอโดยไม่มีอะไรบอก) */
  .tabs { display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; }
  .tabs button {
    flex: 0 0 auto; width: auto;   /* ต้องล้าง width:100% จากกฎ button ทั่วไป */
    margin: 0; padding: 10px 14px; white-space: nowrap;
    background: var(--card); color: var(--muted); border: 1px solid var(--line);
  }
  .tabs button.on { background: var(--grad); color: #fff; border-color: transparent; }
  .row { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
  .row:last-child { border-bottom: 0; }
  .row .name { font-weight: 600; }
  .row .sub { color: var(--muted); font-size: .82rem; }
  .row .qty { font-weight: 700; text-align: right; white-space: nowrap; }
  .hidden { display: none !important; }
  button.line { background: #06c755; color: #fff; }   /* สีเขียวตามข้อกำหนดแบรนด์ LINE ไม่ไล่สี */
  details summary { cursor: pointer; color: var(--muted); font-size: .9rem; margin-top: 18px;
    padding-top: 14px; border-top: 1px solid var(--line); }
  .badge { display: inline-block; padding: 1px 8px; border-radius: 99px; font-size: .75rem;
           border: 1px solid var(--line); color: var(--muted); }
  .badge.ok   { border-color: var(--ok);   color: var(--ok); }
  .badge.warn { border-color: var(--warn); color: var(--warn); }
  .badge.due  { border-color: var(--err);  color: var(--err); font-weight: 700; }
  .tiles { display: flex; gap: 8px; margin-bottom: 12px; }
  .tile { flex: 1 1 0; border: 1px solid var(--line); border-radius: 10px; padding: 8px 4px;
          text-align: center; background: var(--bg); }
  .tile .n { font-size: 1.4rem; font-weight: 700; line-height: 1.1; }
  .tile .l { font-size: .72rem; color: var(--muted); }
  .tile.due .n  { color: var(--err); }
  .tile.warn .n { color: var(--warn); }
  .tile.ok .n   { color: var(--ok); }
  .row.tap { cursor: pointer; }
  .row.tap:active { background: var(--bg); }
  .lp { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; }
  .lp .head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
  .lp .nm { font-weight: 600; }
  .lp .det { color: var(--muted); font-size: .82rem; margin-top: 4px; }
  .bar { height: 6px; border-radius: 99px; background: var(--line); margin-top: 8px; overflow: hidden; }
  .bar > i { display: block; height: 100%; background: var(--ok); }
  .bar.warn > i { background: var(--warn); }
  .bar.due  > i { background: var(--err); }
  /* ---- ไอคอน (ชุดเดียวกับแอปเดิม) ---- */
  .ic { width: 16px; height: 16px; flex-shrink: 0;
        stroke: currentColor; fill: none; stroke-width: 1.75;
        stroke-linecap: round; stroke-linejoin: round; }

  /* ---- กรอบแอป: มือถือ/ใน LINE ให้เหมือนเดิมทุกอย่าง ----
     .side กับ .nav-group เป็น display:contents ปุ่มเมนูจึงไหลเป็นแถวชิปเหมือนเดิม
     ของที่มีเฉพาะจอกว้าง (แบรนด์ หัวข้อกลุ่ม breadcrumb ไอคอนเมนู) ซ่อนไว้ก่อน */
  .side { display: contents; }
  .side .brand { display: none; }
  .nav-group { display: contents; }
  .nav-group-label { display: none; }
  .tabs button .ic { display: none; }
  .crumb, .topbar-spacer { display: none; }

  /* เบราว์เซอร์ไม่มีถังให้สแกน — เลือกจากรายการแทน
     (ติดธง web เฉพาะตอนยืนยันได้ว่าไม่ได้อยู่ในแอป LINE ช่างจึงไม่มีทางเสียตัวสแกน) */
  #scan-pick-wrap { display: none; }
  body.web #scan-pick-wrap { display: block; }
  body.web #scan-qr-wrap { display: none; }

  /* ---- ตัวกรอง + ตารางรายการรถ ---- */
  .filters { display: grid; gap: 8px; margin: 10px 0 8px; }
  .filters input, .filters select, .filters button { margin: 0; }
  #asset-count { margin: 0 0 4px; }
  /* มือถืออ่านเป็นการ์ดซ้อนบรรทัด จอกว้างค่อยกางเป็นคอลัมน์ */
  .thead { display: none; }
  .only-wide { display: none; }

  /* ---- ปฏิทินบำรุงรักษา ---- */
  .cal-bar { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 10px 0; }
  .cal-bar button.ghost { width: auto; margin: 0; padding: 8px 12px; }
  .cal-bar strong { min-width: 120px; text-align: center; }
  .cal-bar .seg { margin-left: auto; }
  .cal-bar .seg button { padding: 8px 10px; font-size: .82rem; white-space: nowrap; }
  .cal-months { display: grid; gap: 14px; }
  .cal-title { font-weight: 700; font-size: .9rem; margin-bottom: 6px; }
  /* ดูเดือนเดียว ชื่อเดือนอยู่บนแถบเครื่องมือแล้ว ไม่ต้องซ้ำ */
  .cal-months:not(.compact) .cal-title { display: none; }
  .cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
  .cal-head { text-align: center; font-size: .7rem; color: var(--muted); padding: 2px 0; }
  .cal-cell {
    min-height: 62px; border: 1px solid var(--line); border-radius: 6px;
    padding: 3px 4px; background: var(--card); cursor: pointer; overflow: hidden;
  }
  .cal-cell.out { background: transparent; border-color: transparent; cursor: default; }
  .cal-cell .cal-date { font-size: .72rem; color: var(--muted); }
  .cal-cell.today { border-color: var(--brand); }
  .cal-cell.today .cal-date { font-weight: 700; color: var(--brand); }
  .cal-cell.picked { outline: 2px solid var(--brand); outline-offset: -2px; }
  .cal-cell.due  { border-color: var(--err); }
  .cal-cell.warn { border-color: var(--warn); }
  .cal-ev {
    font-size: .64rem; line-height: 1.25; font-weight: 600; margin-top: 2px;
    background: var(--bg); border-radius: 3px; padding: 1px 3px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .cal-ev span { display: block; font-weight: 400; color: var(--muted); }
  .cal-more { font-size: .62rem; color: var(--muted); margin-top: 1px; }
  /* มุมมอง 3/12 เดือน ย่อเหลือจุดเดียวต่อวัน */
  .cal-months.compact .cal-cell { min-height: 30px; text-align: center; padding: 2px; }
  .cal-months.compact .cal-dot {
    display: block; width: 5px; height: 5px; border-radius: 50%;
    background: var(--muted); margin: 2px auto 0;
  }
  .cal-months.compact .cal-cell.due  .cal-dot { background: var(--err); }
  .cal-months.compact .cal-cell.warn .cal-dot { background: var(--warn); }
  #cal-clear { margin: 10px 0 4px; }

  /* ---- ปุ่มลัดบนแดชบอร์ด ---- */
  .quick { display: grid; gap: 8px; margin-bottom: 14px; }
  .quick .qa {
    display: flex; align-items: center; gap: 10px; width: 100%; margin: 0;
    padding: 12px 14px; text-align: left; border-radius: 10px;
    background: var(--card); color: var(--ink); border: 1px solid var(--line);
  }
  .quick .qa .ic { color: var(--brand); width: 18px; height: 18px; }
  .quick .qa .t { display: block; font-weight: 600; font-size: .92rem; }
  .quick .qa .s { display: block; color: var(--muted); font-size: .78rem; font-weight: 400; }

  /* ---- แดชบอร์ด ---- */
  .view-header { margin-bottom: 12px; }
  .view-header h2 { margin: 0; font-size: 1.15rem; }
  .view-header .hint { margin: 2px 0 0; }
  .dash-grid { display: grid; gap: 12px; align-items: start; }
  .dash-grid .card { margin-bottom: 0; }
  .banner .ic { margin-top: 2px; }
  .dash-col { display: grid; gap: 12px; align-content: start; }
  .pane-card > .sec:first-child { margin-top: 0; }
  .sec h2 .ic { color: var(--muted); vertical-align: -3px; margin-right: 6px; }
  #home-note:empty { display: none; }
  #home-note { margin-top: -4px; }

  .sec { display: flex; align-items: baseline; justify-content: space-between;
         gap: 8px; margin: 20px 0 2px; }
  .sec h2 { margin: 0; }
  /* ปุ่ม "ดูทั้งหมด" ต้องล้างกฎ button ทั่วไป (เต็มความกว้าง + ไล่สี) ทิ้งให้หมด */
  .sec .more { width: auto; margin: 0; padding: 0; background: none; border: 0;
               color: var(--brand); font-size: .82rem; font-weight: 600; }
  .banner { display: flex; gap: 8px; align-items: flex-start; background: var(--bg);
            border: 1px solid var(--line); border-radius: 10px;
            padding: 10px 12px; margin-bottom: 8px; font-size: .88rem; }
  .banner.due  { border-color: var(--err);  color: var(--err); }
  .banner.warn { border-color: var(--warn); color: var(--warn); }
  .empty { color: var(--muted); font-size: .88rem; text-align: center; padding: 14px 0; margin: 0; }

  .grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .grid2 label { margin-top: 6px; }
  video#scan-video { width: 100%; border-radius: 10px; background: #000; margin-top: 10px; }
  .seg { display: flex; gap: 6px; margin-top: 4px; }
  .seg button { margin: 0; padding: 10px 0; background: var(--card); color: var(--muted); border: 1px solid var(--line); }
  .seg button.on { background: var(--grad); color: #fff; border-color: transparent; }
  .found { border: 1px solid var(--brand); border-radius: 10px; padding: 12px; margin-top: 14px; }
  .found .name { font-weight: 700; font-size: 1.05rem; }
  .found .sub { color: var(--muted); font-size: .85rem; }
  #qr-sheet { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
  .sticker { border: 1.5px dashed var(--muted); border-radius: 10px; padding: 10px;
             text-align: center; background: #fff; color: #111; }
  .sticker img { width: 100%; max-width: 180px; }
  .sticker .t-label { font-weight: 700; font-size: .9rem; }
  .sticker .t-sub { font-size: .72rem; color: #555; }
  .sticker .t-token { font-family: ui-monospace, monospace; font-size: .78rem; letter-spacing: .5px; }
  /* ---- ใบรายงานสำหรับพิมพ์ ---- */
  .pr-head { display: flex; justify-content: space-between; align-items: flex-end;
             border-bottom: 2px solid #333; padding-bottom: 6px; margin-bottom: 12px; }
  .pr-brand { font-size: 18px; font-weight: 800; letter-spacing: .5px; }
  .pr-sub { font-size: 11px; color: #555; }
  .pr-title { font-size: 16px; margin: 0 0 8px; }
  .pr-h2 { font-size: 13px; margin: 16px 0 6px; }
  .pr-tbl { width: 100%; border-collapse: collapse; font-size: 11px; }
  .pr-tbl th, .pr-tbl td { border: 1px solid #bbb; padding: 4px 6px; text-align: left;
                           vertical-align: top; }
  .pr-tbl th { background: #eee; font-weight: 700; }
  .pr-foot { margin-top: 28px; font-size: 12px; }

  @media print {
    body * { visibility: hidden; }
    #qr-sheet, #qr-sheet *, #print-area, #print-area * { visibility: visible; }
    #qr-sheet, #print-area { position: absolute; left: 0; top: 0; width: 100%; color: #000; }
    #print-area { padding: 0 4mm; }
    .sticker { break-inside: avoid; }
    .pr-tbl tr { break-inside: avoid; }
    @page { margin: 12mm; }
  }

  /* ================= จอกว้าง: กรอบแบบแอปเดิม =================
     แถบข้างน้ำเงิน + แถบบนขาว + เนื้อหากว้าง
     ใช้เฉพาะตอนอยู่ในระบบ (body.shell) และยืนยันได้แล้วว่าเปิดจากเบราว์เซอร์ (body.web)
     ถ้า SDK ของ LINE โหลดไม่ได้จะไม่ติดธง web — ตกไปใช้หน้าตาแบบมือถือ ซึ่งใช้ได้ทุกที่ */
  @media (min-width: 900px) {
    body.shell.web main { max-width: none; margin: 0; padding: 0; }

    body.shell.web #view-main {
      display: grid;
      grid-template-columns: 236px minmax(0, 1fr);
      grid-template-rows: auto minmax(0, 1fr);
      grid-template-areas: "side topbar" "side panes";
      min-height: 100vh;
    }

    /* ---- แถบข้าง ---- */
    body.shell.web .side {
      grid-area: side; display: flex; flex-direction: column;
      background: linear-gradient(180deg, #22405c 0%, #16273a 100%);
      position: sticky; top: 0; height: 100vh; overflow-y: auto;
    }
    body.shell.web .side .brand {
      display: flex; align-items: center; gap: 10px; cursor: pointer;
      padding: 18px 16px 16px; border-bottom: 1px solid rgba(255,255,255,.08);
    }
    body.shell.web .brand-mark {
      width: 32px; height: 32px; display: grid; place-items: center; border-radius: 6px;
      background: linear-gradient(135deg, #b99a6b 0%, #8a6b3e 100%);
      color: #fff; font-weight: 800; font-size: 14px; letter-spacing: .5px;
      box-shadow: inset 0 1px 0 rgba(255,255,255,.2);
    }
    body.shell.web .brand-name { color: #fff; font-weight: 700; font-size: 15px; line-height: 1.15; }
    body.shell.web .brand-sub {
      color: #e6d2ac; font-size: 10px; letter-spacing: 1.4px; text-transform: uppercase;
    }

    /* ---- เมนูในแถบข้าง (ตัวเดียวกับแท็บบนมือถือ) ---- */
    body.shell.web .tabs {
      display: block; flex: 1; overflow-y: auto; margin: 0; padding: 12px 10px 20px;
    }
    body.shell.web .nav-group { display: block; margin-bottom: 12px; }
    body.shell.web .nav-group-label {
      display: block; padding: 4px 10px 6px; font-size: 10px; font-weight: 600;
      letter-spacing: 1.4px; text-transform: uppercase; color: rgba(255,255,255,.38);
    }
    body.shell.web .tabs button {
      display: flex; align-items: center; gap: 10px; width: 100%; margin: 0 0 1px;
      padding: 8px 10px; font-size: 13.5px; font-weight: 500; text-align: left;
      background: none; color: #c2cad3; border: 0;
      border-left: 2px solid transparent; border-radius: 5px;
    }
    body.shell.web .tabs button .ic { display: block; color: rgba(255,255,255,.55); }
    body.shell.web .tabs button:hover { background: rgba(255,255,255,.05); color: #fff; }
    body.shell.web .tabs button.on {
      background: rgba(185,154,107,.14); color: #fff; border-left-color: #b99a6b;
    }
    body.shell.web .tabs button.on .ic { color: #d9be8e; }

    /* ---- แถบบน ---- */
    body.shell.web #view-main > .topbar {
      grid-area: topbar; margin: 0; border-radius: 0; height: 56px; padding: 0 22px;
      background: var(--card); color: var(--ink); border-bottom: 1px solid var(--line);
      position: sticky; top: 0; z-index: 5;
    }
    body.shell.web #view-main > .topbar .who { color: var(--muted); }
    body.shell.web #view-main > .topbar .badge { border-color: var(--line); color: var(--muted); }
    body.shell.web .topbar .badge.due  { color: var(--err);  border-color: var(--err); }
    body.shell.web .topbar .badge.warn { color: var(--warn); border-color: var(--warn); }
    body.shell.web .topbar .badge.ok   { color: var(--ok);   border-color: var(--ok); }
    body.shell.web #view-main > .topbar button.ghost {
      background: transparent; color: var(--brand); border-color: var(--line);
    }
    body.shell.web .crumb {
      display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted);
    }
    body.shell.web .crumb .sep { color: var(--line); }
    body.shell.web .crumb strong { color: var(--ink); font-weight: 600; }
    body.shell.web .topbar-spacer { display: block; flex: 1; }

    /* ---- เนื้อหา ---- */
    body.shell.web #panes,
    body.shell.web #view-asset { grid-area: panes; width: 100%; padding: 20px 22px 60px; }
    body.shell.web #panes { max-width: 1240px; }
    body.shell.web #view-asset { max-width: 900px; }
    /* หน้ารายการไม่ต้องยืดเต็มจอ ชื่อกับจำนวนจะห่างกันจนอ่านคู่กันไม่ออก
       ส่วนหน้าที่เป็นฟอร์มแคบกว่านั้นอีก */
    body.shell.web #tab-stock,
    body.shell.web #tab-assets,
    body.shell.web #tab-history,
    body.shell.web #tab-team,
    body.shell.web #tab-stickers { max-width: 1000px; }
    body.shell.web #tab-scan,
    body.shell.web #tab-lube,
    body.shell.web #tab-admin { max-width: 780px; }
    /* ปุ่มในเนื้อหาไม่ต้องยาวเต็มความกว้างแบบมือถือ */
    body.shell.web #panes .card > button,
    body.shell.web #view-asset .card > button { width: auto; padding: 10px 22px; }

    /* หน้ารายละเอียดรถ: แถบหัวกลายเป็นหัวข้อของหน้า ไม่ใช่แถบบนอีกอัน */
    body.shell.web #view-asset > .topbar {
      background: none; color: var(--ink); padding: 0; margin-bottom: 14px;
    }
    body.shell.web #view-asset > .topbar .who { color: var(--muted); }
    body.shell.web #view-asset > .topbar strong { font-size: 1.15rem; }
    body.shell.web #view-asset > .topbar button.ghost {
      background: var(--card); color: var(--brand); border-color: var(--line);
    }

    /* ---- การ์ดตัวเลขสรุป: ป้ายอยู่บน ตัวเลขอยู่ล่าง มีขีดสีบนหัวการ์ด ---- */
    body.shell.web .tiles { gap: 12px; margin-bottom: 14px; }
    body.shell.web .tile {
      display: flex; flex-direction: column-reverse; gap: 4px;
      position: relative; overflow: hidden; text-align: left;
      background: var(--card); border-radius: 8px; padding: 14px 16px;
    }
    body.shell.web .tile::before {
      content: ""; position: absolute; top: 0; left: 0; right: 0; height: 2px; background: var(--muted);
    }
    body.shell.web .tile.due::before  { background: var(--err); }
    body.shell.web .tile.warn::before { background: var(--warn); }
    body.shell.web .tile.ok::before   { background: var(--ok); }
    body.shell.web .tile .n { font-size: 1.7rem; }
    body.shell.web .tile .l { font-size: 10.5px; letter-spacing: .6px; text-transform: uppercase; }

    /* ---- ตัวกรอง + ตารางรายการรถ ---- */
    body.shell.web .filters {
      grid-template-columns: minmax(190px, 1.4fr) repeat(4, minmax(0, 1fr)) auto;
      align-items: center;
    }
    body.shell.web .filters button { width: auto; padding: 10px 16px; }
    body.shell.web .only-wide { display: block; }
    body.shell.web .only-narrow { display: none; }
    body.shell.web .thead, body.shell.web .trow {
      display: grid; grid-template-columns: 1.2fr 1.4fr 1fr 1.2fr 110px;
      gap: 12px; align-items: center;
    }
    body.shell.web .thead {
      padding: 8px 0; border-bottom: 1px solid var(--line);
      color: var(--muted); font-size: 11px; font-weight: 600;
      letter-spacing: .5px; text-transform: uppercase;
    }
    body.shell.web .trow .qty { text-align: left; }
    body.shell.web .tile.tap { cursor: pointer; }

    /* ---- ปฏิทินหลายเดือนเรียงข้างกันบนจอกว้าง ---- */
    body.shell.web .cal-months.compact { grid-template-columns: repeat(3, 1fr); gap: 18px; }
    body.shell.web .cal-cell { min-height: 84px; }
    body.shell.web .cal-months.compact .cal-cell { min-height: 34px; }

    /* ---- ปุ่มลัด ---- */
    body.shell.web .quick { grid-template-columns: repeat(4, 1fr); gap: 12px; }
    body.shell.web .quick .qa { align-items: flex-start; }

    /* ---- แดชบอร์ดสองคอลัมน์ ---- */
    body.shell.web .dash-grid { grid-template-columns: 1.6fr 1fr; gap: 16px; }
    body.shell.web .pane-card { padding: 0; }
    body.shell.web .pane-card > .sec {
      margin: 0; padding: 11px 16px; min-height: 44px; border-bottom: 1px solid var(--line);
    }
    body.shell.web .pane-card > .sec h2 { font-size: .9rem; }
    body.shell.web .pane-card > div { padding: 2px 16px 10px; }
  }

  /* ---- มือถือ: เปิดหน้ารายละเอียดรถแล้วซ่อนแถบบนกับเมนู ให้เหมือนก่อนย้ายเข้ากรอบเดียวกัน ---- */
  @media (max-width: 899px) {
    body.detail #view-main > .topbar, body.detail .side { display: none; }
  }
