:root{
  --bg:#f6f8fb;--card:#fff;--text:#172033;--muted:#64748b;--brand:#2563eb;--ok:#16a34a;--bad:#dc2626;--warn:#f59e0b;--line:#e5e7eb;
  --shadow:0 12px 30px rgba(15,23,42,.08);
}
*{box-sizing:border-box}
html,body{margin:0;font-family:system-ui,-apple-system,"Segoe UI",Tahoma,sans-serif;background:var(--bg);color:var(--text)}
body{min-height:100vh}
.app-shell{max-width:540px;margin:0 auto;min-height:100vh;background:#ffffff;padding:18px 14px 90px}
.topbar{display:flex;align-items:center;justify-content:space-between;margin-bottom:14px}
.brand{display:flex;gap:10px;align-items:center;font-weight:800}
.logo{width:42px;height:42px;border-radius:14px;background:#ffffff;display:grid;place-items:center;color:white;font-size:22px;box-shadow:var(--shadow)}
.badge{font-size:12px;background:#dbeafe;color:#1d4ed8;border-radius:999px;padding:6px 10px}
.card{background:var(--card);border:1px solid var(--line);border-radius:22px;padding:18px;margin:12px 0;box-shadow:var(--shadow)}
h1{font-size:24px;margin:0 0 8px} h2{font-size:20px;margin:0 0 12px} h3{font-size:16px;margin:0 0 8px}
p{color:var(--muted);line-height:1.5}
label{display:block;font-size:13px;color:#334155;margin:12px 0 6px;font-weight:650}
input,select,textarea{width:100%;padding:13px 14px;border:1px solid #cbd5e1;border-radius:14px;font-size:16px;background:white}
textarea{min-height:92px;resize:vertical}
button{border:0;border-radius:14px;padding:13px 16px;font-weight:800;font-size:15px;background:#e2e8f0;color:#0f172a;cursor:pointer}
button.primary{background:var(--brand);color:white}
button.ok{background:var(--ok);color:white}
button.bad{background:var(--bad);color:white}
button.ghost{background:#eff6ff;color:#1d4ed8}
button:disabled{opacity:.45;cursor:not-allowed}
.row{display:flex;gap:10px}.row>*{flex:1}
.stack{display:grid;gap:10px}
.muted{color:var(--muted);font-size:13px}.center{text-align:center}
.status{padding:10px 12px;border-radius:14px;font-weight:700;margin-top:10px}
.status.ok{background:#dcfce7;color:#166534}.status.bad{background:#fee2e2;color:#991b1b}.status.warn{background:#fef3c7;color:#92400e}
.permission-list{display:grid;gap:10px}.perm{display:flex;align-items:center;justify-content:space-between;border:1px solid var(--line);padding:12px;border-radius:16px;background:#fff}
.vehicle-card,.form-card{border:1px solid var(--line);border-radius:18px;padding:14px;background:white;display:flex;justify-content:space-between;align-items:center;margin:10px 0}
.plate-head{font-size:38px;font-weight:900;letter-spacing:1px;color:#1d4ed8}
.camera-box{background:#0f172a;border-radius:22px;overflow:hidden;position:relative;min-height:270px;display:grid;place-items:center;color:white}
video,canvas,.preview-img{width:100%;display:block}
.capture-btn{position:absolute;bottom:16px;left:50%;transform:translateX(-50%);width:68px;height:68px;border-radius:50%;background:white;border:5px solid rgba(255,255,255,.55)}
.photo-thumb{width:64px;height:64px;object-fit:cover;border-radius:12px;border:1px solid var(--line)}
.photos{display:flex;gap:8px;flex-wrap:wrap;margin-top:8px}
.group{margin-top:16px}
.item{border:1px solid var(--line);border-radius:18px;padding:14px;background:#fff;margin:10px 0}
.item-title{font-weight:800}.criteria{font-size:13px;color:var(--muted);margin:4px 0 10px}
.pill{display:inline-flex;border-radius:999px;padding:4px 9px;background:#f1f5f9;color:#475569;font-size:12px;margin-left:6px}
.progress{height:12px;background:#e2e8f0;border-radius:999px;overflow:hidden}.progress span{display:block;height:100%;background:var(--brand);width:0}
.bottom-nav{position:fixed;bottom:0;left:0;right:0;background:rgba(255,255,255,.96);border-top:1px solid var(--line);padding:10px 14px;display:flex;gap:10px;justify-content:center}
.bottom-nav button{max-width:250px}
.hidden{display:none!important}
@media(min-width:800px){.app-shell{max-width:980px}.grid2{display:grid;grid-template-columns:1fr 1fr;gap:14px}.grid3{display:grid;grid-template-columns:repeat(3,1fr);gap:14px}}
.full-btn{width:100%}
.hero-icon{width:78px;height:78px;margin:0 auto 12px;border-radius:26px;background:#ffffff;display:grid;place-items:center;color:#fff;font-size:38px;box-shadow:var(--shadow);animation:popIn .42s ease-out both}
.animate-in{animation:fadeUp .28s ease-out both}
.driver-mini{display:flex;flex-direction:column;gap:2px;background:#f8fafc;border:1px solid var(--line);border-radius:14px;padding:10px 12px;margin:10px 0}.driver-mini span{color:var(--muted);font-size:13px}
button.selected-ok{background:var(--ok)!important;color:#fff!important}button.selected-bad{background:var(--bad)!important;color:#fff!important}.camera-only{flex:0 0 52px!important;padding-left:0;padding-right:0;font-size:20px}.photo-wrap{position:relative;display:inline-flex}.photo-wrap button{position:absolute;right:-6px;top:-8px;width:22px;height:22px;border-radius:999px;padding:0;background:#0f172a;color:#fff;font-size:14px;line-height:22px}.photo-loading{font-size:12px;color:var(--muted);padding:8px 10px;border:1px dashed var(--line);border-radius:10px}
@keyframes fadeUp{from{opacity:0;transform:translateY(12px)}to{opacity:1;transform:translateY(0)}}@keyframes popIn{from{opacity:0;transform:scale(.86)}to{opacity:1;transform:scale(1)}}
.role-grid{display:grid;grid-template-columns:1fr;gap:12px;margin-top:14px}
.role-tile{display:flex;align-items:flex-start;text-align:left;gap:12px;background:#fff;border:1px solid var(--line);border-radius:18px;padding:16px;box-shadow:0 6px 18px rgba(15,23,42,.05)}
.role-tile span{font-size:30px;width:42px;height:42px;border-radius:14px;background:#eff6ff;display:grid;place-items:center;flex:0 0 auto}
.role-tile b{display:block;font-size:17px;margin-bottom:4px}.role-tile small{display:block;color:var(--muted);font-weight:600;line-height:1.35}
.metric-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:10px;margin-top:12px}.metric-card{border:1px solid var(--line);border-radius:16px;background:#f8fafc;padding:12px}.metric-card span{display:block;color:var(--muted);font-size:12px}.metric-card b{font-size:24px;color:#0f172a}.list-row{display:flex;align-items:center;justify-content:space-between;gap:10px;border-bottom:1px solid var(--line);padding:12px 0}.list-row:last-child{border-bottom:0}.list-row small{display:block;color:var(--muted);margin-top:3px}.mini-badge{font-size:12px;font-weight:800;border-radius:999px;padding:5px 9px;white-space:nowrap}.mini-badge.ok{background:#dcfce7;color:#166534}.mini-badge.bad{background:#fee2e2;color:#991b1b}.empty-state{border:1px dashed var(--line);border-radius:16px;padding:18px;text-align:center;color:var(--muted);background:#f8fafc}
@media(min-width:620px){.role-grid{grid-template-columns:1fr 1fr}.metric-grid{grid-template-columns:repeat(4,1fr)}}


/* v12 photo watermark preview modal */
.photo-thumb{cursor:pointer}
.image-modal-backdrop{position:fixed;inset:0;background:rgba(15,23,42,.78);z-index:9999;display:flex;align-items:center;justify-content:center;padding:16px;animation:fadeIn .16s ease-out}
.image-modal{width:min(960px,100%);height:min(90vh,900px);background:#fff;border-radius:18px;box-shadow:0 24px 80px rgba(0,0,0,.38);display:flex;flex-direction:column;overflow:hidden}
.image-modal-head{height:54px;display:flex;align-items:center;justify-content:space-between;padding:0 16px;border-bottom:1px solid #e5e7eb;color:#111827}
.image-modal-head button{width:38px;height:38px;border:0;background:#f3f4f6;border-radius:12px;font-size:24px;line-height:1;cursor:pointer}
.image-modal-body{flex:1;min-height:0;display:flex;align-items:center;justify-content:center;background:#0f172a;overflow:auto;padding:12px}
.image-modal-body img{max-width:100%;max-height:100%;object-fit:contain;border-radius:10px}
.photo-loading{display:inline-flex;align-items:center;gap:6px;font-size:12px;color:#475569;background:#e0f2fe;border:1px solid #bae6fd;border-radius:999px;padding:6px 10px;margin:4px}
@keyframes fadeIn{from{opacity:0}to{opacity:1}}

/* v13 GPS required hard block */
.gps-block-screen{
  min-height:100vh;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:24px;
  background:#ffffff;
  font-family:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  color:#0f172a;
}
.gps-block-card{
  width:min(440px,100%);
  background:rgba(255,255,255,.92);
  border:1px solid rgba(148,163,184,.35);
  border-radius:24px;
  box-shadow:0 24px 80px rgba(15,23,42,.18);
  padding:28px;
  text-align:center;
  animation:gpsCardIn .32s ease-out both;
}
.gps-block-icon{font-size:56px;margin-bottom:8px;}
.gps-block-card h1{font-size:24px;margin:0 0 10px;font-weight:800;}
.gps-block-card p{line-height:1.55;margin:8px 0;}
.gps-block-card .muted{color:#64748b;font-size:14px;}
.gps-block-card button{
  margin-top:16px;
  width:100%;
  min-height:48px;
  border:0;
  border-radius:14px;
  background:#0f62fe;
  color:white;
  font-weight:700;
  font-size:16px;
}
@keyframes gpsCardIn{from{opacity:0;transform:translateY(14px) scale(.98)}to{opacity:1;transform:none}}

/* v14 dashboard redirect + bottom navigation */
.has-bottom-nav{padding-bottom:108px}
.bottom-nav{
  position:fixed;
  left:50%;
  right:auto;
  bottom:12px;
  transform:translateX(-50%);
  width:min(540px,calc(100% - 22px));
  z-index:1000;
  display:grid;
  grid-template-columns:repeat(5,1fr);
  gap:6px;
  padding:8px;
  background:rgba(255,255,255,.94);
  border:1px solid rgba(148,163,184,.38);
  border-radius:22px;
  box-shadow:0 18px 50px rgba(15,23,42,.18);
  backdrop-filter:blur(14px);
}
.bottom-nav .nav-btn{
  max-width:none;
  min-width:0;
  padding:8px 4px;
  border-radius:16px;
  background:transparent;
  color:#475569;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:2px;
  font-size:11px;
  line-height:1.1;
  box-shadow:none;
}
.bottom-nav .nav-btn span{font-size:20px;line-height:1}
.bottom-nav .nav-btn b{font-size:11px;font-weight:800;white-space:nowrap}
.bottom-nav .nav-btn.active{background:#dbeafe;color:#1d4ed8}
.bottom-nav .nav-btn:active{transform:scale(.96)}
@media(min-width:800px){.bottom-nav{width:min(720px,calc(100% - 40px))}}

/* v17 strict live camera only */
.live-camera-modal{max-width:560px;height:min(92vh,820px)}
.live-camera-body{flex:1;min-height:0;display:flex;flex-direction:column;gap:10px;padding:14px;background:#f8fafc;overflow:auto}
.live-camera-box{min-height:320px;background:#0f172a}
.live-camera-box video,.live-camera-box img{width:100%;max-height:58vh;object-fit:contain;background:#0f172a}
.live-actions{margin-top:4px}
.live-actions button{min-height:48px}
@media(max-width:560px){.live-camera-backdrop{padding:8px}.live-camera-modal{width:100%;height:96vh;border-radius:16px}.live-camera-box{min-height:280px}}


/* v20 face capture error diagnostics */
.step-debug{display:grid;gap:8px;margin:14px 0;padding:12px;border:1px solid var(--line);border-radius:16px;background:#f8fafc;font-size:13px;color:#475569}
.step-debug div{padding:8px 10px;border-radius:12px;background:#fff;border:1px solid #e2e8f0;font-weight:700}
.step-debug div.doing{background:#eff6ff;border-color:#bfdbfe;color:#1d4ed8}
.step-debug div.ok{background:#dcfce7;border-color:#86efac;color:#166534}
.step-debug div.bad{background:#fee2e2;border-color:#fecaca;color:#991b1b}
.error-detail{margin-top:12px;border:1px solid #fecaca;background:#fff7f7;border-radius:18px;padding:14px;color:#7f1d1d}
.error-detail h3{margin:0 0 8px;font-size:18px;color:#991b1b}
.error-detail details{margin-top:10px;border:1px solid #fecaca;border-radius:14px;background:#fff;padding:10px}
.error-detail summary{cursor:pointer;font-weight:800;color:#7f1d1d}
.error-detail pre{white-space:pre-wrap;word-break:break-word;font-size:12px;line-height:1.45;color:#334155;background:#f8fafc;border-radius:12px;padding:10px;max-height:240px;overflow:auto}
.error-likely ul,.diag-list{margin:8px 0 0 18px;padding:0;line-height:1.55}
.diag-list li{margin:4px 0;color:#334155}

/* v28 user card, notifications, record detail */
.user-card{display:flex;gap:12px;align-items:center;padding:12px;border:1px solid #e4e9f2;border-radius:18px;background:#f8fbff;margin-bottom:12px}.user-card b{display:block;font-size:18px}.user-card span{display:block;color:#64748b;font-weight:700}.user-avatar{width:58px;height:58px;border-radius:18px;object-fit:cover;background:#dbeafe;border:2px solid #fff;box-shadow:0 6px 16px rgba(15,23,42,.12)}.user-avatar.placeholder{display:grid;place-items:center;font-size:30px}.list-row.clickable{cursor:pointer;border-color:#bfdbfe;background:#f8fbff}.list-row.clickable:active{transform:scale(.99)}.disabled-row{opacity:.86;background:#f8fafc}.list-row.unread{border-left:5px solid #2563eb;background:#eff6ff}.photo-grid-two{display:grid;grid-template-columns:1fr 1fr;gap:12px}.detail-photo{width:100%;max-height:260px;object-fit:contain;border:1px solid #e2e8f0;border-radius:16px;background:#fff;cursor:pointer}.detail-photo.small{width:120px;height:120px;object-fit:cover;margin:6px}.bottom-nav .nav-btn b{font-size:11px}@media(max-width:520px){.photo-grid-two{grid-template-columns:1fr}.user-avatar{width:52px;height:52px}}

/* v32 signatures */
.signature-card{background:#fff;border:1px solid #e5e7eb;border-radius:18px;padding:16px;margin:14px 0;box-shadow:0 8px 24px rgba(15,23,42,.06)}
.signature-card h2{margin:0 0 6px;font-size:20px;color:#111827}.signature-card p{margin:0 0 12px;color:#64748b;line-height:1.5}
.signature-pad{margin:12px 0}.signature-pad label{display:block;font-weight:800;margin-bottom:8px;color:#334155}.signature-pad canvas{display:block;width:100%;height:150px;background:#fff;border:2px dashed #94a3b8;border-radius:14px;touch-action:none}.sig-actions{display:flex;justify-content:flex-end;margin-top:8px}

.app-logo{width:54px;height:54px;border-radius:16px;object-fit:contain;background:#fff;box-shadow:0 8px 24px rgba(255,79,122,.22)}

/* v58 PWA install recommendation + in-app browser block */
.external-browser-block{
  position:fixed;
  inset:0;
  z-index:99999;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:22px;
  background:#ffffff;
  color:#0f172a;
}
.external-browser-card{
  width:min(480px,100%);
  background:#fff;
  border-radius:24px;
  padding:24px;
  box-shadow:0 30px 90px rgba(0,0,0,.36);
  text-align:center;
}
.external-browser-icon{font-size:54px;margin-bottom:8px}
.external-browser-card h1{font-size:24px;margin:0 0 10px;color:#0f172a}
.external-browser-card p{margin:8px 0;color:#475569;line-height:1.55}
.external-browser-card .muted{font-size:13px;color:#64748b}
.external-browser-url{
  word-break:break-all;
  background:#f1f5f9;
  border:1px solid #e2e8f0;
  border-radius:14px;
  padding:10px;
  margin:12px 0;
  font-size:12px;
  color:#334155;
}
.external-browser-card button{width:100%;margin-top:10px}
.pwa-install-tip{
  position:fixed;
  left:50%;
  bottom:18px;
  transform:translateX(-50%);
  width:min(540px,calc(100% - 24px));
  z-index:9000;
}
.pwa-install-card{
  display:flex;
  gap:12px;
  align-items:center;
  justify-content:space-between;
  background:#fff;
  border:1px solid #dbeafe;
  border-radius:18px;
  padding:14px;
  box-shadow:0 20px 60px rgba(15,23,42,.22);
}
.pwa-install-card b{display:block;color:#0f172a;margin-bottom:3px}
.pwa-install-card p{margin:0;color:#475569;font-size:13px;line-height:1.35}
.pwa-install-actions{display:flex;gap:8px;flex:0 0 auto}
.pwa-install-actions button{padding:10px 12px;border-radius:12px;white-space:nowrap}
@media(max-width:520px){
  .pwa-install-card{align-items:stretch;flex-direction:column}
  .pwa-install-actions{display:grid;grid-template-columns:1fr 1fr;width:100%}
}


.identity-latest-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(160px,1fr));
  gap:12px;
  margin:12px 0 18px;
}
.identity-latest-card{
  border:1px solid #e5e7eb;
  border-radius:14px;
  background:#fff;
  padding:10px;
  box-shadow:0 6px 18px rgba(15,23,42,.08);
}
.identity-latest-card img{
  width:100%;
  height:160px;
  object-fit:cover;
  border-radius:12px;
  background:#f3f4f6;
  cursor:zoom-in;
}


.row-with-avatar{
  display:flex;
  align-items:center;
  gap:10px;
}
.small-avatar{
  width:44px;
  height:44px;
  border-radius:999px;
  object-fit:cover;
  background:#f3f4f6;
  border:1px solid #e5e7eb;
  flex:0 0 auto;
}
.small-avatar.empty{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-size:10px;
  color:#6b7280;
}


.live-camera-box{
  position:relative;
  overflow:hidden;
  background:#000;
}
.live-camera-box video,
.live-camera-box .preview-img{
  width:100%;
  height:auto;
  max-height:72vh;
  object-fit:contain !important;
  background:#000;
}
.live-camera-box.aspect-1-1{
  aspect-ratio:1/1;
}
.live-camera-box.aspect-3-4{
  aspect-ratio:3/4;
}
.live-camera-box.aspect-1-1 video,
.live-camera-box.aspect-3-4 video,
.live-camera-box.aspect-1-1 .preview-img,
.live-camera-box.aspect-3-4 .preview-img{
  width:100%;
  height:100%;
  object-fit:contain !important;
}
.live-watermark{
  position:absolute;
  left:0;
  right:0;
  bottom:0;
  padding:10px 12px;
  background:rgba(0,0,0,.66);
  color:#fff;
  font-size:12px;
  font-weight:700;
  line-height:1.35;
  text-align:left;
  z-index:3;
  pointer-events:none;
  text-shadow:0 1px 2px rgba(0,0,0,.8);
}
.photo-thumb,
.detail-photo,
.approval-photo-card .photo-thumb img,
.photo-wrap img,
.identity-latest-card img{
  object-fit:contain !important;
}
.photo-wrap{
  background:#f3f4f6;
}


.live-camera-box.aspect-4-3{
  aspect-ratio:4/3;
}
.live-camera-box.aspect-4-3 video,
.live-camera-box.aspect-4-3 .preview-img{
  width:100%;
  height:100%;
  object-fit:contain !important;
}


/* v82 UI refinements */
.live-camera-box.native-camera{
  aspect-ratio:auto;
  min-height:260px;
}
.live-camera-box.native-camera video,
.live-camera-box.native-camera .preview-img{
  width:100%;
  height:auto;
  max-height:72vh;
  object-fit:contain !important;
  background:#000;
}
.live-camera-body > .status.warn:first-child{
  display:none !important;
}
.item-action-row{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  align-items:center;
}
.item-action-row .choice-btn,
.item-action-row button{
  width:auto !important;
  min-width:max-content;
  flex:0 0 auto;
  white-space:nowrap;
  padding:10px 16px;
}
.photo-required-label{
  display:inline-flex;
  margin-left:8px;
  color:#dc2626;
  font-weight:800;
  font-size:12px;
  vertical-align:middle;
}
.photo-required-label.hidden{
  display:none !important;
}
.signature-pad{
  padding:12px;
  border:1px dashed #94a3b8;
  border-radius:14px;
  background:#fff;
  touch-action:auto;
}
.signature-pad canvas{
  width:100%;
  height:260px;
  min-height:240px;
  border:1px solid #cbd5e1;
  border-radius:12px;
  background:#fff;
  touch-action:none;
  display:block;
}
.signature-help{
  color:#6b7280;
  font-size:13px;
  margin:4px 0 8px;
}
.signature-wait canvas{
  cursor:pointer;
}
.signature-active{
  border-color:#2563eb;
  box-shadow:0 0 0 3px rgba(37,99,235,.12);
}
.signature-active .signature-help{
  color:#2563eb;
  font-weight:700;
}
@media (max-width:640px){
  .signature-pad canvas{
    height:220px;
    min-height:220px;
  }
}


.face-history-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(160px,1fr));
  gap:12px;
}
.face-history-action{
  margin:10px 0 12px;
}


/* v84 inspection start vehicle plate + floating save */
.vehicle-plate-start-card{
  border:2px solid #e0f2fe;
}
.floating-submit-bar{
  position:fixed;
  left:12px;
  right:12px;
  bottom:calc(72px + env(safe-area-inset-bottom, 0px));
  z-index:60;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:10px 12px;
  border:1px solid #d1d5db;
  border-radius:16px;
  background:rgba(255,255,255,.96);
  box-shadow:0 14px 40px rgba(15,23,42,.18);
  backdrop-filter:blur(10px);
}
.floating-submit-bar.ready{
  border-color:#22c55e;
  box-shadow:0 14px 40px rgba(34,197,94,.18);
}
.floating-submit-bar > div{
  font-size:13px;
  color:#374151;
  font-weight:700;
}
.floating-submit-bar button{
  width:auto !important;
  min-width:max-content;
  white-space:nowrap;
  padding:10px 16px;
}
.floating-submit-bar button:disabled{
  opacity:.55;
}
@media (min-width:900px){
  .floating-submit-bar{
    left:50%;
    right:auto;
    transform:translateX(-50%);
    width:min(760px, calc(100vw - 32px));
  }
}


/* v85 Driver/Supervisor button and heading layout */
:root{
  --app-btn-height:44px;
  --app-btn-radius:12px;
}

body:not(.admin-body) h1{
  font-size:clamp(22px, 5.2vw, 32px);
  line-height:1.18;
  letter-spacing:-.02em;
  margin-bottom:10px;
}

body:not(.admin-body) h2{
  font-size:clamp(17px, 4.2vw, 23px);
  line-height:1.25;
  letter-spacing:-.01em;
  margin-bottom:10px;
}

body:not(.admin-body) h3,
body:not(.admin-body) .item-title{
  font-size:clamp(15px, 3.7vw, 18px);
  line-height:1.35;
  word-break:break-word;
  overflow-wrap:anywhere;
}

body:not(.admin-body) .criteria,
body:not(.admin-body) p,
body:not(.admin-body) label{
  font-size:clamp(13px, 3.4vw, 15px);
  line-height:1.45;
}

body:not(.admin-body) button,
body:not(.admin-body) .primary,
body:not(.admin-body) .ghost,
body:not(.admin-body) .camera-only,
body:not(.admin-body) .secondary,
body:not(.admin-body) .ok{
  min-height:var(--app-btn-height) !important;
  height:var(--app-btn-height) !important;
  width:auto !important;
  max-width:100%;
  min-width:max-content;
  padding:0 16px !important;
  border-radius:var(--app-btn-radius);
  display:inline-flex !important;
  align-items:center;
  justify-content:center;
  gap:8px;
  line-height:1.15 !important;
  white-space:nowrap;
  flex:0 0 auto;
}

body:not(.admin-body) .full-btn{
  width:auto !important;
  min-width:max-content;
}

body:not(.admin-body) .card > button,
body:not(.admin-body) .card > .primary,
body:not(.admin-body) .card > .ghost,
body:not(.admin-body) .card > .camera-only,
body:not(.admin-body) .signature-card + .card > button{
  margin-left:auto;
}

body:not(.admin-body) .row,
body:not(.admin-body) .actions,
body:not(.admin-body) .sig-actions,
body:not(.admin-body) .live-actions,
body:not(.admin-body) .item-action-row,
body:not(.admin-body) .form-actions{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  justify-content:flex-end;
  gap:8px;
}

body:not(.admin-body) .item-action-row{
  justify-content:flex-end !important;
}

body:not(.admin-body) .item .item-title{
  display:block;
  padding-right:0;
}

body:not(.admin-body) .photo-required-label{
  margin-left:6px;
  white-space:nowrap;
}

body:not(.admin-body) .signature-pad label{
  font-size:clamp(14px, 3.7vw, 17px);
  font-weight:700;
}

body:not(.admin-body) .floating-submit-bar{
  justify-content:flex-end;
}

body:not(.admin-body) .floating-submit-bar > div{
  flex:1 1 auto;
  text-align:left;
}

body:not(.admin-body) .floating-submit-bar button{
  min-height:var(--app-btn-height) !important;
  height:var(--app-btn-height) !important;
  width:auto !important;
  min-width:max-content;
}

@media (max-width:420px){
  body:not(.admin-body) button,
  body:not(.admin-body) .primary,
  body:not(.admin-body) .ghost,
  body:not(.admin-body) .camera-only,
  body:not(.admin-body) .secondary,
  body:not(.admin-body) .ok{
    min-height:42px !important;
    height:42px !important;
    padding:0 13px !important;
    font-size:14px;
  }

  body:not(.admin-body) .row,
  body:not(.admin-body) .actions,
  body:not(.admin-body) .sig-actions,
  body:not(.admin-body) .live-actions,
  body:not(.admin-body) .item-action-row,
  body:not(.admin-body) .form-actions{
    gap:6px;
  }
}

@media (max-width:360px){
  body:not(.admin-body) button,
  body:not(.admin-body) .primary,
  body:not(.admin-body) .ghost,
  body:not(.admin-body) .camera-only,
  body:not(.admin-body) .secondary,
  body:not(.admin-body) .ok{
    font-size:13px;
    padding:0 11px !important;
  }
}


/* v86 dashboard face avatar */
.user-card{
  align-items:center;
}
.user-avatar-btn{
  width:72px !important;
  height:72px !important;
  min-width:72px !important;
  min-height:72px !important;
  padding:0 !important;
  border:1px solid #dbe4ef;
  border-radius:16px;
  overflow:hidden;
  background:#f8fafc;
  display:inline-flex !important;
  align-items:center;
  justify-content:center;
  flex:0 0 72px;
}
.user-avatar-btn .user-avatar,
.user-avatar.face-smart-avatar{
  width:100% !important;
  height:100% !important;
  border-radius:16px;
  display:block;
  background:#f8fafc;
}
.user-avatar.face-smart-avatar.face-avatar-contain{
  object-fit:contain !important;
  object-position:center center;
}
.user-avatar.face-smart-avatar.face-avatar-detected{
  object-fit:cover !important;
}
.user-avatar.placeholder{
  width:72px;
  height:72px;
  min-width:72px;
  min-height:72px;
  border-radius:16px;
}


/* v87 required photo highlight + camera step buttons */
.item.missing-required-photo{
  border:2px solid #dc2626 !important;
  background:#fff1f2 !important;
  box-shadow:0 0 0 4px rgba(220,38,38,.12);
  border-radius:14px;
}
.item.missing-required-photo .item-title{
  color:#991b1b;
}
.item.missing-required-photo .photo-required-label{
  background:#fee2e2;
  border:1px solid #ef4444;
  border-radius:999px;
  padding:2px 8px;
}
.item.attention-pulse{
  animation:requiredPhotoPulse .9s ease-in-out 0s 2;
}
@keyframes requiredPhotoPulse{
  0%{transform:scale(1);box-shadow:0 0 0 0 rgba(220,38,38,.32);}
  50%{transform:scale(1.01);box-shadow:0 0 0 8px rgba(220,38,38,.14);}
  100%{transform:scale(1);box-shadow:0 0 0 4px rgba(220,38,38,.12);}
}
.live-actions .hidden{
  display:none !important;
}


/* v92 floating save status */
.floating-submit-copy{
  flex:1 1 auto;
  min-width:0;
  display:flex;
  flex-direction:column;
  gap:4px;
  text-align:left;
}

.floating-submit-status{
  display:inline-flex;
  align-items:center;
  width:max-content;
  max-width:100%;
  min-height:30px;
  padding:6px 10px;
  border-radius:12px;
  font-size:13px;
  font-weight:800;
  line-height:1.25;
  white-space:normal;
  overflow-wrap:anywhere;
}

.floating-submit-status.hidden{
  display:none !important;
}

.floating-submit-status.warn{
  background:#fff7cc;
  color:#92400e;
  border:1px solid #facc15;
}

.floating-submit-status.ok{
  background:#dcfce7;
  color:#166534;
  border:1px solid #86efac;
}

.floating-submit-status.bad{
  background:#fee2e2;
  color:#991b1b;
  border:1px solid #fca5a5;
}

.floating-submit-bar.saving{
  border-color:#facc15;
  box-shadow:0 14px 40px rgba(250,204,21,.22);
}

.floating-submit-bar.save-ok{
  border-color:#22c55e;
  box-shadow:0 14px 40px rgba(34,197,94,.18);
}

.floating-submit-bar.save-bad{
  border-color:#ef4444;
  box-shadow:0 14px 40px rgba(239,68,68,.18);
}


/* v93 signature double tap */
.signature-help{
  user-select:none;
}
.signature-wait .signature-help{
  color:#92400e;
  font-weight:700;
}


/* v94 inspection report photo size */
.report-inspection-photo-row,
.user-report-photos{
  display:grid;
  grid-template-columns:repeat(auto-fit, minmax(220px, 1fr));
  gap:12px;
  margin-top:12px;
  width:100%;
}

.report-inspection-photo-row .approval-photo-card,
.report-inspection-photo{
  min-height:220px;
}

.report-inspection-photo{
  display:flex;
  align-items:center;
  justify-content:center;
  width:100%;
  min-height:220px;
  padding:8px;
  border:1px solid #dbe4ef;
  border-radius:14px;
  background:#f8fafc;
  cursor:zoom-in;
}

.report-inspection-photo img,
.report-inspection-photo-row .photo-thumb img,
.report-inspection-photo-row .approval-photo-card .photo-thumb img{
  width:100%;
  height:auto;
  max-height:340px;
  min-height:200px;
  object-fit:contain !important;
  border-radius:12px;
  background:#f3f4f6;
}

.report-list-row{
  align-items:flex-start !important;
}

.report-list-row > div{
  flex:1 1 auto;
  min-width:0;
}

@media (max-width:640px){
  .report-inspection-photo-row,
  .user-report-photos{
    grid-template-columns:1fr;
  }
  .report-inspection-photo,
  .report-inspection-photo-row .approval-photo-card{
    min-height:240px;
  }
  .report-inspection-photo img,
  .report-inspection-photo-row .photo-thumb img,
  .report-inspection-photo-row .approval-photo-card .photo-thumb img{
    max-height:420px;
    min-height:220px;
  }
}


/* v95 admin detail / history / face gallery */
.report-inspection-photo-row.align-right{
  justify-content:flex-end;
  justify-items:end;
}

.report-inspection-photo-row.align-right .approval-photo-card{
  width:min(420px, 100%);
}

.face-photo-gallery-wrap{
  display:flex;
  flex-direction:column;
  gap:8px;
}

.face-thumb-gallery{
  display:flex;
  gap:8px;
  overflow-x:auto;
  padding:6px 2px 2px;
  scrollbar-width:thin;
}

.face-thumb{
  width:64px !important;
  height:64px !important;
  min-width:64px !important;
  padding:0 !important;
  border:2px solid #dbe4ef;
  border-radius:12px;
  overflow:hidden;
  background:#f8fafc;
  cursor:zoom-in;
}

.face-thumb.active{
  border-color:#2563eb;
}

.face-thumb img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}

.face-gallery-empty{
  color:#6b7280;
  font-size:12px;
}

.readonly-detail-head{
  display:flex;
  justify-content:space-between;
  gap:12px;
  align-items:flex-start;
}

.readonly-report .report-item,
.readonly-report-item{
  display:flex;
  justify-content:space-between;
  gap:12px;
  align-items:flex-start;
  border-bottom:1px solid #eef2f7;
  padding:12px 0;
}

.readonly-report-photos{
  justify-content:flex-end;
  justify-items:end;
}

.identity-actions{
  justify-content:flex-end;
  margin-bottom:8px;
}


/* v95 user identity retake button */
.identity-latest-card .identity-actions{
  display:flex;
  justify-content:flex-end;
  margin-top:8px;
}


/* v96 dashboard header avatar layout fix */
body:not(.admin-body) .user-card{
  display:flex !important;
  align-items:center !important;
  gap:14px !important;
  overflow:hidden;
  min-width:0;
}

body:not(.admin-body) .user-card > div:last-child{
  min-width:0;
  flex:1 1 auto;
}

body:not(.admin-body) .user-card > div:last-child b,
body:not(.admin-body) .user-card > div:last-child span{
  display:block;
  max-width:100%;
  overflow-wrap:anywhere;
  word-break:break-word;
}

body:not(.admin-body) .user-card .user-avatar-btn{
  width:72px !important;
  height:72px !important;
  min-width:72px !important;
  min-height:72px !important;
  max-width:72px !important;
  max-height:72px !important;
  flex:0 0 72px !important;
  padding:0 !important;
  margin:0 !important;
  border-radius:16px !important;
  display:inline-flex !important;
  align-items:center !important;
  justify-content:center !important;
  overflow:hidden !important;
  white-space:normal !important;
}

body:not(.admin-body) .user-card .user-avatar-btn .user-avatar,
body:not(.admin-body) .user-card .user-avatar-btn img{
  width:72px !important;
  height:72px !important;
  min-width:72px !important;
  min-height:72px !important;
  max-width:72px !important;
  max-height:72px !important;
  object-fit:contain !important;
  object-position:center center !important;
  border-radius:16px !important;
  display:block !important;
}

body:not(.admin-body) .user-card .user-avatar.placeholder{
  width:72px !important;
  height:72px !important;
  min-width:72px !important;
  min-height:72px !important;
  flex:0 0 72px !important;
}

.detail-click-row{
  cursor:pointer;
}
.detail-click-row:active{
  transform:scale(.995);
}


/* v101 report/detail photo layout: 20% smaller + left aligned */
.report-inspection-photo-row,
.report-inspection-photo-row.align-left,
.report-inspection-photo-row.align-right,
.mini-photo-row,
.user-report-photos{
  display:grid !important;
  grid-template-columns:repeat(auto-fill, minmax(176px, 240px)) !important;
  justify-content:start !important;
  justify-items:start !important;
  align-items:start !important;
  gap:10px !important;
  width:100% !important;
  margin-top:10px !important;
}

.report-inspection-photo-row .approval-photo-card,
.mini-photo-row .approval-photo-card,
.report-inspection-photo,
.user-report-photos .report-inspection-photo{
  width:100% !important;
  max-width:240px !important;
  min-height:176px !important;
  padding:8px !important;
  justify-self:start !important;
}

.report-inspection-photo-row .photo-thumb,
.report-inspection-photo-row .approval-photo-card .photo-thumb,
.mini-photo-row .photo-thumb,
.mini-photo-row .approval-photo-card .photo-thumb,
.report-inspection-photo{
  width:100% !important;
  max-width:224px !important;
  min-height:176px !important;
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
}

.report-inspection-photo-row .photo-thumb img,
.report-inspection-photo-row .approval-photo-card .photo-thumb img,
.mini-photo-row .photo-thumb img,
.mini-photo-row .approval-photo-card .photo-thumb img,
.report-inspection-photo img{
  width:100% !important;
  height:auto !important;
  max-height:336px !important;
  min-height:176px !important;
  object-fit:contain !important;
  object-position:center center !important;
  border-radius:10px !important;
}

.inspection-report .report-item,
.report-list-row{
  align-items:flex-start !important;
}

.inspection-report .report-item > div:first-child,
.report-list-row > div{
  flex:1 1 auto !important;
  min-width:0 !important;
}

@media (max-width:760px){
  .report-inspection-photo-row,
  .report-inspection-photo-row.align-left,
  .report-inspection-photo-row.align-right,
  .mini-photo-row,
  .user-report-photos{
    grid-template-columns:repeat(auto-fill, minmax(152px, 1fr)) !important;
    gap:8px !important;
  }

  .report-inspection-photo-row .approval-photo-card,
  .mini-photo-row .approval-photo-card,
  .report-inspection-photo,
  .user-report-photos .report-inspection-photo{
    max-width:100% !important;
    min-height:168px !important;
  }

  .report-inspection-photo-row .photo-thumb,
  .report-inspection-photo-row .approval-photo-card .photo-thumb,
  .mini-photo-row .photo-thumb,
  .mini-photo-row .approval-photo-card .photo-thumb,
  .report-inspection-photo{
    max-width:100% !important;
    min-height:168px !important;
  }

  .report-inspection-photo-row .photo-thumb img,
  .report-inspection-photo-row .approval-photo-card .photo-thumb img,
  .mini-photo-row .photo-thumb img,
  .mini-photo-row .approval-photo-card .photo-thumb img,
  .report-inspection-photo img{
    max-height:336px !important;
    min-height:168px !important;
  }
}


/* v101 Microsoft-style dashboard profile avatar */
body:not(.admin-body) .user-card{
  display:flex !important;
  align-items:center !important;
  gap:18px !important;
  padding:18px 20px !important;
  min-height:142px !important;
  border-radius:24px !important;
  background:rgba(255,255,255,.86) !important;
  border:1px solid #dbe4ef !important;
  box-shadow:0 10px 28px rgba(15,23,42,.06) !important;
  overflow:hidden !important;
}

body:not(.admin-body) .user-card .user-avatar-btn{
  width:112px !important;
  height:112px !important;
  min-width:112px !important;
  min-height:112px !important;
  max-width:112px !important;
  max-height:112px !important;
  flex:0 0 112px !important;
  padding:0 !important;
  margin:0 !important;
  border-radius:24px !important;
  overflow:hidden !important;
  background:#eef4ff !important;
  border:1px solid #d8e2f0 !important;
  box-shadow:0 8px 18px rgba(15,23,42,.10) !important;
  display:inline-flex !important;
  align-items:center !important;
  justify-content:center !important;
}

body:not(.admin-body) .user-card .user-avatar-btn .user-avatar,
body:not(.admin-body) .user-card .user-avatar-btn img,
body:not(.admin-body) .user-card .face-smart-avatar,
body:not(.admin-body) .user-card .face-smart-avatar.face-avatar-contain,
body:not(.admin-body) .user-card .face-smart-avatar.face-avatar-detected{
  width:112px !important;
  height:112px !important;
  min-width:112px !important;
  min-height:112px !important;
  max-width:112px !important;
  max-height:112px !important;
  border-radius:24px !important;
  display:block !important;
  object-fit:cover !important;
  object-position:center top !important;
  background:#eef4ff !important;
}

body:not(.admin-body) .user-card .user-avatar.placeholder{
  width:112px !important;
  height:112px !important;
  min-width:112px !important;
  min-height:112px !important;
  max-width:112px !important;
  max-height:112px !important;
  flex:0 0 112px !important;
  border-radius:24px !important;
  font-size:44px !important;
  background:#eef4ff !important;
}

body:not(.admin-body) .user-card > div:last-child{
  min-width:0 !important;
  flex:1 1 auto !important;
}

body:not(.admin-body) .user-card > div:last-child b{
  font-size:clamp(22px, 4.8vw, 32px) !important;
  line-height:1.15 !important;
  font-weight:800 !important;
  color:#111827 !important;
  letter-spacing:-.02em !important;
}

body:not(.admin-body) .user-card > div:last-child span{
  margin-top:6px !important;
  font-size:clamp(15px, 3.8vw, 20px) !important;
  line-height:1.35 !important;
  color:#667085 !important;
  font-weight:700 !important;
}

@media (max-width:430px){
  body:not(.admin-body) .user-card{
    gap:14px !important;
    padding:16px !important;
    min-height:128px !important;
    border-radius:22px !important;
  }

  body:not(.admin-body) .user-card .user-avatar-btn,
  body:not(.admin-body) .user-card .user-avatar-btn .user-avatar,
  body:not(.admin-body) .user-card .user-avatar-btn img,
  body:not(.admin-body) .user-card .face-smart-avatar,
  body:not(.admin-body) .user-card .face-smart-avatar.face-avatar-contain,
  body:not(.admin-body) .user-card .face-smart-avatar.face-avatar-detected,
  body:not(.admin-body) .user-card .user-avatar.placeholder{
    width:96px !important;
    height:96px !important;
    min-width:96px !important;
    min-height:96px !important;
    max-width:96px !important;
    max-height:96px !important;
    flex-basis:96px !important;
    border-radius:22px !important;
  }
}


/* v104 temporary history off + face photo overflow guard */
.readonly-identity-grid,
.identity-latest-grid,
.photo-grid-two,
.photo-grid,
.approval-photo-card,
.readonly-photo-card,
.identity-latest-card{
  max-width:100% !important;
  overflow:hidden !important;
  box-sizing:border-box !important;
}

.readonly-identity-grid img,
.identity-latest-grid img,
.photo-grid-two img,
.approval-photo-card img,
.readonly-photo-card img,
.identity-latest-card img,
.photo-thumb img{
  max-width:100% !important;
  width:100% !important;
  height:auto !important;
  object-fit:contain !important;
  box-sizing:border-box !important;
}

.readonly-identity-grid,
.photo-grid-two.readonly-identity-grid{
  grid-template-columns:repeat(auto-fit, minmax(180px, 1fr)) !important;
  gap:12px !important;
}

.disabled-row{
  cursor:default !important;
  pointer-events:none;
  opacity:.92;
}


/* v108 auto camera + compact live camera + ID card guide frame */
.live-camera-backdrop .live-camera-modal{
  width:90vw !important;
  max-width:720px !important;
  max-height:94vh !important;
}

.live-camera-backdrop .live-camera-body{
  max-height:calc(94vh - 58px) !important;
  overflow:auto !important;
}

.live-camera-backdrop .live-camera-box,
.live-camera-backdrop .camera-box{
  width:90% !important;
  max-width:90% !important;
  margin-left:auto !important;
  margin-right:auto !important;
  max-height:62vh !important;
}

.live-camera-backdrop video,
.live-camera-backdrop .preview-img{
  max-height:62vh !important;
  object-fit:contain !important;
}

.live-camera-backdrop .live-actions{
  position:sticky;
  bottom:0;
  background:rgba(255,255,255,.96);
  padding:8px 6px calc(8px + env(safe-area-inset-bottom));
  z-index:5;
}

.camera-guide-overlay{
  position:absolute;
  inset:0;
  pointer-events:none;
  z-index:3;
  display:none;
  align-items:center;
  justify-content:center;
}

.live-guide-id_card .camera-guide-overlay,
.live-guide-face .camera-guide-overlay{
  display:flex;
}

.id-card-guide{
  display:none;
  position:relative;
  width:78%;
  aspect-ratio:1.586/1;
  border:3px solid rgba(255,255,255,.96);
  border-radius:16px;
  box-shadow:0 0 0 999px rgba(0,0,0,.18), 0 0 0 2px rgba(15,108,189,.85) inset;
  background:rgba(15,108,189,.06);
}

.live-guide-id_card .id-card-guide{
  display:block;
}

.id-card-guide span,
.face-guide span{
  position:absolute;
  left:50%;
  transform:translateX(-50%);
  bottom:-34px;
  background:rgba(15,23,42,.84);
  color:#fff;
  font-size:13px;
  font-weight:800;
  padding:6px 10px;
  border-radius:999px;
  white-space:nowrap;
}

.id-card-face-guide{
  position:absolute;
  right:8.5%;
  top:18%;
  width:20%;
  height:34%;
  border:2px dashed rgba(255,255,255,.98);
  border-radius:999px 999px 45% 45%;
  box-shadow:0 0 0 2px rgba(15,108,189,.75);
  background:rgba(255,255,255,.08);
}

.face-guide{
  display:none;
  position:relative;
  width:46%;
  max-width:280px;
  aspect-ratio:3/4;
  border:3px solid rgba(255,255,255,.96);
  border-radius:999px 999px 42% 42%;
  box-shadow:0 0 0 999px rgba(0,0,0,.16), 0 0 0 2px rgba(15,108,189,.85) inset;
  background:rgba(15,108,189,.06);
}

.live-guide-face .face-guide{
  display:block;
}

.auto-camera-step .status.warn,
.auto-camera-step .message.warn{
  margin-top:8px;
}

@media (max-width:520px){
  .live-camera-backdrop .live-camera-modal{
    width:94vw !important;
  }
  .live-camera-backdrop .live-camera-box,
  .live-camera-backdrop .camera-box{
    width:90% !important;
    max-width:90% !important;
    max-height:56vh !important;
  }
  .live-camera-backdrop video,
  .live-camera-backdrop .preview-img{
    max-height:56vh !important;
  }
  .id-card-guide{
    width:84%;
    border-radius:12px;
  }
  .face-guide{
    width:54%;
  }
}


/* v108 selfie face oval overlay */
.live-guide-face .camera-guide-overlay{
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
  background:rgba(15,23,42,.42);
  z-index:4;
}

.live-guide-face .face-guide{
  display:block !important;
  position:relative;
  width:min(56vw, 310px) !important;
  height:min(72vh, 430px) !important;
  max-height:72% !important;
  aspect-ratio:auto !important;
  border:3px solid #34d399 !important;
  border-radius:50% / 48% !important;
  box-shadow:
    0 0 0 999px rgba(15,23,42,.38),
    0 0 0 6px rgba(16,185,129,.12),
    0 0 28px rgba(52,211,153,.38) !important;
  background:rgba(16,185,129,.035) !important;
}

.live-guide-face .face-guide::before{
  content:"";
  position:absolute;
  inset:9px 13px;
  border-left:2px dashed rgba(52,211,153,.95);
  border-right:2px dashed rgba(52,211,153,.95);
  border-radius:50% / 48%;
  opacity:.9;
}

.live-guide-face .face-guide::after{
  content:"";
  position:absolute;
  left:50%;
  top:50%;
  width:1px;
  height:76%;
  transform:translate(-50%,-50%);
  border-left:1px dashed rgba(255,255,255,.42);
}

.live-guide-face .face-guide span{
  position:absolute !important;
  left:50% !important;
  top:-62px !important;
  bottom:auto !important;
  transform:translateX(-50%) !important;
  background:rgba(15,23,42,.78) !important;
  color:#fff !important;
  font-size:15px !important;
  font-weight:800 !important;
  padding:9px 14px !important;
  border-radius:999px !important;
  white-space:nowrap !important;
  box-shadow:0 8px 18px rgba(0,0,0,.18) !important;
}

.live-guide-face .face-guide span::before{
  content:"ถ่ายภาพยืนยันตัวตน";
  display:block;
  text-align:center;
  font-size:16px;
  color:#fff;
  line-height:1.15;
}

.live-guide-face .face-guide span{
  font-size:0 !important;
}

.live-guide-face .face-guide span::after{
  content:"จัดใบหน้าให้อยู่ในกรอบ";
  display:block;
  text-align:center;
  font-size:13px;
  color:#fef08a;
  line-height:1.2;
  margin-top:3px;
}

.live-guide-face .live-camera-box::after,
.live-guide-face .camera-box::after{
  content:"มองตรง • ไม่ก้ม • ไม่เงย • ไม่บังใบหน้า";
  position:absolute;
  left:50%;
  bottom:18px;
  transform:translateX(-50%);
  z-index:6;
  background:rgba(15,23,42,.75);
  color:#fff;
  border:1px solid rgba(255,255,255,.22);
  padding:8px 12px;
  border-radius:999px;
  font-size:12px;
  font-weight:800;
  white-space:nowrap;
  box-shadow:0 8px 18px rgba(0,0,0,.18);
}

.live-guide-face #camV23Watermark{
  z-index:7;
  max-width:92%;
}

/* keep ID card guide unchanged, only face guide is changed */
.live-guide-id_card .camera-guide-overlay{
  background:transparent;
}

@media (max-width:520px){
  .live-guide-face .face-guide{
    width:58vw !important;
    height:58vh !important;
    max-height:390px !important;
  }

  .live-guide-face .face-guide span{
    top:-56px !important;
  }

  .live-guide-face .live-camera-box::after,
  .live-guide-face .camera-box::after{
    bottom:12px;
    font-size:11px;
    padding:7px 10px;
  }
}

@media (max-height:720px){
  .live-guide-face .face-guide{
    height:55vh !important;
  }

  .live-guide-face .face-guide span{
    top:-50px !important;
  }
}


/* v108 face capture UI - match sample */
.live-camera-backdrop.live-guide-face{
  background:#6f7378 !important;
  backdrop-filter:none !important;
  align-items:stretch !important;
  justify-content:center !important;
  padding:0 !important;
}

.live-guide-face .live-camera-modal{
  width:100vw !important;
  height:100vh !important;
  max-width:none !important;
  max-height:none !important;
  margin:0 !important;
  border-radius:0 !important;
  background:#6f7378 !important;
  box-shadow:none !important;
  overflow:hidden !important;
  position:relative !important;
  color:#fff !important;
}

.live-guide-face .image-modal-head{
  display:none !important;
}

.live-guide-face .face-close-x{
  position:absolute !important;
  right:18px !important;
  top:16px !important;
  z-index:30 !important;
  width:34px !important;
  height:34px !important;
  min-width:34px !important;
  min-height:34px !important;
  border:0 !important;
  background:transparent !important;
  color:#fff !important;
  font-size:30px !important;
  font-weight:300 !important;
  line-height:1 !important;
  padding:0 !important;
  border-radius:0 !important;
}

.live-guide-face .face-sample-top{
  position:absolute !important;
  left:0 !important;
  right:0 !important;
  top:56px !important;
  z-index:25 !important;
  text-align:center !important;
  color:#fff !important;
  pointer-events:none !important;
}

.live-guide-face .face-sample-top b{
  display:block !important;
  font-size:15px !important;
  line-height:1.2 !important;
  font-weight:700 !important;
  color:#fff !important;
}

.live-guide-face .face-sample-top span{
  display:block !important;
  margin-top:5px !important;
  font-size:13px !important;
  line-height:1.2 !important;
  font-weight:700 !important;
  color:#34d399 !important;
}

.live-guide-face .live-camera-body{
  height:100vh !important;
  max-height:100vh !important;
  overflow:hidden !important;
  padding:0 !important;
  display:flex !important;
  flex-direction:column !important;
  align-items:center !important;
  justify-content:center !important;
}

.live-guide-face .live-camera-box,
.live-guide-face .camera-box{
  position:absolute !important;
  inset:0 !important;
  width:100% !important;
  max-width:none !important;
  height:100% !important;
  max-height:none !important;
  margin:0 !important;
  border-radius:0 !important;
  background:#6f7378 !important;
  overflow:hidden !important;
  border:0 !important;
  box-shadow:none !important;
}

.live-guide-face video,
.live-guide-face .preview-img{
  width:100% !important;
  height:100% !important;
  max-height:none !important;
  object-fit:cover !important;
  object-position:center center !important;
  border-radius:0 !important;
  transform:none !important;
}

.live-guide-face .camera-guide-overlay{
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
  background:rgba(80,84,88,.34) !important;
  z-index:8 !important;
}

.live-guide-face .face-guide{
  display:block !important;
  position:relative !important;
  width:min(72vw, 310px) !important;
  height:min(62vh, 435px) !important;
  max-height:62vh !important;
  border:3px solid #34d399 !important;
  border-radius:50% / 46% !important;
  background:rgba(16,185,129,.03) !important;
  box-shadow:0 0 0 999px rgba(78,82,86,.38), 0 0 0 4px rgba(52,211,153,.12) !important;
}

.live-guide-face .face-guide::before{
  content:"" !important;
  position:absolute !important;
  inset:9px 14px !important;
  border-left:2px dashed rgba(52,211,153,.95) !important;
  border-right:2px dashed rgba(52,211,153,.95) !important;
  border-radius:50% / 46% !important;
  opacity:.95 !important;
}

.live-guide-face .face-guide::after{
  content:"" !important;
  position:absolute !important;
  left:50% !important;
  top:50% !important;
  width:1px !important;
  height:76% !important;
  transform:translate(-50%,-50%) !important;
  border-left:1px dashed rgba(255,255,255,.32) !important;
}

.live-guide-face .face-guide span{
  display:none !important;
}

.live-guide-face #camV23Watermark{
  left:14px !important;
  right:14px !important;
  bottom:104px !important;
  z-index:20 !important;
  max-width:calc(100% - 28px) !important;
  font-size:9px !important;
  opacity:.75 !important;
}

.live-guide-face .face-sample-bottom{
  position:absolute !important;
  left:0 !important;
  right:0 !important;
  bottom:86px !important;
  z-index:25 !important;
  text-align:center !important;
  color:#fff !important;
  pointer-events:none !important;
}

.live-guide-face .face-sample-bottom b{
  display:block !important;
  font-size:10px !important;
  line-height:1.2 !important;
  font-weight:700 !important;
  color:#fff !important;
}

.live-guide-face .face-sample-bottom span{
  display:block !important;
  margin-top:16px !important;
  font-size:10px !important;
  color:rgba(255,255,255,.78) !important;
}

.live-guide-face .live-actions{
  position:absolute !important;
  left:0 !important;
  right:0 !important;
  bottom:22px !important;
  z-index:28 !important;
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
  gap:12px !important;
  background:transparent !important;
  padding:0 18px calc(env(safe-area-inset-bottom)) !important;
}

.live-guide-face .live-actions button{
  min-height:44px !important;
  height:44px !important;
  border-radius:999px !important;
  padding:0 20px !important;
  font-weight:800 !important;
  box-shadow:0 10px 22px rgba(0,0,0,.18) !important;
}

.live-guide-face #camV23Shot{
  min-width:136px !important;
  background:#fff !important;
  color:#111827 !important;
  border:2px solid rgba(255,255,255,.88) !important;
}

.live-guide-face #camV23Use{
  background:#34d399 !important;
  color:#052e1b !important;
  border:0 !important;
}

.live-guide-face #camV23Retake{
  background:rgba(255,255,255,.18) !important;
  color:#fff !important;
  border:1px solid rgba(255,255,255,.42) !important;
}

.live-guide-face #camV23Out{
  position:absolute !important;
  left:14px !important;
  right:14px !important;
  bottom:144px !important;
  z-index:26 !important;
  pointer-events:none !important;
}

.live-guide-face #camV23Out .status,
.live-guide-face #camV23Out .message{
  margin:0 auto !important;
  max-width:320px !important;
  border-radius:999px !important;
  text-align:center !important;
  font-size:11px !important;
  padding:7px 10px !important;
  border:0 !important;
  background:rgba(15,23,42,.68) !important;
  color:#fff !important;
}

.live-guide-face .live-camera-box::after,
.live-guide-face .camera-box::after{
  display:none !important;
}

@media (max-width:430px){
  .live-guide-face .face-sample-top{
    top:54px !important;
  }
  .live-guide-face .face-guide{
    width:72vw !important;
    height:60vh !important;
    max-height:430px !important;
  }
  .live-guide-face .face-sample-bottom{
    bottom:84px !important;
  }
}

@media (max-height:720px){
  .live-guide-face .face-sample-top{
    top:42px !important;
  }
  .live-guide-face .face-guide{
    height:56vh !important;
  }
  .live-guide-face #camV23Watermark{
    bottom:96px !important;
  }
  .live-guide-face .face-sample-bottom{
    bottom:76px !important;
  }
  .live-guide-face .live-actions{
    bottom:14px !important;
  }
}

/* v110 face capture UI compact fix - driver/contractor/supervisor */
.live-camera-backdrop.live-guide-face{
  background:rgba(15,23,42,.58) !important;
  backdrop-filter:blur(2px) !important;
  align-items:center !important;
  justify-content:center !important;
  padding:10px !important;
  overflow:hidden !important;
}

.live-guide-face .live-camera-modal{
  width:min(94vw, 430px) !important;
  height:min(94dvh, 760px) !important;
  max-width:430px !important;
  max-height:94dvh !important;
  margin:0 auto !important;
  border-radius:22px !important;
  background:#ffffff !important;
  color:#0f172a !important;
  box-shadow:0 22px 60px rgba(0,0,0,.35) !important;
  overflow:hidden !important;
  position:relative !important;
  display:flex !important;
  flex-direction:column !important;
}

.live-guide-face .image-modal-head{
  display:flex !important;
  min-height:46px !important;
  padding:12px 48px 10px 16px !important;
  align-items:center !important;
  border-bottom:1px solid rgba(148,163,184,.24) !important;
  background:#fff !important;
  color:#0f172a !important;
}

.live-guide-face .face-close-x{
  right:12px !important;
  top:9px !important;
  width:32px !important;
  height:32px !important;
  min-width:32px !important;
  min-height:32px !important;
  border-radius:999px !important;
  background:#f1f5f9 !important;
  color:#334155 !important;
  font-size:24px !important;
  font-weight:500 !important;
  z-index:40 !important;
}

.live-guide-face .face-sample-top{
  position:static !important;
  z-index:auto !important;
  padding:10px 16px 6px !important;
  text-align:center !important;
  color:#0f172a !important;
  background:#fff !important;
}

.live-guide-face .face-sample-top b{
  font-size:14px !important;
  color:#0f172a !important;
}

.live-guide-face .face-sample-top span{
  margin-top:3px !important;
  font-size:12px !important;
  color:#047857 !important;
}

.live-guide-face .live-camera-body{
  height:auto !important;
  max-height:none !important;
  min-height:0 !important;
  flex:1 1 auto !important;
  overflow:auto !important;
  padding:0 12px 12px !important;
  display:flex !important;
  flex-direction:column !important;
  align-items:stretch !important;
  justify-content:flex-start !important;
  background:#fff !important;
  gap:8px !important;
}

.live-guide-face .live-camera-box,
.live-guide-face .camera-box{
  position:relative !important;
  inset:auto !important;
  width:100% !important;
  max-width:100% !important;
  height:auto !important;
  aspect-ratio:3 / 4 !important;
  max-height:calc(94dvh - 220px) !important;
  min-height:0 !important;
  margin:0 auto !important;
  border-radius:18px !important;
  background:#111827 !important;
  overflow:hidden !important;
  border:0 !important;
  box-shadow:0 10px 26px rgba(15,23,42,.18) !important;
  flex:0 0 auto !important;
}

.live-guide-face video,
.live-guide-face .preview-img{
  width:100% !important;
  height:100% !important;
  max-height:none !important;
  object-fit:cover !important;
  object-position:center center !important;
  border-radius:18px !important;
}

.live-guide-face .camera-guide-overlay{
  background:rgba(15,23,42,.24) !important;
  z-index:8 !important;
}

.live-guide-face .face-guide{
  width:58% !important;
  height:66% !important;
  max-width:230px !important;
  max-height:330px !important;
  min-width:155px !important;
  min-height:220px !important;
  border:3px solid #34d399 !important;
  border-radius:50% / 46% !important;
  box-shadow:0 0 0 999px rgba(15,23,42,.18), 0 0 0 4px rgba(52,211,153,.12) !important;
}

.live-guide-face .face-guide::before{
  inset:8px 12px !important;
}

.live-guide-face .face-guide span{
  display:none !important;
}

.live-guide-face #camV23Watermark{
  left:10px !important;
  right:10px !important;
  bottom:10px !important;
  max-width:calc(100% - 20px) !important;
  z-index:20 !important;
  font-size:8px !important;
  line-height:1.25 !important;
  opacity:.82 !important;
}

.live-guide-face .face-sample-bottom{
  position:static !important;
  padding:0 4px !important;
  color:#475569 !important;
  text-align:center !important;
  background:#fff !important;
}

.live-guide-face .face-sample-bottom b{
  display:none !important;
}

.live-guide-face .face-sample-bottom span{
  margin-top:0 !important;
  font-size:11px !important;
  color:#64748b !important;
}

.live-guide-face #camV23Out{
  position:static !important;
  left:auto !important;
  right:auto !important;
  bottom:auto !important;
  z-index:auto !important;
  pointer-events:auto !important;
}

.live-guide-face #camV23Out .status,
.live-guide-face #camV23Out .message{
  max-width:none !important;
  border-radius:12px !important;
  font-size:11px !important;
  padding:7px 10px !important;
}

.live-guide-face .live-actions{
  position:sticky !important;
  left:auto !important;
  right:auto !important;
  bottom:0 !important;
  z-index:28 !important;
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
  gap:8px !important;
  background:rgba(255,255,255,.96) !important;
  padding:8px 4px calc(8px + env(safe-area-inset-bottom)) !important;
  margin:0 -4px -4px !important;
}

.live-guide-face .live-actions button{
  min-height:42px !important;
  height:42px !important;
  border-radius:999px !important;
  padding:0 16px !important;
  font-size:13px !important;
  font-weight:800 !important;
  box-shadow:none !important;
}

.live-guide-face #camV23Shot{
  min-width:132px !important;
  background:#0f6cbd !important;
  color:#fff !important;
  border:0 !important;
}

.live-guide-face #camV23Use{
  background:#16a34a !important;
  color:#fff !important;
  border:0 !important;
}

.live-guide-face #camV23Retake{
  background:#f1f5f9 !important;
  color:#334155 !important;
  border:1px solid #cbd5e1 !important;
}

@media (max-width:430px){
  .live-camera-backdrop.live-guide-face{padding:6px !important;}
  .live-guide-face .live-camera-modal{width:calc(100vw - 12px) !important;height:min(94dvh, 720px) !important;border-radius:18px !important;}
  .live-guide-face .live-camera-body{padding:0 10px 10px !important;gap:7px !important;}
  .live-guide-face .live-camera-box,
  .live-guide-face .camera-box{max-height:calc(94dvh - 215px) !important;border-radius:16px !important;}
  .live-guide-face video,
  .live-guide-face .preview-img{border-radius:16px !important;}
  .live-guide-face .face-guide{width:60% !important;height:64% !important;min-width:145px !important;min-height:205px !important;}
}

@media (max-height:680px){
  .live-guide-face .live-camera-modal{height:96dvh !important;max-height:96dvh !important;}
  .live-guide-face .image-modal-head{min-height:40px !important;padding-top:9px !important;padding-bottom:8px !important;}
  .live-guide-face .face-sample-top{padding:6px 12px 4px !important;}
  .live-guide-face .face-sample-bottom{display:none !important;}
  .live-guide-face .live-camera-box,
  .live-guide-face .camera-box{max-height:calc(96dvh - 175px) !important;}
  .live-guide-face .live-actions button{height:40px !important;min-height:40px !important;}
}


/* v111 Face Camera Frame Fix */
.camera-modal .camera-wrap,
.camera-preview-wrap,
.live-camera-wrap{
    width:min(360px,90vw)!important;
    max-width:360px!important;
    margin:0 auto!important;
}
.camera-modal video,
.camera-preview-wrap video,
.live-camera-wrap video{
    width:100%!important;
    height:420px!important;
    max-height:55vh!important;
    object-fit:cover!important;
    border-radius:24px!important;
    border:3px solid #ffffff!important;
}
.camera-modal-content,
.camera-container{
    max-width:420px!important;
    margin:0 auto!important;
}
.face-guide-frame{
    width:260px!important;
    height:320px!important;
    border:4px solid #22c55e!important;
    border-radius:24px!important;
    position:absolute!important;
    left:50%!important;
    top:50%!important;
    transform:translate(-50%,-50%)!important;
    pointer-events:none!important;
}

/* v112 Dashboard cleanup: keep Dashboard compact, move identity photos to identity menu */
.dashboard-start-panel{
  margin:14px 0 12px;
  padding:14px;
  border:1px solid #e5e7eb;
  border-radius:18px;
  background:#f8fafc;
}
.dashboard-start-title{
  font-size:18px;
  font-weight:900;
  margin-bottom:10px;
  color:#0f172a;
}
.dashboard-start-grid{
  display:grid;
  grid-template-columns:1fr;
  gap:10px;
}
.dashboard-start-btn{
  width:100%;
  text-align:left;
  border:1px solid #dbeafe;
  background:#fff;
  border-radius:16px;
  padding:14px 16px;
  min-height:74px;
  box-shadow:0 8px 20px rgba(15,23,42,.06);
}
.dashboard-start-btn b{
  display:block;
  font-size:16px;
  color:#0f172a;
  margin-bottom:4px;
}
.dashboard-start-btn span{
  display:block;
  font-size:13px;
  color:#64748b;
}
.identity-page .identity-latest-grid{
  margin-top:12px;
}
.identity-page .identity-latest-card img{
  max-height:360px;
  object-fit:contain;
  background:#0f172a;
}
@media (min-width:720px){
  .dashboard-start-grid{grid-template-columns:repeat(3,1fr);}
}
@media (max-width:430px){
  .bottom-nav .nav-btn{font-size:11px;}
  .bottom-nav .nav-btn span{font-size:18px;}
  .dashboard-start-panel{padding:12px;}
}


/* v113 Dashboard mobile UX standard */
body:not(.admin-body) .app-shell{
  width:100%;
  max-width:640px;
  margin:0 auto;
  padding-left:14px;
  padding-right:14px;
}
body:not(.admin-body) .dashboard-page{
  display:block;
  width:100%;
}
body:not(.admin-body) .dashboard-page .card,
body:not(.admin-body) .dashboard-start-panel{
  margin:12px 0;
  border-radius:22px;
  box-shadow:0 10px 28px rgba(15,23,42,.07);
}
body:not(.admin-body) .dashboard-hero{
  padding:14px;
}
body:not(.admin-body) .dashboard-profile-card{
  padding:8px;
  margin:0 0 12px;
  border-radius:18px;
  background:#ffffff;
}
body:not(.admin-body) .dashboard-profile-card .user-avatar,
body:not(.admin-body) .dashboard-profile-card .user-avatar-btn,
body:not(.admin-body) .dashboard-profile-card .user-avatar-btn img{
  width:56px!important;
  height:56px!important;
  min-width:56px!important;
  border-radius:16px!important;
}
body:not(.admin-body) .dashboard-profile-card b{
  font-size:20px!important;
  line-height:1.15;
}
body:not(.admin-body) .dashboard-profile-card span{
  font-size:13px!important;
  line-height:1.35;
}
body:not(.admin-body) .dashboard-title-row{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:10px;
  margin-top:2px;
}
body:not(.admin-body) .dashboard-title-row span,
body:not(.admin-body) .dashboard-section-head span{
  display:block;
  color:#64748b;
  font-size:12px;
  font-weight:800;
  letter-spacing:.02em;
}
body:not(.admin-body) .dashboard-title-row h1{
  margin:0;
  font-size:24px;
  line-height:1.15;
  color:#0f172a;
}
body:not(.admin-body) .plate-chip{
  padding:7px 10px;
  border-radius:999px;
  background:#eff6ff;
  color:#1d4ed8;
  border:1px solid #bfdbfe;
  font-size:12px;
  font-weight:900;
  white-space:nowrap;
}
body:not(.admin-body) .dashboard-start-panel{
  padding:14px;
  border:1px solid #dbeafe;
  background:#ffffff;
}
body:not(.admin-body) .dashboard-section-head{
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-bottom:10px;
}
body:not(.admin-body) .dashboard-section-head b{
  display:block;
  color:#0f172a;
  font-size:20px;
  line-height:1.2;
}
body:not(.admin-body) .dashboard-start-grid{
  display:grid!important;
  grid-template-columns:1fr!important;
  gap:10px!important;
  width:100%;
}
body:not(.admin-body) .dashboard-start-btn{
  width:100%;
  min-height:72px;
  display:grid;
  grid-template-columns:46px 1fr auto;
  align-items:center;
  gap:12px;
  text-align:left;
  padding:12px;
  border-radius:18px;
  border:1px solid #e2e8f0;
  background:#fff;
  box-shadow:0 6px 18px rgba(15,23,42,.06);
}
body:not(.admin-body) .dashboard-start-btn.primary-action{
  border-color:#bfdbfe;
  background:#ffffff;
}
body:not(.admin-body) .dashboard-start-btn .action-icon{
  width:46px;
  height:46px;
  border-radius:16px;
  display:grid;
  place-items:center;
  background:#eff6ff;
  font-size:24px;
}
body:not(.admin-body) .dashboard-start-btn .action-copy b{
  display:block;
  font-size:16px;
  line-height:1.2;
  color:#0f172a;
  margin:0 0 3px;
}
body:not(.admin-body) .dashboard-start-btn .action-copy small{
  display:block;
  color:#64748b;
  font-size:12px;
  line-height:1.35;
}
body:not(.admin-body) .dashboard-start-btn em{
  font-style:normal;
  color:#1d4ed8;
  font-size:12px;
  font-weight:900;
  padding:6px 10px;
  border-radius:999px;
  background:#dbeafe;
}
body:not(.admin-body) .dashboard-summary-card{
  padding:14px;
}
body:not(.admin-body) .metric-grid{
  grid-template-columns:repeat(2,1fr)!important;
  gap:10px!important;
}
body:not(.admin-body) .metric-card{
  min-height:72px;
  padding:12px;
  border-radius:16px;
  background:#f8fafc;
}
body:not(.admin-body) .metric-card span{
  font-size:12px;
  line-height:1.25;
}
body:not(.admin-body) .metric-card b{
  font-size:24px;
}
body:not(.admin-body) .bottom-nav{
  grid-template-columns:repeat(5,1fr)!important;
  width:min(620px,calc(100% - 20px));
  gap:4px;
  padding:8px;
  border-radius:22px;
}
body:not(.admin-body) .bottom-nav .nav-btn{
  width:100%;
  min-width:0;
  padding:8px 2px;
  border-radius:16px;
  overflow:hidden;
}
body:not(.admin-body) .bottom-nav .nav-btn span{
  font-size:19px;
}
body:not(.admin-body) .bottom-nav .nav-btn b{
  display:block;
  max-width:100%;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  font-size:10px;
}
@media (max-width:390px){
  body:not(.admin-body) .dashboard-title-row{align-items:flex-start;flex-direction:column;}
  body:not(.admin-body) .plate-chip{white-space:normal;}
  body:not(.admin-body) .metric-grid{grid-template-columns:1fr 1fr!important;}
  body:not(.admin-body) .dashboard-start-btn{grid-template-columns:42px 1fr auto;gap:9px;padding:10px;}
  body:not(.admin-body) .dashboard-start-btn .action-icon{width:42px;height:42px;font-size:22px;}
}


/* v114: split camera modal UI by use-case (face / id card / evidence). Evidence must never show identity copy. */
.live-camera-backdrop.live-mode-evidence .face-guide,
.live-camera-backdrop.live-mode-evidence .id-card-guide,
.live-camera-backdrop.live-mode-evidence .face-guide::before,
.live-camera-backdrop.live-mode-evidence .face-guide::after,
.live-camera-backdrop.live-mode-evidence .id-card-face-guide{
  display:none !important;
}
.live-camera-backdrop.live-mode-evidence .evidence-guide{
  display:block !important;
  position:absolute !important;
  inset:10px !important;
  border:2px dashed rgba(255,255,255,.72) !important;
  border-radius:18px !important;
  pointer-events:none !important;
  box-shadow:0 0 0 999px rgba(15,23,42,.08) !important;
}
.live-camera-backdrop.live-mode-evidence .evidence-guide span{
  position:absolute !important;
  left:50% !important;
  top:10px !important;
  transform:translateX(-50%) !important;
  background:rgba(15,23,42,.72) !important;
  color:#fff !important;
  font-size:12px !important;
  font-weight:800 !important;
  padding:6px 10px !important;
  border-radius:999px !important;
  white-space:nowrap !important;
}
.live-camera-backdrop.live-mode-evidence .live-camera-modal{
  width:min(94vw, 760px) !important;
  max-height:92dvh !important;
  overflow:hidden !important;
}
.live-camera-backdrop.live-mode-evidence .live-camera-body{
  padding:12px 16px 14px !important;
  gap:10px !important;
  max-height:calc(92dvh - 58px) !important;
  overflow:auto !important;
}
.live-camera-backdrop.live-mode-evidence .live-camera-box,
.live-camera-backdrop.live-mode-evidence .camera-box{
  width:100% !important;
  max-width:680px !important;
  aspect-ratio:4 / 3 !important;
  height:auto !important;
  max-height:54dvh !important;
  margin:0 auto !important;
  border-radius:18px !important;
  background:#111827 !important;
  overflow:hidden !important;
}
.live-camera-backdrop.live-mode-evidence video,
.live-camera-backdrop.live-mode-evidence .preview-img{
  width:100% !important;
  height:100% !important;
  max-height:none !important;
  object-fit:contain !important;
  object-position:center center !important;
  border-radius:18px !important;
  background:#000 !important;
}
.live-camera-backdrop.live-mode-evidence .face-sample-top,
.live-camera-backdrop.live-mode-evidence .face-sample-bottom{
  position:static !important;
  color:#0f172a !important;
  text-align:left !important;
  background:#fff !important;
  pointer-events:auto !important;
  padding:0 !important;
}
.live-camera-backdrop.live-mode-evidence .face-sample-top b,
.live-camera-backdrop.live-mode-evidence .face-sample-bottom b{
  display:block !important;
  color:#0f172a !important;
  font-size:15px !important;
  line-height:1.25 !important;
}
.live-camera-backdrop.live-mode-evidence .face-sample-top span,
.live-camera-backdrop.live-mode-evidence .face-sample-bottom span{
  display:block !important;
  color:#475569 !important;
  font-size:13px !important;
  margin-top:3px !important;
}
.live-camera-backdrop.live-mode-evidence .live-actions{
  position:static !important;
  background:#fff !important;
  padding:8px 0 0 !important;
  justify-content:flex-end !important;
}
.live-camera-backdrop.live-mode-id-card .face-guide,
.live-camera-backdrop.live-mode-id-card .evidence-guide{
  display:none !important;
}
.live-camera-backdrop.live-mode-face .id-card-guide,
.live-camera-backdrop.live-mode-face .evidence-guide{
  display:none !important;
}
@media (max-width:520px){
  .live-camera-backdrop.live-mode-evidence .live-camera-modal{
    width:94vw !important;
    border-radius:18px !important;
  }
  .live-camera-backdrop.live-mode-evidence .live-camera-body{
    padding:10px 12px 12px !important;
    max-height:calc(92dvh - 52px) !important;
  }
  .live-camera-backdrop.live-mode-evidence .live-camera-box,
  .live-camera-backdrop.live-mode-evidence .camera-box{
    max-width:100% !important;
    max-height:48dvh !important;
    aspect-ratio:4 / 3 !important;
  }
  .live-camera-backdrop.live-mode-evidence .live-actions{
    display:grid !important;
    grid-template-columns:1fr 1fr 1fr !important;
    gap:8px !important;
  }
  .live-camera-backdrop.live-mode-evidence .live-actions button{
    width:100% !important;
    min-width:0 !important;
    padding:11px 8px !important;
  }
}

/* v116: Evidence camera is fully separated from face/id-card UI. Fix blank/black preview and remove duplicated identity copy. */
.live-camera-backdrop.live-mode-evidence .image-modal-head.evidence-modal-head{
  display:flex !important;
  align-items:center !important;
  min-height:46px !important;
  padding:12px 18px !important;
  border-bottom:1px solid #e5e7eb !important;
  background:#fff !important;
  color:#0f172a !important;
}
.live-camera-backdrop.live-mode-evidence .evidence-camera-body{
  padding:14px !important;
  gap:12px !important;
  background:#fff !important;
}
.live-camera-backdrop.live-mode-evidence .evidence-instruction,
.live-camera-backdrop.live-mode-evidence .evidence-note{
  background:#fff !important;
  color:#0f172a !important;
  padding:0 !important;
  margin:0 !important;
  line-height:1.35 !important;
}
.live-camera-backdrop.live-mode-evidence .evidence-instruction b,
.live-camera-backdrop.live-mode-evidence .evidence-note b{
  display:block !important;
  font-size:16px !important;
  font-weight:900 !important;
  color:#0f172a !important;
}
.live-camera-backdrop.live-mode-evidence .evidence-instruction span,
.live-camera-backdrop.live-mode-evidence .evidence-note span{
  display:block !important;
  margin-top:4px !important;
  font-size:14px !important;
  color:#475569 !important;
}
.live-camera-backdrop.live-mode-evidence .evidence-camera-box{
  aspect-ratio:4 / 3 !important;
  height:auto !important;
  min-height:0 !important;
  max-height:46dvh !important;
  background:#000 !important;
}
.live-camera-backdrop.live-mode-evidence .evidence-camera-box video,
.live-camera-backdrop.live-mode-evidence .evidence-camera-box .preview-img{
  display:block !important;
  width:100% !important;
  height:100% !important;
  object-fit:cover !important;
  object-position:center center !important;
  background:#000 !important;
}
.live-camera-backdrop.live-mode-evidence .evidence-camera-box .live-watermark{
  max-height:38% !important;
  overflow:hidden !important;
  font-size:12px !important;
  line-height:1.25 !important;
}
.live-camera-backdrop.live-mode-evidence .face-sample-top,
.live-camera-backdrop.live-mode-evidence .face-sample-bottom{
  display:none !important;
}
@media(max-width:520px){
  .live-camera-backdrop.live-mode-evidence .evidence-camera-body{padding:12px !important;gap:10px !important;}
  .live-camera-backdrop.live-mode-evidence .evidence-camera-box{max-height:42dvh !important;}
  .live-camera-backdrop.live-mode-evidence .evidence-instruction b,
  .live-camera-backdrop.live-mode-evidence .evidence-note b{font-size:15px !important;}
  .live-camera-backdrop.live-mode-evidence .evidence-instruction span,
  .live-camera-backdrop.live-mode-evidence .evidence-note span{font-size:13px !important;}
}


/* v117: Evidence camera full-frame layout. No fixed 4:3. Make live camera/preview large and fill the available modal area. */
.live-camera-backdrop.live-mode-evidence .live-camera-modal{
  width:min(96vw, 820px) !important;
  height:min(94dvh, 860px) !important;
  max-height:94dvh !important;
  display:flex !important;
  flex-direction:column !important;
  overflow:hidden !important;
}
.live-camera-backdrop.live-mode-evidence .image-modal-head.evidence-modal-head{
  flex:0 0 auto !important;
  min-height:42px !important;
  padding:9px 16px !important;
}
.live-camera-backdrop.live-mode-evidence .evidence-camera-body{
  flex:1 1 auto !important;
  min-height:0 !important;
  display:flex !important;
  flex-direction:column !important;
  padding:10px 14px 12px !important;
  gap:8px !important;
  overflow:hidden !important;
}
.live-camera-backdrop.live-mode-evidence .evidence-instruction{
  flex:0 0 auto !important;
  display:block !important;
}
.live-camera-backdrop.live-mode-evidence .evidence-instruction b{
  font-size:15px !important;
  line-height:1.2 !important;
}
.live-camera-backdrop.live-mode-evidence .evidence-instruction span{
  font-size:12px !important;
  line-height:1.25 !important;
  margin-top:2px !important;
}
.live-camera-backdrop.live-mode-evidence .evidence-note{
  flex:0 0 auto !important;
  padding:0 !important;
  margin:0 !important;
}
.live-camera-backdrop.live-mode-evidence .evidence-note b{
  font-size:14px !important;
  line-height:1.2 !important;
}
.live-camera-backdrop.live-mode-evidence .evidence-note span{
  font-size:12px !important;
  line-height:1.25 !important;
  margin-top:2px !important;
}
.live-camera-backdrop.live-mode-evidence .evidence-camera-box,
.live-camera-backdrop.live-mode-evidence .evidence-camera-box.evidence-full-frame{
  flex:1 1 auto !important;
  width:100% !important;
  max-width:none !important;
  height:auto !important;
  min-height:300px !important;
  max-height:none !important;
  aspect-ratio:auto !important;
  margin:0 auto !important;
  border-radius:18px !important;
  background:#000 !important;
  overflow:hidden !important;
}
.live-camera-backdrop.live-mode-evidence .evidence-camera-box video,
.live-camera-backdrop.live-mode-evidence .evidence-camera-box .preview-img{
  width:100% !important;
  height:100% !important;
  max-height:none !important;
  object-fit:cover !important;
  object-position:center center !important;
  border-radius:18px !important;
  background:#000 !important;
}
.live-camera-backdrop.live-mode-evidence .evidence-guide{
  inset:8px !important;
  border-radius:16px !important;
}
.live-camera-backdrop.live-mode-evidence .evidence-guide span{
  display:none !important;
}
.live-camera-backdrop.live-mode-evidence .evidence-camera-box .live-watermark{
  max-height:32% !important;
  font-size:11px !important;
  line-height:1.18 !important;
  padding:8px 10px !important;
}
.live-camera-backdrop.live-mode-evidence #evidenceCamOut{
  flex:0 0 auto !important;
}
.live-camera-backdrop.live-mode-evidence #evidenceCamOut .status,
.live-camera-backdrop.live-mode-evidence #evidenceCamOut .message{
  padding:8px 10px !important;
  font-size:13px !important;
  line-height:1.25 !important;
}
.live-camera-backdrop.live-mode-evidence .live-actions{
  flex:0 0 auto !important;
  display:grid !important;
  grid-template-columns:1fr 1fr 1fr !important;
  gap:8px !important;
  padding:4px 0 0 !important;
  margin:0 !important;
}
.live-camera-backdrop.live-mode-evidence .live-actions button{
  width:100% !important;
  min-width:0 !important;
  min-height:46px !important;
  height:46px !important;
  padding:8px !important;
  border-radius:16px !important;
  font-size:15px !important;
  justify-content:center !important;
}
@media(max-width:520px){
  .live-camera-backdrop.live-mode-evidence{padding:8px !important;}
  .live-camera-backdrop.live-mode-evidence .live-camera-modal{
    width:calc(100vw - 16px) !important;
    height:calc(100dvh - 28px) !important;
    max-height:calc(100dvh - 28px) !important;
    border-radius:18px !important;
  }
  .live-camera-backdrop.live-mode-evidence .evidence-camera-body{
    padding:8px 10px 10px !important;
    gap:7px !important;
  }
  .live-camera-backdrop.live-mode-evidence .evidence-camera-box,
  .live-camera-backdrop.live-mode-evidence .evidence-camera-box.evidence-full-frame{
    min-height:360px !important;
    border-radius:18px !important;
  }
  .live-camera-backdrop.live-mode-evidence .evidence-instruction span,
  .live-camera-backdrop.live-mode-evidence .evidence-note span{
    display:none !important;
  }
  .live-camera-backdrop.live-mode-evidence .live-actions button{
    min-height:44px !important;
    height:44px !important;
    font-size:14px !important;
  }
}
@media(max-height:760px){
  .live-camera-backdrop.live-mode-evidence .evidence-note{display:none !important;}
  .live-camera-backdrop.live-mode-evidence .evidence-camera-box,
  .live-camera-backdrop.live-mode-evidence .evidence-camera-box.evidence-full-frame{min-height:280px !important;}
}

/* v118: Evidence Camera rebuilt from scratch. Does not use legacy live-camera modal classes. */
.evidence-v118-backdrop{
  position:fixed !important;
  inset:0 !important;
  z-index:999999 !important;
  background:rgba(15,23,42,.72) !important;
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
  padding:10px !important;
  box-sizing:border-box !important;
}
.evidence-v118-sheet{
  width:min(100%, 520px) !important;
  height:min(94dvh, 860px) !important;
  max-height:94dvh !important;
  background:#fff !important;
  border-radius:26px !important;
  overflow:hidden !important;
  display:grid !important;
  grid-template-rows:auto minmax(0,1fr) auto auto !important;
  box-shadow:0 28px 80px rgba(15,23,42,.38) !important;
  border:1px solid rgba(226,232,240,.95) !important;
}
.evidence-v118-topbar{
  display:flex !important;
  align-items:center !important;
  justify-content:space-between !important;
  gap:12px !important;
  padding:14px 16px !important;
  background:linear-gradient(180deg,#f8fafc,#eef5ff) !important;
  border-bottom:1px solid #e5e7eb !important;
}
.evidence-v118-topbar b{
  display:block !important;
  font-size:20px !important;
  line-height:1.2 !important;
  color:#0f172a !important;
}
.evidence-v118-topbar span{
  display:block !important;
  margin-top:4px !important;
  font-size:13px !important;
  line-height:1.25 !important;
  color:#64748b !important;
}
.evidence-v118-close{
  flex:0 0 42px !important;
  width:42px !important;
  height:42px !important;
  border:0 !important;
  border-radius:999px !important;
  background:#e2e8f0 !important;
  color:#0f172a !important;
  font-size:26px !important;
  font-weight:800 !important;
  line-height:1 !important;
}
.evidence-v118-view{
  position:relative !important;
  margin:12px !important;
  min-height:0 !important;
  border-radius:22px !important;
  overflow:hidden !important;
  background:#020617 !important;
  border:1px solid rgba(15,23,42,.12) !important;
}
.evidence-v118-view video,
.evidence-v118-view img{
  position:absolute !important;
  inset:0 !important;
  width:100% !important;
  height:100% !important;
  object-fit:cover !important;
  background:#020617 !important;
  display:block !important;
}
.evidence-v118-view .hidden,
.evidence-v118-actions .hidden{
  display:none !important;
}
.evidence-v118-watermark{
  position:absolute !important;
  left:0 !important;
  right:0 !important;
  bottom:0 !important;
  z-index:3 !important;
  padding:12px 14px !important;
  color:#fff !important;
  background:linear-gradient(180deg, rgba(0,0,0,0), rgba(0,0,0,.78) 28%, rgba(0,0,0,.86)) !important;
  font-size:13px !important;
  font-weight:800 !important;
  line-height:1.32 !important;
  text-shadow:0 1px 2px rgba(0,0,0,.75) !important;
}
.evidence-v118-statusbar{
  padding:0 12px 10px !important;
}
.evidence-v118-status{
  padding:10px 12px !important;
  border-radius:14px !important;
  font-size:14px !important;
  line-height:1.35 !important;
  font-weight:700 !important;
}
.evidence-v118-ok{background:#dcfce7 !important;color:#166534 !important;}
.evidence-v118-warn{background:#eff6ff !important;color:#1d4ed8 !important;}
.evidence-v118-bad{background:#fee2e2 !important;color:#991b1b !important;}
.evidence-v118-actions{
  display:grid !important;
  grid-template-columns:1fr 1fr 1fr !important;
  gap:10px !important;
  padding:10px 12px 14px !important;
  background:#fff !important;
  border-top:1px solid #eef2f7 !important;
}
.evidence-v118-actions:has(.evidence-v118-btn-primary:not(.hidden)){
  grid-template-columns:1fr !important;
}
.evidence-v118-btn{
  min-height:54px !important;
  border:0 !important;
  border-radius:18px !important;
  font-size:18px !important;
  font-weight:900 !important;
  display:inline-flex !important;
  align-items:center !important;
  justify-content:center !important;
  box-shadow:0 10px 24px rgba(15,23,42,.08) !important;
}
.evidence-v118-btn-light{background:#eef6ff !important;color:#1d4ed8 !important;}
.evidence-v118-btn-primary{background:#2563eb !important;color:#fff !important;}
.evidence-v118-btn-ok{background:#16a34a !important;color:#fff !important;}
.evidence-v118-btn:disabled{opacity:.58 !important;}
@media (max-width:480px){
  .evidence-v118-backdrop{padding:8px !important;align-items:center !important;}
  .evidence-v118-sheet{height:92dvh !important;border-radius:24px !important;}
  .evidence-v118-topbar{padding:12px 14px !important;}
  .evidence-v118-topbar b{font-size:18px !important;}
  .evidence-v118-topbar span{font-size:12px !important;max-height:32px !important;overflow:hidden !important;}
  .evidence-v118-view{margin:10px !important;border-radius:20px !important;}
  .evidence-v118-watermark{font-size:11px !important;padding:10px 12px !important;}
  .evidence-v118-statusbar{padding:0 10px 8px !important;}
  .evidence-v118-status{font-size:13px !important;padding:9px 10px !important;}
  .evidence-v118-actions{gap:8px !important;padding:8px 10px 12px !important;}
  .evidence-v118-btn{min-height:52px !important;font-size:16px !important;border-radius:16px !important;}
}
@media (max-height:720px){
  .evidence-v118-sheet{height:96dvh !important;}
  .evidence-v118-topbar span{display:none !important;}
  .evidence-v118-status{font-size:12px !important;padding:8px 10px !important;}
  .evidence-v118-btn{min-height:48px !important;font-size:15px !important;}
}


/* v121: completely separated camera UI. No shared modal classes. */
.face-v121-backdrop,.idcard-v121-backdrop,.evidence-v121-backdrop{position:fixed;inset:0;z-index:99999;background:rgba(15,23,42,.72);display:flex;align-items:center;justify-content:center;padding:10px;box-sizing:border-box}.face-v121-sheet,.idcard-v121-sheet,.evidence-v121-sheet{width:min(100%,520px);height:min(94dvh,760px);background:#fff;border-radius:22px;overflow:hidden;display:flex;flex-direction:column;box-shadow:0 22px 70px rgba(15,23,42,.35)}.face-v121-topbar,.idcard-v121-topbar,.evidence-v121-topbar{display:flex;align-items:flex-start;justify-content:space-between;gap:10px;padding:12px 14px;border-bottom:1px solid #e5e7eb;background:#fff}.face-v121-topbar b,.idcard-v121-topbar b,.evidence-v121-topbar b{display:block;font-size:16px;color:#0f172a}.face-v121-topbar span,.idcard-v121-topbar span,.evidence-v121-topbar span{display:block;margin-top:2px;font-size:12px;color:#64748b}.face-v121-close,.idcard-v121-close,.evidence-v121-close{width:36px;height:36px;border-radius:999px;border:0;background:#f1f5f9;color:#0f172a;font-size:24px;line-height:1}.face-v121-view,.idcard-v121-view,.evidence-v121-view{position:relative;flex:1;min-height:0;background:#020617;display:flex;align-items:center;justify-content:center;overflow:hidden}.face-v121-view video,.face-v121-view img,.idcard-v121-view video,.idcard-v121-view img,.evidence-v121-view video,.evidence-v121-view img{width:100%;height:100%;object-fit:cover;background:#020617;display:block}.face-v121-watermark,.idcard-v121-watermark,.evidence-v121-watermark{position:absolute;left:10px;right:10px;bottom:10px;background:rgba(0,0,0,.62);color:#fff;border-radius:10px;padding:7px 9px;font-size:10px;line-height:1.25;text-shadow:0 1px 2px rgba(0,0,0,.8);max-height:88px;overflow:hidden}.face-v121-guide,.idcard-v121-guide,.evidence-v121-guide{position:absolute;inset:0;pointer-events:none;display:flex;align-items:center;justify-content:center}.face-v121-oval{width:min(62vw,260px);height:min(78vw,340px);max-height:62dvh;border:3px solid rgba(255,255,255,.96);border-radius:999px;box-shadow:0 0 0 999px rgba(2,6,23,.22);display:flex;align-items:flex-end;justify-content:center;padding-bottom:18px;color:#fff;font-weight:800;text-shadow:0 2px 6px #000}.idcard-v121-card{width:min(84vw,420px);aspect-ratio:1.58/1;border:3px solid rgba(255,255,255,.96);border-radius:18px;box-shadow:0 0 0 999px rgba(2,6,23,.2);position:relative;color:#fff;font-weight:800;text-shadow:0 2px 6px #000;display:flex;align-items:flex-end;justify-content:center;padding-bottom:12px}.idcard-v121-card i{position:absolute;right:10%;top:18%;width:19%;height:42%;border:2px solid rgba(255,255,255,.85);border-radius:12px}.evidence-v121-label{position:absolute;top:14px;left:14px;right:14px;background:rgba(15,23,42,.72);color:#fff;border-radius:12px;padding:8px 10px;text-align:center;font-weight:800;font-size:13px}.face-v121-statusbar,.idcard-v121-statusbar,.evidence-v121-statusbar{min-height:34px;padding:7px 10px;background:#f8fafc}.face-v121-status,.idcard-v121-status,.evidence-v121-status{font-size:12px;border-radius:10px;padding:7px 9px}.face-v121-ok,.idcard-v121-ok,.evidence-v121-ok{background:#dcfce7;color:#166534}.face-v121-warn,.idcard-v121-warn,.evidence-v121-warn{background:#fef3c7;color:#92400e}.face-v121-bad,.idcard-v121-bad,.evidence-v121-bad{background:#fee2e2;color:#991b1b}.face-v121-actions,.idcard-v121-actions,.evidence-v121-actions{display:grid;grid-template-columns:1fr;gap:8px;padding:10px;background:#fff;border-top:1px solid #e5e7eb}.face-v121-actions:has(.face-v121-btn:not(.hidden) + .face-v121-btn:not(.hidden)),.idcard-v121-actions:has(.idcard-v121-btn:not(.hidden) + .idcard-v121-btn:not(.hidden)),.evidence-v121-actions:has(.evidence-v121-btn:not(.hidden) + .evidence-v121-btn:not(.hidden)){grid-template-columns:1fr 1fr}.face-v121-btn,.idcard-v121-btn,.evidence-v121-btn{border:0;border-radius:14px;padding:13px 12px;font-weight:800;font-size:15px}.face-v121-btn-primary,.idcard-v121-btn-primary,.evidence-v121-btn-primary{background:#2563eb;color:#fff}.face-v121-btn-ok,.idcard-v121-btn-ok,.evidence-v121-btn-ok{background:#16a34a;color:#fff}.face-v121-btn-light,.idcard-v121-btn-light,.evidence-v121-btn-light{background:#e2e8f0;color:#0f172a}.face-v121-btn:disabled,.idcard-v121-btn:disabled,.evidence-v121-btn:disabled{opacity:.55}.face-v121-backdrop .hidden,.idcard-v121-backdrop .hidden,.evidence-v121-backdrop .hidden{display:none!important}@media(max-width:560px){.face-v121-backdrop,.idcard-v121-backdrop,.evidence-v121-backdrop{padding:0;align-items:stretch}.face-v121-sheet,.idcard-v121-sheet,.evidence-v121-sheet{width:100%;height:100dvh;max-height:100dvh;border-radius:0}.face-v121-topbar,.idcard-v121-topbar,.evidence-v121-topbar{padding:10px 12px}.face-v121-statusbar,.idcard-v121-statusbar,.evidence-v121-statusbar{padding:6px 8px}.face-v121-actions,.idcard-v121-actions,.evidence-v121-actions{padding:9px 10px calc(9px + env(safe-area-inset-bottom))}}

/* v122 inline identity camera: Face/ID live camera stays inside HTML card, no modal */
.inline-camera-page{max-width:520px;margin:0 auto;padding:16px}.inline-camera-page h1{margin:0 0 6px;font-size:22px}.inline-camera-page p{margin:0 0 12px;color:#667085;font-size:14px;line-height:1.45}.inline-camera-host{width:100%;margin:10px 0 12px}.inline-camera-save-status{margin-top:10px}
.face-v120-inline-card,.idcard-v120-inline-card{position:relative;width:100%;border:1px solid rgba(15,23,42,.1);border-radius:22px;background:#fff;box-shadow:0 12px 34px rgba(15,23,42,.10);overflow:hidden}.face-v120-sheet,.idcard-v120-sheet{width:100%;background:#fff}.face-v120-topbar,.idcard-v120-topbar{display:flex;align-items:flex-start;justify-content:space-between;gap:10px;padding:12px 14px 10px;border-bottom:1px solid rgba(15,23,42,.08)}.face-v120-topbar b,.idcard-v120-topbar b{display:block;color:#101828;font-size:16px}.face-v120-topbar span,.idcard-v120-topbar span{display:block;color:#667085;font-size:12.5px;line-height:1.35;margin-top:2px}.face-v120-close,.idcard-v120-close{border:0;background:#f2f4f7;border-radius:999px;width:34px;height:34px;font-size:22px;line-height:1;color:#344054}.face-v120-view,.idcard-v120-view{position:relative;width:100%;background:#050505;overflow:hidden}.face-v120-view{height:min(58vh,430px);min-height:330px}.idcard-v120-view{height:min(54vh,390px);min-height:300px}.face-v120-view video,.face-v120-view img,.idcard-v120-view video,.idcard-v120-view img{width:100%;height:100%;display:block;object-fit:cover;background:#000}.face-v120-guide,.idcard-v120-guide{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;pointer-events:none}.face-v120-oval{width:62%;height:72%;max-width:260px;max-height:330px;border:3px solid rgba(255,255,255,.96);border-radius:48%/42%;box-shadow:0 0 0 999px rgba(0,0,0,.24),0 0 0 1px rgba(0,0,0,.15) inset;display:flex;align-items:flex-end;justify-content:center;padding-bottom:14px}.face-v120-oval span,.idcard-v120-card span{background:rgba(0,0,0,.55);color:#fff;border-radius:999px;padding:6px 10px;font-size:12px;font-weight:700}.idcard-v120-card{position:relative;width:86%;aspect-ratio:1.586/1;border:3px solid rgba(255,255,255,.95);border-radius:16px;box-shadow:0 0 0 999px rgba(0,0,0,.22);display:flex;align-items:flex-end;justify-content:center;padding-bottom:12px}.idcard-v120-card i{position:absolute;right:10%;top:22%;width:18%;height:33%;border:2px solid rgba(255,255,255,.9);border-radius:50%}.face-v120-watermark,.idcard-v120-watermark{position:absolute;left:0;right:0;bottom:0;background:rgba(0,0,0,.62);color:#fff;font-size:10.5px;line-height:1.32;padding:7px 9px;text-shadow:0 1px 2px rgba(0,0,0,.7)}.face-v120-statusbar,.idcard-v120-statusbar{padding:10px 14px}.face-v120-status,.idcard-v120-status{border-radius:14px;padding:9px 11px;font-size:13px;line-height:1.35}.face-v120-ok,.idcard-v120-ok{background:#ecfdf3;color:#027a48}.face-v120-warn,.idcard-v120-warn{background:#fffaeb;color:#b54708}.face-v120-bad,.idcard-v120-bad{background:#fef3f2;color:#b42318}.face-v120-actions,.idcard-v120-actions{display:grid;grid-template-columns:1fr;gap:10px;padding:0 14px 14px}.face-v120-actions:has(.face-v120-btn:not(.hidden)+.face-v120-btn:not(.hidden)),.idcard-v120-actions:has(.idcard-v120-btn:not(.hidden)+.idcard-v120-btn:not(.hidden)){grid-template-columns:1fr 1fr}.face-v120-btn,.idcard-v120-btn{border:0;border-radius:16px;padding:13px 12px;font-weight:800;font-size:15px}.face-v120-btn-primary,.idcard-v120-btn-primary{background:#2563eb;color:#fff}.face-v120-btn-ok,.idcard-v120-btn-ok{background:#16a34a;color:#fff}.face-v120-btn-light,.idcard-v120-btn-light{background:#f2f4f7;color:#344054}.hidden{display:none!important}@media(max-width:390px){.inline-camera-page{padding:12px}.face-v120-view{height:min(56vh,390px);min-height:300px}.idcard-v120-view{height:min(50vh,350px);min-height:270px}.face-v120-oval{width:68%;height:72%}.face-v120-topbar,.idcard-v120-topbar{padding:10px 12px}.face-v120-actions,.idcard-v120-actions{padding:0 12px 12px}.face-v120-btn,.idcard-v120-btn{padding:12px 10px}}


/* v124 evidence camera modal position fix: center on mobile screen, dedicated evidence-v120 classes */
.evidence-v120-backdrop{
  position:fixed !important;
  inset:0 !important;
  z-index:999999 !important;
  width:100vw !important;
  height:100dvh !important;
  background:rgba(15,23,42,.72) !important;
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
  padding:14px !important;
  box-sizing:border-box !important;
  overflow:hidden !important;
}
.evidence-v120-sheet{
  width:min(100%,520px) !important;
  height:min(88dvh,720px) !important;
  max-height:calc(100dvh - 28px) !important;
  background:#fff !important;
  border-radius:24px !important;
  overflow:hidden !important;
  display:flex !important;
  flex-direction:column !important;
  box-shadow:0 24px 80px rgba(15,23,42,.38) !important;
  margin:auto !important;
  transform:none !important;
}
.evidence-v120-topbar{
  flex:0 0 auto !important;
  display:flex !important;
  align-items:flex-start !important;
  justify-content:space-between !important;
  gap:10px !important;
  padding:12px 14px !important;
  border-bottom:1px solid #e5e7eb !important;
  background:#fff !important;
}
.evidence-v120-topbar b{display:block !important;font-size:17px !important;line-height:1.25 !important;color:#0f172a !important;}
.evidence-v120-topbar span{display:block !important;margin-top:3px !important;font-size:12px !important;line-height:1.35 !important;color:#64748b !important;}
.evidence-v120-close{
  flex:0 0 auto !important;
  width:38px !important;height:38px !important;border:0 !important;border-radius:999px !important;
  background:#eef2f7 !important;color:#0f172a !important;font-size:26px !important;font-weight:800 !important;line-height:1 !important;
}
.evidence-v120-view{
  position:relative !important;
  flex:1 1 auto !important;
  min-height:260px !important;
  margin:12px !important;
  border-radius:22px !important;
  background:#020617 !important;
  overflow:hidden !important;
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
}
.evidence-v120-view video,
.evidence-v120-view img{
  width:100% !important;
  height:100% !important;
  object-fit:cover !important;
  display:block !important;
  background:#020617 !important;
}
.evidence-v120-guide{position:absolute !important;inset:0 !important;pointer-events:none !important;z-index:2 !important;}
.evidence-v120-label{
  position:absolute !important;left:12px !important;right:12px !important;top:12px !important;
  padding:8px 10px !important;border-radius:12px !important;background:rgba(15,23,42,.68) !important;color:#fff !important;
  text-align:center !important;font-size:13px !important;font-weight:800 !important;line-height:1.25 !important;
}
.evidence-v120-watermark{
  position:absolute !important;left:0 !important;right:0 !important;bottom:0 !important;z-index:3 !important;
  padding:10px 12px !important;background:linear-gradient(180deg,rgba(0,0,0,0),rgba(0,0,0,.78) 28%,rgba(0,0,0,.88)) !important;
  color:#fff !important;font-size:11.5px !important;font-weight:800 !important;line-height:1.28 !important;text-shadow:0 1px 2px rgba(0,0,0,.8) !important;
  max-height:36% !important;overflow:hidden !important;
}
.evidence-v120-statusbar{flex:0 0 auto !important;padding:0 12px 10px !important;background:#fff !important;}
.evidence-v120-status{border-radius:14px !important;padding:9px 11px !important;font-size:13px !important;font-weight:800 !important;line-height:1.35 !important;}
.evidence-v120-ok{background:#dcfce7 !important;color:#166534 !important;}
.evidence-v120-warn{background:#eff6ff !important;color:#1d4ed8 !important;}
.evidence-v120-bad{background:#fee2e2 !important;color:#991b1b !important;}
.evidence-v120-actions{
  flex:0 0 auto !important;
  display:grid !important;
  grid-template-columns:1fr 1fr 1fr !important;
  gap:10px !important;
  padding:10px 12px calc(12px + env(safe-area-inset-bottom)) !important;
  background:#fff !important;
  border-top:1px solid #eef2f7 !important;
}
.evidence-v120-actions:has(.evidence-v120-btn-primary:not(.hidden)){grid-template-columns:1fr !important;}
.evidence-v120-actions:has(.evidence-v120-btn-light:not(.hidden)){grid-template-columns:1fr 1fr !important;}
.evidence-v120-btn{
  min-height:52px !important;border:0 !important;border-radius:16px !important;padding:10px 12px !important;
  font-size:16px !important;font-weight:900 !important;display:inline-flex !important;align-items:center !important;justify-content:center !important;
}
.evidence-v120-btn-light{background:#eef6ff !important;color:#1d4ed8 !important;}
.evidence-v120-btn-primary{background:#2563eb !important;color:#fff !important;}
.evidence-v120-btn-ok{background:#16a34a !important;color:#fff !important;}
.evidence-v120-btn:disabled{opacity:.58 !important;}
.evidence-v120-backdrop .hidden{display:none !important;}
@media (max-width:480px){
  .evidence-v120-backdrop{padding:10px !important;align-items:center !important;justify-content:center !important;}
  .evidence-v120-sheet{width:100% !important;height:86dvh !important;max-height:calc(100dvh - 20px) !important;border-radius:22px !important;}
  .evidence-v120-topbar{padding:10px 12px !important;}
  .evidence-v120-topbar b{font-size:16px !important;}
  .evidence-v120-topbar span{font-size:11.5px !important;max-height:30px !important;overflow:hidden !important;}
  .evidence-v120-close{width:34px !important;height:34px !important;font-size:24px !important;}
  .evidence-v120-view{margin:10px !important;border-radius:20px !important;min-height:250px !important;}
  .evidence-v120-watermark{font-size:10.5px !important;padding:9px 10px !important;}
  .evidence-v120-label{font-size:12px !important;padding:7px 9px !important;}
  .evidence-v120-statusbar{padding:0 10px 8px !important;}
  .evidence-v120-status{font-size:12.5px !important;padding:8px 10px !important;}
  .evidence-v120-actions{gap:8px !important;padding:8px 10px calc(10px + env(safe-area-inset-bottom)) !important;}
  .evidence-v120-btn{min-height:50px !important;font-size:15px !important;border-radius:15px !important;}
}
@media (max-height:720px){
  .evidence-v120-sheet{height:92dvh !important;}
  .evidence-v120-topbar span{display:none !important;}
  .evidence-v120-view{margin:8px 10px !important;}
  .evidence-v120-status{font-size:12px !important;padding:7px 9px !important;}
  .evidence-v120-btn{min-height:46px !important;font-size:14px !important;}
}


/* v125 evidence floating modal: backup CSS in case JS style injection is delayed */
.evidence-v125-backdrop{position:fixed!important;left:0!important;top:0!important;right:0!important;bottom:0!important;width:100vw!important;height:100dvh!important;z-index:2147483000!important;background:rgba(15,23,42,.76)!important;display:flex!important;align-items:center!important;justify-content:center!important;padding:10px!important;box-sizing:border-box!important;overflow:hidden!important}.evidence-v125-sheet{position:relative!important;width:min(100%,540px)!important;height:min(90dvh,760px)!important;max-height:calc(100dvh - 20px)!important;background:#fff!important;border-radius:24px!important;overflow:hidden!important;display:flex!important;flex-direction:column!important;box-shadow:0 26px 90px rgba(15,23,42,.44)!important;margin:auto!important}.evidence-v125-view{position:relative!important;flex:1 1 auto!important;min-height:280px!important;margin:10px!important;border-radius:22px!important;background:#020617!important;overflow:hidden!important;display:block!important}.evidence-v125-view video,.evidence-v125-view img{position:absolute!important;inset:0!important;width:100%!important;height:100%!important;object-fit:cover!important;display:block!important}.evidence-v125-topbar{flex:0 0 auto!important;display:flex!important;align-items:flex-start!important;justify-content:space-between!important;gap:10px!important;padding:12px 14px!important;border-bottom:1px solid #e5e7eb!important;background:#fff!important}.evidence-v125-topbar b{display:block!important;font-size:17px!important;line-height:1.25!important;color:#0f172a!important}.evidence-v125-topbar span{display:block!important;margin-top:3px!important;font-size:12px!important;line-height:1.35!important;color:#64748b!important}.evidence-v125-close{flex:0 0 auto!important;width:38px!important;height:38px!important;border:0!important;border-radius:999px!important;background:#eef2f7!important;color:#0f172a!important;font-size:26px!important;font-weight:900!important;line-height:1!important}.evidence-v125-guide{position:absolute!important;inset:0!important;z-index:2!important;pointer-events:none!important}.evidence-v125-label{position:absolute!important;left:12px!important;right:12px!important;top:12px!important;padding:8px 10px!important;border-radius:12px!important;background:rgba(15,23,42,.72)!important;color:#fff!important;text-align:center!important;font-size:13px!important;font-weight:900!important;line-height:1.25!important}.evidence-v125-watermark{position:absolute!important;left:0!important;right:0!important;bottom:0!important;z-index:3!important;padding:10px 12px!important;background:linear-gradient(180deg,rgba(0,0,0,0),rgba(0,0,0,.78) 28%,rgba(0,0,0,.9))!important;color:#fff!important;font-size:11px!important;font-weight:800!important;line-height:1.28!important;max-height:34%!important;overflow:hidden!important}.evidence-v125-statusbar{flex:0 0 auto!important;padding:0 10px 8px!important;background:#fff!important}.evidence-v125-status{border-radius:14px!important;padding:8px 10px!important;font-size:12.5px!important;font-weight:800!important;line-height:1.35!important}.evidence-v125-ok{background:#dcfce7!important;color:#166534!important}.evidence-v125-warn{background:#eff6ff!important;color:#1d4ed8!important}.evidence-v125-bad{background:#fee2e2!important;color:#991b1b!important}.evidence-v125-actions{flex:0 0 auto!important;display:grid!important;grid-template-columns:1fr!important;gap:8px!important;padding:8px 10px calc(10px + env(safe-area-inset-bottom))!important;background:#fff!important;border-top:1px solid #eef2f7!important}.evidence-v125-actions.evidence-v125-preview-actions{grid-template-columns:1fr 1fr!important}.evidence-v125-btn{min-height:50px!important;border:0!important;border-radius:16px!important;padding:10px 12px!important;font-size:15px!important;font-weight:900!important;display:inline-flex!important;align-items:center!important;justify-content:center!important}.evidence-v125-btn-light{background:#eef6ff!important;color:#1d4ed8!important}.evidence-v125-btn-primary{background:#2563eb!important;color:#fff!important}.evidence-v125-btn-ok{background:#16a34a!important;color:#fff!important}.evidence-v125-backdrop .hidden{display:none!important}@media(max-width:560px){.evidence-v125-backdrop{padding:10px!important}.evidence-v125-sheet{width:100%!important;height:88dvh!important;max-height:calc(100dvh - 20px)!important;border-radius:22px!important}.evidence-v125-view{margin:8px!important;min-height:280px!important}}@media(max-height:720px){.evidence-v125-sheet{height:92dvh!important}.evidence-v125-topbar span{display:none!important}.evidence-v125-view{min-height:240px!important}.evidence-v125-btn{min-height:46px!important;font-size:14px!important}}


/* v126 dashboard profile face avatar auto-center */
body:not(.admin-body) .dashboard-profile-card .user-avatar-btn{
  position:relative !important;
  overflow:hidden !important;
}
body:not(.admin-body) .dashboard-profile-card .face-smart-avatar{
  object-fit:cover !important;
  object-position:50% 56% !important;
  transform:none !important;
}
body:not(.admin-body) .dashboard-profile-card .face-smart-avatar.face-avatar-loading{
  object-position:50% 56% !important;
}
body:not(.admin-body) .dashboard-profile-card .face-smart-avatar.face-avatar-detected{
  object-fit:cover !important;
}


/* v127 dashboard driver card avatar: center crop only
   ใช้เฉพาะกรอบรูปคนขับบน Dashboard: ตัดรูปจากกึ่งกลาง ไม่ใช้ face-detect/auto focus */
body:not(.admin-body) .dashboard-profile-card .user-avatar-btn,
body:not(.admin-body) .dashboard-profile-card .user-avatar-btn .user-avatar,
body:not(.admin-body) .dashboard-profile-card .user-avatar-btn img,
body:not(.admin-body) .dashboard-profile-card .dashboard-avatar-center-crop,
body:not(.admin-body) .dashboard-profile-card .face-smart-avatar,
body:not(.admin-body) .dashboard-profile-card .face-smart-avatar.face-avatar-detected,
body:not(.admin-body) .dashboard-profile-card .face-smart-avatar.face-avatar-loading{
  width:96px !important;
  height:96px !important;
  min-width:96px !important;
  min-height:96px !important;
  max-width:96px !important;
  max-height:96px !important;
  border-radius:20px !important;
  overflow:hidden !important;
}
body:not(.admin-body) .dashboard-profile-card .user-avatar-btn img,
body:not(.admin-body) .dashboard-profile-card .dashboard-avatar-center-crop,
body:not(.admin-body) .dashboard-profile-card .face-smart-avatar,
body:not(.admin-body) .dashboard-profile-card .face-smart-avatar.face-avatar-detected,
body:not(.admin-body) .dashboard-profile-card .face-smart-avatar.face-avatar-loading{
  display:block !important;
  object-fit:cover !important;
  object-position:50% 50% !important;
  transform:none !important;
}
@media (max-width:430px){
  body:not(.admin-body) .dashboard-profile-card .user-avatar-btn,
  body:not(.admin-body) .dashboard-profile-card .user-avatar-btn .user-avatar,
  body:not(.admin-body) .dashboard-profile-card .user-avatar-btn img,
  body:not(.admin-body) .dashboard-profile-card .dashboard-avatar-center-crop,
  body:not(.admin-body) .dashboard-profile-card .face-smart-avatar,
  body:not(.admin-body) .dashboard-profile-card .face-smart-avatar.face-avatar-detected,
  body:not(.admin-body) .dashboard-profile-card .face-smart-avatar.face-avatar-loading{
    width:76px !important;
    height:76px !important;
    min-width:76px !important;
    min-height:76px !important;
    max-width:76px !important;
    max-height:76px !important;
    flex-basis:76px !important;
    border-radius:18px !important;
  }
}


/* v129 HARD FIX: dashboard avatar center crop only */
body:not(.admin-body) .dashboard-profile-card [data-dashboard-avatar-wrap="1"],
body:not(.admin-body) .dashboard-profile-card .dashboard-avatar-wrap{
  width:76px !important;
  height:76px !important;
  min-width:76px !important;
  min-height:76px !important;
  max-width:76px !important;
  max-height:76px !important;
  flex:0 0 76px !important;
  padding:0 !important;
  overflow:hidden !important;
  border-radius:18px !important;
  display:block !important;
}
body:not(.admin-body) .dashboard-profile-card [data-dashboard-avatar-center="1"],
body:not(.admin-body) .dashboard-profile-card .dashboard-avatar-center-crop{
  width:76px !important;
  height:76px !important;
  min-width:76px !important;
  min-height:76px !important;
  max-width:76px !important;
  max-height:76px !important;
  object-fit:cover !important;
  object-position:50% 50% !important;
  transform:none !important;
  display:block !important;
  border-radius:18px !important;
}

/* v130: Dashboard avatar uses real center-cropped source and background-image wrapper */
body:not(.admin-body) .dashboard-profile-card .dashboard-avatar-bg-wrap,
body:not(.admin-body) .dashboard-profile-card [data-dashboard-avatar-wrap="1"]{
  width:76px !important;
  height:76px !important;
  min-width:76px !important;
  min-height:76px !important;
  max-width:76px !important;
  max-height:76px !important;
  flex:0 0 76px !important;
  padding:0 !important;
  border:0 !important;
  overflow:hidden !important;
  border-radius:18px !important;
  display:block !important;
  background:#eef4ff !important;
}
body:not(.admin-body) .dashboard-profile-card .dashboard-avatar-center-bg,
body:not(.admin-body) .dashboard-profile-card [data-dashboard-avatar-center="1"]{
  width:76px !important;
  height:76px !important;
  min-width:76px !important;
  min-height:76px !important;
  max-width:76px !important;
  max-height:76px !important;
  display:block !important;
  border-radius:18px !important;
  background-size:cover !important;
  background-position:50% 50% !important;
  background-repeat:no-repeat !important;
  transform:none !important;
}


/* v131 FINAL dashboard avatar render fix
   Root cause: index.html still referenced v129 assets, so browser/PWA loaded old dashboard avatar code.
   This block is intentionally last and targets only the Dashboard profile avatar card. */
body:not(.admin-body) .dashboard-profile-card.dashboard-avatar-v131,
body:not(.admin-body) .dashboard-profile-card .dashboard-avatar-v131,
body:not(.admin-body) .dashboard-profile-card [data-dashboard-avatar-wrap="1"],
body:not(.admin-body) .dashboard-profile-card .dashboard-avatar-bg-wrap{
  width:76px !important;
  height:76px !important;
  min-width:76px !important;
  min-height:76px !important;
  max-width:76px !important;
  max-height:76px !important;
  flex:0 0 76px !important;
  padding:0 !important;
  margin:0 !important;
  border:0 !important;
  border-radius:18px !important;
  overflow:hidden !important;
  display:block !important;
  background:#eef4ff !important;
}
body:not(.admin-body) .dashboard-profile-card .dashboard-avatar-v131-img,
body:not(.admin-body) .dashboard-profile-card .dashboard-avatar-center-bg,
body:not(.admin-body) .dashboard-profile-card [data-dashboard-avatar-center="1"]{
  width:76px !important;
  height:76px !important;
  min-width:76px !important;
  min-height:76px !important;
  max-width:76px !important;
  max-height:76px !important;
  display:block !important;
  border-radius:18px !important;
  background-size:cover !important;
  background-position:center center !important;
  background-repeat:no-repeat !important;
  object-fit:cover !important;
  object-position:center center !important;
  transform:none !important;
}


/* v134 camera inline card stability */
.inline-camera-page{max-width:520px!important;margin:0 auto!important;padding:16px!important;box-sizing:border-box!important;}
.inline-camera-host{display:block!important;width:100%!important;min-height:0!important;margin:12px 0!important;}
.face-v120-inline-card,.idcard-v120-inline-card{display:block!important;width:100%!important;max-width:100%!important;position:relative!important;inset:auto!important;transform:none!important;margin:0!important;}
.face-v120-inline-card .face-v120-sheet,.idcard-v120-inline-card .idcard-v120-sheet{display:flex!important;flex-direction:column!important;width:100%!important;border-radius:22px!important;overflow:hidden!important;}
.face-v120-inline-card .face-v120-view{height:min(52vh,420px)!important;min-height:300px!important;}
.idcard-v120-inline-card .idcard-v120-view{height:min(46vh,360px)!important;min-height:260px!important;}
.face-v120-view video,.face-v120-view img,.idcard-v120-view video,.idcard-v120-view img{object-fit:cover!important;object-position:center center!important;}
.face-v120-statusbar,.idcard-v120-statusbar{min-height:0!important;}
.face-v120-actions,.idcard-v120-actions{position:relative!important;bottom:auto!important;background:#fff!important;}
@media(max-width:420px){.inline-camera-page{padding:12px!important}.face-v120-inline-card .face-v120-view{height:min(50vh,380px)!important;min-height:280px!important}.idcard-v120-inline-card .idcard-v120-view{height:min(44vh,330px)!important;min-height:240px!important}}

/* v137 DEVICE FIT MOBILE LAYOUT
   Force real-phone UI to fill the device even when the browser is in Desktop Site mode. */
html, body{
  width:100%;
  min-height:100%;
  overflow-x:hidden;
  -webkit-text-size-adjust:100%;
  text-size-adjust:100%;
}
body.device-phone{
  background:#f6f8fb;
  touch-action:manipulation;
}
.device-phone .app-shell{
  width:100%;
  max-width:480px;
  min-height:100dvh;
  min-height:var(--app-vh,100dvh);
  margin:0 auto;
  padding:calc(14px + env(safe-area-inset-top,0px)) 14px calc(104px + env(safe-area-inset-bottom,0px));
  background:#ffffff;
  overflow-x:hidden;
}
.device-phone .topbar{
  gap:10px;
  align-items:center;
}
.device-phone .brand{
  min-width:0;
  font-size:15px;
  line-height:1.2;
}
.device-phone .brand .muted{
  font-size:12px;
}
.device-phone .app-logo{
  width:48px;
  height:48px;
  flex:0 0 48px;
}
.device-phone .badge{
  flex:0 0 auto;
  white-space:nowrap;
  font-size:11px;
  padding:6px 9px;
}
.device-phone .card{
  border-radius:22px;
  padding:16px;
  margin:12px 0;
}
.device-phone h1{font-size:24px;line-height:1.15;}
.device-phone h2{font-size:20px;line-height:1.2;}
.device-phone h3{font-size:16px;line-height:1.25;}
.device-phone p{font-size:15px;line-height:1.45;}
.device-phone button,
.device-phone input,
.device-phone select,
.device-phone textarea{
  font-size:16px;
}
.device-phone .bottom-nav{
  position:fixed;
  left:50%;
  right:auto;
  bottom:calc(10px + env(safe-area-inset-bottom,0px));
  transform:translateX(-50%);
  width:min(480px,calc(100vw - 20px));
  z-index:5000;
}
.device-phone .camera-box,
.device-phone .face-inline-camera-card,
.device-phone .id-card-inline-camera-card{
  max-width:100%;
  overflow:hidden;
}
.device-phone video,
.device-phone canvas,
.device-phone img{
  max-width:100%;
}

/* When phone opens browser Desktop Site, CSS viewport becomes very wide and the app looks tiny.
   Build the app at physical phone width, then scale it to fill that desktop viewport. */
html.device-phone-desktop-viewport,
html.device-phone-desktop-viewport body{
  width:var(--app-vw,100vw);
  min-height:var(--app-vh,100vh);
  overflow-x:hidden;
  background:#f6f8fb;
}
.device-phone-desktop-viewport body{
  margin:0;
}
.device-phone-desktop-viewport #app{
  width:var(--device-screen-w,390px);
  min-height:var(--device-visual-h,720px);
  transform:scale(var(--device-fit-scale,1));
  transform-origin:top left;
  margin:0;
}
.device-phone-desktop-viewport .app-shell{
  width:var(--device-screen-w,390px) !important;
  max-width:none !important;
  min-height:var(--device-visual-h,720px) !important;
  margin:0 !important;
  padding:calc(14px + env(safe-area-inset-top,0px)) 14px calc(104px + env(safe-area-inset-bottom,0px)) !important;
}
.device-phone-desktop-viewport .bottom-nav{
  position:fixed !important;
  left:10px !important;
  right:10px !important;
  bottom:calc(10px + env(safe-area-inset-bottom,0px)) !important;
  transform:none !important;
  width:auto !important;
  max-width:none !important;
}
.device-phone-desktop-viewport .image-modal-backdrop,
.device-phone-desktop-viewport .evidence-v125-backdrop,
.device-phone-desktop-viewport .evidence-v118-backdrop{
  width:var(--device-screen-w,390px) !important;
  min-height:var(--device-visual-h,720px) !important;
}

.device-tablet .app-shell{
  width:100%;
  max-width:760px;
  min-height:100dvh;
  margin:0 auto;
}

/* v159 bottom navigation icon/theme cleanup - solid mockup style */
body:not(.admin-body) .bottom-nav.circular-bottom-nav-v159,
.bottom-nav.circular-bottom-nav-v159{
  position:fixed!important;
  left:50%!important;
  right:auto!important;
  bottom:calc(10px + env(safe-area-inset-bottom,0px))!important;
  transform:translateX(-50%)!important;
  width:min(480px,calc(100vw - 20px))!important;
  display:grid!important;
  grid-template-columns:repeat(5,1fr)!important;
  gap:0!important;
  padding:8px!important;
  background:#fff!important;
  border:1px solid #dbe3ef!important;
  border-radius:20px!important;
  box-shadow:0 10px 34px rgba(15,23,42,.14)!important;
  backdrop-filter:none!important;
  -webkit-backdrop-filter:none!important;
  z-index:5000!important;
}
body:not(.admin-body) .bottom-nav.circular-bottom-nav-v159 .nav-btn,
.bottom-nav.circular-bottom-nav-v159 .nav-btn{
  width:100%!important;
  min-width:0!important;
  max-width:none!important;
  min-height:58px!important;
  padding:6px 2px!important;
  border:0!important;
  border-radius:14px!important;
  background:transparent!important;
  color:#111827!important;
  display:flex!important;
  flex-direction:column!important;
  align-items:center!important;
  justify-content:center!important;
  gap:3px!important;
  box-shadow:none!important;
  overflow:hidden!important;
}
body:not(.admin-body) .bottom-nav.circular-bottom-nav-v159 .nav-btn span,
.bottom-nav.circular-bottom-nav-v159 .nav-btn span{
  width:24px!important;
  height:24px!important;
  display:grid!important;
  place-items:center!important;
  font-size:0!important;
  line-height:1!important;
}
body:not(.admin-body) .bottom-nav.circular-bottom-nav-v159 .nav-btn svg,
.bottom-nav.circular-bottom-nav-v159 .nav-btn svg{
  width:23px!important;
  height:23px!important;
  fill:none!important;
  stroke:currentColor!important;
  stroke-width:1.9!important;
  stroke-linecap:round!important;
  stroke-linejoin:round!important;
  display:block!important;
}
body:not(.admin-body) .bottom-nav.circular-bottom-nav-v159 .nav-btn b,
.bottom-nav.circular-bottom-nav-v159 .nav-btn b{
  display:block!important;
  max-width:100%!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  white-space:nowrap!important;
  font-size:11px!important;
  line-height:1.1!important;
  font-weight:850!important;
  color:currentColor!important;
}
body:not(.admin-body) .bottom-nav.circular-bottom-nav-v159 .nav-btn.active,
.bottom-nav.circular-bottom-nav-v159 .nav-btn.active{
  background:#eaf2ff!important;
  color:#2563eb!important;
}
body:not(.admin-body) .bottom-nav.circular-bottom-nav-v159 .nav-btn:active,
.bottom-nav.circular-bottom-nav-v159 .nav-btn:active{
  transform:scale(.97)!important;
}
@media(max-width:390px){
  body:not(.admin-body) .bottom-nav.circular-bottom-nav-v159,
  .bottom-nav.circular-bottom-nav-v159{width:calc(100vw - 14px)!important;padding:7px!important;border-radius:18px!important;}
  body:not(.admin-body) .bottom-nav.circular-bottom-nav-v159 .nav-btn,
  .bottom-nav.circular-bottom-nav-v159 .nav-btn{min-height:54px!important;border-radius:13px!important;}
  body:not(.admin-body) .bottom-nav.circular-bottom-nav-v159 .nav-btn b,
  .bottom-nav.circular-bottom-nav-v159 .nav-btn b{font-size:10px!important;}
}

/* v161 unified line icons across driver/supervisor app */
body:not(.admin-body) .line-icon svg,
.line-icon svg{width:26px;height:26px;fill:none;stroke:currentColor;stroke-width:2.6;stroke-linecap:round;stroke-linejoin:round;display:block}
body:not(.admin-body) .dashboard-start-btn .action-icon.line-icon{font-size:0;color:#2563eb;background:#eff6ff;border:1px solid #dbeafe}
body:not(.admin-body) .dashboard-start-btn .action-icon.line-icon.tube{color:#059669;background:#ecfdf5;border-color:#bbf7d0}
body:not(.admin-body) .dashboard-start-btn .action-icon.line-icon.microscope{color:#e11d48;background:#fff1f2;border-color:#fecdd3}
body:not(.admin-body) .app-form-card{display:grid;grid-template-columns:48px 1fr auto;gap:12px;align-items:center}
body:not(.admin-body) .app-form-card .form-card-icon{width:44px;height:44px;border-radius:16px;display:grid;place-items:center;background:#eff6ff;color:#2563eb;border:1px solid #dbeafe}
body:not(.admin-body) .app-form-card .form-card-icon.tube{background:#ecfdf5;color:#059669;border-color:#bbf7d0}
body:not(.admin-body) .app-form-card .form-card-icon.microscope{background:#fff1f2;color:#e11d48;border-color:#fecdd3}
body:not(.admin-body) .app-form-card b{min-width:0}



/* v172 bottom nav edge-to-edge icon fix
   Fix: app.js used a newer class while CSS targeted old nav class.
   Requirement: solid nav, icons visible, flush to left/right/bottom edges. */
body:not(.admin-body) .bottom-nav.circular-bottom-nav-v172,
.bottom-nav.circular-bottom-nav-v172{
  position:fixed!important;
  left:0!important;
  right:0!important;
  bottom:0!important;
  transform:none!important;
  width:100vw!important;
  max-width:none!important;
  margin:0!important;
  display:grid!important;
  grid-template-columns:repeat(5,minmax(0,1fr))!important;
  gap:0!important;
  padding:8px 6px calc(8px + env(safe-area-inset-bottom,0px)) 6px!important;
  background:#ffffff!important;
  border-top:1px solid #dbe3ef!important;
  border-left:0!important;
  border-right:0!important;
  border-bottom:0!important;
  border-radius:0!important;
  box-shadow:0 -8px 26px rgba(15,23,42,.12)!important;
  backdrop-filter:none!important;
  -webkit-backdrop-filter:none!important;
  z-index:9999!important;
}

body:not(.admin-body) .bottom-nav.circular-bottom-nav-v172 .nav-btn,
.bottom-nav.circular-bottom-nav-v172 .nav-btn{
  width:100%!important;
  min-width:0!important;
  max-width:none!important;
  min-height:56px!important;
  padding:6px 2px!important;
  border:0!important;
  border-radius:14px!important;
  background:transparent!important;
  color:#111827!important;
  display:flex!important;
  flex-direction:column!important;
  align-items:center!important;
  justify-content:center!important;
  gap:3px!important;
  box-shadow:none!important;
  overflow:hidden!important;
  appearance:none!important;
  -webkit-appearance:none!important;
}

body:not(.admin-body) .bottom-nav.circular-bottom-nav-v172 .nav-btn span,
.bottom-nav.circular-bottom-nav-v172 .nav-btn span{
  width:24px!important;
  height:24px!important;
  display:grid!important;
  place-items:center!important;
  font-size:0!important;
  line-height:1!important;
  color:currentColor!important;
  flex:0 0 auto!important;
}

body:not(.admin-body) .bottom-nav.circular-bottom-nav-v172 .nav-btn svg,
.bottom-nav.circular-bottom-nav-v172 .nav-btn svg{
  width:23px!important;
  height:23px!important;
  fill:none!important;
  stroke:currentColor!important;
  stroke-width:1.9!important;
  stroke-linecap:round!important;
  stroke-linejoin:round!important;
  display:block!important;
  opacity:1!important;
  visibility:visible!important;
}

body:not(.admin-body) .bottom-nav.circular-bottom-nav-v172 .nav-btn b,
.bottom-nav.circular-bottom-nav-v172 .nav-btn b{
  display:block!important;
  max-width:100%!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  white-space:nowrap!important;
  font-size:11px!important;
  line-height:1.1!important;
  font-weight:850!important;
  color:currentColor!important;
}

body:not(.admin-body) .bottom-nav.circular-bottom-nav-v172 .nav-btn.active,
.bottom-nav.circular-bottom-nav-v172 .nav-btn.active{
  background:#eaf2ff!important;
  color:#2563eb!important;
}

body:not(.admin-body) .has-bottom-nav,
.has-bottom-nav{
  padding-bottom:calc(92px + env(safe-area-inset-bottom,0px))!important;
}

@media(max-width:390px){
  body:not(.admin-body) .bottom-nav.circular-bottom-nav-v172,
  .bottom-nav.circular-bottom-nav-v172{
    padding:7px 4px calc(7px + env(safe-area-inset-bottom,0px)) 4px!important;
  }
  body:not(.admin-body) .bottom-nav.circular-bottom-nav-v172 .nav-btn,
  .bottom-nav.circular-bottom-nav-v172 .nav-btn{
    min-height:54px!important;
    border-radius:13px!important;
  }
  body:not(.admin-body) .bottom-nav.circular-bottom-nav-v172 .nav-btn b,
  .bottom-nav.circular-bottom-nav-v172 .nav-btn b{
    font-size:10px!important;
  }
}



/* v172 dashboard/history UI refinements */
/* Dashboard: make "งานหลักวันนี้ / เริ่มการตรวจ" buttons match form menu cards */
body:not(.admin-body) .dashboard-start-btn,
body:not(.admin-body) .dash-action,
body:not(.admin-body) .start-form-btn{
  min-height:64px!important;
  border-radius:20px!important;
  border:1px solid #dbeafe!important;
  background:#ffffff!important;
  box-shadow:0 8px 22px rgba(15,23,42,.07)!important;
  display:grid!important;
  grid-template-columns:50px 1fr auto!important;
  gap:12px!important;
  align-items:center!important;
  width:100%!important;
  padding:10px 14px!important;
  text-align:left!important;
}

body:not(.admin-body) .dashboard-start-btn .action-icon,
body:not(.admin-body) .dashboard-start-btn .form-card-icon,
body:not(.admin-body) .dash-action .action-icon,
body:not(.admin-body) .start-form-btn .action-icon{
  width:44px!important;
  height:44px!important;
  border-radius:16px!important;
  display:grid!important;
  place-items:center!important;
  background:#eff6ff!important;
  color:#2563eb!important;
  border:1px solid #dbeafe!important;
  font-size:0!important;
  flex:0 0 auto!important;
}

body:not(.admin-body) .dashboard-start-btn .action-icon svg,
body:not(.admin-body) .dash-action .action-icon svg,
body:not(.admin-body) .start-form-btn .action-icon svg{
  width:26px!important;
  height:26px!important;
  fill:none!important;
  stroke:currentColor!important;
  stroke-width:2.4!important;
  stroke-linecap:round!important;
  stroke-linejoin:round!important;
  display:block!important;
}

body:not(.admin-body) .dashboard-start-btn .action-main,
body:not(.admin-body) .dash-action .action-main,
body:not(.admin-body) .start-form-btn .action-main{
  min-width:0!important;
  display:block!important;
}

body:not(.admin-body) .dashboard-start-btn .action-title,
body:not(.admin-body) .dash-action .action-title,
body:not(.admin-body) .start-form-btn .action-title{
  display:block!important;
  font-size:17px!important;
  line-height:1.2!important;
  font-weight:900!important;
  color:#111827!important;
  margin:0!important;
}

body:not(.admin-body) .dashboard-start-btn .action-sub,
body:not(.admin-body) .dash-action .action-sub,
body:not(.admin-body) .start-form-btn .action-sub{
  display:block!important;
  font-size:12px!important;
  line-height:1.25!important;
  font-weight:700!important;
  color:#64748b!important;
  margin-top:3px!important;
}

body:not(.admin-body) .dashboard-start-btn .start-pill,
body:not(.admin-body) .dash-action .start-pill,
body:not(.admin-body) .start-form-btn .start-pill,
body:not(.admin-body) .dashboard-start-btn > b:last-child,
body:not(.admin-body) .dash-action > b:last-child,
body:not(.admin-body) .start-form-btn > b:last-child{
  justify-self:end!important;
  background:#eaf2ff!important;
  color:#2563eb!important;
  border-radius:999px!important;
  padding:8px 13px!important;
  font-size:13px!important;
  line-height:1!important;
  font-weight:900!important;
  white-space:nowrap!important;
}

/* Dashboard: compact today's status cards for mobile */
body:not(.admin-body) .today-status-card,
body:not(.admin-body) .dashboard-status-card,
body:not(.admin-body) .status-today-card{
  padding:14px!important;
  border-radius:22px!important;
}

body:not(.admin-body) .today-status-grid,
body:not(.admin-body) .dashboard-status-grid,
body:not(.admin-body) .stats-grid{
  gap:8px!important;
}

body:not(.admin-body) .today-status-grid .stat,
body:not(.admin-body) .dashboard-status-grid .stat,
body:not(.admin-body) .stats-grid .stat,
body:not(.admin-body) .stat-card{
  min-height:64px!important;
  padding:10px 12px!important;
  border-radius:16px!important;
}

body:not(.admin-body) .today-status-grid .stat b,
body:not(.admin-body) .dashboard-status-grid .stat b,
body:not(.admin-body) .stats-grid .stat b,
body:not(.admin-body) .stat-card b{
  font-size:24px!important;
  line-height:1.05!important;
}

body:not(.admin-body) .today-status-grid .stat span,
body:not(.admin-body) .dashboard-status-grid .stat span,
body:not(.admin-body) .stats-grid .stat span,
body:not(.admin-body) .stat-card span{
  font-size:12px!important;
  line-height:1.2!important;
}

/* History detail: never crop/squash photos. Show original ratio. */
body:not(.admin-body) .driver-history-detail img,
body:not(.admin-body) .history-detail img,
body:not(.admin-body) .history-photo-full,
body:not(.admin-body) .history-detail-photo,
body:not(.admin-body) .driver-history-photo,
body:not(.admin-body) .detail-photo,
body:not(.admin-body) .dh-photo,
body:not(.admin-body) .inspection-item-photo,
body:not(.admin-body) .vehicle-history-photo{
  width:100%!important;
  height:auto!important;
  max-height:none!important;
  object-fit:contain!important;
  object-position:center center!important;
  aspect-ratio:auto!important;
  border-radius:16px!important;
  background:#f8fafc!important;
}

/* Vehicle inspection detail thumbnails: keep thumbnails small but not distorted */
body:not(.admin-body) .driver-history-detail .thumb img,
body:not(.admin-body) .history-detail .thumb img,
body:not(.admin-body) .inspection-thumb img,
body:not(.admin-body) .history-thumb img{
  width:72px!important;
  height:72px!important;
  object-fit:contain!important;
  object-position:center center!important;
  background:#f8fafc!important;
  border-radius:12px!important;
}

@media(max-width:430px){
  body:not(.admin-body) .dashboard-start-btn,
  body:not(.admin-body) .dash-action,
  body:not(.admin-body) .start-form-btn{
    min-height:60px!important;
    grid-template-columns:46px 1fr auto!important;
    padding:9px 12px!important;
    border-radius:18px!important;
  }
  body:not(.admin-body) .dashboard-start-btn .action-icon,
  body:not(.admin-body) .dash-action .action-icon,
  body:not(.admin-body) .start-form-btn .action-icon{
    width:40px!important;
    height:40px!important;
    border-radius:15px!important;
  }
  body:not(.admin-body) .dashboard-start-btn .action-title,
  body:not(.admin-body) .dash-action .action-title,
  body:not(.admin-body) .start-form-btn .action-title{
    font-size:16px!important;
  }
  body:not(.admin-body) .dashboard-start-btn .action-sub,
  body:not(.admin-body) .dash-action .action-sub,
  body:not(.admin-body) .start-form-btn .action-sub{
    font-size:11px!important;
  }
}

/* v172 bottom nav alias keeps v163 edge-to-edge behavior */



/* v172 History Detail Image Ratio Fix
   Requirement: ประวัติ > ดูรายละเอียด รูปต้องไม่ถูกบีบ ไม่ crop และแสดงเต็มสัดส่วนเดิม */
body:not(.admin-body) .driver-history-detail .dh-photo-wrap,
body:not(.admin-body) .history-detail .dh-photo-wrap,
body:not(.admin-body) .driver-history-detail .photo-wrap,
body:not(.admin-body) .history-detail .photo-wrap,
body:not(.admin-body) .driver-history-detail .signature-box,
body:not(.admin-body) .history-detail .signature-box{
  width:100%!important;
  height:auto!important;
  min-height:0!important;
  max-height:none!important;
  overflow:visible!important;
  display:block!important;
  padding:0!important;
  background:#ffffff!important;
}

body:not(.admin-body) .driver-history-detail .dh-detail-img,
body:not(.admin-body) .history-detail .dh-detail-img,
body:not(.admin-body) .driver-history-detail img.dh-photo,
body:not(.admin-body) .history-detail img.dh-photo,
body:not(.admin-body) .driver-history-detail img.history-photo-full,
body:not(.admin-body) .history-detail img.history-photo-full,
body:not(.admin-body) .driver-history-detail img.history-detail-photo,
body:not(.admin-body) .history-detail img.history-detail-photo,
body:not(.admin-body) .driver-history-detail img.driver-history-photo,
body:not(.admin-body) .history-detail img.driver-history-photo,
body:not(.admin-body) .driver-history-detail img.dh-signature-img,
body:not(.admin-body) .history-detail img.dh-signature-img,
body:not(.admin-body) .driver-history-detail .signature-card img,
body:not(.admin-body) .history-detail .signature-card img{
  display:block!important;
  width:100%!important;
  height:auto!important;
  min-height:0!important;
  max-height:none!important;
  aspect-ratio:auto!important;
  object-fit:contain!important;
  object-position:center center!important;
  border-radius:16px!important;
  background:#f8fafc!important;
  border:1px solid #e2e8f0!important;
  box-sizing:border-box!important;
}

/* Full-width photo rows for alcohol / amphetamine details */
body:not(.admin-body) .driver-history-detail .dh-photo-full,
body:not(.admin-body) .history-detail .dh-photo-full,
body:not(.admin-body) .driver-history-detail .history-photo-row,
body:not(.admin-body) .history-detail .history-photo-row{
  width:100%!important;
  height:auto!important;
  overflow:visible!important;
  display:block!important;
}

/* Vehicle inspection item thumbnails: keep compact but not distorted/cropped */
body:not(.admin-body) .driver-history-detail .dh-thumb,
body:not(.admin-body) .history-detail .dh-thumb,
body:not(.admin-body) .driver-history-detail .inspection-thumb,
body:not(.admin-body) .history-detail .inspection-thumb,
body:not(.admin-body) .driver-history-detail .history-thumb,
body:not(.admin-body) .history-detail .history-thumb{
  width:88px!important;
  height:auto!important;
  min-height:64px!important;
  max-height:none!important;
  overflow:visible!important;
  background:#ffffff!important;
}

body:not(.admin-body) .driver-history-detail .dh-thumb img,
body:not(.admin-body) .history-detail .dh-thumb img,
body:not(.admin-body) .driver-history-detail .inspection-thumb img,
body:not(.admin-body) .history-detail .inspection-thumb img,
body:not(.admin-body) .driver-history-detail .history-thumb img,
body:not(.admin-body) .history-detail .history-thumb img,
body:not(.admin-body) .driver-history-detail img.dh-thumb-img,
body:not(.admin-body) .history-detail img.dh-thumb-img{
  display:block!important;
  width:88px!important;
  height:auto!important;
  min-height:64px!important;
  max-height:120px!important;
  aspect-ratio:auto!important;
  object-fit:contain!important;
  object-position:center center!important;
  border-radius:12px!important;
  background:#f8fafc!important;
  border:1px solid #e2e8f0!important;
}

/* Prevent parent rows from forcing image strip height */
body:not(.admin-body) .driver-history-detail .photo-list,
body:not(.admin-body) .history-detail .photo-list,
body:not(.admin-body) .driver-history-detail .dh-photo-list,
body:not(.admin-body) .history-detail .dh-photo-list{
  display:flex!important;
  flex-direction:column!important;
  gap:12px!important;
  width:100%!important;
  height:auto!important;
  overflow:visible!important;
}

body:not(.admin-body) .driver-history-detail .inspection-item-row,
body:not(.admin-body) .history-detail .inspection-item-row,
body:not(.admin-body) .driver-history-detail .vehicle-item-row,
body:not(.admin-body) .history-detail .vehicle-item-row{
  height:auto!important;
  min-height:72px!important;
  overflow:visible!important;
  align-items:flex-start!important;
}



/* v172 REAL history detail image render fix
   Target actual classes generated by driver-history.js:
   - dh-photo-full
   - dh-signature-photo
   - dh-item-thumb
   - dh-render-full / dh-render-thumb
*/
body:not(.admin-body) .dh-photo-full-list{
  width:100%!important;
  display:flex!important;
  flex-direction:column!important;
  gap:14px!important;
  height:auto!important;
  overflow:visible!important;
}

body:not(.admin-body) button.dh-photo-full,
body:not(.admin-body) button.dh-signature-photo,
body:not(.admin-body) button.dh-render-full{
  width:100%!important;
  height:auto!important;
  min-height:0!important;
  max-height:none!important;
  display:flex!important;
  flex-direction:column!important;
  align-items:stretch!important;
  justify-content:flex-start!important;
  gap:8px!important;
  padding:10px!important;
  overflow:visible!important;
  border:1px solid #dbe3ef!important;
  border-radius:18px!important;
  background:#fff!important;
  box-sizing:border-box!important;
  text-align:left!important;
}

body:not(.admin-body) button.dh-photo-full img,
body:not(.admin-body) button.dh-signature-photo img,
body:not(.admin-body) button.dh-render-full img,
body:not(.admin-body) img.dh-render-full-img{
  display:block!important;
  width:100%!important;
  height:auto!important;
  min-height:0!important;
  max-height:none!important;
  aspect-ratio:auto!important;
  object-fit:contain!important;
  object-position:center center!important;
  border-radius:14px!important;
  background:#f8fafc!important;
  border:1px solid #e2e8f0!important;
  box-sizing:border-box!important;
}

body:not(.admin-body) button.dh-photo-full span,
body:not(.admin-body) button.dh-signature-photo span,
body:not(.admin-body) button.dh-render-full span{
  display:block!important;
  width:100%!important;
  height:auto!important;
  min-height:0!important;
  padding:4px 2px 0!important;
  color:#334155!important;
  font-size:13px!important;
  line-height:1.25!important;
  font-weight:850!important;
  text-align:left!important;
  white-space:normal!important;
}

/* Signatures must not be shown as thin cropped strips */
body:not(.admin-body) .dh-signature-grid{
  display:grid!important;
  grid-template-columns:1fr!important;
  gap:16px!important;
}

body:not(.admin-body) .dh-signature-grid > div{
  width:100%!important;
  min-width:0!important;
  overflow:visible!important;
}

/* Inspection item thumbnails: compact but keep original ratio */
body:not(.admin-body) .dh-item-thumbs{
  display:flex!important;
  flex-wrap:wrap!important;
  align-items:flex-start!important;
  gap:8px!important;
  width:100%!important;
  height:auto!important;
  overflow:visible!important;
  margin-top:8px!important;
}

body:not(.admin-body) button.dh-item-thumb,
body:not(.admin-body) button.dh-render-thumb{
  width:96px!important;
  height:auto!important;
  min-height:72px!important;
  max-height:none!important;
  display:flex!important;
  flex-direction:column!important;
  align-items:stretch!important;
  justify-content:flex-start!important;
  gap:4px!important;
  padding:6px!important;
  overflow:visible!important;
  border:1px solid #dbe3ef!important;
  border-radius:14px!important;
  background:#fff!important;
  box-sizing:border-box!important;
}

body:not(.admin-body) button.dh-item-thumb img,
body:not(.admin-body) button.dh-render-thumb img,
body:not(.admin-body) img.dh-render-thumb-img{
  display:block!important;
  width:100%!important;
  height:auto!important;
  min-height:54px!important;
  max-height:110px!important;
  aspect-ratio:auto!important;
  object-fit:contain!important;
  object-position:center center!important;
  border-radius:10px!important;
  background:#f8fafc!important;
  border:1px solid #e2e8f0!important;
  box-sizing:border-box!important;
}

body:not(.admin-body) button.dh-item-thumb span,
body:not(.admin-body) button.dh-render-thumb span{
  display:block!important;
  width:100%!important;
  height:auto!important;
  min-height:0!important;
  padding:2px 0 0!important;
  color:#334155!important;
  font-size:10px!important;
  line-height:1.15!important;
  font-weight:800!important;
  text-align:center!important;
  white-space:normal!important;
}

/* Avoid old fixed strip layouts from previous versions */
body:not(.admin-body) .dh-detail-card,
body:not(.admin-body) .dh-inspection-item{
  overflow:visible!important;
  height:auto!important;
  max-height:none!important;
}

body:not(.admin-body) .dh-inspection-item{
  align-items:flex-start!important;
}



/* v172 history detail photo clean + pass criteria */
body:not(.admin-body) button.dh-photo-full,
body:not(.admin-body) button.dh-signature-photo,
body:not(.admin-body) button.dh-render-full{
  padding:0!important;
  border:0!important;
  border-radius:0!important;
  background:transparent!important;
  box-shadow:none!important;
  overflow:visible!important;
  gap:0!important;
}

body:not(.admin-body) button.dh-photo-full img,
body:not(.admin-body) button.dh-signature-photo img,
body:not(.admin-body) button.dh-render-full img,
body:not(.admin-body) img.dh-render-full-img{
  border:0!important;
  border-radius:0!important;
  background:transparent!important;
  box-shadow:none!important;
}

body:not(.admin-body) button.dh-photo-full span,
body:not(.admin-body) button.dh-signature-photo span,
body:not(.admin-body) button.dh-render-full span,
body:not(.admin-body) button.dh-item-thumb span,
body:not(.admin-body) button.dh-render-thumb span{
  display:none!important;
}

body:not(.admin-body) button.dh-item-thumb,
body:not(.admin-body) button.dh-render-thumb{
  border:0!important;
  background:transparent!important;
  box-shadow:none!important;
  padding:0!important;
  border-radius:0!important;
}

body:not(.admin-body) button.dh-item-thumb img,
body:not(.admin-body) button.dh-render-thumb img,
body:not(.admin-body) img.dh-render-thumb-img{
  border:0!important;
  background:transparent!important;
  box-shadow:none!important;
  border-radius:8px!important;
}

body:not(.admin-body) .dh-pass-criteria{
  display:block!important;
  margin-top:6px!important;
  color:#64748b!important;
  font-size:12px!important;
  line-height:1.35!important;
  font-weight:800!important;
}

body:not(.admin-body) .dh-pass-criteria strong{
  color:#334155!important;
  font-weight:950!important;
}

body:not(.admin-body) .dh-item-main{
  display:flex!important;
  flex-direction:column!important;
  gap:4px!important;
}



/* v172 History inspection item alignment
   Requirement: หัวข้อและเกณฑ์ผ่านชิดซ้าย / ผ่าน-ไม่ผ่านชิดขวา */
body:not(.admin-body) .driver-history-detail .dh-inspection-item,
body:not(.admin-body) .history-detail .dh-inspection-item,
body:not(.admin-body) .dh-inspection-item{
  display:grid!important;
  grid-template-columns:minmax(0,1fr) auto!important;
  grid-template-areas:
    "main status"
    "photos photos"
    "note note"!important;
  align-items:start!important;
  column-gap:12px!important;
  row-gap:10px!important;
  text-align:left!important;
}

body:not(.admin-body) .driver-history-detail .dh-inspection-item .dh-item-main,
body:not(.admin-body) .history-detail .dh-inspection-item .dh-item-main,
body:not(.admin-body) .dh-inspection-item .dh-item-main{
  grid-area:main!important;
  min-width:0!important;
  width:100%!important;
  display:flex!important;
  flex-direction:column!important;
  align-items:flex-start!important;
  justify-content:flex-start!important;
  text-align:left!important;
  gap:5px!important;
}

body:not(.admin-body) .driver-history-detail .dh-inspection-item .dh-item-main > b,
body:not(.admin-body) .history-detail .dh-inspection-item .dh-item-main > b,
body:not(.admin-body) .dh-inspection-item .dh-item-main > b{
  display:block!important;
  width:100%!important;
  text-align:left!important;
  margin:0!important;
  color:#111827!important;
  font-size:17px!important;
  line-height:1.25!important;
  font-weight:950!important;
}

body:not(.admin-body) .driver-history-detail .dh-inspection-item .dh-pass-criteria,
body:not(.admin-body) .history-detail .dh-inspection-item .dh-pass-criteria,
body:not(.admin-body) .dh-inspection-item .dh-pass-criteria{
  display:block!important;
  width:100%!important;
  text-align:left!important;
  margin:0!important;
  color:#64748b!important;
  font-size:12px!important;
  line-height:1.35!important;
  font-weight:800!important;
}

body:not(.admin-body) .driver-history-detail .dh-inspection-item .dh-pass-criteria strong,
body:not(.admin-body) .history-detail .dh-inspection-item .dh-pass-criteria strong,
body:not(.admin-body) .dh-inspection-item .dh-pass-criteria strong{
  color:#334155!important;
  font-weight:950!important;
}

body:not(.admin-body) .driver-history-detail .dh-inspection-item .dh-chip,
body:not(.admin-body) .history-detail .dh-inspection-item .dh-chip,
body:not(.admin-body) .dh-inspection-item .dh-chip{
  grid-area:status!important;
  justify-self:end!important;
  align-self:start!important;
  margin:0!important;
  min-width:72px!important;
  height:44px!important;
  padding:0 14px!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  text-align:center!important;
  border-radius:16px!important;
  font-size:15px!important;
  font-weight:950!important;
  white-space:nowrap!important;
}

body:not(.admin-body) .driver-history-detail .dh-inspection-item .dh-item-thumbs,
body:not(.admin-body) .history-detail .dh-inspection-item .dh-item-thumbs,
body:not(.admin-body) .dh-inspection-item .dh-item-thumbs{
  grid-area:photos!important;
  justify-self:start!important;
  width:100%!important;
  margin-top:2px!important;
}

body:not(.admin-body) .driver-history-detail .dh-inspection-item > p,
body:not(.admin-body) .history-detail .dh-inspection-item > p,
body:not(.admin-body) .dh-inspection-item > p{
  grid-area:note!important;
  text-align:left!important;
  margin:0!important;
}

@media(max-width:430px){
  body:not(.admin-body) .driver-history-detail .dh-inspection-item,
  body:not(.admin-body) .history-detail .dh-inspection-item,
  body:not(.admin-body) .dh-inspection-item{
    grid-template-columns:minmax(0,1fr) auto!important;
    column-gap:10px!important;
  }
  body:not(.admin-body) .driver-history-detail .dh-inspection-item .dh-item-main > b,
  body:not(.admin-body) .history-detail .dh-inspection-item .dh-item-main > b,
  body:not(.admin-body) .dh-inspection-item .dh-item-main > b{
    font-size:16px!important;
  }
  body:not(.admin-body) .driver-history-detail .dh-inspection-item .dh-chip,
  body:not(.admin-body) .history-detail .dh-inspection-item .dh-chip,
  body:not(.admin-body) .dh-inspection-item .dh-chip{
    min-width:64px!important;
    height:40px!important;
    border-radius:14px!important;
    font-size:14px!important;
    padding:0 12px!important;
  }
}



/* v172 History test photos thumbnail view
   Requirement: รูปประกอบแอลกอฮอล์/แอมเฟตามีน ให้เป็นรูปย่อขนาดเดียวกับตรวจรถ */
body:not(.admin-body) .dh-test-photo-thumbs{
  display:flex!important;
  flex-wrap:wrap!important;
  align-items:flex-start!important;
  justify-content:flex-start!important;
  gap:8px!important;
  width:100%!important;
  height:auto!important;
  overflow:visible!important;
  margin-top:8px!important;
}

body:not(.admin-body) button.dh-test-thumb,
body:not(.admin-body) .dh-test-photo-thumbs button.dh-item-thumb,
body:not(.admin-body) .dh-test-photo-thumbs button.dh-render-thumb{
  width:96px!important;
  height:auto!important;
  min-height:72px!important;
  max-height:none!important;
  display:flex!important;
  flex-direction:column!important;
  align-items:stretch!important;
  justify-content:flex-start!important;
  padding:0!important;
  overflow:visible!important;
  border:0!important;
  border-radius:0!important;
  background:transparent!important;
  box-shadow:none!important;
}

body:not(.admin-body) button.dh-test-thumb img,
body:not(.admin-body) .dh-test-photo-thumbs button.dh-item-thumb img,
body:not(.admin-body) .dh-test-photo-thumbs button.dh-render-thumb img{
  display:block!important;
  width:96px!important;
  height:auto!important;
  min-height:54px!important;
  max-height:120px!important;
  aspect-ratio:auto!important;
  object-fit:contain!important;
  object-position:center center!important;
  border:0!important;
  border-radius:8px!important;
  background:transparent!important;
  box-shadow:none!important;
}

body:not(.admin-body) button.dh-test-thumb span,
body:not(.admin-body) .dh-test-photo-thumbs button span{
  display:none!important;
}



/* v172 History detail signature fit
   Requirement: รูปลายเซ็นไม่ล้นกรอบ และแสดงเต็มกรอบตามสัดส่วนจริง */
body:not(.admin-body) .dh-signature-fit-v172,
body:not(.admin-body) .dh-signature-section{
  overflow:hidden!important;
  box-sizing:border-box!important;
}

body:not(.admin-body) .dh-signature-grid{
  display:grid!important;
  grid-template-columns:1fr!important;
  gap:16px!important;
  width:100%!important;
  max-width:100%!important;
  overflow:hidden!important;
  box-sizing:border-box!important;
}

body:not(.admin-body) .dh-signature-grid > div{
  width:100%!important;
  max-width:100%!important;
  min-width:0!important;
  overflow:hidden!important;
  box-sizing:border-box!important;
}

body:not(.admin-body) button.dh-signature-photo,
body:not(.admin-body) button.dh-render-signature{
  width:100%!important;
  max-width:100%!important;
  min-width:0!important;
  height:auto!important;
  min-height:0!important;
  max-height:none!important;
  display:block!important;
  overflow:hidden!important;
  padding:0!important;
  margin:8px 0 0 0!important;
  border:0!important;
  border-radius:12px!important;
  background:transparent!important;
  box-shadow:none!important;
  box-sizing:border-box!important;
}

body:not(.admin-body) button.dh-signature-photo img,
body:not(.admin-body) button.dh-render-signature img,
body:not(.admin-body) .dh-signature-section img,
body:not(.admin-body) .dh-signature-grid img{
  display:block!important;
  width:100%!important;
  max-width:100%!important;
  height:auto!important;
  min-height:0!important;
  max-height:none!important;
  aspect-ratio:auto!important;
  object-fit:contain!important;
  object-position:center center!important;
  margin:0!important;
  border:0!important;
  border-radius:12px!important;
  background:#fff!important;
  box-shadow:none!important;
  box-sizing:border-box!important;
}

body:not(.admin-body) .dh-signature-grid b{
  display:block!important;
  margin:0 0 6px!important;
  color:#111827!important;
  font-size:16px!important;
  line-height:1.25!important;
  font-weight:950!important;
  text-align:left!important;
}

/* Prevent any old button/span layout from pushing signature outside */
body:not(.admin-body) button.dh-render-signature span,
body:not(.admin-body) button.dh-signature-photo span{
  display:none!important;
}

/* Mobile safe: never let signature content exceed viewport/card width */
@media(max-width:520px){
  body:not(.admin-body) .dh-signature-section,
  body:not(.admin-body) .dh-signature-fit-v172{
    padding-left:14px!important;
    padding-right:14px!important;
  }
  body:not(.admin-body) .dh-signature-grid,
  body:not(.admin-body) .dh-signature-grid > div,
  body:not(.admin-body) button.dh-signature-photo,
  body:not(.admin-body) button.dh-render-signature,
  body:not(.admin-body) .dh-signature-section img{
    width:100%!important;
    max-width:100%!important;
  }
}



/* v176 unified icon theme: MENU icons and CONTENT icons are separated */

/* MENU: bottom navigation only */
body:not(.admin-body) .bottom-nav.circular-bottom-nav-v176{
  position:fixed!important;
  left:0!important;
  right:0!important;
  bottom:0!important;
  width:100vw!important;
  max-width:none!important;
  transform:none!important;
  margin:0!important;
  display:grid!important;
  grid-template-columns:repeat(5,minmax(0,1fr))!important;
  gap:0!important;
  padding:8px 6px calc(8px + env(safe-area-inset-bottom,0px))!important;
  background:#fff!important;
  border:0!important;
  border-top:1px solid #dbe3ef!important;
  border-radius:0!important;
  box-shadow:0 -8px 26px rgba(15,23,42,.12)!important;
  z-index:9999!important;
  backdrop-filter:none!important;
  -webkit-backdrop-filter:none!important;
}
body:not(.admin-body) .bottom-nav.circular-bottom-nav-v176 .nav-btn{
  width:100%!important;
  min-width:0!important;
  max-width:none!important;
  min-height:58px!important;
  padding:6px 2px!important;
  border:0!important;
  border-radius:14px!important;
  background:transparent!important;
  color:#111827!important;
  display:flex!important;
  flex-direction:column!important;
  align-items:center!important;
  justify-content:center!important;
  gap:3px!important;
  box-shadow:none!important;
  overflow:hidden!important;
}
body:not(.admin-body) .bottom-nav.circular-bottom-nav-v176 .nav-btn span{
  width:24px!important;
  height:24px!important;
  display:grid!important;
  place-items:center!important;
  font-size:0!important;
  line-height:1!important;
}
body:not(.admin-body) .bottom-nav.circular-bottom-nav-v176 .nav-btn svg{
  width:24px!important;
  height:24px!important;
  fill:none!important;
  stroke:currentColor!important;
  stroke-width:1.9!important;
  stroke-linecap:round!important;
  stroke-linejoin:round!important;
  display:block!important;
}
body:not(.admin-body) .bottom-nav.circular-bottom-nav-v176 .nav-btn b{
  display:block!important;
  max-width:100%!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  white-space:nowrap!important;
  font-size:11px!important;
  line-height:1.1!important;
  font-weight:850!important;
  color:currentColor!important;
}
body:not(.admin-body) .bottom-nav.circular-bottom-nav-v176 .nav-btn.active{
  background:#eaf2ff!important;
  color:#2563eb!important;
}

/* CONTENT: dashboard/form/history cards only */
body:not(.admin-body) .line-icon,
body:not(.admin-body) .dh-icon,
body:not(.admin-body) .form-card-icon,
body:not(.admin-body) .action-icon.line-icon{
  width:58px!important;
  height:58px!important;
  min-width:58px!important;
  border-radius:50%!important;
  display:grid!important;
  place-items:center!important;
  font-size:0!important;
  flex:0 0 auto!important;
  box-sizing:border-box!important;
  overflow:hidden!important;
}
body:not(.admin-body) .line-icon svg,
body:not(.admin-body) .dh-icon svg,
body:not(.admin-body) .form-card-icon svg,
body:not(.admin-body) .action-icon.line-icon svg{
  width:34px!important;
  height:34px!important;
  fill:none!important;
  stroke:currentColor!important;
  stroke-width:2.4!important;
  stroke-linecap:round!important;
  stroke-linejoin:round!important;
  display:block!important;
}
body:not(.admin-body) .line-icon.truck,
body:not(.admin-body) .dh-icon-truck,
body:not(.admin-body) .form-card-icon.truck{
  color:#2563eb!important;
  background:#eff6ff!important;
  border:1px solid #dbeafe!important;
}
body:not(.admin-body) .line-icon.tube,
body:not(.admin-body) .dh-icon-tube,
body:not(.admin-body) .form-card-icon.tube{
  color:#059669!important;
  background:#ecfdf5!important;
  border:1px solid #bbf7d0!important;
}
body:not(.admin-body) .line-icon.microscope,
body:not(.admin-body) .dh-icon-microscope,
body:not(.admin-body) .form-card-icon.microscope{
  color:#e11d48!important;
  background:#fff1f2!important;
  border:1px solid #fecdd3!important;
}

/* Dashboard "งานหลักวันนี้" card buttons */
body:not(.admin-body) .dashboard-start-grid{
  display:flex!important;
  flex-direction:column!important;
  gap:12px!important;
}
body:not(.admin-body) .dashboard-start-btn{
  width:100%!important;
  display:grid!important;
  grid-template-columns:74px minmax(0,1fr) auto!important;
  align-items:center!important;
  gap:14px!important;
  min-height:82px!important;
  padding:12px 16px!important;
  border:1px solid #dbe3ef!important;
  border-radius:24px!important;
  background:#fff!important;
  color:#111827!important;
  text-align:left!important;
  box-shadow:0 8px 22px rgba(15,23,42,.06)!important;
}
body:not(.admin-body) .dashboard-start-btn .action-copy{
  min-width:0!important;
  display:block!important;
  text-align:left!important;
}
body:not(.admin-body) .dashboard-start-btn .action-copy b{
  display:block!important;
  font-size:18px!important;
  line-height:1.2!important;
  font-weight:950!important;
  color:#111827!important;
  white-space:normal!important;
  overflow:visible!important;
}
body:not(.admin-body) .dashboard-start-btn .action-copy small{
  display:block!important;
  margin-top:4px!important;
  color:#64748b!important;
  font-size:12px!important;
  line-height:1.25!important;
  font-weight:750!important;
}
body:not(.admin-body) .dashboard-start-btn em{
  justify-self:end!important;
  align-self:center!important;
  font-style:normal!important;
  color:#64748b!important;
  font-size:0!important;
}
body:not(.admin-body) .dashboard-start-btn em::after{
  content:'›';
  font-size:30px!important;
  line-height:1!important;
  font-weight:400!important;
  color:#111827!important;
}

/* Form menu cards */
body:not(.admin-body) .app-form-card{
  display:grid!important;
  grid-template-columns:74px minmax(0,1fr) auto!important;
  gap:14px!important;
  align-items:center!important;
  min-height:82px!important;
  padding:12px 16px!important;
  border-radius:24px!important;
}
body:not(.admin-body) .app-form-card .form-card-icon{
  width:58px!important;
  height:58px!important;
  min-width:58px!important;
  border-radius:50%!important;
}

/* History list cards */
body:not(.admin-body) .dh-card{
  display:grid!important;
  grid-template-columns:74px minmax(0,1fr) auto!important;
  gap:14px!important;
  align-items:center!important;
}
body:not(.admin-body) .dh-card .dh-icon{
  align-self:center!important;
}

/* Bottom spacing for edge-to-edge menu */
body:not(.admin-body) .has-bottom-nav,
.has-bottom-nav{
  padding-bottom:calc(94px + env(safe-area-inset-bottom,0px))!important;
}

@media(max-width:430px){
  body:not(.admin-body) .dashboard-start-btn,
  body:not(.admin-body) .app-form-card,
  body:not(.admin-body) .dh-card{
    grid-template-columns:66px minmax(0,1fr) auto!important;
    gap:12px!important;
  }
  body:not(.admin-body) .line-icon,
  body:not(.admin-body) .dh-icon,
  body:not(.admin-body) .form-card-icon,
  body:not(.admin-body) .action-icon.line-icon{
    width:54px!important;
    height:54px!important;
    min-width:54px!important;
  }
  body:not(.admin-body) .line-icon svg,
  body:not(.admin-body) .dh-icon svg,
  body:not(.admin-body) .form-card-icon svg,
  body:not(.admin-body) .action-icon.line-icon svg{
    width:31px!important;
    height:31px!important;
  }
}



/* v176 content icons REAL fix */
body:not(.admin-body) .content-icon,
body:not(.admin-body) .dashboard-start-btn .action-icon.content-icon,
body:not(.admin-body) .app-form-card .form-card-icon.content-icon,
body:not(.admin-body) .dh-card .dh-icon.content-icon,
body:not(.admin-body) .dh-detail-top .dh-icon.content-icon{
  width:58px!important;height:58px!important;min-width:58px!important;max-width:58px!important;
  border-radius:50%!important;display:grid!important;place-items:center!important;
  overflow:hidden!important;font-size:0!important;box-sizing:border-box!important;flex:0 0 58px!important;padding:0!important;
}
body:not(.admin-body) .content-icon svg,
body:not(.admin-body) .dashboard-start-btn .action-icon.content-icon svg,
body:not(.admin-body) .app-form-card .form-card-icon.content-icon svg,
body:not(.admin-body) .dh-card .dh-icon.content-icon svg,
body:not(.admin-body) .dh-detail-top .dh-icon.content-icon svg{
  width:34px!important;height:34px!important;fill:none!important;stroke:currentColor!important;
  stroke-width:2.35!important;stroke-linecap:round!important;stroke-linejoin:round!important;display:block!important;
}
body:not(.admin-body) .content-icon.truck,
body:not(.admin-body) .content-icon.dh-icon-truck,
body:not(.admin-body) .dh-icon-truck.content-icon,
body:not(.admin-body) .form-card-icon.truck,
body:not(.admin-body) .action-icon.truck{
  color:#2563eb!important;background:#eff6ff!important;border:1px solid #dbeafe!important;
}
body:not(.admin-body) .content-icon.tube,
body:not(.admin-body) .content-icon.dh-icon-tube,
body:not(.admin-body) .dh-icon-tube.content-icon,
body:not(.admin-body) .form-card-icon.tube,
body:not(.admin-body) .action-icon.tube{
  color:#059669!important;background:#ecfdf5!important;border:1px solid #bbf7d0!important;
}
body:not(.admin-body) .content-icon.microscope,
body:not(.admin-body) .content-icon.dh-icon-microscope,
body:not(.admin-body) .dh-icon-microscope.content-icon,
body:not(.admin-body) .form-card-icon.microscope,
body:not(.admin-body) .action-icon.microscope{
  color:#e11d48!important;background:#fff1f2!important;border:1px solid #fecdd3!important;
}
body:not(.admin-body) .app-form-list{display:flex!important;flex-direction:column!important;gap:12px!important;}
body:not(.admin-body) .dashboard-start-btn,
body:not(.admin-body) .app-form-card,
body:not(.admin-body) .dh-card{
  display:grid!important;grid-template-columns:72px minmax(0,1fr) auto!important;gap:14px!important;align-items:center!important;
}
body:not(.admin-body) .app-form-card,
body:not(.admin-body) .dashboard-start-btn{
  min-height:82px!important;padding:12px 16px!important;border-radius:24px!important;border:1px solid #dbe3ef!important;background:#fff!important;
}
body:not(.admin-body) .form-card-copy,
body:not(.admin-body) .dashboard-start-btn .action-copy{display:block!important;text-align:left!important;min-width:0!important;}
body:not(.admin-body) .form-card-copy b,
body:not(.admin-body) .dashboard-start-btn .action-copy b{display:block!important;font-size:18px!important;line-height:1.22!important;font-weight:950!important;color:#111827!important;white-space:normal!important;}
body:not(.admin-body) .form-card-copy small,
body:not(.admin-body) .dashboard-start-btn .action-copy small{display:block!important;margin-top:4px!important;color:#64748b!important;font-size:12px!important;line-height:1.25!important;font-weight:750!important;}
body:not(.admin-body) .app-form-card em,
body:not(.admin-body) .dashboard-start-btn em{justify-self:end!important;align-self:center!important;font-style:normal!important;font-size:30px!important;line-height:1!important;color:#111827!important;}
body:not(.admin-body) .bottom-nav .content-icon{width:24px!important;height:24px!important;min-width:24px!important;border-radius:0!important;background:transparent!important;border:0!important;}
@media(max-width:430px){
  body:not(.admin-body) .content-icon,
  body:not(.admin-body) .dashboard-start-btn .action-icon.content-icon,
  body:not(.admin-body) .app-form-card .form-card-icon.content-icon,
  body:not(.admin-body) .dh-card .dh-icon.content-icon{
    width:54px!important;height:54px!important;min-width:54px!important;max-width:54px!important;flex-basis:54px!important;
  }
  body:not(.admin-body) .content-icon svg,
  body:not(.admin-body) .dashboard-start-btn .action-icon.content-icon svg,
  body:not(.admin-body) .app-form-card .form-card-icon.content-icon svg,
  body:not(.admin-body) .dh-card .dh-icon.content-icon svg{width:31px!important;height:31px!important;}
  body:not(.admin-body) .dashboard-start-btn,
  body:not(.admin-body) .app-form-card,
  body:not(.admin-body) .dh-card{grid-template-columns:66px minmax(0,1fr) auto!important;gap:12px!important;}
}



/* v240 compact layout fix for uploaded icon set
   Goal: match Screen 1 proportions, avoid huge/overflow content cards. */

/* Global content icon size: compact and stable */
body:not(.admin-body) .circular-content-icon,
body:not(.admin-body) .content-icon,
body:not(.admin-body) .form-card-icon.circular-content-icon,
body:not(.admin-body) .action-icon.circular-content-icon,
body:not(.admin-body) .dh-icon.circular-content-icon{
  width:52px!important;
  height:52px!important;
  min-width:52px!important;
  max-width:52px!important;
  flex:0 0 52px!important;
  border-radius:18px!important;
  display:grid!important;
  place-items:center!important;
  padding:0!important;
  overflow:hidden!important;
  box-sizing:border-box!important;
}

body:not(.admin-body) .circular-content-icon .circular-content-icon-img,
body:not(.admin-body) .content-icon .circular-content-icon-img,
body:not(.admin-body) .form-card-icon .circular-content-icon-img,
body:not(.admin-body) .action-icon .circular-content-icon-img,
body:not(.admin-body) .dh-icon .circular-content-icon-img,
body:not(.admin-body) .circular-content-icon-img{
  width:30px!important;
  height:30px!important;
  max-width:30px!important;
  max-height:30px!important;
  display:block!important;
  object-fit:contain!important;
}

/* Dashboard and form menu cards: no overflow to the right */
body:not(.admin-body) .dashboard-start-grid,
body:not(.admin-body) .app-form-list{
  display:flex!important;
  flex-direction:column!important;
  gap:10px!important;
  width:100%!important;
  max-width:100%!important;
  overflow:hidden!important;
}

body:not(.admin-body) .dashboard-start-btn,
body:not(.admin-body) .app-form-card{
  width:100%!important;
  max-width:100%!important;
  min-width:0!important;
  min-height:72px!important;
  height:auto!important;
  display:grid!important;
  grid-template-columns:60px minmax(0,1fr) auto!important;
  gap:12px!important;
  align-items:center!important;
  padding:10px 12px!important;
  border-radius:20px!important;
  border:1px solid #dbe3ef!important;
  background:#fff!important;
  box-shadow:0 6px 18px rgba(15,23,42,.055)!important;
  overflow:hidden!important;
  box-sizing:border-box!important;
  text-align:left!important;
}

/* Text must stay inside card */
body:not(.admin-body) .dashboard-start-btn .action-copy,
body:not(.admin-body) .app-form-card .form-card-copy{
  min-width:0!important;
  max-width:100%!important;
  overflow:hidden!important;
  text-align:left!important;
  display:block!important;
}

body:not(.admin-body) .dashboard-start-btn .action-copy b,
body:not(.admin-body) .app-form-card .form-card-copy b{
  display:block!important;
  margin:0!important;
  max-width:100%!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  white-space:nowrap!important;
  font-size:17px!important;
  line-height:1.22!important;
  font-weight:950!important;
  color:#111827!important;
}

body:not(.admin-body) .dashboard-start-btn .action-copy small,
body:not(.admin-body) .app-form-card .form-card-copy small{
  display:block!important;
  margin-top:3px!important;
  max-width:100%!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  white-space:nowrap!important;
  font-size:11px!important;
  line-height:1.22!important;
  font-weight:750!important;
  color:#64748b!important;
}

/* Start pill / arrow: keep compact, not huge */
body:not(.admin-body) .dashboard-start-btn .start-pill,
body:not(.admin-body) .dashboard-start-btn em,
body:not(.admin-body) .app-form-card em{
  justify-self:end!important;
  align-self:center!important;
  min-width:42px!important;
  max-width:62px!important;
  height:36px!important;
  padding:0 11px!important;
  border-radius:999px!important;
  background:#eaf2ff!important;
  color:#2563eb!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  font-size:13px!important;
  line-height:1!important;
  font-weight:950!important;
  font-style:normal!important;
  white-space:nowrap!important;
  overflow:hidden!important;
  text-overflow:clip!important;
  box-sizing:border-box!important;
}

/* If old CSS created a huge pseudo arrow, suppress it in dashboard/form cards */
body:not(.admin-body) .dashboard-start-btn em::after,
body:not(.admin-body) .app-form-card em::after{
  content:none!important;
  display:none!important;
}

/* If arrow-only is wanted on form menu, keep a small › from actual text */
body:not(.admin-body) .app-form-card em{
  background:transparent!important;
  color:#111827!important;
  min-width:20px!important;
  max-width:24px!important;
  width:24px!important;
  height:32px!important;
  padding:0!important;
  font-size:28px!important;
  font-weight:700!important;
}

/* History list cards like Screen 1: icon column compact */
body:not(.admin-body) .dh-card{
  width:100%!important;
  max-width:100%!important;
  display:grid!important;
  grid-template-columns:60px minmax(0,1fr) auto!important;
  gap:12px!important;
  align-items:center!important;
  overflow:hidden!important;
}

body:not(.admin-body) .dh-card .dh-icon.circular-content-icon{
  width:52px!important;
  height:52px!important;
  min-width:52px!important;
  max-width:52px!important;
  border-radius:18px!important;
}

/* Search/filter icons should remain UI icons, not big content cards */
body:not(.admin-body) .dh-search-icon,
body:not(.admin-body) .dh-filter-icon,
body:not(.admin-body) .search-icon,
body:not(.admin-body) .filter-icon{
  width:24px!important;
  height:24px!important;
}

/* Mobile exact tuning */
@media(max-width:430px){
  body:not(.admin-body) .circular-content-icon,
  body:not(.admin-body) .content-icon,
  body:not(.admin-body) .form-card-icon.circular-content-icon,
  body:not(.admin-body) .action-icon.circular-content-icon,
  body:not(.admin-body) .dh-icon.circular-content-icon{
    width:50px!important;
    height:50px!important;
    min-width:50px!important;
    max-width:50px!important;
    flex-basis:50px!important;
    border-radius:17px!important;
  }

  body:not(.admin-body) .circular-content-icon .circular-content-icon-img,
  body:not(.admin-body) .content-icon .circular-content-icon-img,
  body:not(.admin-body) .form-card-icon .circular-content-icon-img,
  body:not(.admin-body) .action-icon .circular-content-icon-img,
  body:not(.admin-body) .dh-icon .circular-content-icon-img,
  body:not(.admin-body) .circular-content-icon-img{
    width:28px!important;
    height:28px!important;
    max-width:28px!important;
    max-height:28px!important;
  }

  body:not(.admin-body) .dashboard-start-btn,
  body:not(.admin-body) .app-form-card{
    grid-template-columns:58px minmax(0,1fr) auto!important;
    gap:10px!important;
    min-height:70px!important;
    padding:9px 10px!important;
    border-radius:19px!important;
  }

  body:not(.admin-body) .dashboard-start-btn .action-copy b,
  body:not(.admin-body) .app-form-card .form-card-copy b{
    font-size:16px!important;
  }

  body:not(.admin-body) .dashboard-start-btn .action-copy small,
  body:not(.admin-body) .app-form-card .form-card-copy small{
    font-size:10.5px!important;
  }

  body:not(.admin-body) .dashboard-start-btn .start-pill,
  body:not(.admin-body) .dashboard-start-btn em{
    min-width:40px!important;
    max-width:54px!important;
    height:34px!important;
    padding:0 10px!important;
    font-size:12px!important;
  }
}

@media(max-width:360px){
  body:not(.admin-body) .dashboard-start-btn,
  body:not(.admin-body) .app-form-card{
    grid-template-columns:54px minmax(0,1fr) auto!important;
    gap:8px!important;
    padding:8px!important;
  }
  body:not(.admin-body) .dashboard-start-btn .action-copy b,
  body:not(.admin-body) .app-form-card .form-card-copy b{
    font-size:15px!important;
  }
}



/* v240 stable menu bar sizing like Screen 1 */
body:not(.admin-body) .bottom-nav.circular-menu-bar-v240,
body:not(.admin-body) .bottom-nav.circular-menu-bar-v178{
  left:0!important;
  right:0!important;
  bottom:0!important;
  width:100vw!important;
  max-width:none!important;
  border-radius:0!important;
  padding:7px 6px calc(7px + env(safe-area-inset-bottom,0px))!important;
  background:#fff!important;
  box-shadow:0 -8px 22px rgba(15,23,42,.10)!important;
  transform:none!important;
}

body:not(.admin-body) .bottom-nav.circular-menu-bar-v240 .nav-btn,
body:not(.admin-body) .bottom-nav.circular-menu-bar-v178 .nav-btn{
  min-height:56px!important;
  border-radius:14px!important;
  gap:3px!important;
  padding:5px 2px!important;
}

body:not(.admin-body) .bottom-nav.circular-menu-bar-v240 .circular-menu-icon-img,
body:not(.admin-body) .bottom-nav.circular-menu-bar-v178 .circular-menu-icon-img{
  width:23px!important;
  height:23px!important;
  max-width:23px!important;
  max-height:23px!important;
  object-fit:contain!important;
}

body:not(.admin-body) .bottom-nav.circular-menu-bar-v240 .nav-btn b,
body:not(.admin-body) .bottom-nav.circular-menu-bar-v178 .nav-btn b{
  font-size:11px!important;
  line-height:1.1!important;
}



/* v240 content icon no-frame + no-overflow
   Requirement:
   - Content icons: no circle / no frame
   - Show icon only
   - Dashboard word "เริ่ม" removed in JS
   - Text must fit card; same content group uses same font sizing
   - No overflow
*/

/* Content icon: icon only, no background, no border, no circle */
body:not(.admin-body) .circular-content-icon,
body:not(.admin-body) .content-icon,
body:not(.admin-body) .form-card-icon.circular-content-icon,
body:not(.admin-body) .action-icon.circular-content-icon,
body:not(.admin-body) .dh-icon.circular-content-icon{
  width:44px!important;
  height:44px!important;
  min-width:44px!important;
  max-width:44px!important;
  flex:0 0 44px!important;
  border-radius:0!important;
  display:grid!important;
  place-items:center!important;
  padding:0!important;
  margin:0!important;
  overflow:visible!important;
  box-sizing:border-box!important;
  background:transparent!important;
  border:0!important;
  box-shadow:none!important;
}

body:not(.admin-body) .circular-content-icon .circular-content-icon-img,
body:not(.admin-body) .content-icon .circular-content-icon-img,
body:not(.admin-body) .form-card-icon .circular-content-icon-img,
body:not(.admin-body) .action-icon .circular-content-icon-img,
body:not(.admin-body) .dh-icon .circular-content-icon-img,
body:not(.admin-body) .circular-content-icon-img{
  width:34px!important;
  height:34px!important;
  max-width:34px!important;
  max-height:34px!important;
  display:block!important;
  object-fit:contain!important;
  background:transparent!important;
  border:0!important;
  box-shadow:none!important;
}

/* Remove color backgrounds inherited from previous content icon theme */
body:not(.admin-body) .circular-content-icon.inspection,
body:not(.admin-body) .content-icon.inspection,
body:not(.admin-body) .circular-content-icon.truck,
body:not(.admin-body) .dh-icon-truck.circular-content-icon,
body:not(.admin-body) .circular-content-icon.alcohol,
body:not(.admin-body) .content-icon.alcohol,
body:not(.admin-body) .circular-content-icon.tube,
body:not(.admin-body) .dh-icon-tube.circular-content-icon,
body:not(.admin-body) .circular-content-icon.amphetamine,
body:not(.admin-body) .content-icon.amphetamine,
body:not(.admin-body) .circular-content-icon.microscope,
body:not(.admin-body) .dh-icon-microscope.circular-content-icon,
body:not(.admin-body) .circular-content-icon.search,
body:not(.admin-body) .circular-content-icon.filter{
  background:transparent!important;
  border:0!important;
  box-shadow:none!important;
}

/* Dashboard content cards: 2 columns only after removing "เริ่ม" */
body:not(.admin-body) .dashboard-start-grid{
  display:flex!important;
  flex-direction:column!important;
  gap:9px!important;
  width:100%!important;
  max-width:100%!important;
  overflow:hidden!important;
}

body:not(.admin-body) .dashboard-start-btn{
  width:100%!important;
  max-width:100%!important;
  min-width:0!important;
  min-height:68px!important;
  height:auto!important;
  display:grid!important;
  grid-template-columns:48px minmax(0,1fr)!important;
  gap:10px!important;
  align-items:center!important;
  padding:10px 12px!important;
  border-radius:19px!important;
  border:1px solid #dbe3ef!important;
  background:#fff!important;
  box-shadow:0 6px 18px rgba(15,23,42,.055)!important;
  overflow:hidden!important;
  box-sizing:border-box!important;
  text-align:left!important;
}

/* Any remaining dashboard em/start must be hidden */
body:not(.admin-body) .dashboard-start-btn em,
body:not(.admin-body) .dashboard-start-btn .start-pill{
  display:none!important;
}

/* Form cards still have right arrow, but compact */
body:not(.admin-body) .app-form-list{
  display:flex!important;
  flex-direction:column!important;
  gap:10px!important;
  width:100%!important;
  max-width:100%!important;
  overflow:hidden!important;
}

body:not(.admin-body) .app-form-card{
  width:100%!important;
  max-width:100%!important;
  min-width:0!important;
  min-height:68px!important;
  height:auto!important;
  display:grid!important;
  grid-template-columns:48px minmax(0,1fr) 22px!important;
  gap:10px!important;
  align-items:center!important;
  padding:10px 12px!important;
  border-radius:19px!important;
  border:1px solid #dbe3ef!important;
  background:#fff!important;
  box-shadow:0 6px 18px rgba(15,23,42,.055)!important;
  overflow:hidden!important;
  box-sizing:border-box!important;
  text-align:left!important;
}

body:not(.admin-body) .app-form-card em{
  justify-self:end!important;
  align-self:center!important;
  width:22px!important;
  min-width:22px!important;
  max-width:22px!important;
  height:28px!important;
  padding:0!important;
  margin:0!important;
  border:0!important;
  border-radius:0!important;
  background:transparent!important;
  color:#111827!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  font-size:26px!important;
  line-height:1!important;
  font-weight:700!important;
  font-style:normal!important;
  overflow:hidden!important;
}

body:not(.admin-body) .app-form-card em::after{
  content:none!important;
  display:none!important;
}

/* Text sizing: same content group = same sizes; no overflow */
body:not(.admin-body) .dashboard-start-btn .action-copy,
body:not(.admin-body) .app-form-card .form-card-copy{
  min-width:0!important;
  max-width:100%!important;
  overflow:hidden!important;
  text-align:left!important;
  display:block!important;
  box-sizing:border-box!important;
}

body:not(.admin-body) .dashboard-start-btn .action-copy b,
body:not(.admin-body) .app-form-card .form-card-copy b{
  display:block!important;
  width:100%!important;
  max-width:100%!important;
  margin:0!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  white-space:nowrap!important;
  font-size:16px!important;
  line-height:1.22!important;
  font-weight:950!important;
  color:#111827!important;
}

body:not(.admin-body) .dashboard-start-btn .action-copy small,
body:not(.admin-body) .app-form-card .form-card-copy small{
  display:block!important;
  width:100%!important;
  max-width:100%!important;
  margin-top:3px!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  white-space:nowrap!important;
  font-size:11px!important;
  line-height:1.22!important;
  font-weight:750!important;
  color:#64748b!important;
}

/* History cards content icons also no frame and no overflow */
body:not(.admin-body) .dh-card{
  width:100%!important;
  max-width:100%!important;
  min-width:0!important;
  display:grid!important;
  grid-template-columns:48px minmax(0,1fr) auto!important;
  gap:10px!important;
  align-items:center!important;
  overflow:hidden!important;
  box-sizing:border-box!important;
}

body:not(.admin-body) .dh-card .dh-icon.circular-content-icon{
  width:44px!important;
  height:44px!important;
  min-width:44px!important;
  max-width:44px!important;
  flex-basis:44px!important;
  border-radius:0!important;
  background:transparent!important;
  border:0!important;
  box-shadow:none!important;
}

body:not(.admin-body) .dh-card b,
body:not(.admin-body) .dh-card small,
body:not(.admin-body) .dh-card span{
  max-width:100%!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
}

/* Compact mobile tuning */
@media(max-width:430px){
  body:not(.admin-body) .circular-content-icon,
  body:not(.admin-body) .content-icon,
  body:not(.admin-body) .form-card-icon.circular-content-icon,
  body:not(.admin-body) .action-icon.circular-content-icon,
  body:not(.admin-body) .dh-icon.circular-content-icon{
    width:42px!important;
    height:42px!important;
    min-width:42px!important;
    max-width:42px!important;
    flex-basis:42px!important;
  }

  body:not(.admin-body) .circular-content-icon .circular-content-icon-img,
  body:not(.admin-body) .content-icon .circular-content-icon-img,
  body:not(.admin-body) .form-card-icon .circular-content-icon-img,
  body:not(.admin-body) .action-icon .circular-content-icon-img,
  body:not(.admin-body) .dh-icon .circular-content-icon-img,
  body:not(.admin-body) .circular-content-icon-img{
    width:31px!important;
    height:31px!important;
    max-width:31px!important;
    max-height:31px!important;
  }

  body:not(.admin-body) .dashboard-start-btn{
    grid-template-columns:44px minmax(0,1fr)!important;
    gap:9px!important;
    min-height:64px!important;
    padding:9px 10px!important;
    border-radius:18px!important;
  }

  body:not(.admin-body) .app-form-card{
    grid-template-columns:44px minmax(0,1fr) 20px!important;
    gap:9px!important;
    min-height:64px!important;
    padding:9px 10px!important;
    border-radius:18px!important;
  }

  body:not(.admin-body) .dashboard-start-btn .action-copy b,
  body:not(.admin-body) .app-form-card .form-card-copy b{
    font-size:15px!important;
  }

  body:not(.admin-body) .dashboard-start-btn .action-copy small,
  body:not(.admin-body) .app-form-card .form-card-copy small{
    font-size:10.5px!important;
  }
}

@media(max-width:360px){
  body:not(.admin-body) .dashboard-start-btn .action-copy b,
  body:not(.admin-body) .app-form-card .form-card-copy b{
    font-size:14px!important;
  }

  body:not(.admin-body) .dashboard-start-btn .action-copy small,
  body:not(.admin-body) .app-form-card .form-card-copy small{
    font-size:10px!important;
  }
}



/* v240 Dashboard + History compact fix */

/* Dashboard: compact driver card with vehicle plate inside card */
body:not(.admin-body) .dashboard-hero-compact{
  padding:16px!important;
  border-radius:24px!important;
}

body:not(.admin-body) .dashboard-hero-compact .dashboard-kicker{
  font-size:14px!important;
  line-height:1.1!important;
  font-weight:900!important;
  color:#64748b!important;
  margin:0 0 10px!important;
  letter-spacing:.02em!important;
}

body:not(.admin-body) .dashboard-profile-card-v240{
  display:grid!important;
  grid-template-columns:64px minmax(0,1fr)!important;
  gap:14px!important;
  align-items:center!important;
  width:100%!important;
  max-width:100%!important;
  min-height:94px!important;
  padding:14px!important;
  border-radius:22px!important;
  border:1px solid #dbe3ef!important;
  background:#fff!important;
  overflow:hidden!important;
  box-sizing:border-box!important;
}

body:not(.admin-body) .dashboard-profile-card-v240 .driver-card-info{
  min-width:0!important;
  width:100%!important;
  overflow:hidden!important;
  display:flex!important;
  flex-direction:column!important;
  align-items:flex-start!important;
  gap:4px!important;
}

body:not(.admin-body) .dashboard-profile-card-v240 .driver-card-info b{
  display:block!important;
  max-width:100%!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  white-space:nowrap!important;
  font-size:21px!important;
  line-height:1.18!important;
  font-weight:950!important;
  color:#111827!important;
}

body:not(.admin-body) .dashboard-profile-card-v240 .driver-card-info span{
  display:block!important;
  max-width:100%!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  white-space:nowrap!important;
  font-size:13px!important;
  line-height:1.25!important;
  font-weight:800!important;
  color:#64748b!important;
}

body:not(.admin-body) .driver-card-plate{
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  max-width:100%!important;
  margin-top:4px!important;
  padding:6px 12px!important;
  border-radius:999px!important;
  background:#eff6ff!important;
  border:1px solid #bfdbfe!important;
  color:#1d4ed8!important;
  font-size:14px!important;
  line-height:1!important;
  font-weight:950!important;
  font-style:normal!important;
  white-space:nowrap!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
}

/* Hide old dashboard title row if any remains */
body:not(.admin-body) .dashboard-title-row{
  display:none!important;
}

/* Dashboard start panel: remove text "เริ่มตรวจ", only show section label */
body:not(.admin-body) .dashboard-start-panel .dashboard-section-head b{
  display:none!important;
}

body:not(.admin-body) .dashboard-start-panel .dashboard-section-head span{
  font-size:13px!important;
  line-height:1.2!important;
  font-weight:900!important;
  color:#64748b!important;
}

/* Dashboard cards: font matches form menu selection cards, no overflow */
body:not(.admin-body) .dashboard-start-btn .action-copy b{
  font-size:18px!important;
  line-height:1.22!important;
  font-weight:950!important;
}

body:not(.admin-body) .dashboard-start-btn .action-copy small{
  font-size:12px!important;
  line-height:1.22!important;
  font-weight:800!important;
}

/* History list: compact cards, height fits content */
body:not(.admin-body) .driver-history-page .dh-card{
  min-height:0!important;
  height:auto!important;
  padding:12px!important;
  border-radius:20px!important;
  grid-template-columns:42px minmax(0,1fr) auto!important;
  gap:10px!important;
  align-items:center!important;
  overflow:hidden!important;
}

body:not(.admin-body) .driver-history-page .dh-card .dh-icon.circular-content-icon{
  width:38px!important;
  height:38px!important;
  min-width:38px!important;
  max-width:38px!important;
  flex-basis:38px!important;
}

body:not(.admin-body) .driver-history-page .dh-card .circular-content-icon-img{
  width:30px!important;
  height:30px!important;
  max-width:30px!important;
  max-height:30px!important;
}

body:not(.admin-body) .driver-history-page .dh-main{
  min-width:0!important;
  display:flex!important;
  flex-direction:column!important;
  gap:4px!important;
  overflow:hidden!important;
}

body:not(.admin-body) .driver-history-page .dh-date{
  display:flex!important;
  align-items:center!important;
  gap:6px!important;
  font-size:12px!important;
  line-height:1.2!important;
  color:#64748b!important;
  font-weight:750!important;
  min-width:0!important;
  overflow:hidden!important;
}

body:not(.admin-body) .driver-history-page .dh-date svg,
body:not(.admin-body) .driver-history-page .dh-date img{
  width:14px!important;
  height:14px!important;
  flex:0 0 14px!important;
}

body:not(.admin-body) .driver-history-page .dh-date span,
body:not(.admin-body) .driver-history-page .dh-type{
  max-width:100%!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  white-space:nowrap!important;
}

body:not(.admin-body) .driver-history-page .dh-type{
  font-size:16px!important;
  line-height:1.22!important;
  font-weight:950!important;
  color:#111827!important;
}

body:not(.admin-body) .driver-history-page .dh-status-line{
  display:flex!important;
  flex-wrap:nowrap!important;
  align-items:center!important;
  gap:6px!important;
  min-width:0!important;
  overflow:hidden!important;
}

body:not(.admin-body) .driver-history-page .dh-status-line .dh-label{
  font-size:11px!important;
  font-weight:800!important;
  color:#64748b!important;
  white-space:nowrap!important;
}

body:not(.admin-body) .driver-history-page .dh-status-line i{
  width:1px!important;
  height:16px!important;
  background:#e2e8f0!important;
  flex:0 0 1px!important;
}

body:not(.admin-body) .driver-history-page .dh-chip{
  min-height:26px!important;
  padding:5px 10px!important;
  border-radius:999px!important;
  font-size:12px!important;
  line-height:1!important;
  font-weight:950!important;
  white-space:nowrap!important;
}

body:not(.admin-body) .driver-history-page .dh-detail-btn{
  min-width:92px!important;
  max-width:108px!important;
  height:38px!important;
  padding:0 10px!important;
  border-radius:14px!important;
  font-size:13px!important;
  font-weight:950!important;
  white-space:nowrap!important;
}

@media(max-width:430px){
  body:not(.admin-body) .dashboard-profile-card-v240{
    grid-template-columns:58px minmax(0,1fr)!important;
    gap:12px!important;
    min-height:88px!important;
    padding:12px!important;
  }
  body:not(.admin-body) .dashboard-profile-card-v240 .driver-card-info b{
    font-size:19px!important;
  }
  body:not(.admin-body) .dashboard-profile-card-v240 .driver-card-info span{
    font-size:12px!important;
  }
  body:not(.admin-body) .driver-card-plate{
    font-size:13px!important;
    padding:5px 10px!important;
  }
  body:not(.admin-body) .dashboard-start-btn .action-copy b{
    font-size:17px!important;
  }
  body:not(.admin-body) .dashboard-start-btn .action-copy small{
    font-size:11.5px!important;
  }
  body:not(.admin-body) .driver-history-page .dh-card{
    grid-template-columns:40px minmax(0,1fr) auto!important;
    padding:10px!important;
    gap:9px!important;
    border-radius:18px!important;
  }
  body:not(.admin-body) .driver-history-page .dh-card .dh-icon.circular-content-icon{
    width:36px!important;
    height:36px!important;
    min-width:36px!important;
    max-width:36px!important;
  }
  body:not(.admin-body) .driver-history-page .dh-card .circular-content-icon-img{
    width:28px!important;
    height:28px!important;
  }
  body:not(.admin-body) .driver-history-page .dh-type{
    font-size:15px!important;
  }
  body:not(.admin-body) .driver-history-page .dh-detail-btn{
    min-width:82px!important;
    max-width:92px!important;
    height:36px!important;
    font-size:12px!important;
  }
}

@media(max-width:370px){
  body:not(.admin-body) .driver-history-page .dh-detail-btn span{
    display:none!important;
  }
  body:not(.admin-body) .driver-history-page .dh-detail-btn{
    min-width:38px!important;
    max-width:38px!important;
    width:38px!important;
    padding:0!important;
  }
}


/* v240 Dashboard driver card layout fix */
body:not(.admin-body) .dashboard-hero-v240{
  display:block!important;width:100%!important;max-width:100%!important;
  padding:16px!important;border-radius:24px!important;overflow:hidden!important;box-sizing:border-box!important;
}
body:not(.admin-body) .dashboard-hero-v240 .dashboard-kicker{
  display:block!important;margin:0 0 12px!important;color:#64748b!important;
  font-size:14px!important;line-height:1.1!important;font-weight:950!important;letter-spacing:.02em!important;
}
body:not(.admin-body) .dashboard-driver-card-v240{
  width:100%!important;max-width:100%!important;min-width:0!important;overflow:hidden!important;box-sizing:border-box!important;
}
body:not(.admin-body) .dashboard-profile-card-v240{
  width:100%!important;max-width:100%!important;min-width:0!important;min-height:88px!important;
  display:grid!important;grid-template-columns:64px minmax(0,1fr)!important;gap:14px!important;align-items:center!important;
  padding:0!important;margin:0!important;border:0!important;border-radius:0!important;background:transparent!important;
  box-shadow:none!important;overflow:hidden!important;box-sizing:border-box!important;
}
body:not(.admin-body) .dashboard-profile-card-v240 .dashboard-avatar-wrap,
body:not(.admin-body) .dashboard-profile-card-v240 .dashboard-avatar-v240,
body:not(.admin-body) .dashboard-profile-card-v240 .user-avatar-btn{
  width:64px!important;height:64px!important;min-width:64px!important;max-width:64px!important;
  min-height:64px!important;max-height:64px!important;flex:0 0 64px!important;
  padding:0!important;margin:0!important;border:0!important;border-radius:16px!important;
  overflow:hidden!important;background:#eef4ff!important;display:block!important;box-sizing:border-box!important;position:relative!important;
}
body:not(.admin-body) .dashboard-profile-card-v240 .dashboard-avatar-v240-img,
body:not(.admin-body) .dashboard-profile-card-v240 .dashboard-avatar-center-bg{
  width:64px!important;height:64px!important;min-width:64px!important;max-width:64px!important;
  min-height:64px!important;max-height:64px!important;display:block!important;border-radius:16px!important;
  background-size:cover!important;background-position:center center!important;background-repeat:no-repeat!important;transform:none!important;position:static!important;
}
body:not(.admin-body) .dashboard-profile-card-v240 .driver-card-info{
  min-width:0!important;width:100%!important;max-width:100%!important;overflow:hidden!important;
  display:flex!important;flex-direction:column!important;align-items:flex-start!important;justify-content:center!important;gap:4px!important;box-sizing:border-box!important;
}
body:not(.admin-body) .dashboard-profile-card-v240 .driver-card-info b{
  display:block!important;width:100%!important;max-width:100%!important;margin:0!important;overflow:hidden!important;
  text-overflow:ellipsis!important;white-space:nowrap!important;font-size:21px!important;line-height:1.18!important;font-weight:950!important;color:#111827!important;
}
body:not(.admin-body) .dashboard-profile-card-v240 .driver-card-info span{
  display:block!important;width:100%!important;max-width:100%!important;margin:0!important;overflow:hidden!important;
  text-overflow:ellipsis!important;white-space:nowrap!important;font-size:13px!important;line-height:1.25!important;font-weight:800!important;color:#64748b!important;
}
body:not(.admin-body) .dashboard-profile-card-v240 .driver-card-plate{
  display:inline-flex!important;align-items:center!important;justify-content:center!important;max-width:100%!important;min-width:0!important;
  margin:4px 0 0!important;padding:6px 12px!important;border-radius:999px!important;background:#eff6ff!important;border:1px solid #bfdbfe!important;
  color:#1d4ed8!important;font-size:14px!important;line-height:1!important;font-weight:950!important;font-style:normal!important;
  white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;box-sizing:border-box!important;
}
body:not(.admin-body) .dashboard-profile-card-v240{display:contents!important;}
@media(max-width:430px){
  body:not(.admin-body) .dashboard-hero-v240{padding:14px!important;border-radius:22px!important;}
  body:not(.admin-body) .dashboard-profile-card-v240{grid-template-columns:58px minmax(0,1fr)!important;gap:12px!important;min-height:82px!important;}
  body:not(.admin-body) .dashboard-profile-card-v240 .dashboard-avatar-wrap,
  body:not(.admin-body) .dashboard-profile-card-v240 .dashboard-avatar-v240,
  body:not(.admin-body) .dashboard-profile-card-v240 .user-avatar-btn,
  body:not(.admin-body) .dashboard-profile-card-v240 .dashboard-avatar-v240-img,
  body:not(.admin-body) .dashboard-profile-card-v240 .dashboard-avatar-center-bg{
    width:58px!important;height:58px!important;min-width:58px!important;max-width:58px!important;min-height:58px!important;max-height:58px!important;flex-basis:58px!important;border-radius:15px!important;
  }
  body:not(.admin-body) .dashboard-profile-card-v240 .driver-card-info b{font-size:19px!important;}
  body:not(.admin-body) .dashboard-profile-card-v240 .driver-card-info span{font-size:12px!important;}
  body:not(.admin-body) .dashboard-profile-card-v240 .driver-card-plate{font-size:13px!important;padding:5px 10px!important;}
}
@media(max-width:360px){
  body:not(.admin-body) .dashboard-profile-card-v240{grid-template-columns:52px minmax(0,1fr)!important;gap:10px!important;}
  body:not(.admin-body) .dashboard-profile-card-v240 .dashboard-avatar-wrap,
  body:not(.admin-body) .dashboard-profile-card-v240 .dashboard-avatar-v240,
  body:not(.admin-body) .dashboard-profile-card-v240 .user-avatar-btn,
  body:not(.admin-body) .dashboard-profile-card-v240 .dashboard-avatar-v240-img,
  body:not(.admin-body) .dashboard-profile-card-v240 .dashboard-avatar-center-bg{
    width:52px!important;height:52px!important;min-width:52px!important;max-width:52px!important;min-height:52px!important;max-height:52px!important;flex-basis:52px!important;
  }
  body:not(.admin-body) .dashboard-profile-card-v240 .driver-card-info b{font-size:17px!important;}
}

/* v240 session expired screen */
body:not(.admin-body) .session-expired-card{
  max-width:520px!important;
  margin:24px auto!important;
  text-align:left!important;
}
body:not(.admin-body) .session-expired-card h1{
  margin-bottom:8px!important;
}
body:not(.admin-body) .session-expired-card p{
  color:#64748b!important;
  font-weight:750!important;
  line-height:1.45!important;
}


/* v240 Dashboard driver outer card fix */
body:not(.admin-body) .dashboard-hero-v240{
  width:100%!important;max-width:100%!important;
  padding:16px!important;border-radius:24px!important;
  overflow:hidden!important;box-sizing:border-box!important;
}
body:not(.admin-body) .dashboard-hero-v240 .dashboard-kicker{
  display:block!important;margin:0 0 10px!important;color:#64748b!important;
  font-size:14px!important;line-height:1.1!important;font-weight:950!important;letter-spacing:.02em!important;
}
body:not(.admin-body) .driver-block-v240{
  width:100%!important;max-width:100%!important;min-width:0!important;
  display:grid!important;grid-template-columns:72px minmax(0,1fr)!important;
  gap:14px!important;align-items:center!important;min-height:78px!important;
  padding:0!important;margin:0!important;border:0!important;background:transparent!important;
  box-shadow:none!important;overflow:hidden!important;box-sizing:border-box!important;
}
body:not(.admin-body) .driver-avatar-v240{
  width:72px!important;height:72px!important;min-width:72px!important;max-width:72px!important;
  min-height:72px!important;max-height:72px!important;
  padding:0!important;margin:0!important;border:0!important;border-radius:18px!important;
  overflow:hidden!important;background:#eef4ff!important;display:block!important;position:relative!important;box-sizing:border-box!important;
}
body:not(.admin-body) .driver-avatar-v240 span{
  display:block!important;width:72px!important;height:72px!important;min-width:72px!important;max-width:72px!important;
  min-height:72px!important;max-height:72px!important;background-size:cover!important;
  background-position:center center!important;background-repeat:no-repeat!important;border-radius:18px!important;transform:none!important;
}
body:not(.admin-body) .driver-avatar-empty-v240{
  display:grid!important;place-items:center!important;font-size:28px!important;
}
body:not(.admin-body) .driver-info-v240{
  min-width:0!important;width:100%!important;max-width:100%!important;overflow:hidden!important;
  display:flex!important;flex-direction:column!important;align-items:flex-start!important;justify-content:center!important;gap:4px!important;box-sizing:border-box!important;
}
body:not(.admin-body) .driver-info-v240 b{
  display:block!important;width:100%!important;max-width:100%!important;margin:0!important;padding:0!important;
  overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important;
  font-size:22px!important;line-height:1.18!important;font-weight:950!important;color:#111827!important;
}
body:not(.admin-body) .driver-info-v240 span{
  display:block!important;width:100%!important;max-width:100%!important;margin:0!important;padding:0!important;
  overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important;
  font-size:13px!important;line-height:1.25!important;font-weight:800!important;color:#64748b!important;
}
body:not(.admin-body) .driver-plate-v240{
  display:inline-flex!important;align-items:center!important;justify-content:center!important;max-width:100%!important;min-width:0!important;
  margin:4px 0 0!important;padding:6px 12px!important;border-radius:999px!important;
  background:#eff6ff!important;border:1px solid #bfdbfe!important;color:#1d4ed8!important;
  font-size:14px!important;line-height:1!important;font-weight:950!important;font-style:normal!important;
  white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;box-sizing:border-box!important;
}
body:not(.admin-body) .dashboard-hero-v240 .dashboard-profile-card-v240,
body:not(.admin-body) .dashboard-hero-v240 .dashboard-profile-card-v182,
body:not(.admin-body) .dashboard-hero-v240 .dashboard-profile-card-v181,
body:not(.admin-body) .dashboard-hero-v240 .microsoft-profile-card,
body:not(.admin-body) .dashboard-hero-v240 .user-card{
  display:contents!important;
}
@media(max-width:430px){
  body:not(.admin-body) .dashboard-hero-v240{padding:14px!important;border-radius:22px!important;}
  body:not(.admin-body) .driver-block-v240{
    grid-template-columns:64px minmax(0,1fr)!important;gap:12px!important;min-height:72px!important;
  }
  body:not(.admin-body) .driver-avatar-v240,
  body:not(.admin-body) .driver-avatar-v240 span{
    width:64px!important;height:64px!important;min-width:64px!important;max-width:64px!important;
    min-height:64px!important;max-height:64px!important;border-radius:16px!important;
  }
  body:not(.admin-body) .driver-info-v240 b{font-size:20px!important;}
  body:not(.admin-body) .driver-info-v240 span{font-size:12px!important;}
  body:not(.admin-body) .driver-plate-v240{font-size:13px!important;padding:5px 10px!important;}
}
@media(max-width:360px){
  body:not(.admin-body) .driver-block-v240{
    grid-template-columns:56px minmax(0,1fr)!important;gap:10px!important;
  }
  body:not(.admin-body) .driver-avatar-v240,
  body:not(.admin-body) .driver-avatar-v240 span{
    width:56px!important;height:56px!important;min-width:56px!important;max-width:56px!important;
    min-height:56px!important;max-height:56px!important;border-radius:14px!important;
  }
  body:not(.admin-body) .driver-info-v240 b{font-size:18px!important;}
}

/* v285 App startup splash screen */
.app-startup-splash{
  position:fixed;
  inset:0;
  z-index:999999;
  display:grid;
  place-items:center;
  min-height:100dvh;
  background:#ffffff;
  transition:opacity .34s ease, visibility .34s ease;
  pointer-events:auto;
}
.app-startup-splash.is-hiding{opacity:0;visibility:hidden;pointer-events:none}
.app-startup-splash-inner{display:grid;place-items:center;gap:18px;text-align:center;padding:28px;animation:circularSplashEnter .72s cubic-bezier(.2,.85,.2,1) both}
.app-startup-logo{
  width:clamp(132px,34vw,230px);
  height:clamp(132px,34vw,230px);
  object-fit:contain;
  display:block;
  filter:drop-shadow(0 18px 34px rgba(15,108,189,.18));
  animation:circularSplashLogo 1.45s ease-in-out both;
}
.app-startup-title{font-size:clamp(18px,4vw,26px);line-height:1.2;font-weight:800;color:#172033;letter-spacing:.01em;margin:0}
.app-startup-dots{display:flex;gap:7px;align-items:center;justify-content:center;height:12px}
.app-startup-dots span{width:7px;height:7px;border-radius:999px;background:#0f6cbd;opacity:.38;animation:circularSplashDot 1.15s ease-in-out infinite}
.app-startup-dots span:nth-child(2){animation-delay:.16s}.app-startup-dots span:nth-child(3){animation-delay:.32s}
body.app-starting{overflow:hidden}
@keyframes circularSplashEnter{from{opacity:0;transform:translateY(10px)}to{opacity:1;transform:none}}
@keyframes circularSplashLogo{0%{opacity:0;transform:scale(.86)}45%{opacity:1;transform:scale(1.04)}100%{opacity:1;transform:scale(1)}}
@keyframes circularSplashDot{0%,100%{opacity:.28;transform:translateY(0)}50%{opacity:1;transform:translateY(-4px)}}
@media (prefers-reduced-motion:reduce){.app-startup-splash-inner,.app-startup-logo,.app-startup-dots span{animation:none!important}.app-startup-splash{transition:opacity .15s ease, visibility .15s ease}}

