/* v4/console.css — Workplace console v4: the few console pieces base.css does not have (sign-in gate, boot, environment
   ribbon, nav counts, photo crops, live video in tiles, the right-side person panel, the full-screen viewers, the v3
   popups' frame). base.css variables only; never overrides base.css phone input sizes or iOS date-input rules. */

/* ---------- start-up ---------- */
.envr{display:flex;gap:12px;align-items:center;flex-wrap:wrap;padding:6px 16px;background:#7A3E00;color:#fff;font-size:var(--fs-sm)}
.envr b{font-weight:700}
.boot{position:fixed;inset:0;display:grid;place-items:center;background:var(--bg);z-index:400;color:var(--ink-2);font-size:var(--fs-md)}
.boot .sp{width:28px;height:28px;border-radius:50%;border:3px solid var(--line);border-top-color:var(--brand);animation:bspin .8s linear infinite;margin:0 auto 12px}
@keyframes bspin{to{transform:rotate(360deg)}}
@media (prefers-reduced-motion:reduce){.boot .sp{animation:none}}
.bootbox{max-width:360px;text-align:center;padding:24px}.bootbox b{display:block;font-size:var(--fs-lg);margin-bottom:6px}
.bootbox button,.gate button{min-height:44px;padding:0 20px;border-radius:10px;border:0;background:var(--brand);color:var(--brand-ink);font-weight:600;font-size:var(--fs-md);cursor:pointer}
.gate{position:fixed;inset:0;display:grid;place-items:center;background:var(--bg);z-index:401;padding:16px}
.gate form{width:100%;max-width:380px;background:var(--surface);border:1px solid var(--line);border-radius:var(--r-lg);padding:28px;display:grid;gap:14px}
.gate h1{margin:0;font-size:var(--fs-xl)}.gate p{margin:0;color:var(--ink-2)}
.gate label{display:grid;gap:6px;font-weight:500;color:var(--ink-2)}
.gate input{min-height:44px;border-radius:10px;border:1px solid var(--line-2);background:var(--bg);padding:0 12px}
.gate .err{color:var(--bad);font-size:var(--fs-sm);min-height:18px}
.gate .gmark{width:48px;height:48px;border-radius:12px}
[hidden]{display:none!important}

/* ---------- shell ---------- */
#frame{min-height:100vh;min-height:100dvh}
.sitebtn{border:0;background:none;padding:0;text-align:left;cursor:pointer;min-width:0}
.top .live-pill{border:0;cursor:pointer}
.live-pill.warn{color:var(--warn);background:var(--warn-bg)} .live-pill.past{color:var(--ink-2);background:var(--sunk)}
.avatar4{font-size:var(--fs-xs);font-weight:700;color:var(--brand);background:var(--brand-2);cursor:pointer}
.side .cnt{margin-left:auto;font-size:10px;font-weight:700;background:var(--sunk);border-radius:8px;padding:0 6px;color:var(--ink-2)}
.side .cnt.r{background:var(--bad);color:#fff}
@media (max-width:1199px){.side .cnt{display:none}}
.sfoot4{display:none}
@media (min-width:1200px){.sfoot4{display:block;margin-top:auto;padding:12px 10px 4px;font-size:var(--fs-xs);color:var(--ink-3);line-height:1.5}}
.bnav .badge-n.r{background:var(--bad)}
main#view{container-type:inline-size;container-name:app}
main#view.dim{opacity:.6;transition:opacity .15s}
main#view.flush{padding:0}
.back4{align-self:flex-start;margin:0 0 4px -8px}
.ph .acts .live-pill{align-self:center}
.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.grow{flex:1}
.kpi.still{cursor:default}
.kpi:disabled{cursor:default}
.note.fcount{margin-top:-4px}
.card-h h2{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.tbl-h{padding:10px 12px 0;margin-bottom:6px}
.tbl tr.none{cursor:default} .tbl tr.none td{padding:0}
.tbl th button{border:0;background:none;padding:0;font:inherit;color:inherit;cursor:pointer;white-space:nowrap}
.tbl th .sa{margin-left:3px;opacity:.6}
.tbl tr.rc.sel{background:var(--brand-2)}
.tbl .who b,.row .t b{overflow:hidden;text-overflow:ellipsis}
.tbl td.c-img{width:1%}
#frame.compact .tbl td{padding-top:4px;padding-bottom:4px}
.row .e .b{margin-top:2px}
.bars4{position:relative}
.bars4 .bars i.now{background:repeating-linear-gradient(45deg,var(--brand) 0 3px,var(--brand-2) 3px 5px);opacity:1}
.stats4{display:flex;flex-wrap:wrap;gap:6px;align-items:center}
.hbar b,.hbar .mono{font-weight:600;text-align:right;white-space:nowrap}
.hbar>span:first-child{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.dl .v .b{vertical-align:middle}
.v4s{display:flex;flex-direction:column}
.empty{display:flex;flex-direction:column;align-items:center;gap:6px}
.empty .et b{display:block;color:var(--ink);font-size:var(--fs)} .empty .et .muted{display:block}
.empty .ei{color:var(--ink-3)} .empty .ea{display:flex;gap:6px;flex-wrap:wrap;justify-content:center}
/* v3 banners (freshness / partly covered) on native pages */
.banner{display:flex;gap:10px;align-items:flex-start;border-radius:var(--r);padding:9px 12px;font-size:var(--fs-sm);background:var(--info-bg);color:var(--ink)}
.banner.b-warn{background:var(--warn-bg)} .banner.b-bad{background:var(--bad-bg)} .banner.b-ok{background:var(--ok-bg)}
.banner>.ic{color:var(--info);margin-top:1px} .banner.b-warn>.ic{color:var(--warn)} .banner.b-bad>.ic{color:var(--bad)}
.banner .bt{flex:1;min-width:0} .banner .act{display:flex;gap:6px;flex-wrap:wrap}
.btn.p{background:var(--brand);border-color:var(--brand);color:var(--brand-ink)}
.btn.s{height:28px;padding:0 9px;font-size:var(--fs-sm);border-radius:8px}
.btn:disabled{opacity:.5;cursor:default}

/* ---------- photos: the server's real crops, never stretched (owner 10-13: object-fit contain) ---------- */
.crop{flex:none;display:inline-grid;place-items:center;overflow:hidden;border-radius:8px;background:var(--sunk);color:var(--ink-3);border:0;padding:0}
.crop{position:relative}.crop img{position:absolute;inset:0;width:100%;height:100%;object-fit:contain;display:block}   /* absolute: an auto-height box (aspect-ratio) no longer lets the picture overflow and get cut (06-11) */
#sheet .who .crop.l{width:120px;height:160px}
/* popups (sheet/drawer) keep the old-console scope .lg for their frame; stop its chart and button rules leaking into native content (owner 06-11 'Who is this' popup) */
.lg :not(.bars)>.bar{flex:none;background:none;border-radius:0;height:auto;min-width:0;position:static}
.lg .btn.pri{background:var(--brand);border-color:var(--brand);color:var(--brand-ink)}
.lg .fgroup h3{font-size:var(--fs-xs);line-height:normal;font-weight:600}
#sheet.center.lg:has(#nrT){width:min(640px,calc(100% - 32px));max-height:92%}   /* Who is this: room for the photos and the choices without cramped scrolling */
/* owner 28-10: one portrait ratio (3:4) for every face photo, the whole edge crop visible (contain), never cut */
.crop{aspect-ratio:3/4}
.crop.xs{width:24px;height:32px}.crop.s{width:36px;height:48px}.crop.m{width:48px;height:64px}.crop.l{width:72px;height:96px;border-radius:12px}.crop.xl{width:auto;height:240px;max-width:100%}
.crop svg{width:60%;height:60%}
.crop.lock span{display:grid;place-items:center;gap:2px;font-size:9px;text-align:center}
.crop.lock span .ic{width:14px;height:14px}
.crop.xs.lock em,.crop.s.lock em{display:none}
button.crop{cursor:zoom-in}
.tbl td.c-img .crop{width:39px;height:52px}
@media (max-width:1023px){.tbl td.c-img .crop{width:36px;height:48px}}

/* ---------- camera tiles with real video (live.js puts a <video> and messages inside .vid) ---------- */
.cam .vid{filter:none}
.cam .vid video{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;background:#000}
.cam .vid .ov{position:absolute;inset:0;display:grid;place-items:center;text-align:center;font-size:11px;padding:8px;color:#fff;z-index:2}
.cam .vid .lvtap{font-size:var(--fs)!important}
.cam .tl,.cam .tr,.cam .bl,.cam .br,.cam .q{z-index:3}
.cam .bl,.cam .br{text-shadow:0 1px 2px rgba(0,0,0,.7)}
.cam:focus-visible{outline:2px solid var(--brand);outline-offset:2px}
.cams.quad{grid-template-columns:repeat(2,minmax(0,1fr))}
.camfocus{display:grid;gap:8px;grid-template-columns:1fr}
@media (min-width:1024px){.camfocus{grid-template-columns:minmax(0,3fr) minmax(0,1fr)}.camfocus .rail{display:grid;gap:8px;align-content:start;max-height:70vh;overflow:auto}}
@media (max-width:1023px){.camfocus .rail{display:grid;gap:8px;grid-template-columns:repeat(2,minmax(0,1fr))}}

/* ---------- person card: right-side panel on tablet/desktop, full sheet on phone (owner rule) ---------- */
.pcard{position:fixed;inset:0;z-index:60;display:none;background:rgba(10,20,18,.35)}
.pcard.open{display:block}
.pcard .mbox{position:absolute;top:0;right:0;bottom:0;width:min(520px,100%);background:var(--bg);overflow:auto;display:flex;flex-direction:column;gap:var(--gap);
  padding:calc(12px + env(safe-area-inset-top,0px)) 14px calc(16px + env(safe-area-inset-bottom,0px));box-shadow:-8px 0 30px rgba(0,0,0,.12)}
@media (max-width:767px){.pcard .mbox{width:100%;box-shadow:none}}
.pc-top{display:flex;align-items:center;gap:8px}
.pc-top h2{margin:0;font-size:var(--fs-lg);flex:1;min-width:0}
.pc-head{display:flex;gap:12px;align-items:flex-start}
.pc-head .t{flex:1;min-width:0}
.pc-head .t b{display:block;font-size:var(--fs-md);overflow:hidden;text-overflow:ellipsis}
.pc-tags{display:flex;gap:6px;flex-wrap:wrap;margin-top:4px}
.pc-acts{display:flex;gap:6px;flex-wrap:wrap;margin-top:10px}
.pc-strip{display:flex;gap:6px;flex-wrap:wrap}
.pcard .dl{grid-template-columns:repeat(2,minmax(0,1fr))}
@media (min-width:768px){.pcard .dl.d3{grid-template-columns:repeat(3,minmax(0,1fr))}}
.ribbon4{display:flex;height:10px;border-radius:5px;overflow:hidden;background:var(--sunk)}
.ribbon4 i{display:block;height:100%}
.legend4{display:flex;flex-wrap:wrap;gap:4px 12px;font-size:var(--fs-xs);color:var(--ink-3);margin-top:6px}
.legend4 i{display:inline-block;width:8px;height:8px;border-radius:2px;margin-right:4px;vertical-align:middle}

/* ---------- full-screen viewers (camera, photo): base .sheet.full look, opened by v3's "open" class ---------- */
#ev.open,#fs.open{display:flex}
.sheet.full .vw-top{display:flex;align-items:center;gap:8px;min-width:0}
.sheet.full .vw-top h2{margin:0;font-size:var(--fs-md);color:#fff;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.sheet.full .vw-top .sub{font-size:var(--fs-xs);color:rgba(255,255,255,.65);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0;flex:1}
.sheet.full .vw-stage{position:relative;flex:1 1 auto;min-height:0;display:flex;align-items:center;justify-content:center}
.sheet.full .vw-stage .cam{width:100%;max-width:calc((100dvh - 230px) * 16 / 9);margin:auto;cursor:default}
@media (orientation:landscape) and (max-height:500px){.sheet.full .vw-stage .cam{max-width:calc((100dvh - 70px) * 16 / 9)}.sheet.full .vw-more{display:none}}
.sheet.full .vw-pic{width:100%;height:100%;max-height:calc(100dvh - 260px);display:flex;align-items:center;justify-content:center;overflow:hidden;border-radius:6px;background:#000;position:relative}
.sheet.full .vw-pic img{max-width:100%;max-height:100%;object-fit:contain;transition:transform .25s;cursor:zoom-in}
.sheet.full .vw-pic img.zoom{transform:scale(1.8);cursor:zoom-out}
.sheet.full .vw-pic .stamp{position:absolute;left:8px;top:8px;font-size:10px;font-weight:700;background:rgba(0,0,0,.55);border-radius:4px;padding:1px 6px}
.sheet.full .vw-nav{position:absolute;top:50%;transform:translateY(-50%);z-index:4}
.sheet.full .vw-nav.l{left:4px} .sheet.full .vw-nav.r{right:4px}
.sheet.full .vw-strip{display:flex;gap:6px;overflow-x:auto;justify-content:center;flex:none}
.sheet.full .vw-strip button{flex:none;width:52px;height:52px;border-radius:6px;border:2px solid transparent;padding:0;overflow:hidden;background:#000;cursor:pointer}
.sheet.full .vw-strip button[aria-selected="true"]{border-color:#fff}
.sheet.full .vw-strip img{width:100%;height:100%;object-fit:contain}
.sheet.full .vw-more{flex:none;display:grid;gap:8px;max-height:40dvh;overflow:auto}
.sheet.full .dl{grid-template-columns:repeat(2,minmax(0,1fr))}
@media (min-width:768px){.sheet.full .dl{grid-template-columns:repeat(4,minmax(0,1fr))}}
.sheet.full .bar .wpb-btn,.sheet.full .bar button:not(.btn):not(.icon-btn){flex:1 1 auto}
.sheet.full .note{margin:0}

/* ---------- v3 popups kept (incident, camera details, forms, filters, site/date, palette): frame only; inside = legacy.css ---------- */
.fg4{display:grid;gap:6px;margin-bottom:8px}
.fg4 h3{margin:6px 0 0;font-size:var(--fs-xs);letter-spacing:.06em;text-transform:uppercase;color:var(--ink-3)}
.fg4 .g{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.fg4 label{display:block;min-width:0} .fg4 .sel{width:100%}

/* ---------- Home ---------- */
.home-k .kpi:last-child{grid-column:1/-1}
@media (min-width:768px){.home-k{grid-template-columns:repeat(3,minmax(0,1fr))}.home-k .kpi,.home-k .kpi:last-child{grid-column:auto}.home-k .kpi.hero{grid-column:1/-1}}
@media (min-width:1200px){.home-k{grid-template-columns:repeat(4,minmax(0,1fr))}.home-k .kpi.hero{grid-column:auto}}
.map4 #mapinner{width:100%;height:100%;transform-origin:center}
.map4 svg{width:100%;height:100%;display:block}
.map4 .zt4{cursor:pointer} .map4 .zt4:hover polygon,.map4 .zt4:focus-visible polygon{stroke:var(--brand);stroke-width:4}
@media (min-width:1200px){.map-card .map{aspect-ratio:2/1}}
.map-note{margin:4px 0 0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.health4{padding:10px 14px}

/* ---------- More ---------- */
.more-me{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.tile-n{position:absolute;top:4px;right:4px}
.tbl .rowacts{display:inline-flex;gap:4px;flex-wrap:nowrap}
/* QA fixes (smoke 390) */
button.b{border:0;cursor:pointer;font-family:var(--mono)}
.pcard .dl .v{white-space:normal}
.note.fcount{margin-top:0}
@media (max-width:767px){.sheet.full .bar .btn,.sheet.full .bar .sel{width:auto}.sheet.full .bar .sel{flex:1 1 100%}}
.row .t span span,.row .t span .mono{display:inline}
.fbar .fsel{flex:0 1 auto;overflow:hidden} .fbar .fsel .sel{min-width:64px;flex:0 1 auto} .fbar .search{min-width:120px} .fbar>.btn,.fbar>span{flex:none}
.cam .vid .ov{inset:22px 6px 34px;font-size:10.5px;line-height:1.25}
/* live site map frame (core.js V4_LIVEMAP) */
.livemap-slot{height:470px;border-radius:10px;background:linear-gradient(100deg,var(--sunk) 40%,var(--surface) 50%,var(--sunk) 60%) 0 0/200% 100%;animation:lmwait 1.4s linear infinite;display:grid;place-items:center}
.livemap-wait{font-size:var(--fs-sm);color:var(--ink-3)}
@keyframes lmwait{to{background-position:-200% 0}}
@media (prefers-reduced-motion:reduce){.livemap-slot{animation:none}}
@media (max-width:767px){.livemap-slot{height:340px}}
.livemap-holder{position:absolute;z-index:5;border-radius:10px;overflow:hidden}
.livemap-holder iframe{width:100%;height:100%;border:0;display:block}
/* "N people may be employees" popup: above the bottom nav on phones (nav = 6px + 28px icon + label + 6px + safe area) */
@media (max-width:767px){#nan.nan{left:12px;right:12px;width:auto;bottom:calc(var(--bnavh,72px) + env(safe-area-inset-bottom,0px) + 8px);z-index:40}}
/* chip rows that must never run past the card (More: Recently opened, Quick actions) */
.chips.wrap4{flex-wrap:wrap;overflow:visible}

/* Home activity card (owner 28-10): the chart grows to the row height on desktop instead of leaving an empty bottom */
@media (min-width:900px){
 .act-fill{display:flex;flex-direction:column}
 .act-fill .bars4{flex:1;display:flex;flex-direction:column;min-height:140px}
 .act-fill .bars4 .bars{flex:1;height:auto;min-height:90px}
}

/* Home map header: one line at every width (owner 28-10): Site map · [floor] · [Occupancy/Heatmap] · expand */
.map-card .card-h{flex-wrap:nowrap;min-width:0}
.map-card .card-h h2{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0}
.map-card .card-h .r{flex-wrap:nowrap;gap:6px}
.map-card .card-h .sel{height:30px;padding:0 4px;max-width:118px}

/* person card "Today's path": area chips joined by dots and lines in time order (owner 28-10) */
.zpath{display:flex;flex-wrap:wrap;align-items:flex-start;gap:6px 0}
.zp-stop{display:grid;justify-items:center;gap:2px;min-width:64px;max-width:120px;text-align:center}
.zp-stop b{font-size:var(--fs-sm);background:var(--brand-2);color:var(--brand);border-radius:999px;padding:2px 9px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}
.zp-stop .mono{font-size:var(--fs-xs);color:var(--ink-3)}
.zp-stay{font-size:var(--fs-xs);color:var(--ink-2)}
.zp-dot{width:8px;height:8px;border-radius:50%;background:var(--brand)}
.zp-line{flex:0 0 18px;height:2px;background:var(--line-2);margin-top:3px;align-self:flex-start}
.cam-off-chip{cursor:pointer;border:0;height:24px;align-self:center}

/* ---------- dark theme (owner 28-10): same tokens, dark values ---------- */
html[data-theme="dark"]{color-scheme:dark}
html[data-theme="dark"] body,html[data-theme="dark"] body[data-product]{
 --bg:#0e1514; --surface:#162120; --sunk:#1c2928; --line:#283735; --line-2:#3a4b49;
 --ink:#e7efed; --ink-2:#b9c7c4; --ink-3:#8fa09d;
 --brand:#4cc2b4; --brand-2:#1d3b37; --brand-ink:#06201d;
 --ok:#79c795; --ok-bg:#183626; --warn:#e8b45a; --warn-bg:#3a2e16; --bad:#f08a83; --bad-bg:#43201d; --info:#86ace8; --info-bg:#1c2d47;
}
html[data-theme="dark"] .tbl tbody tr:hover{background:#1f2e2d}
html[data-theme="dark"] .kpi.hero{color:#06201d}
html[data-theme="dark"] .kpi.hero .l,html[data-theme="dark"] .kpi.hero .s{color:rgba(6,32,29,.8)}
html[data-theme="dark"] .kpi.warn{border-color:#5a4520} html[data-theme="dark"] .kpi.bad{border-color:#5e2c28}
html[data-theme="dark"] .sheet,html[data-theme="dark"] .card,html[data-theme="dark"] .top,html[data-theme="dark"] .side,html[data-theme="dark"] .bnav{background:var(--surface)}
html[data-theme="dark"] .chip[aria-pressed="true"]{color:var(--brand-ink)}
@media (max-width:767px){html[data-theme="dark"] .tabs button[aria-selected="true"]{color:var(--brand-ink)}}
html[data-theme="dark"] .ph-img{filter:brightness(.7)}
html[data-theme="dark"] .sel,html[data-theme="dark"] .search,html[data-theme="dark"] .btn,html[data-theme="dark"] .icon-btn,html[data-theme="dark"] input,html[data-theme="dark"] textarea{background-color:var(--surface);color:var(--ink);border-color:var(--line-2)}
html[data-theme="dark"] .btn.pri,html[data-theme="dark"] .btn.p{background:var(--brand);color:var(--brand-ink);border-color:var(--brand)}

/* top bar: the site name never wraps (one line at 390 with the theme button) */
.top .site{min-width:0;flex:1 1 auto}
.top .site b,.top .site span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:block;max-width:100%}

/* map edge to edge in its card (iOS QA 28-10): only the header row keeps padding */
.map-card{padding-bottom:0;overflow:hidden}
.map-card .livemap-slot{margin:0 calc(-1 * var(--pad));border-radius:0 0 var(--r) var(--r)}

/* camera tile 17b: name + expand + SD/HD + red dot when not live; readable at ~180x100 */
.cam .bl{right:44px}
.cam .bl b{font-size:12px}
.cam .cdot{position:absolute;top:8px;left:8px;width:9px;height:9px;border-radius:50%;background:#e54b3c;box-shadow:0 0 0 2px rgba(0,0,0,.35)}
.cam .cq{position:absolute;right:6px;bottom:5px;height:20px;min-width:30px;padding:0 6px;border-radius:5px;border:1px solid rgba(255,255,255,.55);background:rgba(0,0,0,.45);color:#fff;font-size:10px;font-weight:700;cursor:pointer}
.cam .tl,.cam .q,.cam .br,.cam .bl span,.cam .mid{display:none}
/* 17b: no status text on a tile -- a camera that is not answering shows the same small red dot as an offline one */
.cam .lvmsg{display:none!important}
.cam:has(.lvmsg:not(:empty))::before{content:"";position:absolute;top:8px;left:8px;width:9px;height:9px;border-radius:50%;background:#e54b3c;box-shadow:0 0 0 2px rgba(0,0,0,.35);z-index:3}

/* plain words: the 'may be employees' popup keeps its title + Later / Check only */
#nan .muted,#nan p{display:none!important}

.cam button.tr{border:0;color:#fff;cursor:pointer;padding:0}
/* iPhone 390 pan (Mac, 28-10): grid tracks never grow past the screen; no sideways pan on phones/tablets */
.app,#app{grid-template-columns:minmax(0,1fr)}
@media (min-width:768px){.app,#app{grid-template-columns:72px minmax(0,1fr)}}
@media (min-width:1200px){.app,#app{grid-template-columns:232px minmax(0,1fr)}}
.app>*,#app>*{min-width:0}
@media (max-width:1023px){html,body{overflow-x:clip}}

/* one naming prompt per screen: when the page shows its own card, no floating popup on top (QA 28-10) */
body:has(#view [data-act="nanOpen"]) #nan{display:none!important}
