/* Neutral black theme in the style of shadcn/ui (zinc/neutral dark). */
:root {
  --bg: #0a0a0a;            /* background */
  --panel: #0a0a0a;         /* card */
  --panel2: #171717;        /* muted / secondary */
  --hover: #262626;         /* accent */
  --line: #262626;          /* border / input */
  --text: #fafafa;          /* foreground */
  --muted: #a3a3a3;         /* muted-foreground */
  --primary: #fafafa;       /* primary */
  --primary-fg: #171717;    /* primary-foreground */
  --ring: #d4d4d4;
  --crit: #ef4444; --warn: #f59e0b; --info: #3b82f6; --ok: #22c55e;
  --radius: 8px;
}
* { box-sizing: border-box; }
/* Display scale: every page is drawn a bit smaller so more fits at once.
   Change --ui-scale to taste (1 = 100%). */
:root { --ui-scale: 0.9; }
body { zoom: var(--ui-scale); }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text);
  font: 14px/1.5 "Geist", "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
code, pre { font-family: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
h3, h4 { font-weight: 600; letter-spacing: -0.01em; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.center { text-align: center; margin: 16px; }
::selection { background: #404040; }

/* bottom dock (replaces the top bar) */
.dock { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: flex; flex-wrap: wrap; align-items: center;
  gap: 8px 16px; min-height: 56px; padding: 8px 16px; background: rgba(10, 10, 10, .92); backdrop-filter: blur(8px);
  border-top: 1px solid var(--line); transition: transform .2s ease, opacity .2s ease; }
body.live-mode .dock:not(.show) { transform: translateY(100%); opacity: 0; pointer-events: none; }
.dock-hotzone { display: none; position: fixed; left: 0; right: 0; bottom: 0; height: 22px; z-index: 39; cursor: pointer;
  justify-content: center; align-items: flex-end; }
body.live-mode .dock-hotzone { display: flex; }
.dock-hotzone span { margin-bottom: 4px; padding: 0 10px; border-radius: 999px; font-size: 11px; line-height: 16px;
  color: var(--muted); background: rgba(10, 10, 10, .6); border: 1px solid rgba(255, 255, 255, .08); opacity: .35;
  transition: opacity .15s; }
.dock-hotzone:hover span { opacity: 1; }
.live-controls { display: none; align-items: center; gap: 12px; }
body.live-mode .live-controls { display: flex; }
.brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 18px; letter-spacing: 1px; }
.brand img { width: 26px; height: 26px; }
.brand span { color: var(--muted); }
.brand.big { font-size: 32px; }
nav { display: flex; gap: 2px; flex: 1; overflow-x: auto; }
nav a { padding: 6px 12px; border-radius: 6px; color: var(--muted); white-space: nowrap; font-weight: 500; transition: color .15s, background .15s; }
nav a:hover { color: var(--text); }
nav a.active { background: var(--panel2); color: var(--text); }
.clock { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 13px; }
.badge { background: var(--crit); color: #fff; border-radius: 999px; padding: 0 6px; font-size: 11px; font-weight: 600; margin-left: 4px; }

main { padding: 16px 16px 96px; }
body.live-mode main { padding: 0; }
body.live-mode { overflow: hidden; background: #000; }
.page { display: none; }
.page.active { display: block; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; }

/* inputs */
input, select, textarea { background: transparent; color: var(--text); border: 1px solid var(--line);
  border-radius: 6px; padding: 7px 12px; font: inherit; height: 36px; transition: box-shadow .15s, border-color .15s; }
textarea { height: auto; }
select { background: var(--bg); }
input::placeholder { color: #737373; }
input:focus-visible, select:focus-visible, textarea:focus-visible, .btn:focus-visible {
  outline: none; border-color: var(--ring); box-shadow: 0 0 0 3px rgba(212, 212, 212, .15); }
input[type="checkbox"] { height: 16px; width: 16px; padding: 0; accent-color: var(--primary); }
input[type="date"] { color-scheme: dark; }

/* buttons: default = outline */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 14px;
  background: transparent; color: var(--text); border: 1px solid var(--line); border-radius: 6px; font: inherit;
  font-weight: 500; cursor: pointer; white-space: nowrap; transition: background .15s, color .15s, border-color .15s; }
.btn:hover { background: var(--hover); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--primary-fg); }
.btn.primary:hover { background: #e5e5e5; }
.btn.danger { background: #7f1d1d; border-color: #7f1d1d; color: #fef2f2; }
.btn.danger:hover { background: #991b1b; }
.btn.ghost { border-color: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--text); }
.btn.small { height: 28px; padding: 0 10px; font-size: 12px; }

/* segmented control (tabs list) */
.seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--panel2); border: 1px solid var(--line); border-radius: var(--radius); }
.seg .btn { height: 28px; padding: 0 10px; border: 0; border-radius: 5px; color: var(--muted); }
.seg .btn:hover { background: transparent; color: var(--text); }
.seg .btn.on { background: var(--bg); color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, .4); }
.pager { display: flex; align-items: center; gap: 8px; color: var(--muted); font-variant-numeric: tabular-nums; }
.switch { display: flex; align-items: center; gap: 8px; cursor: pointer; color: var(--muted); }
.switch:hover { color: var(--text); }

/* live grid */
/* zoom also shrinks viewport units, so divide by the scale to still fill the screen */
.grid { display: grid; gap: 2px; height: calc(100vh / var(--ui-scale)); height: calc(100dvh / var(--ui-scale)); background: #000; }
.tile { position: relative; background: #000; border: 1px solid #171717; overflow: hidden; }
.tile iframe, .tile img { width: 100%; height: 100%; border: 0; object-fit: contain; display: block; }
.tile geye-video { display: block; width: 100%; height: 100%; }
.tile geye-video video { background: #000; }
.tile .ai-layer { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; display: none; }
body:has(#aiOverlay:checked) .tile .ai-layer { display: block; }
.tile .label, .tile .tile-btns { z-index: 2; }
.tile .tile-state { position: absolute; inset: 0; display: none; place-items: center; z-index: 1; pointer-events: none;
  padding: 0 16px; color: var(--muted); font-size: 13px; text-align: center; }
.tile[data-state="loading"] .tile-state, .tile[data-state="error"] .tile-state, .tile[data-state="paused"] .tile-state { display: grid; }
.tile[data-state="paused"] .tile-state { color: var(--text); font-weight: 600; align-content: center; gap: 10px; }
.tile .tile-start { pointer-events: auto; justify-self: center; }
.tile.paused geye-video { filter: grayscale(.6) brightness(.55); }
.run-all .btn { gap: 5px; }
.run-all .btn:disabled { opacity: .4; cursor: default; }
.run-count { font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tile img:not([src]) { visibility: hidden; }   /* no broken-image frame before the first frame */
.tile .label { position: absolute; left: 6px; top: 6px; padding: 2px 8px; background: rgba(10, 10, 10, .75);
  border: 1px solid rgba(255, 255, 255, .08); border-radius: 999px; font-size: 12px; font-weight: 500; pointer-events: none;
  display: flex; align-items: center; }
.tile .dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: #525252; margin-right: 6px; }
.tile .dot.ok { background: var(--ok); }
.tile .dot.bad { background: var(--crit); }
.tile.alarm { border-color: var(--crit); box-shadow: inset 0 0 0 1px var(--crit); animation: blink 1s infinite; }
.tile.empty { background: var(--panel2); border-style: dashed; }
.tile .tile-btns { position: absolute; right: 6px; top: 6px; display: flex; gap: 4px; opacity: 0; transition: opacity .15s; }
.tile .tile-btns .btn { padding: 0 8px; color: var(--text); background: rgba(10, 10, 10, .8); border-color: rgba(255, 255, 255, .18); }
.tile:hover .tile-btns { opacity: 1; }

/* camera viewer (live / replay / event clips) */
.modal.wide .modal-box { width: min(1400px, 100%); }
.cv-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0 28px 12px 0; }
.cv-head h3 { margin: 0; }
.cv-mode { padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; letter-spacing: .04em; border: 1px solid; }
.cv-mode.live { color: #86efac; border-color: rgba(34, 197, 94, .35); background: rgba(34, 197, 94, .1); }
.cv-mode.replay { color: #fcd34d; border-color: rgba(245, 158, 11, .35); background: rgba(245, 158, 11, .1); }
.cv-mode.event { color: #fca5a5; border-color: rgba(239, 68, 68, .35); background: rgba(239, 68, 68, .1); }
.cv-mode.paused { color: var(--muted); border-color: var(--line); background: var(--panel2); }
.cv-time { font-family: 'Geist Mono', monospace; font-size: 13px; color: var(--muted); }
.cv-head .seg .btn { gap: 5px; }
.live-pip { width: 6px; height: 6px; border-radius: 50%; background: var(--ok); }
.cv-stage { height: calc(62vh / var(--ui-scale)); border-radius: 8px; }
.cv-stage video { width: 100%; height: 100%; object-fit: contain; border-radius: 0; display: block; }
.cv-msg { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 16px; text-align: center; color: var(--muted); font-size: 13px; }
.cv-events-head { display: flex; align-items: baseline; gap: 10px; margin: 16px 0 8px; font-size: 13px; }
.cv-strip { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; }
.cv-strip > p { margin: 4px 0; font-size: 13px; }
.cv-ev { flex: 0 0 168px; padding: 0; overflow: hidden; text-align: left; cursor: pointer; color: var(--text);
  background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; font: inherit; }
.cv-ev:hover { border-color: #404040; }
.cv-ev.on { border-color: var(--text); }
.cv-ev img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; border-radius: 0; }
.cv-ev span { display: flex; flex-direction: column; padding: 6px 8px; font-size: 12px; border-left: 3px solid var(--line); }
.cv-ev.critical span { border-left-color: var(--crit); }
.cv-ev.warning span { border-left-color: #f59e0b; }
.cv-ev small { color: var(--muted); font-family: 'Geist Mono', monospace; font-size: 11px; }
@keyframes blink { 50% { border-color: var(--line); box-shadow: none; } }

/* events */
.events { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.ev { position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; cursor: pointer; transition: border-color .15s, background .15s; }
.ev:hover { border-color: #404040; }
.ev::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--info); z-index: 1; }
.ev.critical::before { background: var(--crit); }
.ev.warning::before { background: var(--warn); }
.ev img { width: 100%; aspect-ratio: 16/9; object-fit: cover; display: block; background: #000; }
.ev .meta { padding: 10px 12px; }
.ev .msg { font-weight: 500; }
.ev .muted { font-size: 12px; }
.ev.acked { opacity: .5; }
.ev.selected { border-color: var(--text); box-shadow: 0 0 0 1px var(--text); opacity: 1; }
.ev-check { position: absolute; left: 8px; top: 8px; z-index: 2; background: rgba(10, 10, 10, .75); border-radius: 4px;
  padding: 4px; line-height: 0; cursor: pointer; }
.ev-check input { margin: 0; cursor: pointer; }
.events.list { grid-template-columns: 1fr; gap: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.events.list .ev { display: flex; align-items: center; gap: 12px; padding: 6px 12px 6px 40px; border: 0;
  border-bottom: 1px solid var(--line); border-radius: 0; }
.events.list .ev:last-child { border-bottom: 0; }
.events.list .ev:hover { background: var(--panel2); }
.events.list .ev.selected { background: var(--panel2); box-shadow: none; }
.events.list .ev-check { top: 50%; left: 14px; transform: translateY(-50%); background: none; }
.events.list .ev img { width: 112px; flex-shrink: 0; border-radius: 4px; }
.events.list .ev .meta { flex: 1; display: grid; grid-template-columns: 150px 1fr auto; gap: 12px; align-items: center; padding: 0; }
.events.list .ev .meta .muted { text-align: right; white-space: nowrap; }
.events.list .ev .meta .sev { justify-self: start; }
@media (max-width: 700px) {
  .events.list .ev .meta { grid-template-columns: 1fr; gap: 2px; }
  .events.list .ev .meta .muted { text-align: left; }
  .events.list .ev img { width: 80px; }
}
.sev { display: inline-block; font-size: 11px; font-weight: 600; padding: 0 8px; border-radius: 999px; border: 1px solid;
  line-height: 18px; }
.sev.critical { color: #fca5a5; border-color: rgba(239, 68, 68, .4); background: rgba(239, 68, 68, .1); }
.sev.warning { color: #fcd34d; border-color: rgba(245, 158, 11, .4); background: rgba(245, 158, 11, .1); }
.sev.info { color: #93c5fd; border-color: rgba(59, 130, 246, .4); background: rgba(59, 130, 246, .1); }

/* tables */
.table { width: 100%; border-collapse: separate; border-spacing: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.table th, .table td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table tr:hover td { background: rgba(23, 23, 23, .5); }
.table th { color: var(--muted); font-weight: 500; font-size: 13px; }

/* badges */
.chip { display: inline-flex; align-items: center; padding: 0 8px; border-radius: 999px; background: var(--panel2);
  border: 1px solid var(--line); font-size: 12px; font-weight: 500; line-height: 20px; margin: 1px; }
.chip.ok { color: #86efac; border-color: rgba(34, 197, 94, .35); background: rgba(34, 197, 94, .1); }
.chip.bad { color: #fca5a5; border-color: rgba(239, 68, 68, .35); background: rgba(239, 68, 68, .1); }
.chip.vip { color: #fde68a; border-color: rgba(250, 204, 21, .35); background: rgba(250, 204, 21, .1); }
.chip.blacklist { color: #fca5a5; border-color: rgba(239, 68, 68, .35); background: rgba(239, 68, 68, .1); }

/* watchlist */
.persons { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.person { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.person .photos { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.person .photos div { position: relative; }
.person .photos img { width: 64px; height: 64px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); }
.person .photos button { position: absolute; top: -6px; right: -6px; height: 20px; width: 20px; padding: 0;
  border-radius: 50%; background: var(--panel2); }

/* dialog */
.modal { position: fixed; inset: 0; background: rgba(0, 0, 0, .8); display: flex; align-items: flex-start;
  justify-content: center; z-index: 50; overflow-y: auto; padding: 40px 16px; }
.modal-box { position: relative; background: var(--bg); border: 1px solid var(--line); border-radius: 12px;
  padding: 24px; width: min(920px, 100%); box-shadow: 0 20px 50px rgba(0, 0, 0, .6); }
.modal-box .close { position: absolute; right: 14px; top: 10px; background: none; border: 0; color: var(--muted);
  font-size: 22px; cursor: pointer; border-radius: 4px; }
.modal-box .close:hover { color: var(--text); }
.modal-box h3 { margin-top: 0; }
.modal-box img, .modal-box video { max-width: 100%; border-radius: 6px; background: #000; }
.modal-box pre { background: var(--panel2); border: 1px solid var(--line); border-radius: 6px; padding: 10px; overflow-x: auto; }
.form { display: grid; grid-template-columns: 170px 1fr; gap: 10px 14px; align-items: center; }
.form label { color: var(--muted); font-size: 13px; font-weight: 500; }
.form .full { grid-column: 1 / -1; }
.module { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-top: 10px; background: var(--panel); }
.module h4 { margin: 0 0 4px; display: flex; gap: 8px; align-items: center; }
.module .params { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; margin-top: 10px; }
.module .params label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.roi-wrap { position: relative; display: inline-block; margin-top: 6px; }
.roi-wrap canvas { position: absolute; inset: 0; cursor: crosshair; }
.roi-wrap img { display: block; max-width: 100%; }

/* toasts (sonner-like) */
.toasts { position: fixed; right: 16px; top: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 60; }
.toast { position: relative; background: var(--bg); border: 1px solid var(--line); padding: 12px 16px 12px 18px;
  border-radius: var(--radius); min-width: 300px; max-width: 380px; cursor: pointer; box-shadow: 0 8px 30px rgba(0, 0, 0, .6); }
.toast::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: var(--info); }
.toast.critical::before { background: var(--crit); }
.toast.warning::before { background: var(--warn); }
.toast .muted { font-size: 12px; }
.toast > b { display: block; padding-right: 22px; }
.toast.has-img { width: 340px; padding: 10px 10px 12px 18px; }
.toast.has-img > b { padding-right: 0; }
.toast-img { position: relative; margin-bottom: 8px; aspect-ratio: 16 / 9; border-radius: 6px; overflow: hidden; background: #000; }
.toast-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.toast-img .toast-crop { position: absolute; right: 6px; bottom: 6px; width: 56px; height: 56px;
  border: 2px solid var(--bg); border-radius: 6px; }
.toast-close { position: absolute; right: 8px; top: 8px; display: grid; place-items: center; width: 24px; height: 24px;
  padding: 0; border: 1px solid var(--line); border-radius: 6px; background: rgba(10, 10, 10, .8); color: var(--muted); cursor: pointer; }
.toast-close:hover { color: var(--text); border-color: #525252; }
.toast.has-img .toast-close { right: 16px; top: 16px; }

/* login */
.login-page { display: flex; align-items: center; justify-content: center; }
.login-box { background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 32px; width: 340px;
  display: flex; flex-direction: column; gap: 12px; text-align: center; }
.login-box .btn { width: 100%; }
.err { color: var(--crit); min-height: 1em; margin: 0; font-size: 13px; }

@media (max-width: 700px) {
  .form { grid-template-columns: 1fr; }
  .clock { display: none; }
}

/* ---------- camera page ---------- */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.page-head h2 { margin: 0; font-size: 22px; font-weight: 600; letter-spacing: -0.02em; }
.page-head p { margin: 2px 0 0; }
.page-head .toolbar { margin: 0; }
input[type="search"] { min-width: 220px; }
.empty-state { text-align: center; padding: 64px 16px; border: 1px dashed var(--line); border-radius: var(--radius); }
.empty-icon { font-size: 36px; opacity: .4; }
.empty-state p { margin: 6px 0 16px; }

/* switch */
.toggle { position: relative; display: inline-flex; flex-shrink: 0; width: 36px; height: 20px; cursor: pointer; }
.toggle input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.toggle span { position: absolute; inset: 0; border-radius: 999px; background: #404040; transition: background .15s; }
.toggle span::after { content: ""; position: absolute; left: 2px; top: 2px; width: 16px; height: 16px; border-radius: 50%;
  background: var(--bg); transition: transform .15s; }
.toggle input:checked + span { background: var(--primary); }
.toggle input:checked + span::after { transform: translateX(16px); }
.toggle input:focus-visible + span { box-shadow: 0 0 0 3px rgba(212, 212, 212, .25); }

/* sheet (side panel) */
.sheet { position: fixed; inset: 0; z-index: 55; background: rgba(0, 0, 0, .7); display: flex; justify-content: flex-end;
  animation: fade .15s ease; }
.sheet-panel { width: min(720px, 100%); height: 100%; background: var(--bg); border-left: 1px solid var(--line);
  display: flex; flex-direction: column; animation: slidein .2s ease; }
@keyframes fade { from { opacity: 0; } }
@keyframes slidein { from { transform: translateX(40px); opacity: 0; } }
.sheet-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 20px 24px 16px;
  border-bottom: 1px solid var(--line); }
.sheet-head h3 { margin: 0; font-size: 18px; }
.sheet-head p { margin: 2px 0 0; font-size: 13px; }
.sheet-body { flex: 1; overflow-y: auto; padding: 8px 24px 24px; }
.sheet-foot { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 14px 24px;
  border-top: 1px solid var(--line); background: var(--bg); }
.sheet-foot .err { flex: 1; }
.step { padding: 18px 0; border-bottom: 1px solid var(--line); }
.step:last-child { border-bottom: 0; }
.step-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.step-head small { display: block; font-size: 12px; }
.step-head .num { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; flex-shrink: 0;
  background: var(--primary); color: var(--primary-fg); font-size: 12px; font-weight: 600; }
.step-body { display: flex; flex-direction: column; gap: 14px; padding-left: 36px; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.field > span:first-child { font-weight: 500; }
.field small { font-weight: 400; }
.field.row { flex-direction: row; align-items: center; justify-content: space-between; gap: 12px; cursor: pointer; }
.field.row > span:first-child small { display: block; margin-top: 2px; }
.field input:not([type="checkbox"]):not([type="range"]), .field select { width: 100%; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.src-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.src-card { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 14px; text-align: left;
  background: transparent; color: var(--text); border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer; font: inherit; }
.src-card span { font-size: 20px; margin-bottom: 4px; }
.src-card small { color: var(--muted); font-size: 12px; }
.src-card:hover { background: var(--panel2); }
.src-card.on { border-color: var(--text); box-shadow: 0 0 0 1px var(--text); background: var(--panel2); }
.url-preview { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; background: var(--panel2);
  border: 1px solid var(--line); border-radius: 6px; }
.url-preview code { color: var(--muted); word-break: break-all; }
.probe { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.probe-result:empty { display: none; }
.probe-result { width: 100%; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.probe-result img { display: block; width: 100%; max-height: 220px; object-fit: contain; background: #000; }
.probe-result p { margin: 0; padding: 12px; }
.probe-lines { padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.probe-lines .ok { color: #86efac; }
.probe-lines .bad { color: #fca5a5; }
.video-list { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.video-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; cursor: pointer; border-bottom: 1px solid var(--line); }
.video-row:last-child { border-bottom: 0; }
.video-row span { flex: 1; }
.video-row:hover, .video-row.on { background: var(--panel2); }
.video-row input { accent-color: var(--primary); height: 16px; }
.dropzone { display: block; padding: 14px; text-align: center; border: 1px dashed #404040; border-radius: var(--radius);
  color: var(--muted); cursor: pointer; }
.dropzone:hover { color: var(--text); border-color: var(--muted); }
details.adv { border-top: 1px dashed var(--line); padding-top: 10px; }
details.adv summary { cursor: pointer; color: var(--muted); font-size: 13px; user-select: none; }
details.adv summary:hover { color: var(--text); }
details.adv[open] summary { margin-bottom: 12px; }
.mod-card { border: 1px solid var(--line); border-radius: var(--radius); transition: border-color .15s; }
.mod-card.on { border-color: #525252; }
.mod-head { display: flex; align-items: center; gap: 12px; padding: 12px 14px; cursor: pointer; }
.mod-icon { font-size: 22px; width: 28px; text-align: center; }
.mod-title { flex: 1; display: flex; flex-direction: column; }
.mod-title small { font-size: 12px; }
.mod-body { display: flex; flex-direction: column; gap: 14px; padding: 4px 14px 14px 54px; }
.choices { display: flex; flex-wrap: wrap; gap: 6px; }
.choice { height: 30px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: transparent;
  color: var(--muted); font: inherit; font-size: 13px; cursor: pointer; }
.choice:hover { color: var(--text); }
.choice.on { background: var(--primary); border-color: var(--primary); color: var(--primary-fg); }
.choice.on::before { content: "✓ "; }
input[type="range"] { width: 100%; height: auto; padding: 0; border: 0; accent-color: var(--primary); }
.field .val { float: right; font-variant-numeric: tabular-nums; }
.range-hint { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-top: -4px; }
.roi-box { position: relative; aspect-ratio: 16/9; max-width: 360px; background: var(--panel2); border: 1px solid var(--line);
  border-radius: 6px; overflow: hidden; }
.roi-box.editing { max-width: none; border-color: var(--text); }
.roi-box img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: fill; }
.roi-box canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.roi-box.editing canvas { cursor: crosshair; }
.roi-box .roi-empty { position: absolute; inset: 0; display: none; pointer-events: none; place-items: center; padding: 12px; text-align: center;
  font-size: 12px; color: var(--muted); }
.roi-box:not(:has(img)) .roi-empty, .roi-box.noimg .roi-empty { display: grid; }
.roi-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.roi-actions .muted { font-size: 12px; margin-right: auto; }
@media (max-width: 700px) {
  .grid2, .src-cards { grid-template-columns: 1fr; }
  .step-body { padding-left: 0; }
  .mod-body { padding-left: 14px; }
  .sheet-head, .sheet-body, .sheet-foot { padding-left: 16px; padding-right: 16px; }
}
.step-body > [data-part] { display: flex; flex-direction: column; gap: 14px; }
.step-body > [data-part]:empty { display: none; }
.seg { align-self: flex-start; }

.roi-box.noimg img { display: none; }

/* ---------- icons ---------- */
.ic { flex-shrink: 0; vertical-align: -2px; }
.btn .ic { vertical-align: 0; }
.icon-btn { padding: 0 8px; }
.spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.spacer { flex: 1; }
a.link { cursor: pointer; }
a.link:hover { color: var(--text); text-decoration: underline; }

/* ---------- camera list ---------- */
.cam-list { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.cam-row { display: grid; grid-template-columns: 88px minmax(180px, 2fr) 130px 120px minmax(150px, 1.4fr) 52px auto;
  align-items: center; gap: 14px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.cam-row:last-child { border-bottom: 0; }
.cam-row:not(.head):hover { background: rgba(23, 23, 23, .6); }
.cam-row.head { padding-top: 8px; padding-bottom: 8px; font-size: 12px; font-weight: 500; color: var(--muted); background: var(--panel2); }
.cam-row.off .cam-thumb, .cam-row.off .cam-main b { opacity: .45; }
.cam-thumb { position: relative; aspect-ratio: 16/9; border-radius: 4px; overflow: hidden; background: var(--panel2); cursor: pointer; }
.cam-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cam-thumb .ph { position: absolute; inset: 0; display: grid; place-items: center; color: #525252; }
.cam-main { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.cam-main b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cam-main small { font-size: 12px; display: flex; align-items: center; gap: 4px; overflow: hidden; white-space: nowrap; }
.cam-err { color: #fca5a5; white-space: normal !important; }
.cam-col { font-size: 13px; display: flex; align-items: center; gap: 6px; min-width: 0; }
.cam-col.mods { flex-wrap: wrap; }
.cam-col.actions { justify-content: flex-end; }
.mod-pill { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--panel2); font-size: 12px; }
@media (max-width: 1000px) {
  .cam-row { grid-template-columns: 72px 1fr auto auto; }
  .cam-row > :nth-child(4), .cam-row > :nth-child(5) { display: none; }
  .cam-row > :nth-child(3) { grid-column: 2; grid-row: 2; }
  .cam-row.head { display: none; }
}

/* module cards in the camera sheet */
.mod-icon { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 8px; background: var(--panel2);
  border: 1px solid var(--line); flex-shrink: 0; }
.mod-card.on .mod-icon { background: var(--primary); color: var(--primary-fg); border-color: var(--primary); }
.mod-body { gap: 10px; }
.mod-line { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.mod-line > span { flex: 1; }
.mod-line a { color: var(--text); text-decoration: underline; }
.mod-line.warn-line { color: #fcd34d; }
.mod-line.warn-line b { color: #fde68a; }
.src-card .ic { margin-bottom: 6px; }
.dropzone { display: flex; align-items: center; justify-content: center; gap: 8px; }

/* detection-area dialog */
.roi-modal { z-index: 70; }
.roi-modal .modal-box { width: min(1000px, 100%); }
.roi-modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.roi-modal-head h3 { margin: 0; }
.roi-modal-head p { margin: 2px 0 0; font-size: 13px; }
.roi-help { font-size: 13px; margin: 12px 0; }
.roi-modal .roi-box { max-width: none; width: 100%; }
.roi-modal-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.roi-modal-foot [data-count] { font-size: 13px; margin-right: 8px; }

/* ---------- AI modules page ---------- */
.ai-tabs { display: flex; gap: 4px; padding: 4px; margin-bottom: 16px; flex-wrap: wrap; background: var(--panel2);
  border: 1px solid var(--line); border-radius: var(--radius); width: fit-content; max-width: 100%; }
.ai-tab { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 14px; border: 0; border-radius: 6px;
  background: transparent; color: var(--muted); font: inherit; font-weight: 500; white-space: nowrap; cursor: pointer; }
.ai-tab:hover { color: var(--text); }
.ai-tab.on { background: var(--bg); color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, .4); }
.ai-card { max-width: 760px; border: 1px solid var(--line); border-radius: var(--radius); }
.ai-card-head { display: flex; align-items: flex-start; gap: 14px; padding: 20px; border-bottom: 1px solid var(--line); }
.ai-card-head > div { flex: 1; }
.ai-card-head h3 { margin: 0; font-size: 17px; }
.ai-card-head p { margin: 2px 0 0; font-size: 13px; }
.ai-card-icon { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 8px; flex-shrink: 0;
  background: var(--panel2); border: 1px solid var(--line); }
.ai-fields { display: flex; flex-direction: column; gap: 18px; padding: 20px; }
.ai-adv { margin: 0 20px; padding: 14px 0 0; }
.ai-adv .ai-fields { padding: 14px 0 6px; }
.ai-card-foot { display: flex; align-items: center; gap: 8px; padding: 14px 20px; margin-top: 14px; border-top: 1px solid var(--line); }
.dirty { font-size: 12px; color: var(--warn); }
.btn:disabled { opacity: .45; cursor: not-allowed; }

/* ---------- face watchlist (inside Modul AI) ---------- */
.watchlist { margin-top: 16px; }
.wl-form { display: flex; flex-wrap: wrap; gap: 8px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.wl-form input[name="name"] { flex: 1; min-width: 160px; }
.wl-form input[name="note"] { flex: 1; min-width: 160px; }
.watchlist .persons { padding: 16px 20px 20px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.wl-empty { grid-column: 1 / -1; margin: 0; font-size: 13px; }
.person { padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.person-head { display: flex; align-items: center; gap: 10px; }
.person-name { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.person-name small { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar { width: 40px; height: 40px; border-radius: 50%; overflow: hidden; flex-shrink: 0; display: grid; place-items: center;
  background: var(--panel2); border: 1px solid var(--line); font-weight: 600; color: var(--muted); }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.person .photos { margin: 0; }
.person .photos img { width: 56px; height: 56px; }
.photo-del { position: absolute; top: -6px; right: -6px; width: 20px; height: 20px; padding: 0; display: grid; place-items: center;
  border-radius: 50%; border: 1px solid var(--line); background: var(--bg); color: var(--muted); cursor: pointer; }
.photo-del:hover { color: var(--text); }
.person-actions { display: flex; align-items: center; gap: 6px; }

/* ---------- heatmaps (inside Modul AI) ---------- */
.hm-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; padding: 16px 20px 20px; }
.hm-item { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.hm-item p { margin: 0; font-size: 13px; }
.hm-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.hm-head .muted { font-size: 12px; }
.hm-item img { width: 100%; aspect-ratio: 16/9; object-fit: cover; border-radius: 6px; background: var(--panel2); }
.hm-stats { display: flex; flex-wrap: wrap; gap: 12px; font-size: 13px; color: var(--muted); }
.hm-stats b { color: var(--text); }
.hm-trend { display: flex; flex-direction: column; gap: 2px; font-size: 11px; }
.spark { width: 100%; height: 36px; }
.spark polyline { fill: none; stroke: var(--warn); stroke-width: 1.5; vector-effect: non-scaling-stroke; }

/* ---------- multi-zone dialog ---------- */
.zones-layout { display: grid; grid-template-columns: 240px 1fr; gap: 12px; align-items: start; }
.zone-list { display: flex; flex-direction: column; gap: 6px; }
.zone-item { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; cursor: pointer; }
.zone-item.on { border-color: var(--text); background: var(--panel2); }
.zone-item input { flex: 1; min-width: 0; height: 28px; padding: 0 8px; }
.zone-item small { font-size: 11px; white-space: nowrap; }
.zone-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.zone-empty { font-size: 13px; margin: 0 0 4px; }
@media (max-width: 800px) { .zones-layout { grid-template-columns: 1fr; } }

/* ---------- add AI node ---------- */
.row-actions { white-space: nowrap; text-align: right; }
.warn-box { margin: 10px 0; padding: 10px 12px; border: 1px solid rgba(245, 158, 11, .4); background: rgba(245, 158, 11, .08);
  border-radius: 6px; color: #fcd34d; font-size: 13px; }
ol.steps { padding-left: 20px; display: flex; flex-direction: column; gap: 14px; font-size: 13px; }
ol.steps li > input { display: block; width: 100%; margin-top: 6px; }
ol.steps code { background: var(--panel2); padding: 1px 5px; border-radius: 4px; }
.cmd { position: relative; margin-top: 6px; }
.cmd pre { margin: 0; padding: 12px 70px 12px 12px; background: var(--panel2); border: 1px solid var(--line); border-radius: 6px;
  white-space: pre-wrap; word-break: break-all; color: var(--text); }
.cmd .btn { position: absolute; top: 8px; right: 8px; }
.node-wait { display: flex; align-items: center; gap: 8px; padding: 12px; border: 1px dashed var(--line); border-radius: 6px;
  font-size: 13px; color: var(--muted); }
.node-wait.ok { border-style: solid; border-color: rgba(34, 197, 94, .4); color: #86efac; }

.login-logo { width: 88px; height: 88px; margin: 0 auto 4px; }
.login-box .brand { justify-content: center; }
.brand b { font-weight: 700; }

/* ---------- Event Monitor pop-out window ---------- */
.popout-head { display: none; }
body.popout .popout-head { display: flex; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 10; height: 52px;
  padding: 0 16px; background: rgba(10, 10, 10, .92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
body.popout .dock, body.popout .dock-hotzone, body.popout #evPopout { display: none !important; }
body.popout main { padding-bottom: 24px; }
.popout-title { font-weight: 600; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: #525252; }
.live-dot.on { background: var(--ok); box-shadow: 0 0 0 3px rgba(34, 197, 94, .2); }
.ev.fresh { animation: fresh 2.5s ease-out; }
@keyframes fresh { from { box-shadow: 0 0 0 2px var(--warn); } to { box-shadow: 0 0 0 0 transparent; } }

/* ---------- event evidence (motorcycle theft) ---------- */
.evidence { margin: 12px 0 16px; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); }
.evidence h4 { margin: 0 0 10px; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.ev-pair { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: center; }
.ev-vs { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.ev-vs b { font-size: 28px; color: var(--crit); line-height: 1; }
.ev-vs small { font-size: 11px; white-space: nowrap; }
.ev-more { display: grid; grid-template-columns: 1fr 2fr; gap: 12px; margin-top: 12px; }
.ev-more:empty { display: none; }
.ev-fig { margin: 0; display: flex; flex-direction: column; gap: 6px; }
.ev-fig img { width: 100%; height: 220px; object-fit: contain; background: #000; border-radius: 6px; cursor: zoom-in; }
.ev-more .ev-fig img { height: 180px; }
.ev-fig figcaption { display: flex; flex-direction: column; font-size: 13px; }
.ev-fig figcaption small { font-size: 11px; }
@media (max-width: 700px) { .ev-pair, .ev-more { grid-template-columns: 1fr; } .ev-vs { flex-direction: row; } }
/* traffic evidence: vehicle view + plate */
.tr-vehs { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-top: 12px; }
.tr-veh { display: flex; flex-direction: column; gap: 8px; }
.tr-veh .ev-fig img { height: 170px; }
.tr-plate { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.tr-plate img { height: 44px; max-width: 100%; border-radius: 4px; background: #000; cursor: zoom-in; }
.plate-text { padding: 3px 10px; border: 2px solid #0a0a0a; outline: 1px solid #d4d4d4; border-radius: 4px; background: #fafafa;
  color: #0a0a0a; font: 700 15px 'Geist Mono', monospace; letter-spacing: .08em; white-space: nowrap; }
.plate-text.none { background: transparent; color: var(--muted); border-color: var(--line); outline: 0; font-weight: 500; font-size: 13px; letter-spacing: 0; }
.tr-others { margin: 10px 0 0; font-size: 13px; }
.trap-dist { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.trap-dist input { width: 84px; height: 30px; }

/* ---------- camera page: sidebar list + settings panel ---------- */
.cam-layout { display: grid; grid-template-columns: 300px 1fr; gap: 16px; align-items: start; }
.cam-side { position: sticky; top: 16px; display: flex; flex-direction: column; gap: 10px; max-height: calc(100vh - 56px - 32px);
  padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.cam-side-head { display: flex; align-items: center; gap: 10px; }
.cam-side-head img { width: 32px; height: 32px; }
.cam-side-head > div { flex: 1; display: flex; flex-direction: column; line-height: 1.3; }
.cam-side-head small { font-size: 12px; }
.cam-side input[type="search"] { min-width: 0; width: 100%; }
.cam-side-list { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; margin: 0 -4px; padding: 0 4px; }
.cam-side-empty { font-size: 13px; padding: 8px; margin: 0; }
.cam-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px; text-align: left; border: 1px solid transparent;
  border-radius: 6px; background: transparent; color: var(--text); font: inherit; cursor: pointer; }
.cam-item:hover { background: var(--panel2); }
.cam-item.on { background: var(--panel2); border-color: var(--line); }
.cam-item.off .cam-item-text b { color: var(--muted); }
.cam-item-icon { width: 32px; height: 32px; flex-shrink: 0; display: grid; place-items: center; border-radius: 6px;
  background: var(--panel2); border: 1px solid var(--line); color: var(--muted); }
.cam-item.on .cam-item-icon { background: var(--primary); color: var(--primary-fg); border-color: var(--primary); }
.cam-item-icon.big { width: 40px; height: 40px; color: var(--text); }
.cam-item-text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.cam-item-text b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cam-item-text small { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; background: #525252; }
.st-dot.ok { background: var(--ok); }
.st-dot.bad { background: var(--crit); }
.cam-detail { min-width: 0; }
.cam-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; padding: 80px 24px;
  border: 1px dashed var(--line); border-radius: var(--radius); }
.cam-empty img { width: 72px; height: 72px; opacity: .9; }
.cam-empty h3 { margin: 8px 0 0; }
.cam-empty p { max-width: 420px; margin: 0 0 12px; }
.cam-panel .sheet-panel { width: 100%; height: auto; border: 1px solid var(--line); border-radius: var(--radius); animation: none; }
.cam-panel .sheet-body { overflow: visible; }
.cam-panel .sheet-foot { position: sticky; bottom: 55px; z-index: 5; border-radius: 0 0 var(--radius) var(--radius); }
.cam-head-title { display: flex; align-items: center; gap: 12px; min-width: 0; }
@media (max-width: 900px) {
  .cam-layout { grid-template-columns: 1fr; }
  .cam-side { position: static; max-height: 320px; }
}

/* ---------- attendance (Modul AI → Attendance) ---------- */
.att-tools { display: flex; gap: 6px; align-items: center; }
.att-tools input { height: 30px; }
.att-stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; padding: 16px 20px 0; }
.att-stat { display: flex; flex-direction: column; padding: 10px 12px; border: 1px solid var(--line); border-radius: 6px; }
.att-stat b { font-size: 22px; font-variant-numeric: tabular-nums; }
.att-stat small { font-size: 12px; }
.att-stat.bad b { color: #fca5a5; }
.att-table { padding: 16px 20px; }
.att-table .table td, .att-log .table td { vertical-align: middle; }
.att-face { width: 44px; height: 44px; object-fit: cover; border-radius: 6px; cursor: zoom-in; border: 1px solid var(--line); }
.att-log { margin: 0 20px 20px; }
.att-log .table { margin-top: 10px; }
.chip.warn { color: #fcd34d; border-color: rgba(245, 158, 11, .35); background: rgba(245, 158, 11, .1); }
@media (max-width: 700px) { .att-stats { grid-template-columns: repeat(2, 1fr); } }

/* ---------- alarm sound card (Modul AI) ---------- */
#soundCard { margin-top: 16px; }
#soundCard .ai-card-head .toggle { margin-top: 6px; }
.snd-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.snd-row select { flex: 1; min-width: 180px; }
.muted-off { opacity: .45; pointer-events: none; }
.snd-saved { min-height: 1em; color: #86efac; }

/* Konfigurasi: three floating cards over a blurred backdrop */
.cfg-overlay { position: fixed; inset: 0; z-index: 45; display: flex; padding: 24px 16px; overflow-y: auto;
  background: rgba(0, 0, 0, .45); backdrop-filter: blur(14px) saturate(.8); -webkit-backdrop-filter: blur(14px) saturate(.8);
  animation: cfg-fade .18s ease-out; }
.cfg-float { width: min(1000px, 100%); margin: auto; animation: cfg-pop .22s ease-out; }
.cfg-title { display: flex; flex-direction: column; align-items: center; gap: 4px; margin-bottom: 20px; text-align: center; }
.cfg-title b { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; }
.cfg-title .muted { font-size: 13px; }
.cfg-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.cfg-card { display: flex; flex-direction: column; gap: 14px; padding: 22px; border: 1px solid var(--line); border-radius: 14px;
  background: rgba(10, 10, 10, .88); box-shadow: 0 24px 60px rgba(0, 0, 0, .55); transition: border-color .15s, background .15s, transform .15s; }
.cfg-card:hover { border-color: #525252; background: rgba(23, 23, 23, .95); transform: translateY(-2px); }
.cfg-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel2); }
.cfg-card:hover .cfg-icon { background: var(--bg); }
.cfg-text { display: flex; flex-direction: column; gap: 4px; }
.cfg-text b { font-size: 16px; font-weight: 600; }
.cfg-text .muted { font-size: 13px; line-height: 1.5; }
.cfg-stat { display: flex; flex-wrap: wrap; gap: 6px; min-height: 22px; }
.cfg-go { margin-top: auto; display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 500; color: var(--muted); }
.cfg-card:hover .cfg-go { color: var(--text); }
@keyframes cfg-fade { from { opacity: 0; } }
@keyframes cfg-pop { from { opacity: 0; transform: translateY(10px) scale(.98); } }
@media (max-width: 760px) { .cfg-cards { grid-template-columns: 1fr; } }
.crumbs { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; font-size: 13px; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--text); }
.crumbs b { font-weight: 500; }
.crumb-sep::before { content: "/"; color: #525252; }

/* signed-in user; viewer accounts (GEye Cloud) only watch */
.whoami { font-size: 12px; white-space: nowrap; }
body.viewer [data-config], body.viewer .run-all, body.viewer .tile-btns [data-act="pause"], body.viewer #cfgOverlay { display: none !important; }
