:root{
  --ink:#0B1B33;--muted:#43546F;--blue:#005FE0;--blue-d:#003F99;--blue-soft:rgba(0,95,224,0.13);
  --green:#0B6B44;--green-bg:#DDF4E8;--orange:#8A4A06;--orange-bg:#FDEBD3;--red:#B42318;--red-bg:#FDE3E1;
  --gray-bg:rgba(11,27,51,0.08);--line:rgba(11,27,51,0.08);
  --glass:rgba(255,255,255,0.55);--glass-b:rgba(255,255,255,0.8);
  --shadow:inset 0 1px 0 rgba(255,255,255,0.95),0 10px 30px rgba(20,70,160,0.12);
}
*{box-sizing:border-box}
html,body{margin:0;height:100%}
body{background:#C9DCF5;display:flex;justify-content:center;align-items:flex-start;font-family:'Noto Sans Thai',-apple-system,system-ui,sans-serif;color:var(--ink);-webkit-tap-highlight-color:transparent}
a{color:var(--blue);text-decoration:none}
button,input,select,textarea{font-family:inherit;color:inherit}
button{cursor:pointer}
.phone{width:390px;height:844px;position:relative;overflow:hidden;background:linear-gradient(165deg,#EEF5FF 0%,#D6E7FF 42%,#EAF2FF 100%)}
.phone.dark{background:linear-gradient(165deg,#E9F0FA 0%,#D3E1F5 45%,#E6EEF9 100%)}
@media (max-width:500px){.phone{width:100vw;height:100vh;height:100dvh}}
.blob{position:absolute;border-radius:50%;pointer-events:none;filter:blur(10px)}
.statusbar{position:absolute;top:0;left:0;right:0;height:46px;display:flex;justify-content:space-between;align-items:center;padding:0 28px 0 32px;font-size:15px;font-weight:600;z-index:30;pointer-events:none}
.statusbar .ic{display:flex;gap:6px;align-items:center}
.screen{position:absolute;inset:0;display:flex;flex-direction:column;animation:in .22s ease}
@keyframes in{from{opacity:0;transform:translateX(14px)}to{opacity:1;transform:none}}
.scroll{flex:1 1 auto;overflow-y:auto;padding:54px 20px 110px;display:flex;flex-direction:column;gap:18px;position:relative;scrollbar-width:none}
.scroll::-webkit-scrollbar{display:none}
.scroll>*{flex-shrink:0}
.scroll.nobar{padding-bottom:120px}
.glass{background:var(--glass);backdrop-filter:blur(22px) saturate(180%);-webkit-backdrop-filter:blur(22px) saturate(180%);border:1px solid var(--glass-b);box-shadow:var(--shadow)}
.card{border-radius:28px;padding:18px;display:flex;flex-direction:column;gap:12px}
.row{display:flex;align-items:center;gap:10px}
.between{display:flex;align-items:center;justify-content:space-between;gap:10px}
.col{display:flex;flex-direction:column;gap:4px;min-width:0}
.muted{color:var(--muted)}
.small{font-size:12.5px}.xs{font-size:11.5px}
.b{font-weight:700}.sb{font-weight:600}
h1{margin:0;font-size:30px;font-weight:700;letter-spacing:-.5px}
h2{margin:0;font-size:19px;font-weight:700}
h3{margin:0;font-size:16px;font-weight:700}
.iconbtn{width:44px;height:44px;border-radius:22px;display:flex;align-items:center;justify-content:center;padding:0;color:var(--ink);position:relative;flex:0 0 auto}
.badge{position:absolute;top:6px;right:7px;min-width:16px;height:16px;border-radius:8px;background:#E5484D;color:#fff;font-size:10px;font-weight:700;display:flex;align-items:center;justify-content:center;padding:0 4px;border:2px solid #fff}
.topbar{display:flex;align-items:center;gap:12px}
.topbar .t{flex:1;text-align:center;font-size:17px;font-weight:700;margin-right:44px}
.topbar .t.noright{margin-right:0}
.btn{height:50px;border-radius:25px;border:0;background:var(--blue);color:#fff;font-size:16px;font-weight:600;display:flex;align-items:center;justify-content:center;gap:8px;box-shadow:0 8px 20px rgba(0,95,224,.35);width:100%;transition:transform .1s}
.btn:active{transform:scale(.98)}
.btn.sec{background:rgba(255,255,255,.7);color:var(--ink);box-shadow:var(--shadow);border:1px solid var(--glass-b)}
.btn.danger{background:var(--red-bg);color:var(--red);box-shadow:none}
.btn.sm{height:38px;font-size:14px;border-radius:19px;width:auto;padding:0 16px;box-shadow:none}
.btn[disabled]{background:#9DB3D3;box-shadow:none;cursor:not-allowed}
.chips{display:flex;gap:8px;overflow-x:auto;scrollbar-width:none;flex:0 0 auto}
.chips::-webkit-scrollbar{display:none}
.chip{height:36px;padding:0 15px;border-radius:18px;font-size:13px;font-weight:500;white-space:nowrap;flex:0 0 auto;display:flex;align-items:center;gap:6px}
.chip.on{background:var(--ink);color:#fff;border:0;font-weight:600;box-shadow:none;backdrop-filter:none}
.seg{display:flex;padding:4px;border-radius:22px;gap:4px}
.seg button{flex:1;height:36px;border:0;border-radius:18px;background:transparent;font-size:14px;font-weight:500;color:var(--muted)}
.seg button.on{background:#fff;color:var(--ink);font-weight:700;box-shadow:0 4px 12px rgba(20,70,160,.14)}
.pill{display:inline-flex;align-items:center;gap:6px;height:26px;padding:0 10px;border-radius:13px;font-size:12px;font-weight:600;white-space:nowrap}
.pill i{width:7px;height:7px;border-radius:4px;background:currentColor;display:block}
.pill.green{background:var(--green-bg);color:var(--green)}
.pill.orange{background:var(--orange-bg);color:var(--orange)}
.pill.blue{background:var(--blue-soft);color:var(--blue)}
.pill.red{background:var(--red-bg);color:var(--red)}
.pill.gray{background:var(--gray-bg);color:var(--muted)}
.pill.live i{animation:pulse 1.4s infinite}
@keyframes pulse{50%{opacity:.25}}
.list{display:flex;flex-direction:column}
.li{display:flex;align-items:center;gap:12px;padding:13px 0;border-bottom:1px solid var(--line);color:var(--ink);background:none;border-left:0;border-right:0;border-top:0;width:100%;text-align:left;font-size:15px}
.li:last-child{border-bottom:0}
.li .chev{margin-left:auto;color:#9AA9C0;flex:0 0 auto}
.ico{width:38px;height:38px;border-radius:12px;display:flex;align-items:center;justify-content:center;flex:0 0 auto;background:var(--blue-soft);color:var(--blue)}
.ico.green{background:var(--green-bg);color:var(--green)}
.ico.orange{background:var(--orange-bg);color:var(--orange)}
.ico.red{background:var(--red-bg);color:var(--red)}
.ico.gray{background:var(--gray-bg);color:var(--muted)}
.tabbar{position:absolute;left:16px;right:16px;bottom:22px;height:66px;border-radius:33px;padding:6px;display:flex;gap:4px;z-index:20}
.tabbar a{flex:1 1 0;height:54px;border-radius:27px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;font-size:11px;font-weight:500;color:var(--muted);position:relative}
.tabbar a.on{background:rgba(0,95,224,.14);color:var(--blue);font-weight:600}
.tabbar a .badge{top:3px;right:calc(50% - 22px)}
.bottombar{position:absolute;left:0;right:0;bottom:0;padding:14px 20px 28px;display:flex;gap:12px;align-items:center;z-index:20;border-radius:30px 30px 0 0}
.grid2{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.grid3{display:grid;grid-template-columns:1fr 1fr 1fr;gap:8px}
.stat{border-radius:20px;padding:12px 14px;display:flex;flex-direction:column;gap:2px;background:rgba(255,255,255,.6);border:1px solid rgba(255,255,255,.85);color:var(--ink);text-align:left}
.stat .v{font-size:24px;font-weight:700;line-height:1.15}
.stat .k{font-size:12px;color:var(--muted)}
button.stat{font:inherit;cursor:pointer}
button.stat.on{outline:2px solid var(--blue)}
.field{display:flex;flex-direction:column;gap:6px}
.field label{font-size:13px;font-weight:600;color:var(--muted)}
.input{height:48px;border-radius:16px;border:1px solid rgba(11,27,51,.12);background:rgba(255,255,255,.8);padding:0 14px;font-size:15px;width:100%;outline:none}
.input:focus{border-color:var(--blue);box-shadow:0 0 0 3px rgba(0,95,224,.15)}
textarea.input{height:80px;padding:12px 14px;resize:none}
.opt{display:flex;align-items:center;gap:12px;padding:12px 14px;border-radius:18px;border:1.5px solid transparent;background:rgba(255,255,255,.6);cursor:pointer;width:100%;text-align:left;font-size:14px}
.opt.on{border-color:var(--blue);background:#fff}
.opt .radio{width:20px;height:20px;border-radius:10px;border:2px solid #9AA9C0;flex:0 0 auto;margin-left:auto}
.opt.on .radio{border:6px solid var(--blue)}
.toggle{width:51px;height:31px;border-radius:16px;background:rgba(11,27,51,.16);border:0;position:relative;flex:0 0 auto;padding:0;transition:background .2s}
.toggle::after{content:"";position:absolute;top:2px;left:2px;width:27px;height:27px;border-radius:14px;background:#fff;box-shadow:0 2px 6px rgba(0,0,0,.2);transition:left .2s}
.toggle.on{background:#34C759}
.toggle.on::after{left:22px}
.toast{position:absolute;left:50%;bottom:110px;transform:translateX(-50%) translateY(20px);background:rgba(11,27,51,.92);color:#fff;padding:12px 18px;border-radius:18px;font-size:14px;font-weight:500;opacity:0;transition:all .25s;z-index:100;pointer-events:none;max-width:330px;text-align:center}
.toast.show{opacity:1;transform:translateX(-50%) translateY(0)}
.sheet-bg{position:absolute;inset:0;background:rgba(11,27,51,.35);z-index:90;display:flex;align-items:flex-end;animation:fade .2s}
@keyframes fade{from{opacity:0}}
.sheet{width:100%;background:#F4F8FF;border-radius:30px 30px 0 0;padding:10px 20px 34px;display:flex;flex-direction:column;gap:14px;animation:up .25s ease}
@keyframes up{from{transform:translateY(100%)}}
.sheet .grab{width:40px;height:5px;border-radius:3px;background:rgba(11,27,51,.2);align-self:center}
.empty{text-align:center;padding:40px 10px;color:var(--muted);font-size:14px}
.truckimg{border-radius:18px;display:flex;align-items:center;justify-content:center;background:linear-gradient(160deg,#F3F8FF,#CFE2FF);flex:0 0 auto}
.map{border-radius:24px;overflow:hidden;position:relative;background:#E4EEF9}
.map svg{display:block;width:100%;height:100%}
.timeline{display:flex;flex-direction:column}
.tl{display:flex;gap:12px;position:relative;padding-bottom:16px}
.tl:last-child{padding-bottom:0}
.tl .dot{width:14px;height:14px;border-radius:7px;background:#C3D3EA;margin-top:3px;flex:0 0 auto;position:relative;z-index:1}
.tl.done .dot{background:var(--blue)}
.tl.now .dot{background:#fff;border:4px solid var(--blue)}
.tl:not(:last-child)::before{content:"";position:absolute;left:6px;top:14px;bottom:-2px;width:2px;background:#C3D3EA}
.tl.done:not(:last-child)::before{background:var(--blue)}
.bar{height:8px;border-radius:4px;background:rgba(11,27,51,.1);overflow:hidden}
.bar>i{display:block;height:100%;border-radius:4px;background:var(--blue)}
/* demo menu pill + real-phone tweaks */
.demopill{pointer-events:auto;display:inline-flex;align-items:center;gap:4px;height:28px;padding:0 12px 0 8px;border-radius:14px;background:rgba(11,27,51,.82);color:#fff;font-size:12.5px;font-weight:600;backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px)}
.realphone .statusbar{height:44px;justify-content:center;padding:0;background:linear-gradient(180deg,rgba(234,242,255,.95) 55%,rgba(234,242,255,0))}
.realphone .scroll{padding-top:52px}
@media (max-width:500px){
  .scroll{padding-left:16px;padding-right:16px;padding-bottom:calc(104px + env(safe-area-inset-bottom))}
  .tabbar{left:12px;right:12px;bottom:calc(12px + env(safe-area-inset-bottom));height:64px}
  .tabbar a{font-size:10.5px}
  .bottombar{padding:12px 16px calc(16px + env(safe-area-inset-bottom))}
  .toast{bottom:calc(96px + env(safe-area-inset-bottom))}
  .sheet{padding-bottom:calc(24px + env(safe-area-inset-bottom));max-height:88dvh;overflow-y:auto}
  .input{font-size:16px}
}
@media (max-width:380px){
  h1{font-size:26px}
  .card{padding:16px;border-radius:24px}
  .grid3{gap:6px}
  .stat{padding:10px 11px}
  .seg button{font-size:13px}
  .truckimg[style*="width:112px"]{width:96px!important;height:76px!important}
  .truckimg[style*="width:112px"] svg{width:86px}
}
.grid2>*,.grid3>*{min-width:0}
input[type=date].input{min-width:0;padding:0 10px;-webkit-appearance:none;appearance:none;display:flex;align-items:center}
@media (max-width:400px){.grid2:has(input[type=date]){grid-template-columns:1fr}}
