/* ZoneX-Vision — ZoneX brand: orange #EF7D1B, navy #272D38 */
:root {
  --brand: #EF7D1B;
  --brand-600: #d96b0c;
  --brand-soft: rgba(239, 125, 27, .14);
  --navy: #272D38;
  --bg: #161a21;
  --surface: #1e232c;
  --surface-2: #252b36;
  --surface-3: #2e3542;
  --line: #333b49;
  --text: #e9ecf1;
  --muted: #9aa3b2;
  --faint: #6c7586;
  --ok: #22c55e;
  --warn: #f59e0b;
  --danger: #ef4444;
  --info: #3b82f6;
  --radius: 12px;
  --shadow: 0 8px 30px rgba(0, 0, 0, .35);
  --font: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font: 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--brand); text-decoration: none; }
img { display: block; }
h1, h2, h3 { margin: 0; font-weight: 650; letter-spacing: -.01em; }
h1 { font-size: 22px; }
h2 { font-size: 16px; }
h3 { font-size: 14px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.mono { font-family: var(--mono); font-size: 12px; }
.hidden { display: none !important; }
.row { display: flex; gap: 12px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; }
.stack { display: flex; flex-direction: column; gap: 12px; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.sidebar { background: var(--navy); border-right: 1px solid #1c2129; padding: 18px 14px; display: flex; flex-direction: column; gap: 6px; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; }
.brand img { width: 40px; height: 40px; }
.brand .name { font-weight: 750; font-size: 17px; letter-spacing: .01em; }
.brand .name b { color: var(--brand); font-weight: 750; }
.brand .by { font-size: 11px; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 9px; color: #c3c9d4; font-weight: 500; }
.nav a:hover { background: rgba(255, 255, 255, .05); color: #fff; }
.nav a.active { background: var(--brand-soft); color: #fff; box-shadow: inset 3px 0 0 var(--brand); }
.nav a svg { width: 18px; height: 18px; flex: none; opacity: .9; }
.nav .badge { margin-left: auto; }
.sidebar .foot { margin-top: auto; padding: 12px; border-top: 1px solid rgba(255, 255, 255, .07); font-size: 12px; color: var(--muted); }
.sidebar .foot .user { color: var(--text); font-weight: 600; }
.main { padding: 26px 30px 60px; min-width: 0; }
.page-head { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head .sub { color: var(--muted); font-size: 13px; }

/* ---------- elements ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.card.pad0 { padding: 0; overflow: hidden; }
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.grid { display: grid; gap: 16px; }
.g-kpi { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.g-2 { grid-template-columns: 2fr 1fr; }
.g-half { grid-template-columns: 1fr 1fr; }
@media (max-width: 1100px) { .g-2, .g-half { grid-template-columns: 1fr; } }

.kpi { position: relative; overflow: hidden; }
.kpi .label { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.kpi .value { font-size: 30px; font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; }
.kpi .hint { font-size: 12px; color: var(--faint); }
.kpi.accent { border-color: rgba(239, 125, 27, .45); background: linear-gradient(135deg, rgba(239, 125, 27, .16), var(--surface) 60%); }
.kpi.accent .value { color: var(--brand); }

.btn { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); padding: 8px 14px; border-radius: 9px; font: 500 13px var(--font); cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--surface-3); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-600); }
.btn.danger { color: #fca5a5; border-color: rgba(239, 68, 68, .4); background: rgba(239, 68, 68, .08); }
.btn.ghost { background: transparent; }
.btn.sm { padding: 5px 10px; font-size: 12px; }
.btn svg { width: 16px; height: 16px; }
.btn:disabled { opacity: .5; cursor: default; }

input, select, textarea { width: 100%; background: var(--bg); border: 1px solid var(--line); color: var(--text); border-radius: 9px; padding: 9px 12px; font: 14px var(--font); outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
input[type=checkbox] { width: auto; accent-color: var(--brand); }
input[type=range] { padding: 0; accent-color: var(--brand); }
label.f { display: block; font-size: 12px; color: var(--muted); margin-bottom: 5px; font-weight: 500; }
.field { margin-bottom: 14px; }
.search { position: relative; }
.search input { padding-left: 34px; }
.search svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 16px; color: var(--faint); }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 99px; font-size: 11px; font-weight: 600; background: var(--surface-3); color: var(--muted); text-transform: capitalize; white-space: nowrap; }
.badge.count { background: var(--brand); color: #fff; min-width: 20px; justify-content: center; }
.cat-employee { background: rgba(34, 197, 94, .15); color: #86efac; }
.cat-visitor { background: rgba(59, 130, 246, .15); color: #93c5fd; }
.cat-contractor { background: rgba(168, 85, 247, .15); color: #d8b4fe; }
.cat-vip { background: rgba(234, 179, 8, .18); color: #fde047; }
.cat-unknown { background: var(--brand-soft); color: #fdba74; }
.cat-watchlist { background: rgba(239, 68, 68, .18); color: #fca5a5; }
.cat-banned { background: #7f1d1d; color: #fecaca; }

.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: var(--faint); }
.dot.online { background: var(--ok); box-shadow: 0 0 0 3px rgba(34, 197, 94, .2); }
.dot.offline { background: var(--danger); }
.dot.starting, .dot.connecting { background: var(--warn); }
.dot.reconnecting { background: var(--warn); box-shadow: 0 0 0 3px rgba(245, 158, 11, .2); }

.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { padding: 6px 12px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); cursor: pointer; font-size: 12px; font-weight: 500; text-transform: capitalize; }
.chip.on { background: var(--brand-soft); border-color: var(--brand); color: #fff; }

table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); font-weight: 600; padding: 10px 14px; border-bottom: 1px solid var(--line); }
td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: rgba(255, 255, 255, .02); }

.avatar { width: 38px; height: 38px; border-radius: 10px; object-fit: cover; background: var(--surface-3); flex: none; }
.avatar.lg { width: 112px; height: 112px; border-radius: 16px; }
.avatar.ph { display: grid; place-items: center; color: var(--faint); font-weight: 700; }

/* ---------- people ---------- */
.people { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.pcard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; cursor: pointer; transition: transform .12s, border-color .12s; }
.pcard:hover { transform: translateY(-2px); border-color: var(--brand); }
.pcard .ph { aspect-ratio: 1; background: var(--surface-2) center/cover no-repeat; position: relative; }
.pcard .ph .star { position: absolute; top: 8px; right: 8px; background: var(--brand); color: #fff; border-radius: 99px; padding: 2px 8px; font-size: 11px; font-weight: 700; }
.pcard .body { padding: 10px 12px 12px; }
.pcard .nm { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pcard .meta { font-size: 12px; color: var(--muted); margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- cameras / live ---------- */
.cams { display: grid; grid-template-columns: repeat(var(--cols, 2), 1fr); gap: 14px; }
.cam { background: #000; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; position: relative; }
.cam img { width: 100%; aspect-ratio: 16/9; object-fit: contain; background: #0b0d11; }
.cam .bar { white-space: nowrap; overflow: hidden; position: absolute; left: 0; right: 0; top: 0; padding: 8px 12px; display: flex; gap: 8px; align-items: center; background: linear-gradient(rgba(0, 0, 0, .75), transparent); font-size: 12px; font-weight: 600; }
.cam .bar .zone { color: var(--muted); font-weight: 500; }
.cam .bar .fps { margin-left: auto; font-family: var(--mono); color: var(--muted); font-weight: 400; }
.cam .empty { aspect-ratio: 16/9; display: grid; place-items: center; color: var(--faint); background: repeating-linear-gradient(45deg, #11141a, #11141a 12px, #14181f 12px, #14181f 24px); }

/* ---------- timeline ---------- */
.tl-day { margin-bottom: 26px; }
.tl-day > h3 { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 12px; }
.tl { position: relative; padding-left: 28px; }
.tl::before { content: ""; position: absolute; left: 9px; top: 6px; bottom: 6px; width: 2px; background: linear-gradient(var(--brand), var(--line)); }
.tl-item { position: relative; margin-bottom: 12px; }
.tl-item::before { content: ""; position: absolute; left: -24px; top: 18px; width: 12px; height: 12px; border-radius: 50%; background: var(--bg); border: 3px solid var(--brand); }
.tl-move { font-size: 12px; color: var(--muted); margin: -4px 0 8px; display: flex; align-items: center; gap: 6px; }
.tl-move b { color: var(--brand); font-weight: 600; }
.tl-card { display: flex; gap: 14px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; }
.tl-card img { width: 64px; height: 64px; border-radius: 10px; object-fit: cover; background: var(--surface-3); cursor: zoom-in; }
.tl-card .time { font-family: var(--mono); font-size: 13px; }
.tl-card .dur { margin-left: auto; text-align: right; }

.lanes { overflow-x: auto; }
.lanes svg { display: block; min-width: 720px; }
.lanes text { fill: var(--muted); font: 11px var(--font); }

/* ---------- chart ---------- */
.bars { display: flex; align-items: flex-end; gap: 4px; height: 150px; padding-top: 10px; }
.bars .b { flex: 1; background: var(--surface-3); border-radius: 4px 4px 0 0; position: relative; min-height: 2px; }
.bars .b.now { background: var(--brand); }
.bars .b:hover { background: var(--brand-600); }
.bars .b:hover::after { content: attr(data-tip); position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); background: #000; padding: 3px 7px; border-radius: 6px; font-size: 11px; white-space: nowrap; }
.bars-x { display: flex; gap: 4px; font-size: 10px; color: var(--faint); margin-top: 6px; }
.bars-x span { flex: 1; text-align: center; }

/* ---------- feed ---------- */
.feed { display: flex; flex-direction: column; }
.feed .it { display: flex; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.feed .it:last-child { border-bottom: 0; }
.feed .ico { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; flex: none; background: var(--surface-3); }
.feed .ico svg { width: 17px; height: 17px; }
.ev-new_person .ico { background: var(--brand-soft); color: var(--brand); }
.ev-watchlist .ico { background: rgba(239, 68, 68, .15); color: var(--danger); }
.ev-tracked_seen .ico { background: rgba(59, 130, 246, .15); color: var(--info); }
.ev-camera_offline .ico { background: rgba(239, 68, 68, .1); color: #fca5a5; }
.ev-camera_online .ico { background: rgba(34, 197, 94, .1); color: var(--ok); }
.ev-identity_corrected .ico { background: rgba(34, 197, 94, .12); color: var(--ok); }
.feed .msg { font-size: 13px; }
.feed .ts { font-size: 11px; color: var(--faint); }
.feed img.snap { width: 34px; height: 34px; border-radius: 8px; object-fit: cover; }
.empty-state { text-align: center; padding: 40px 20px; color: var(--faint); }
.empty-state svg { width: 42px; height: 42px; opacity: .5; margin: 0 auto 10px; display: block; }

/* ---------- modal / toast ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(5, 7, 10, .7); backdrop-filter: blur(3px); display: grid; place-items: center; z-index: 50; padding: 20px; }
.modal { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; width: min(560px, 100%); max-height: 90vh; overflow: auto; box-shadow: var(--shadow); }
.modal .mh { padding: 18px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; }
.modal .mb { padding: 20px; }
.modal .mf { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; }
.modal.wide { width: min(980px, 100%); }
.x { margin-left: auto; background: none; border: 0; color: var(--muted); font-size: 22px; cursor: pointer; line-height: 1; }
.drop { border: 2px dashed var(--line); border-radius: 12px; padding: 22px; text-align: center; color: var(--muted); cursor: pointer; }
.drop:hover, .drop.over { border-color: var(--brand); background: var(--brand-soft); }
.thumbs { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.thumbs img { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; }
.faces { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.faces .f { position: relative; }
.faces .f img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; background: var(--surface-3); }
.faces .f .t { position: absolute; left: 4px; bottom: 4px; font-size: 9px; background: rgba(0, 0, 0, .7); padding: 1px 5px; border-radius: 4px; text-transform: uppercase; }
.faces .f button { position: absolute; top: 4px; right: 4px; border: 0; background: rgba(0, 0, 0, .7); color: #fff; border-radius: 6px; width: 22px; height: 22px; cursor: pointer; display: none; }
.faces .f:hover button { display: block; }

.toasts { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 10px; z-index: 60; }
.toast { background: var(--surface-2); border: 1px solid var(--line); border-left: 4px solid var(--brand); padding: 12px 14px; border-radius: 10px; box-shadow: var(--shadow); min-width: 280px; max-width: 380px; display: flex; gap: 10px; align-items: center; animation: slide .25s ease-out; }
.toast.err { border-left-color: var(--danger); }
.toast.ok { border-left-color: var(--ok); }
.toast img { width: 40px; height: 40px; border-radius: 8px; object-fit: cover; }
@keyframes slide { from { transform: translateX(30px); opacity: 0; } }
.lightbox { position: fixed; inset: 0; background: rgba(0, 0, 0, .9); display: grid; place-items: center; z-index: 70; cursor: zoom-out; }
.lightbox img { max-width: 90vw; max-height: 90vh; border-radius: 10px; }

/* ---------- auth ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: radial-gradient(1200px 600px at 20% -10%, rgba(239, 125, 27, .18), transparent 60%), radial-gradient(900px 500px at 110% 110%, rgba(239, 125, 27, .08), transparent 60%), var(--bg); }
.auth .box { width: min(400px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 34px 30px; box-shadow: var(--shadow); }
.auth .logo { width: 84px; height: 84px; margin: 0 auto 14px; }
.auth h1 { text-align: center; font-size: 24px; }
.auth h1 b { color: var(--brand); }
.auth .tag { text-align: center; color: var(--muted); margin: 4px 0 26px; font-size: 13px; }
.err-msg { color: #fca5a5; font-size: 13px; min-height: 18px; margin-bottom: 8px; }

.pulse { animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { opacity: .45; } }
.spinner { width: 18px; height: 18px; border: 2px solid var(--line); border-top-color: var(--brand); border-radius: 50%; animation: spin .8s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.setting { display: grid; grid-template-columns: minmax(0, 1fr) 180px 60px; gap: 14px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.setting:last-child { border-bottom: 0; }
.setting .d { font-size: 12px; color: var(--faint); }
.setting output { font-family: var(--mono); text-align: right; }

.card-head h2 { display: flex; align-items: center; gap: 8px; }
.card-head h2 svg { width: 18px; height: 18px; color: var(--brand); }
.tl-move svg { width: 14px; height: 14px; }
.badge.plain { text-transform: none; }
.cam .nosignal { aspect-ratio: 16/9; display: grid; place-items: center; color: var(--faint); font-size: 13px; background: repeating-linear-gradient(45deg, #11141a, #11141a 12px, #14181f 12px, #14181f 24px); }

/* ---------- monitor ---------- */
.g-3 { grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); }
.g-charts { grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 22px 26px; }
.st { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 3px 9px 3px 7px; border-radius: 99px; white-space: nowrap; text-transform: capitalize; }
.st svg { width: 14px; height: 14px; }
.st-ok { background: rgba(34, 197, 94, .12); color: #86efac; }
.st-warning { background: rgba(245, 158, 11, .14); color: #fcd34d; }
.st-critical { background: rgba(239, 68, 68, .16); color: #fca5a5; }
.checks { display: flex; flex-direction: column; gap: 8px; }
.check { display: flex; align-items: center; gap: 12px; padding: 9px 12px; background: var(--surface-2); border-radius: 10px; font-size: 13px; }
.comp .card-head h2 svg, .card-head h2 svg { width: 18px; height: 18px; }
.big { font-size: 28px; font-weight: 700; margin: 2px 0 12px; font-variant-numeric: tabular-nums; }
.big .unit { font-size: 12px; color: var(--muted); font-weight: 500; margin-left: 8px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 13px; margin-top: 10px; }
.kv > div:nth-child(odd) { color: var(--muted); }
.kv > div:nth-child(even) { text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.meter { margin-bottom: 10px; font-size: 13px; }
.meter .bar { height: 6px; background: var(--surface-3); border-radius: 4px; margin-top: 5px; overflow: hidden; }
.meter .fill { height: 100%; border-radius: 4px; }
.fill-ok { background: #3987e5; }
.fill-warning { background: var(--warn); }
.fill-critical { background: var(--danger); }
.cores { display: flex; gap: 2px; align-items: flex-end; height: 26px; margin: -4px 0 10px; }
.cores span { flex: 1; min-width: 2px; border-radius: 2px 2px 0 0; }
.mtable td, .mtable th { padding: 9px 12px; }
svg.inl { width: 14px; height: 14px; vertical-align: -2px; }
svg.warn { color: var(--warn); }
.mchart h3 { font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.chart { position: relative; }
.chart svg text { fill: var(--faint); font: 10px var(--font); }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .xhair { stroke: var(--muted); stroke-width: 1; }
.chart-empty { height: 150px; display: grid; place-items: center; color: var(--faint); font-size: 12px; border: 1px dashed var(--line); border-radius: 10px; }
.tip { position: absolute; top: 4px; background: #0b0d11; border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; font-size: 12px; min-width: 130px; pointer-events: none; box-shadow: var(--shadow); }
.tip .row { margin-top: 3px; }
.key { display: inline-block; width: 10px; height: 3px; border-radius: 2px; }
.legend { display: flex; gap: 10px; flex-wrap: wrap; font-size: 11px; color: var(--muted); }
.legend > span { display: inline-flex; align-items: center; gap: 5px; }
.logbox { height: 340px; overflow: auto; background: #0b0d11; border: 1px solid var(--line); border-radius: 10px; padding: 8px 0; font-size: 12px; }
.ll { display: grid; grid-template-columns: 78px 70px 150px 1fr; gap: 10px; padding: 2px 12px; white-space: pre-wrap; word-break: break-word; }
.ll:hover { background: rgba(255, 255, 255, .03); }
.ll .ts { color: var(--faint); }
.ll .src { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ll .lv { font-weight: 700; color: var(--muted); }
.lv-WARNING .lv { color: #fcd34d; }
.lv-ERROR .lv, .lv-CRITICAL .lv { color: #fca5a5; }
.lv-ERROR { background: rgba(239, 68, 68, .06); }
.testres { background: var(--surface-2); border-radius: 10px; padding: 12px 14px; }
.ev-system_warning .ico { background: rgba(245, 158, 11, .14); color: var(--warn); }
.ev-system_critical .ico { background: rgba(239, 68, 68, .16); color: var(--danger); }
.ev-system_ok .ico { background: rgba(34, 197, 94, .12); color: var(--ok); }
.ev-system_action .ico { background: var(--surface-3); color: var(--muted); }
@media (max-width: 700px) { .ll { grid-template-columns: 70px 60px 1fr; } .ll .src { display: none; } }

/* stream quality badge on camera tiles */
.cam .qual { position: absolute; right: 8px; bottom: 8px; font: 11px var(--mono); color: #d7dbe2; background: rgba(0, 0, 0, .62);
  padding: 3px 8px; border-radius: 6px; pointer-events: none; white-space: nowrap; }
.cam .qual:empty { display: none; }
.cam .qual b { font-weight: 700; color: #fff; }

.badge.probable { background: rgba(255, 200, 0, .14); color: #fcd34d; text-transform: none; }

/* v1.6 - AI activity pill (camera bars, Monitor) */
.ai-pill { display: inline-flex; align-items: center; gap: 6px; font: 12px var(--mono); color: var(--muted); white-space: nowrap; }
.ai-pill i { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); flex: none; }
.ai-pill.ai-analysing { color: var(--ok); }
.ai-pill.ai-analysing i { background: var(--ok); animation: aibeat 1s ease-in-out infinite; }
.ai-pill.ai-starting, .ai-pill.ai-busy { color: var(--warn); }
.ai-pill.ai-starting i, .ai-pill.ai-busy i { background: var(--warn); animation: pulse 1.4s infinite; }
.ai-pill.ai-stalled, .ai-pill.ai-error { color: var(--danger); }
.ai-pill.ai-stalled i, .ai-pill.ai-error i { background: var(--danger); }
@keyframes aibeat { 0%, 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, .55); } 50% { box-shadow: 0 0 0 4px rgba(34, 197, 94, 0); } }
.cam .bar .ai-pill { text-shadow: 0 1px 2px rgba(0, 0, 0, .9); font-weight: 600; }

/* v1.7 - look-alike tools */
.faces .f.sus img { outline: 3px solid var(--warn); outline-offset: -3px; }
.faces .f .why { position: absolute; left: 4px; top: 4px; font-size: 9px; font-weight: 700; color: #1a1a1a; background: var(--warn); padding: 1px 5px; border-radius: 4px; max-width: calc(100% - 8px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-card .nothim { display: none; margin-top: 4px; font-size: 11px; padding: 2px 8px; }
.tl-card:hover .nothim { display: inline-block; }

/* v1.7.1 - person picker with photos (Not him / Merge into dialogs) */
.pp .search { width: 100%; margin-bottom: 8px; }
.pp-list { max-height: 46vh; overflow: auto; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.pp-it { display: flex; gap: 10px; align-items: center; padding: 7px 10px; cursor: pointer; border-bottom: 1px solid var(--line); }
.pp-it:last-child { border-bottom: 0; }
.pp-it:hover { background: var(--surface-3); }
.pp-it.on { background: var(--brand-soft); box-shadow: inset 3px 0 0 var(--brand); }
.pp-it .ts { font-size: 11px; color: var(--faint); margin-top: 2px; }
.pp-it .pp-chk { width: 18px; height: 18px; color: var(--brand); visibility: hidden; }
.pp-it.on .pp-chk { visibility: visible; }
.pp-it .pp-chk svg { width: 18px; height: 18px; }
.pp-none .avatar.ph { color: var(--brand); font-size: 20px; }

/* v1.7.4 - toggle switches + clothing memory section */
.switch { position: relative; display: inline-block; width: 44px; height: 24px; justify-self: end; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: var(--surface-3); border: 1px solid var(--line); border-radius: 24px; transition: .15s; cursor: pointer; }
.switch span::before { content: ""; position: absolute; width: 18px; height: 18px; left: 2px; top: 2px; background: var(--muted); border-radius: 50%; transition: .15s; }
.switch input:checked + span { background: var(--brand); border-color: var(--brand); }
.switch input:checked + span::before { transform: translateX(20px); background: #fff; }
.switch input:disabled + span { opacity: .5; cursor: default; }
.setting.sub { padding-left: 14px; border-left: 2px solid var(--line); margin-left: 2px; }
.setting.dim { opacity: .45; }

/* v1.9.3 - profile photo picker */
.faces .f button.star { right: 30px; font-size: 13px; line-height: 20px; }
.faces .f.is-thumb img { outline: 3px solid var(--brand); outline-offset: -3px; }
.faces.pick .f { cursor: pointer; }
.faces.pick .f.on img { outline: 3px solid var(--brand); outline-offset: -3px; }
.faces.pick .f:hover img { filter: brightness(1.15); }
