/* Gözcü NVR — control room theme */
:root {
  --bg: #0a0d12;
  --panel: #10151c;
  --panel-2: #151b24;
  --panel-3: #1b2330;
  --border: #222b37;
  --border-2: #2d3846;
  --text: #e7ecf3;
  --text-2: #b4bfcd;
  --muted: #7d8a9b;
  --accent: #f5a524;
  --accent-2: #ffbe4d;
  --accent-ink: #1a1204;
  --accent-soft: rgba(245, 165, 36, .12);
  --ok: #22c55e;
  --ok-soft: rgba(34, 197, 94, .14);
  --bad: #ef4444;
  --bad-soft: rgba(239, 68, 68, .14);
  --warn: #eab308;
  --info: #60a5fa;
  --info-soft: rgba(96, 165, 250, .14);
  --radius: 10px;
  --radius-sm: 7px;
  --shadow: 0 10px 40px rgba(0, 0, 0, .45);
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --sidebar: 220px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.45 var(--sans);
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
[hidden] { display: none !important; }
::selection { background: rgba(245, 165, 36, .35); }
.num, .mono { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); font-size: 12.5px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.nowrap { white-space: nowrap; }
.grow { flex: 1; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 14px; }

/* ---------------------------------------------------------------- boot / spinner */
.boot { height: 100vh; display: grid; place-items: center; }
.spinner {
  width: 26px; height: 26px; border-radius: 50%;
  border: 2.5px solid rgba(255, 255, 255, .14); border-top-color: var(--accent);
  animation: spin .8s linear infinite;
}
.spinner.sm { width: 16px; height: 16px; border-width: 2px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------------------------------------------------------- login */
.login {
  min-height: 100vh; display: grid; place-items: center; padding: 24px 16px;
  background:
    radial-gradient(900px 500px at 15% -10%, rgba(245, 165, 36, .10), transparent 60%),
    radial-gradient(700px 500px at 110% 110%, rgba(96, 165, 250, .07), transparent 60%),
    var(--bg);
}
.login-card {
  width: 100%; max-width: 380px; background: var(--panel); border: 1px solid var(--border);
  border-radius: 16px; padding: 32px 28px 26px; box-shadow: var(--shadow);
}
.login-card .brand { justify-content: center; margin-bottom: 6px; }
.login-card .brand-name { font-size: 22px; }
.login-card .sub { text-align: center; color: var(--muted); margin: 0 0 24px; font-size: 13px; }
.login-card form { display: flex; flex-direction: column; gap: 14px; }
.login-card .btn { justify-content: center; height: 42px; margin-top: 4px; }
.login-foot { text-align: center; color: var(--muted); font-size: 12px; margin-top: 18px; }

/* ---------------------------------------------------------------- brand */
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark { width: 30px; height: 30px; flex: none; }
.brand-name { font-weight: 700; font-size: 17px; letter-spacing: .2px; }
.brand-name small { color: var(--accent); font-weight: 700; margin-left: 3px; font-size: .72em; letter-spacing: 1px; }

/* ---------------------------------------------------------------- shell */
.shell { display: grid; grid-template-columns: var(--sidebar) 1fr; height: 100vh; }
.sidebar {
  background: var(--panel); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; min-height: 0;
}
.sidebar .brand { padding: 18px 18px 16px; }
.nav { display: flex; flex-direction: column; gap: 2px; padding: 6px 10px; flex: 1; overflow-y: auto; }
.nav-label { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .8px; padding: 14px 10px 6px; }
.nav a {
  display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: var(--radius-sm);
  color: var(--text-2); font-weight: 500; position: relative;
}
.nav a:hover { background: var(--panel-2); color: var(--text); text-decoration: none; }
.nav a.active { background: var(--accent-soft); color: var(--accent-2); }
.nav a.active::before {
  content: ""; position: absolute; left: -10px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent);
}
.nav a svg { flex: none; opacity: .9; }
.nav .badge { margin-left: auto; }
.sidebar-foot { border-top: 1px solid var(--border); padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.engine-state { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; padding: 0 6px; }
.user-chip {
  display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: var(--radius-sm);
  background: var(--panel-2); border: 1px solid var(--border); cursor: pointer; text-align: left; width: 100%;
}
.user-chip:hover { border-color: var(--border-2); }
.avatar {
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: linear-gradient(135deg, #f5a524, #d97706); color: var(--accent-ink); font-weight: 700; font-size: 13px;
}
.user-chip .who { min-width: 0; flex: 1; }
.user-chip .who b { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chip .who span { color: var(--muted); font-size: 12px; }

.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow: hidden; }
.page-head {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 14px 22px; border-bottom: 1px solid var(--border); background: var(--bg); min-height: 62px;
}
.page-head h1 { margin: 0; font-size: 18px; font-weight: 650; letter-spacing: .1px; }
.page-head .sub { color: var(--muted); font-size: 13px; }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.page-body { flex: 1; overflow: auto; padding: 20px 22px 28px; min-height: 0; }
.page-body.flush { padding: 0; overflow: hidden; display: flex; flex-direction: column; }

/* ---------------------------------------------------------------- controls */
.btn {
  display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 14px;
  border-radius: var(--radius-sm); border: 1px solid var(--border-2); background: var(--panel-2);
  color: var(--text); font-weight: 550; cursor: pointer; white-space: nowrap; user-select: none;
  transition: background .12s, border-color .12s, color .12s;
}
.btn:hover { background: var(--panel-3); border-color: #3a4757; }
.btn:focus-visible, .icon-btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, .seg button:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 1px;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: var(--accent-2); border-color: var(--accent-2); }
.btn.danger { background: transparent; border-color: rgba(239, 68, 68, .5); color: #fca5a5; }
.btn.danger:hover { background: var(--bad-soft); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--panel-2); color: var(--text); }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12.5px; }
.icon-btn {
  display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: var(--radius-sm);
  border: 1px solid transparent; background: transparent; color: var(--text-2); cursor: pointer;
}
.icon-btn:hover { background: var(--panel-3); color: var(--text); }
.icon-btn.danger:hover { color: #fca5a5; background: var(--bad-soft); }
.icon-btn.active { color: var(--accent); background: var(--accent-soft); }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span { font-size: 12.5px; color: var(--text-2); font-weight: 550; }
.field > span em { color: var(--accent); font-style: normal; }
.field .hint { font-size: 12px; color: var(--muted); }
input[type=text], input[type=password], input[type=number], input[type=date], input[type=datetime-local], input[type=search], input[type=url], select, textarea {
  height: 36px; width: 100%; padding: 0 11px; border-radius: var(--radius-sm);
  background: var(--bg); border: 1px solid var(--border-2); color: var(--text); min-width: 0;
}
textarea { height: auto; min-height: 70px; padding: 9px 11px; resize: vertical; }
input::placeholder, textarea::placeholder { color: #5d6a7b; }
input:hover, select:hover, textarea:hover { border-color: #3a4757; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: none; }
input[type=date]::-webkit-calendar-picker-indicator, input[type=datetime-local]::-webkit-calendar-picker-indicator { filter: invert(.8); cursor: pointer; }
select { padding-right: 28px; }
.input-sm { height: 30px !important; font-size: 13px; }

.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.switch input { appearance: none; width: 36px; height: 20px; border-radius: 20px; background: var(--panel-3); border: 1px solid var(--border-2); position: relative; cursor: pointer; transition: background .15s; margin: 0; flex: none; }
.switch input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #9aa6b6; transition: transform .15s, background .15s; }
.switch input:checked { background: var(--accent); border-color: var(--accent); }
.switch input:checked::after { transform: translateX(16px); background: var(--accent-ink); }

.seg { display: inline-flex; background: var(--panel); border: 1px solid var(--border-2); border-radius: var(--radius-sm); padding: 2px; gap: 2px; }
.seg button {
  border: 0; background: transparent; color: var(--text-2); height: 28px; min-width: 32px; padding: 0 9px;
  border-radius: 5px; cursor: pointer; font-weight: 600; font-size: 12.5px; display: inline-grid; place-items: center;
}
.seg button:hover { color: var(--text); background: var(--panel-3); }
.seg button.on { background: var(--accent); color: var(--accent-ink); }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid3 { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 14px; }
@media (max-width: 640px) { .grid2, .grid3 { grid-template-columns: 1fr; } }

/* ---------------------------------------------------------------- badges / status */
.badge {
  display: inline-flex; align-items: center; gap: 5px; height: 21px; padding: 0 8px; border-radius: 20px;
  font-size: 11.5px; font-weight: 650; background: var(--panel-3); color: var(--text-2); white-space: nowrap;
}
.badge.ok { background: var(--ok-soft); color: #86efac; }
.badge.bad { background: var(--bad-soft); color: #fca5a5; }
.badge.warn { background: rgba(234, 179, 8, .14); color: #fde047; }
.badge.info { background: var(--info-soft); color: #93c5fd; }
.badge.accent { background: var(--accent-soft); color: var(--accent-2); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: none; display: inline-block; }
.dot.ok { background: var(--ok); box-shadow: 0 0 0 3px rgba(34, 197, 94, .18); }
.dot.bad { background: var(--bad); box-shadow: 0 0 0 3px rgba(239, 68, 68, .18); }
.dot.warn { background: var(--warn); }
.dot.info { background: var(--info); }
.rec-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--bad); animation: blink 1.6s ease-in-out infinite; flex: none; }
@keyframes blink { 50% { opacity: .35; } }

/* ---------------------------------------------------------------- cards / tables */
.card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); }
.card-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.card-head h2 { margin: 0; font-size: 14.5px; font-weight: 650; }
.card-head .actions { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.card-body { padding: 16px; }
.card-body.flush { padding: 0; }

.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; }
.tbl th {
  text-align: left; font-weight: 600; color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: .6px;
  padding: 10px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; background: var(--panel);
}
.tbl td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover td { background: rgba(255, 255, 255, .018); }
.tbl .actions { text-align: right; white-space: nowrap; }
.tbl .name b { display: block; font-weight: 600; }
.tbl .name span { color: var(--muted); font-size: 12px; }
.tbl.compact td { padding: 8px 14px; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.stat { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.stat .k { color: var(--muted); font-size: 12px; font-weight: 550; display: flex; align-items: center; gap: 7px; }
.stat .v { font-size: 24px; font-weight: 700; margin-top: 6px; font-variant-numeric: tabular-nums; letter-spacing: -.3px; }
.stat .v small { font-size: 13px; color: var(--muted); font-weight: 550; margin-left: 4px; letter-spacing: 0; }
.stat .s { color: var(--muted); font-size: 12px; margin-top: 2px; }

.meter { height: 10px; background: var(--panel-3); border-radius: 10px; overflow: hidden; position: relative; display: flex; }
.meter > i { display: block; height: 100%; }
.meter .rec { background: var(--accent); }
.meter .other { background: #4b5667; }
.meter .limit { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--bad); }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--text-2); margin-top: 10px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

.empty { text-align: center; padding: 56px 20px; color: var(--muted); }
.empty svg { color: #3d4858; margin-bottom: 12px; }
.empty h3 { color: var(--text); margin: 0 0 6px; font-size: 16px; }
.empty p { margin: 0 0 18px; }

.notice { display: flex; gap: 10px; padding: 11px 13px; border-radius: var(--radius-sm); background: var(--info-soft); color: #bfdbfe; font-size: 13px; align-items: flex-start; }
.notice.warn { background: rgba(234, 179, 8, .1); color: #fde68a; }
.notice.bad { background: var(--bad-soft); color: #fecaca; }
.notice.ok { background: var(--ok-soft); color: #bbf7d0; }
.notice svg { flex: none; margin-top: 1px; }

/* ---------------------------------------------------------------- modal / toast / menu */
.overlay {
  position: fixed; inset: 0; background: rgba(3, 5, 8, .72); backdrop-filter: blur(3px); z-index: 100;
  display: grid; place-items: center; padding: 20px 16px; animation: fade .12s ease-out; overflow-y: auto;
}
@keyframes fade { from { opacity: 0; } }
.modal {
  width: 100%; max-width: 520px; background: var(--panel); border: 1px solid var(--border-2); border-radius: 14px;
  box-shadow: var(--shadow); display: flex; flex-direction: column; max-height: calc(100vh - 40px); animation: pop .14s ease-out;
}
.modal.wide { max-width: 780px; }
.modal.xwide { max-width: 1000px; }
@keyframes pop { from { transform: translateY(8px) scale(.985); opacity: 0; } }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.modal-head h2 { margin: 0; font-size: 16px; font-weight: 650; flex: 1; }
.modal-body { padding: 18px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
.modal-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 14px 18px; border-top: 1px solid var(--border); flex-wrap: wrap; align-items: center; }
.modal-foot .left { margin-right: auto; }
.section-title { font-size: 11.5px; text-transform: uppercase; letter-spacing: .8px; color: var(--muted); font-weight: 650; margin: 4px 0 -4px; }

#toasts { position: fixed; right: 18px; bottom: 18px; z-index: 200; display: flex; flex-direction: column; gap: 8px; max-width: min(380px, calc(100vw - 36px)); }
.toast {
  display: flex; gap: 10px; align-items: flex-start; padding: 11px 14px; border-radius: var(--radius-sm);
  background: var(--panel-3); border: 1px solid var(--border-2); box-shadow: var(--shadow); animation: pop .15s ease-out; font-size: 13.5px;
}
.toast.ok { border-left: 3px solid var(--ok); }
.toast.bad { border-left: 3px solid var(--bad); }
.toast.info { border-left: 3px solid var(--info); }

.menu {
  position: fixed; z-index: 150; min-width: 190px; background: var(--panel-2); border: 1px solid var(--border-2);
  border-radius: var(--radius-sm); box-shadow: var(--shadow); padding: 5px; animation: pop .1s ease-out;
}
.menu button { display: flex; align-items: center; gap: 9px; width: 100%; padding: 8px 10px; border: 0; background: transparent; border-radius: 5px; cursor: pointer; text-align: left; color: var(--text-2); }
.menu button:hover { background: var(--panel-3); color: var(--text); }
.menu hr { border: 0; border-top: 1px solid var(--border); margin: 5px 0; }

/* ---------------------------------------------------------------- live view */
.live-bar {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--border);
  background: var(--panel); flex-wrap: wrap;
}
.live-bar .clock { font-family: var(--mono); font-size: 13px; color: var(--text-2); margin-left: auto; }
.live-bar select { width: auto; height: 32px; }
.pager { display: inline-flex; align-items: center; gap: 4px; color: var(--text-2); font-size: 12.5px; }
.wall { flex: 1; min-height: 0; background: #000; position: relative; }
.wall-grid { position: absolute; inset: 0; display: grid; gap: 2px; background: #05070a; }
.wall:fullscreen { background: #000; }

.tile { container-type: size; position: relative; background: #07090c; overflow: hidden; min-width: 0; min-height: 0; cursor: pointer; outline: 1px solid transparent; outline-offset: -1px; }
.tile.selected { outline-color: var(--accent); }
.tile video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; }
.wall.fill .tile video { object-fit: cover; }
.tile-top {
  position: absolute; left: 0; right: 0; top: 0; display: flex; align-items: center; gap: 8px; padding: 7px 9px;
  background: linear-gradient(rgba(0, 0, 0, .72), transparent); pointer-events: none; font-size: 12.5px; z-index: 2;
}
.tile-top .nm { flex: 1 1 auto; min-width: 48px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-shadow: 0 1px 2px #000; }
.tile-top .meta { margin-left: auto; display: flex; gap: 6px; align-items: center; color: #d6dde7; font-size: 11px; font-family: var(--mono); white-space: nowrap; }
.tile-top .tag { background: rgba(0, 0, 0, .55); border-radius: 4px; padding: 1px 5px; }
.tile-top .rec { display: inline-flex; align-items: center; gap: 4px; color: #fecaca; font-weight: 700; letter-spacing: .5px; background: rgba(127, 29, 29, .55); border-radius: 4px; padding: 1px 6px 1px 5px; }
.tile-bottom {
  position: absolute; left: 0; right: 0; bottom: 0; display: flex; gap: 4px; justify-content: flex-end; padding: 6px;
  background: linear-gradient(transparent, rgba(0, 0, 0, .75)); opacity: 0; transition: opacity .15s; z-index: 2;
}
.tile:hover .tile-bottom, .tile:focus-within .tile-bottom { opacity: 1; }
.tile-bottom .icon-btn { width: 28px; height: 28px; color: #e2e8f0; background: rgba(0, 0, 0, .45); }
.tile-bottom .icon-btn:hover { background: rgba(255, 255, 255, .16); }
.tile-bottom .q { font-size: 10.5px; font-weight: 800; letter-spacing: .3px; width: auto; padding: 0 7px; }
.tile-state {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  color: var(--muted); font-size: 12.5px; text-align: center; padding: 10px; z-index: 1;
}
.tile-state.offline { color: #fca5a5; background: repeating-linear-gradient(135deg, #0b0d11 0 12px, #0e1116 12px 24px); }
.tile-state svg { opacity: .8; }
.tile.empty-slot { cursor: default; display: grid; place-items: center; color: #2c3542; background: #06080b; }
.tile .mode { position: absolute; right: 8px; bottom: 8px; font: 700 10px var(--mono); color: rgba(255, 255, 255, .45); z-index: 1; }
.tile:hover .mode { display: none; }

/* ---------------------------------------------------------------- playback */
.pb { display: grid; grid-template-columns: 250px 1fr; height: 100%; min-height: 0; }
.pb-side { border-right: 1px solid var(--border); background: var(--panel); overflow-y: auto; display: flex; flex-direction: column; }
.pb-side .search { padding: 12px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--panel); z-index: 1; }
.cam-list { display: flex; flex-direction: column; padding: 6px; gap: 1px; }
.cam-list .grp { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .8px; padding: 10px 10px 4px; font-weight: 650; }
.cam-list button {
  display: flex; align-items: center; gap: 9px; width: 100%; padding: 8px 10px; border: 0; background: transparent;
  color: var(--text-2); border-radius: var(--radius-sm); cursor: pointer; text-align: left;
}
.cam-list button:hover { background: var(--panel-2); color: var(--text); }
.cam-list button.on { background: var(--accent-soft); color: var(--accent-2); }
.cam-list button span:not(.dot) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.pb-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.pb-bar { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--border); background: var(--panel); flex-wrap: wrap; }
.pb-bar input[type=date] { width: auto; height: 32px; }
.pb-bar .title { font-weight: 650; }
.pb-video { flex: 1; background: #000; position: relative; min-height: 180px; }
.pb-video video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.pb-video .tile-state { color: var(--muted); }
.pb-osd { position: absolute; left: 12px; top: 10px; font: 600 15px var(--mono); color: #fff; text-shadow: 0 1px 3px #000; background: rgba(0, 0, 0, .35); padding: 3px 8px; border-radius: 5px; z-index: 2; }
.pb-ctl { display: flex; align-items: center; gap: 8px; padding: 10px 14px; background: var(--panel); border-top: 1px solid var(--border); flex-wrap: wrap; }
.pb-ctl .clock { font: 600 16px var(--mono); min-width: 190px; color: var(--text); }
.pb-ctl .play { width: 40px; height: 40px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); border: 0; }
.pb-ctl .play:hover { background: var(--accent-2); color: var(--accent-ink); }
.pb-ctl select { width: auto; height: 32px; }
.timeline-wrap { background: var(--panel); border-top: 1px solid var(--border); padding: 8px 14px 12px; user-select: none; }
.timeline-tools { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.timeline { position: relative; height: 64px; cursor: pointer; }
.timeline canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.timeline .tip {
  position: absolute; top: -26px; transform: translateX(-50%); background: var(--panel-3); border: 1px solid var(--border-2);
  font: 600 11.5px var(--mono); padding: 2px 7px; border-radius: 5px; pointer-events: none; white-space: nowrap; z-index: 3;
}

/* ---------------------------------------------------------------- camera form bits */
.probe-result { display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.probe-result .line { display: flex; gap: 8px; align-items: center; }
.profile-table td, .profile-table th { padding: 7px 10px; }
.profile-table input[type=radio] { accent-color: var(--accent); width: 16px; height: 16px; }
.dev-row.added { opacity: .6; }
details.adv > summary { cursor: pointer; color: var(--text-2); font-weight: 550; font-size: 13px; list-style: none; display: flex; align-items: center; gap: 6px; }
details.adv > summary::-webkit-details-marker { display: none; }
details.adv > summary::before { content: "▸"; color: var(--muted); transition: transform .15s; display: inline-block; }
details.adv[open] > summary::before { transform: rotate(90deg); }
details.adv > div { margin-top: 12px; display: flex; flex-direction: column; gap: 14px; }
.progress { height: 6px; background: var(--panel-3); border-radius: 6px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--accent); transition: width .2s; }
pre.log { margin: 0; background: #06080b; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px; font: 11.5px/1.5 var(--mono); color: #aeb9c7; max-height: 60vh; overflow: auto; white-space: pre-wrap; word-break: break-all; }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 900px) {
  :root { --sidebar: 60px; }
  .sidebar .brand-name, .nav a span, .nav-label, .user-chip .who, .engine-state span, .nav .badge { display: none; }
  .sidebar .brand { padding: 16px 15px; }
  .nav a { justify-content: center; padding: 10px; }
  .user-chip { justify-content: center; padding: 6px; }
  .engine-state { justify-content: center; }
  .pb { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .pb-side { max-height: 150px; border-right: 0; border-bottom: 1px solid var(--border); }
}
@media (max-width: 560px) {
  .page-head { padding: 12px 16px; }
  .page-body { padding: 16px; }
  .pb-ctl .clock { min-width: 0; font-size: 14px; }
}

/* Small tiles (dense grids, phones): keep the camera name readable. */
@container (max-width: 380px) {
  .tile-top { padding: 5px 7px; font-size: 11.5px; }
  .tile-top .tag { display: none; }
  .tile-state span { display: none; }
  .tile-state b { font-size: 11.5px; }
}
.tbl td .mono { white-space: nowrap; }
