:root{
  --bg:#f3f5f9;--card:#fff;--text:#1b2433;--muted:#667085;--border:#d5dbe6;
  --brand:#0a5bd6;--brand-text:#fff;--heading:#0b3a82;--danger:#c62828;--danger-bg:#fdecec;--ok:#1b7f3b;--ok-bg:#e6f5ea;--warn-bg:#fff6dd;--warn:#7a5b00;--shadow:0 1px 3px rgba(16,24,40,.12);
}
@media (prefers-color-scheme:dark){:root:not([data-theme="light"]){
  --bg:#0f141c;--card:#18202c;--text:#e6ebf2;--muted:#9aa6b8;--border:#2c394b;--brand:#4b8dff;--brand-text:#06142e;--heading:#9cc2ff;--danger:#ff7b7b;--danger-bg:#3a1c1c;--ok:#6fd48b;--ok-bg:#16301e;--warn-bg:#352c10;--warn:#f2cf6b;--shadow:none}}
:root[data-theme="dark"]{
  --bg:#0f141c;--card:#18202c;--text:#e6ebf2;--muted:#9aa6b8;--border:#2c394b;--brand:#4b8dff;--brand-text:#06142e;--heading:#9cc2ff;--danger:#ff7b7b;--danger-bg:#3a1c1c;--ok:#6fd48b;--ok-bg:#16301e;--warn-bg:#352c10;--warn:#f2cf6b;--shadow:none}
*{box-sizing:border-box}
:root{color-scheme:light}
@media (prefers-color-scheme:dark){:root:not([data-theme="light"]){color-scheme:dark}}
:root[data-theme="dark"]{color-scheme:dark}
html{-webkit-text-size-adjust:100%}
body{margin:0;background:var(--bg);color:var(--text);font:16px/1.5 system-ui,-apple-system,"Sukhumvit Set","Noto Sans Thai",sans-serif}
.wrap{max-width:640px;margin:0 auto;padding:12px 16px 40px}
.wide{max-width:1200px}
header.top{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:10px 0}
h1{font-size:1.25rem;margin:0;color:var(--heading)}
h2{font-size:1.1rem;margin:0 0 8px;color:var(--heading)}
.card{background:var(--card);border:1px solid var(--border);border-radius:12px;padding:14px;margin:12px 0;box-shadow:var(--shadow)}
.field{margin:12px 0;padding:6px;border-radius:8px;border:1px solid transparent}
.field label,.field .lbl{display:block;font-weight:600;margin-bottom:4px}
.field .req{color:var(--danger)}
input,select,textarea,button{font:inherit;color:inherit}
input[type=text],input[type=tel],input[type=search],input[type=password],input[type=number],select,textarea{width:100%;min-height:46px;padding:10px 12px;border:1px solid var(--border);border-radius:10px;background:var(--bg)}
textarea{min-height:90px}
.field--invalid{border-color:var(--danger);background:var(--danger-bg)}
.field--invalid label,.field--invalid .lbl{color:var(--danger)}
.err{color:var(--danger);font-size:.9rem;min-height:1.1em;margin-top:2px}
.btn{display:inline-flex;align-items:center;justify-content:center;min-height:48px;padding:10px 18px;border:1px solid var(--border);border-radius:10px;background:var(--card);cursor:pointer;font-weight:600}
.btn.primary{background:var(--brand);color:var(--brand-text);border-color:var(--brand)}
.btn.danger{color:var(--danger);border-color:var(--danger)}
.btn.sm{min-height:34px;padding:4px 10px;font-size:.9rem}
.btn:disabled{opacity:.5;cursor:default}
.btn.block{display:flex;width:100%}
.row{display:flex;gap:8px;flex-wrap:wrap;align-items:center}
.seg{display:flex;gap:8px;flex-wrap:wrap}
.seg label{display:flex;align-items:center;gap:6px;margin:0;font-weight:500;padding:10px 14px;border:1px solid var(--border);border-radius:10px;background:var(--bg);cursor:pointer;min-height:46px}
.seg input{width:20px;height:20px}
.notice{padding:10px 12px;border-radius:10px;margin:10px 0}
.notice.warn{background:var(--warn-bg);color:var(--warn)}
.notice.ok{background:var(--ok-bg);color:var(--ok)}
.notice.err{background:var(--danger-bg);color:var(--danger)}
.thumbs{display:grid;grid-template-columns:repeat(auto-fill,minmax(96px,1fr));gap:8px;margin:8px 0}
.thumb{position:relative;aspect-ratio:1;border-radius:10px;overflow:hidden;border:1px solid var(--border);background:var(--bg)}
.thumb img{width:100%;height:100%;object-fit:cover;display:block}
.thumb button{position:absolute;top:4px;right:4px;width:28px;height:28px;border-radius:50%;border:0;background:rgba(0,0,0,.65);color:#fff;font-size:18px;line-height:1;cursor:pointer}
.thumb.loading{display:flex;align-items:center;justify-content:center;color:var(--muted);font-size:.8rem}
.muted{color:var(--muted);font-size:.9rem}
footer{color:var(--muted);font-size:.8rem;text-align:center;margin-top:24px}
[hidden]{display:none!important}
.iconbtn{background:none;border:1px solid var(--border);border-radius:10px;min-width:40px;min-height:40px;cursor:pointer}
/* admin */
.tabs{display:flex;gap:4px;flex-wrap:wrap;margin:8px 0}
.tabs button{padding:8px 14px;border:1px solid var(--border);background:var(--card);border-radius:10px;cursor:pointer;font-weight:600}
.tabs button.on{background:var(--brand);color:var(--brand-text);border-color:var(--brand)}
table{border-collapse:collapse;width:100%;font-size:.9rem}
th,td{border-bottom:1px solid var(--border);padding:6px 8px;text-align:left;vertical-align:top}
th{position:sticky;top:0;background:var(--card);z-index:1}
.tscroll{overflow:auto;max-height:70vh;border:1px solid var(--border);border-radius:10px;background:var(--card)}
.grid2{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:8px}
.stat{padding:12px;border:1px solid var(--border);border-radius:10px;background:var(--card)}
.stat b{display:block;font-size:1.4rem;color:var(--heading)}
dialog{border:1px solid var(--border);border-radius:12px;background:var(--card);color:var(--text);max-width:min(680px,96vw);width:100%;padding:16px}
dialog::backdrop{background:rgba(0,0,0,.5)}
dialog{max-height:92vh}
.dlg-head{position:sticky;top:-16px;z-index:2;display:flex;align-items:center;justify-content:space-between;gap:8px;margin:-16px -16px 10px;padding:10px 12px 10px 16px;background:var(--card);border-bottom:1px solid var(--border)}
.dlg-head h2{margin:0}
.zoom{cursor:zoom-in}
dialog.photo-viewer{max-width:100vw;max-height:100vh;width:100vw;height:100vh;padding:0;border:0;border-radius:0;background:transparent;color:#fff;overflow:hidden}
dialog.photo-viewer::backdrop{background:rgba(0,0,0,.88)}
.lb-stage{width:100%;height:100%;display:flex;align-items:center;justify-content:center;padding:56px 12px 40px;box-sizing:border-box;cursor:zoom-out}
.lb-stage>img{max-width:100%;max-height:100%;border-radius:6px}
.lb-stage>img.lb-white{background:#fff}
.photo-viewer .iconbtn{position:fixed;color:#fff;border-color:rgba(255,255,255,.5);background:rgba(0,0,0,.45);min-width:44px;min-height:44px}
.photo-viewer .iconbtn:hover{background:rgba(0,0,0,.7)}
.lb-close{top:10px;right:10px}
.lb-prev{left:10px;top:50%;transform:translateY(-50%)}
.lb-next{right:10px;top:50%;transform:translateY(-50%)}
.lb-count{position:fixed;bottom:12px;left:0;right:0;text-align:center;font-size:.9rem;opacity:.85}
.bar{height:8px;background:var(--border);border-radius:4px;overflow:hidden}
.bar i{display:block;height:100%;background:var(--brand)}
@media (max-width:480px){.wrap{padding:8px 16px 32px}}

.brand{display:flex;align-items:center;gap:10px;min-width:0}
.logo{width:72px;height:auto;flex:none;border-radius:6px}
.logo-dark{display:none}
@media (prefers-color-scheme:dark){:root:not([data-theme="light"]) .logo-light{display:none}:root:not([data-theme="light"]) .logo-dark{display:block}}
:root[data-theme="dark"] .logo-light{display:none}
:root[data-theme="dark"] .logo-dark{display:block}
.lightbox{position:fixed;inset:0;z-index:100;background:rgba(0,0,0,.85);display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;color:#fff;padding:16px;cursor:zoom-out}
.lightbox img{max-width:100%;max-height:80vh;border-radius:8px}
footer div+div{margin-top:2px}
@media (max-width:480px){h1{font-size:1rem}.logo{width:60px}}

/* New-version banner: fixed colors so it is readable in light and dark themes */
.update-banner{position:fixed;left:0;right:0;bottom:0;z-index:200;display:flex;align-items:center;justify-content:center;gap:10px;flex-wrap:wrap;padding:12px 16px calc(12px + env(safe-area-inset-bottom));background:#0a2a5e;color:#fff;border-top:4px solid #ffc107;box-shadow:0 -4px 16px rgba(0,0,0,.35);font-size:1.05rem;font-weight:700}
.update-banner small{font-weight:500;opacity:.85}
.update-go{min-height:44px;padding:8px 18px;border:0;border-radius:10px;background:#ffc107;color:#1b1b1b;font:inherit;font-weight:800;cursor:pointer}
.update-x{min-width:40px;min-height:40px;border:1px solid rgba(255,255,255,.5);border-radius:10px;background:transparent;color:#fff;font-size:1.3rem;line-height:1;cursor:pointer}
a.btn{color:inherit;text-decoration:none}

.portal{display:flex;gap:10px;justify-content:center;flex-wrap:wrap;margin:20px 0 4px}
.portal .btn{min-width:130px}
/* Viewer: distinct teal read-only look */
body.viewer{--brand:#0f8b7d;--brand-text:#fff}
body.viewer .wrap{border-top:5px solid #0f8b7d}
.ro-badge{background:#0f8b7d;color:#fff;border-radius:999px;padding:4px 12px;font-size:.8rem;font-weight:700;letter-spacing:.02em}

select[size]{padding:4px;overflow-y:auto;height:auto}
select[size] option{padding:10px 12px;border-radius:6px;min-height:20px}
select[size] option:checked{background:var(--brand) linear-gradient(0deg,var(--brand),var(--brand));color:var(--brand-text)}

.history{margin:10px 0;border:1px solid var(--border);border-radius:10px;padding:8px 12px;background:var(--bg)}
.history summary{cursor:pointer;font-weight:700;color:var(--heading)}
.hist-item{padding:8px 0;border-top:1px dashed var(--border);margin-top:8px;font-size:.9rem}
.hist-head{font-weight:600}
.hist-change{color:var(--muted);padding-left:10px}

.title{min-width:0}
.role-sub{font-size:.8rem;font-weight:600;color:var(--muted);line-height:1.2;margin-top:2px}
header.top{flex-wrap:wrap}.brand{flex:1 1 200px}

.kpi-row{display:grid;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));gap:8px}
.chart-card{min-width:0}
.hbar{display:grid;grid-template-columns:minmax(90px,1.2fr) 3fr auto;gap:8px;align-items:center;font-size:.88rem;padding:3px 0}
.hbar .bar{height:12px}
.hbar .lbl2{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.cols2{display:grid;grid-template-columns:repeat(auto-fit,minmax(340px,1fr));gap:12px}
.pill{display:inline-block;padding:1px 8px;border-radius:999px;font-size:.8rem;font-weight:700}
.pill.ok{background:var(--ok-bg);color:var(--ok)}
.pill.no{background:var(--danger-bg);color:var(--danger)}
.pill.mid{background:var(--warn-bg);color:var(--warn)}
.trend{display:flex;align-items:flex-end;gap:3px;height:120px;padding-top:6px;overflow-x:auto}
.trend div{flex:1 0 14px;background:var(--brand);border-radius:3px 3px 0 0;min-height:2px;position:relative}
@media (max-width:480px){.cols2{grid-template-columns:1fr}}
input[type=date]{min-height:40px;padding:6px 10px;border:1px solid var(--border);border-radius:10px;background:var(--bg);color:var(--text)}
.reason-sel.need{border:2px solid var(--danger);background:var(--danger-bg);color:var(--danger);font-weight:600}
.need-photo{color:var(--warn)}
.model-btn.redo{border-color:var(--danger);background:var(--danger-bg)}
.model-btn.redo small{color:var(--danger)}
.redo{margin:8px 0 0;font-size:.9rem}
.pending{display:flex;flex-direction:column;gap:6px;margin:8px 0;padding:10px;border:2px solid var(--danger);border-radius:10px;background:var(--danger-bg);color:var(--danger)}
.pending-item{display:flex;flex-direction:column;align-items:flex-start;gap:2px;padding:8px 10px;border:1px solid var(--danger);border-radius:8px;background:var(--card);color:var(--text);font:inherit;font-weight:600;text-align:left;cursor:pointer}
.pending-item small{font-weight:500;color:var(--muted)}
/* admin: one-line report rows, icon buttons, sub menu, guideline help */
table.oneline td,table.oneline th{white-space:nowrap;vertical-align:middle;padding:4px 8px}
td.cut{overflow:hidden;text-overflow:ellipsis}
.ico-cell{width:24px;text-align:center}
.icons{display:flex;gap:4px}
.ico{width:32px;height:32px;padding:0;border:1px solid var(--border);border-radius:8px;background:var(--card);cursor:pointer;font-size:15px;line-height:1}
.ico:hover,.ico:focus-visible{border-color:var(--brand);outline:none}
tr.row-redo td{background:var(--danger-bg)}
.tabs.sub{margin:0 0 10px;padding-bottom:8px;border-bottom:1px solid var(--border)}
.tabs.sub button{padding:6px 12px;font-size:.9rem}
.guide summary{cursor:pointer}
.guide h3{font-size:.95rem;margin:12px 0 4px;color:var(--heading)}
.guide ul{margin:0;padding-left:18px;font-size:.88rem;line-height:1.5}
.guide li{margin:3px 0}
.guide code{background:var(--bg);border:1px solid var(--border);border-radius:4px;padding:0 4px;font-size:.82rem}
.guide-cols{display:grid;grid-template-columns:repeat(auto-fit,minmax(320px,1fr));gap:16px}
a.iconbtn{display:inline-flex;align-items:center;justify-content:center;text-decoration:none;color:inherit}
table.oneline .actions{position:sticky;right:0;background:var(--card);box-shadow:-6px 0 8px -6px rgba(0,0,0,.35)}
table.oneline tr.row-redo .actions{background:var(--danger-bg)}
.ico-flag{display:inline-flex;align-items:center;justify-content:center;width:24px}
/* Active by level tree */
.tree{margin-top:10px}
.tree-node>summary{list-style:none;cursor:pointer;padding:4px 0}
.tree-node>summary::-webkit-details-marker{display:none}
.tree-node>summary::before{content:'▸';display:inline-block;width:16px;color:var(--muted)}
.tree-node[open]>summary::before{content:'▾'}
.tree-leaf{padding:4px 0 4px 16px}
.tree-kids{margin-left:10px;padding-left:12px;border-left:1px dashed var(--border)}
.tree-head{display:inline-flex;align-items:center;gap:8px;flex-wrap:wrap}
.tree-head input{width:18px;height:18px}
.tree-head.off b{text-decoration:line-through;color:var(--muted)}
.tree-level{font-size:.72rem;font-weight:700;text-transform:uppercase;letter-spacing:.03em;color:var(--muted);border:1px solid var(--border);border-radius:999px;padding:0 6px}
/* monochrome line icons (icons.js): follow the text colour in both themes */
.i{width:1.15em;height:1.15em;flex:none;vertical-align:-.2em}
.btn .i,.seg .i{margin-right:2px}
.iconbtn{display:inline-flex;align-items:center;justify-content:center;color:var(--text)}
.iconbtn .i{width:20px;height:20px}
.ico{display:inline-flex;align-items:center;justify-content:center;color:var(--text)}
.ico .i{width:17px;height:17px}
.ico.danger:hover,.ico:hover,.ico:focus-visible{border-color:var(--text);background:var(--bg)}
.ico-flag{color:var(--muted)}
.ico-flag .i{width:17px;height:17px}
.cam-sq{color:var(--text)}
.cam-sq .i{width:22px;height:22px}
.update-banner .i{width:20px;height:20px}

/* Channel / Area / Region on one row (short values) */
.row3{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr) minmax(0,1.2fr);gap:4px;margin-top:8px}
.row3 .field{margin:0;padding:2px;min-width:0}
.row3 select{padding:10px 4px 10px 8px;text-overflow:ellipsis;font-size:.95rem}
.row3-note{margin:2px 4px 4px}

/* Admin / Viewer: the password card sits in the middle of the screen (header on top, footer at the bottom) */
.wrap.wide{min-height:100vh;min-height:100dvh;display:flex;flex-direction:column}
.wrap.wide>#app{width:100%;min-width:0}
#login{margin:auto;width:100%}

.span-all{grid-column:1/-1}

/* ===== Admin / Viewer: desktop-first layout =====
   Small screens: header on top, menu as a row of buttons. From 1000px: left sidebar
   (logo, menu, actions) + wide content area with a page title. The PC page (index.html) is not affected. */
#tabs.side:empty{display:none}
#tabs.side button{display:inline-flex;align-items:center;gap:8px}
#tabs.side .nav-badge{margin-left:auto;min-width:20px;padding:0 6px;border-radius:999px;background:var(--danger);color:#fff;font-size:.75rem;line-height:20px;text-align:center}
.page-title{font-size:1.35rem;margin:4px 0 12px}
body:not(.signed-in) #tabs.side{display:none}
@media (max-width:999px){
  header.top #tabs.side{order:3;flex:1 1 100%;margin:4px 0 0}
  .page-title{display:none}
}
@media (min-width:1000px){
  body.signed-in .wrap.wide{display:grid;grid-template-columns:236px minmax(0,1fr);grid-template-rows:1fr auto;max-width:none;margin:0;padding:0;min-height:100vh}
  body.signed-in header.top{grid-row:1/3;position:sticky;top:0;height:100vh;display:flex;flex-direction:column;align-items:stretch;justify-content:flex-start;flex-wrap:nowrap;gap:18px;padding:18px 12px;background:var(--card);border-right:1px solid var(--border);overflow-y:auto}
  body.signed-in header.top .brand{flex:none;flex-direction:column;align-items:flex-start;gap:8px;padding:0 6px}
  body.signed-in header.top .logo{width:84px}
  body.signed-in #tabs.side{flex:1;flex-direction:column;flex-wrap:nowrap;gap:2px;margin:0}
  body.signed-in #tabs.side button{width:100%;justify-content:flex-start;border:0;background:none;border-radius:8px;padding:10px 12px;font-weight:600;color:var(--text)}
  body.signed-in #tabs.side button:hover{background:var(--bg)}
  body.signed-in #tabs.side button.on{background:var(--brand);color:var(--brand-text)}
  body.signed-in #tabs.side .i{width:18px;height:18px}
  body.signed-in .hdr-actions{flex-wrap:wrap;gap:6px;padding:12px 6px 0;border-top:1px solid var(--border)}
  body.signed-in .hdr-actions .ro-badge{flex:1 1 100%;text-align:center}
  body.signed-in #app{padding:18px 28px 8px;width:100%;max-width:1680px}
  body.signed-in footer{grid-column:2;margin:8px 0 16px}
  body.signed-in .tscroll{max-height:calc(100vh - 230px)}
  body.signed-in .cols2{grid-template-columns:repeat(auto-fill,minmax(360px,1fr));grid-auto-flow:dense}
  body.signed-in .kpi-row{grid-template-columns:repeat(6,minmax(0,1fr))}
  body.signed-in .hbar{grid-template-columns:minmax(120px,1.5fr) 2fr auto}
  body.viewer.signed-in .wrap{border-top:0}
  body.viewer.signed-in header.top{border-top:5px solid #0f8b7d}
}


/* ---------- PC page ---------- */
.small{font-size:.82rem}
.seg.tabs2{display:grid;grid-template-columns:1fr 1fr;gap:6px;margin-bottom:6px}
.seg.tabs2 button,.seg.chips button{min-height:44px;border:1px solid var(--border);border-radius:10px;background:var(--bg);color:var(--text);font:inherit;font-weight:700;cursor:pointer}
.seg.tabs2 button.on,.seg.chips button.on{background:var(--brand);border-color:var(--brand);color:var(--brand-text)}
/* status buttons: always one line, equal widths, count under the label */
.seg.chips{display:grid;grid-auto-flow:column;grid-auto-columns:minmax(0,1fr);gap:3px;margin:10px 0 4px}
.seg.chips button{display:flex;flex-direction:column;align-items:center;justify-content:center;min-width:0;min-height:42px;padding:3px 2px;font-size:.76rem;font-weight:600;line-height:1.2;white-space:nowrap;overflow:hidden}
.seg.chips button small{font-size:.72rem;font-weight:700;opacity:.8}
.row2{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:6px}
.row2 .field{margin:6px 0;min-width:0}
.seg.yn{gap:6px;flex-wrap:nowrap}
.seg.yn label{flex:1;justify-content:center;font-weight:700;position:relative}
.seg.yn input{position:absolute;opacity:0;width:1px;height:1px;pointer-events:none}
.seg.yn label:has(input:focus-visible){outline:2px solid var(--brand);outline-offset:2px}
.seg.yn label.ok:has(input:checked){background:var(--ok-bg);color:var(--ok);border-color:var(--ok)}
.seg.yn label.no:has(input:checked){background:var(--danger-bg);color:var(--danger);border-color:var(--danger)}
.pgroup .thumbs{grid-template-columns:repeat(3,minmax(0,1fr));margin:6px 0}
.thumb.pdf{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;color:var(--text);text-decoration:none;font-size:.75rem;padding:6px;text-align:center;overflow-wrap:anywhere}
.thumb.pdf .i{width:28px;height:28px}
.hist-card{display:flex;flex-direction:column;gap:4px;width:100%;margin:8px 0 0;padding:10px 12px;border:1px solid var(--border);border-radius:10px;background:var(--bg);color:var(--text);font:inherit;text-align:left;cursor:pointer}
.hist-card:hover,.hist-card:focus-visible{border-color:var(--brand);outline:none}
.hist-card.redo{border:2px solid var(--danger);background:var(--danger-bg)}
.redo-msg{color:var(--danger);font-weight:600;font-size:.9rem}
.kv{display:grid;grid-template-columns:minmax(110px,40%) 1fr;gap:8px;padding:5px 0;border-bottom:1px dashed var(--border);font-size:.92rem}
.kv span{color:var(--muted)}
.kv b{font-weight:600;white-space:pre-wrap;overflow-wrap:anywhere}
.notice .kv{border-color:currentColor}
.notice .kv span{color:inherit;opacity:.8}
.scan-box{position:relative;border-radius:10px;overflow:hidden;background:#000;line-height:0}
.scan-video{width:100%;max-height:60vh;object-fit:cover}
.scan-line{position:absolute;left:8%;right:8%;top:50%;height:2px;background:#ff3b30;box-shadow:0 0 8px #ff3b30}
.submit-bar{position:sticky;bottom:0;z-index:50;margin:10px -16px 0;padding:8px 16px calc(8px + env(safe-area-inset-bottom));background:var(--card);border-top:1px solid var(--border);box-shadow:0 -4px 12px rgba(0,0,0,.12)}
.submit-bar .notice{margin:0 0 6px}
#done .notice{font-size:1.05rem;font-weight:700}
/* ---------- consoles ---------- */
.pill.blue{background:var(--bg);color:var(--heading);border:1px solid var(--border)}
.mismatch{color:var(--danger);font-weight:700}
.match{color:var(--ok);font-weight:700}
.dlg-wide{max-width:min(900px,96vw)}
.photo-groups h3{font-size:.95rem;margin:12px 0 4px;color:var(--heading)}
.ev-list{display:flex;flex-direction:column;gap:6px;margin:6px 0}
.ev-item{display:flex;align-items:center;gap:8px;padding:6px 8px;border:1px solid var(--border);border-radius:8px;background:var(--bg)}
.ev-item img{width:48px;height:48px;object-fit:cover;border-radius:6px}
.ev-item .grow{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
/* PC: submissions table under the RTV form */
.tscroll.subs{max-height:340px}
.subs table{font-size:.85rem}
.subs td,.subs th{padding:6px;white-space:nowrap;vertical-align:middle}
.subs td.ms{white-space:normal;overflow-wrap:anywhere}
.subs tr.click{cursor:pointer}
.subs tr.click:hover td{background:var(--bg)}
.subs tr.row-redo td{background:var(--danger-bg)}
.subs .pill{font-size:.72rem}
/* second menu badge: reports checked and waiting for the service result */
#tabs.side .nav-badge.svc{background:var(--brand);color:var(--brand-text)}
#tabs.side .nav-badge+.nav-badge{margin-left:4px}
@media (min-width:1000px){body.signed-in .kpi-row.kpi7{grid-template-columns:repeat(7,minmax(0,1fr))}}
/* RTV reports: tick boxes and bulk actions */
table.oneline .tick{width:34px;text-align:center;position:sticky;left:0;background:var(--card);z-index:1}
table.oneline th.tick{z-index:2}
table.oneline .tick input{width:18px;height:18px;margin:0;vertical-align:middle;cursor:pointer}
table.oneline tr.row-on td{background:var(--warn-bg)}
table.oneline tr.row-redo .tick{background:var(--danger-bg)}
table.oneline tr.row-on .tick{background:var(--warn-bg)}
.bulkbar{align-items:center}
/* Admin report pop-up: details left, photos right (2 x 2 groups), sized to fit one screen */
dialog.dlg-xl{max-width:min(1500px,97vw);max-height:94vh}
.rv-grid{display:grid;grid-template-columns:minmax(300px,1fr) minmax(0,2.1fr);gap:16px;align-items:start}
.rv-info .kv{padding:3px 0;font-size:.88rem;grid-template-columns:minmax(90px,32%) 1fr}
.rv-info .notice{margin:8px 0;padding:8px 10px}
.rv-info .thumbs{grid-template-columns:repeat(auto-fill,minmax(64px,1fr))}
.rv-hist{margin-top:10px}
.rv-hist summary{cursor:pointer;font-weight:700;color:var(--heading)}
.rv-photos{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.rv-group{min-width:0}
.rv-group h3{margin:0 0 6px;font-size:.95rem;color:var(--heading)}
.rv-thumbs{display:grid;gap:6px;grid-template-columns:repeat(3,minmax(0,1fr))}
.rv-thumbs.n1{grid-template-columns:minmax(0,1fr)}
.rv-thumbs.n2{grid-template-columns:repeat(2,minmax(0,1fr))}
.rv-thumbs .thumb{aspect-ratio:auto;height:clamp(130px,calc((94vh - 200px) / 2 - 30px),340px)}
.rv-empty{height:60px;display:flex;align-items:center;justify-content:center;border:1px dashed var(--border);border-radius:10px}
@media (max-width:900px){.rv-grid{grid-template-columns:1fr}.rv-photos{grid-template-columns:1fr}.rv-thumbs .thumb{height:160px}}
.rv-info .kv2{display:grid;grid-template-columns:1fr 1fr;column-gap:12px}
.rv-info .kv2 .kv{grid-template-columns:auto 1fr}
.rv-info .thumbs{grid-template-columns:repeat(auto-fill,minmax(52px,64px))}
@media (min-width:901px){.rv-info{max-height:calc(94vh - 90px);overflow-y:auto;padding-right:4px}}
/* PC: model list (wraps on a phone) */
.mlist{max-height:260px;overflow-y:auto;border:1px solid var(--border);border-radius:10px;background:var(--bg);padding:4px}
.mopt{display:flex;flex-direction:column;align-items:flex-start;gap:1px;width:100%;padding:8px 10px;border:0;border-radius:8px;background:none;color:var(--text);font:inherit;text-align:left;cursor:pointer}
.mopt span{font-size:.8rem;color:var(--muted);line-height:1.3}
.mopt:hover,.mopt:focus-visible{background:var(--card);outline:none}
.mopt.on{background:var(--brand);color:var(--brand-text)}
.mopt.on span{color:inherit;opacity:.85}
.field--invalid .mlist{border-color:var(--danger)}
/* Admin photo viewer: zoom and pan */
.lb-stage.zoomable-stage{position:relative;overflow:hidden;touch-action:none;cursor:default;padding:0}
.zoomable-stage>img{position:absolute;left:50%;top:50%;max-width:none;max-height:none;transform:translate(-50%,-50%);transform-origin:center;user-select:none;-webkit-user-drag:none;cursor:zoom-in}
.zoomable-stage.zoomed>img{cursor:grab}
.zoomable-stage.zoomed:active>img{cursor:grabbing}
.lb-tools{position:fixed;left:50%;bottom:34px;transform:translateX(-50%);display:flex;align-items:center;gap:6px;padding:6px;border-radius:14px;background:rgba(0,0,0,.55);z-index:3}
.lb-tools .iconbtn{position:static;color:#fff;border-color:rgba(255,255,255,.5);background:rgba(0,0,0,.45);min-width:44px;min-height:44px}
.lb-pct{min-width:52px;text-align:center;color:#fff;font-weight:700;font-size:.9rem}
.photo-viewer .lb-count{bottom:8px}
/* PC: stores this PC looks after */
.my-stores{display:flex;flex-direction:column;gap:6px;margin-top:10px}
.my-store{display:flex;align-items:center;gap:8px;padding:8px 10px;border:1px solid var(--border);border-radius:10px;background:var(--bg)}
.my-store .grow{flex:1;min-width:0}
.my-store .iconbtn{min-width:36px;min-height:36px}
.hist-store{font-size:.85rem;font-weight:600;color:var(--heading)}
.hist-store .i{width:14px;height:14px}
#s-home .pending{margin:12px 0}
/* Admin PC users: one line per store inside a cell */
td.multi div+div{border-top:1px dashed var(--border)}
td.multi.cut{max-width:240px}
td.multi div{overflow:hidden;text-overflow:ellipsis;line-height:1.6}
/* Multi-check dropdown (button and list share one width; small checkboxes) */
.mc{position:relative;display:inline-block}
.mc-btn{display:flex;align-items:center;justify-content:space-between;gap:8px;min-height:36px;padding:5px 10px;font-size:.9rem;font-weight:600;border-radius:10px;border:1px solid var(--border);background:var(--bg);color:var(--text);cursor:pointer;white-space:nowrap}
.mc-btn .i{width:16px;height:16px}
.mc-btn .mc-sum{flex:1;text-align:left}
.mc-caret{font-size:.7rem;opacity:.6}
.mc.open .mc-btn{border-color:var(--brand)}
.mc-list{position:absolute;top:100%;left:0;z-index:60;margin-top:2px;min-width:100%;width:max-content;max-height:min(520px,calc(100vh - 220px));overflow-y:auto;background:var(--card);border:1px solid var(--border);border-radius:10px;box-shadow:0 4px 14px rgba(0,0,0,.2);visibility:hidden;pointer-events:none}
.mc.open .mc-list{visibility:visible;pointer-events:auto}
.mc-row{display:flex;align-items:center;gap:8px;margin:0;padding:5px 10px;font-size:.9rem;font-weight:400;white-space:nowrap;cursor:pointer}
.mc-row:hover{background:var(--bg)}
.mc-row input{flex:none;width:14px;height:14px;min-height:0;margin:0;padding:0;cursor:pointer}
.mc-sep{border-top:1px solid var(--border)}
/* Table toolbar: filters left, Columns (multi-check dropdown) always right, directly above the table */
.tbar{justify-content:space-between;align-items:center;gap:8px;margin-top:8px}
.tbar-right{margin-left:auto;display:flex;align-items:center;gap:8px}
.tbar-right .mc-list{left:auto;right:0}
.tbar>.row:first-child{flex:1 1 0;min-width:0}
/* ---------- Gift card PC page ---------- */
.gc-hero{display:block;width:min(220px,60%);height:auto;margin:0 auto 6px;border-radius:12px}
.gc-hero.sm{width:min(150px,45%)}
.row3 select:disabled{opacity:1;color:var(--text);background:var(--card);-webkit-text-fill-color:var(--text)}
.seg.yn.val label,.seg.yn.use label{min-height:56px;font-size:1.05rem}
.seg.yn label.ok:has(input:checked){box-shadow:inset 0 0 0 1px var(--ok)}
.item{border:1px solid var(--border);border-radius:12px;padding:6px 8px 2px;margin:0 0 10px;background:var(--bg)}
.item .field{margin:6px 0}
.item input[type=date]{width:100%;min-height:46px}
.item-head{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:2px 6px;min-height:40px;color:var(--heading)}
.item-head .iconbtn{min-width:36px;min-height:36px}
.model-pick{display:flex;flex-direction:column;align-items:flex-start;gap:1px;width:100%;min-height:52px;padding:8px 34px 8px 12px;position:relative;border:1px solid var(--border);border-radius:10px;background:var(--card);color:var(--muted);font:inherit;text-align:left;cursor:pointer}
.model-pick.on{color:var(--text)}
.model-pick span{font-size:.82rem;color:var(--muted);line-height:1.3}
.model-pick .mp-caret{position:absolute;right:12px;top:50%;transform:translateY(-50%);font-size:1rem}
.field--invalid .model-pick{border-color:var(--danger)}
.total-box{display:flex;justify-content:space-between;gap:8px;flex-wrap:wrap;margin:12px 0 0;padding:10px 12px;border-radius:10px;background:var(--warn-bg);color:var(--warn);font-size:1rem}
.total-box b{font-size:1.15rem}
#f-low{margin-top:10px}
#dlg-model{max-width:min(560px,96vw)}
.mlist.tall{max-height:min(52vh,420px)}
/* ---------- Gift card console ---------- */
.datef{display:inline-flex;align-items:center;gap:6px;margin:0}
.datef input{min-height:36px}
td.num,th.num{text-align:right}
td.low{color:var(--warn);font-weight:700}
.rv-lines{margin:8px 0;border:1px solid var(--border);border-radius:10px;overflow:auto}
.rv-lines table{font-size:.85rem}
.rv-lines th,.rv-lines td{padding:4px 8px;white-space:nowrap}
.rv-lines tr.tot td{font-weight:700;background:var(--bg)}
.rv-photos.one{grid-template-columns:minmax(0,1fr)}
.rv-photos.one .rv-thumbs .thumb{height:clamp(220px,calc(94vh - 150px),760px)}
.rv-photos.one .rv-thumbs .thumb img{object-fit:contain;background:#111}
@media (max-width:900px){.rv-photos.one .rv-thumbs .thumb{height:300px}}
/* HomePro logo next to the Haier logo (same height feel; rounded corners hide the file's white corners) */
.logos{display:flex;align-items:center;gap:6px;flex:none}
.logo-hp{width:72px;height:auto;flex:none;border-radius:6px;display:block}
@media (max-width:480px){.logos .logo,.logo-hp{width:52px}.logos{gap:4px}header.top .title h1{white-space:nowrap}}
@media (min-width:1000px){body.signed-in header.top .logo-hp{width:84px}}
