:root {
  --bg: #0b0d10;
  --bg-2: #111418;
  --panel: #161a1f;
  --panel-2: #1c2127;
  --panel-3: #242a32;
  --border: #262c34;
  --border-2: #323a44;
  --text: #e8eaed;
  --text-2: #b4bac2;
  --muted: #7d8590;
  --accent: #3d8bfd;
  --accent-2: #2f74d9;
  --accent-soft: rgba(61, 139, 253, .14);
  --ok: #2fbf71;
  --ok-soft: rgba(47, 191, 113, .14);
  --warn: #f0a33a;
  --warn-soft: rgba(240, 163, 58, .14);
  --bad: #f2555a;
  --bad-soft: rgba(242, 85, 90, .14);
  --rec: #2f6fbf;
  --radius: 10px;
  --sidebar: 228px;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 14px/1.45 Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; color: inherit; }
a { color: var(--accent); text-decoration: none; }
svg.i { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8;
        stroke-linecap: round; stroke-linejoin: round; }
[hidden] { display: none !important; }

/* ---------- shell ---------- */
.app { display: grid; grid-template-columns: var(--sidebar) 1fr; height: 100vh; }
.sidebar {
  background: var(--bg-2); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; padding: 16px 12px; gap: 4px; min-height: 0;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 18px; }
.brand-mark { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center;
              background: linear-gradient(135deg, var(--accent), #7a5cff); color: #fff; }
.brand-mark svg { width: 17px; height: 17px; }
.brand-name { font-weight: 700; letter-spacing: .2px; }
.brand-name span { color: var(--muted); font-weight: 500; }
.nav-item {
  display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 8px;
  color: var(--text-2); cursor: pointer; border: 0; background: none; text-align: left; width: 100%;
}
.nav-item:hover { background: var(--panel); color: var(--text); }
.nav-item.active { background: var(--accent-soft); color: #fff; }
.nav-item.active svg { color: var(--accent); }
.nav-item .count { margin-left: auto; font-size: 12px; color: var(--muted); }
.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 12px; padding: 12px 8px 4px;
                border-top: 1px solid var(--border); font-size: 12px; color: var(--muted); }
.foot-row { display: flex; align-items: center; gap: 8px; }
.foot-row b { color: var(--text-2); font-weight: 500; margin-left: auto; font-variant-numeric: tabular-nums; }
.meter { height: 5px; border-radius: 3px; background: var(--panel-3); overflow: hidden; display: flex; }
.meter > div { height: 100%; }
.sys-clock { font-family: var(--mono); color: var(--text-2); font-size: 12px; }

.main { min-width: 0; display: flex; flex-direction: column; min-height: 0; }
.topbar {
  display: flex; align-items: center; gap: 12px; padding: 14px 24px; border-bottom: 1px solid var(--border);
  background: var(--bg); min-height: 62px; flex-wrap: wrap;
}
.topbar h1 { font-size: 17px; font-weight: 650; margin: 0; }
.topbar .sub { color: var(--muted); font-size: 13px; }
.topbar .actions { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.content { flex: 1; overflow: auto; padding: 20px 24px 40px; min-height: 0; }

/* ---------- controls ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 13px; border-radius: 8px;
  background: var(--panel-2); border: 1px solid var(--border-2); color: var(--text); cursor: pointer;
  white-space: nowrap; font-weight: 500;
}
.btn:hover { background: var(--panel-3); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-2); }
.btn.danger { color: var(--bad); }
.btn.danger.solid { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.ghost { background: none; border-color: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--panel-2); color: var(--text); }
.btn.icon { width: 34px; padding: 0; justify-content: center; }
.btn.sm { height: 28px; padding: 0 10px; font-size: 13px; }
.btn.sm.icon { width: 28px; }
.seg { display: inline-flex; background: var(--panel); border: 1px solid var(--border-2); border-radius: 8px; padding: 2px; }
.seg button { border: 0; background: none; padding: 5px 11px; border-radius: 6px; color: var(--text-2); cursor: pointer; font-size: 13px; }
.seg button.on { background: var(--panel-3); color: #fff; }

input[type=text], input[type=password], input[type=number], input[type=time], input[type=date], select {
  height: 36px; padding: 0 11px; border-radius: 8px; background: var(--bg-2); border: 1px solid var(--border-2);
  outline: none; width: 100%; min-width: 0;
}
input:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input::placeholder { color: #5b636d; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12.5px; color: var(--text-2); font-weight: 500; }
.field .hint { font-size: 12px; color: var(--muted); }
.row { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
.row.r-3-1 { grid-template-columns: 3fr 1fr; }
.input-suffix { position: relative; }
.input-suffix span { position: absolute; right: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 13px; pointer-events: none; }
.input-suffix input { padding-right: 44px; }

.switch { position: relative; width: 36px; height: 20px; flex: none; cursor: pointer; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; background: var(--panel-3); border-radius: 20px; transition: .15s; border: 1px solid var(--border-2); }
.switch span::after { content: ""; position: absolute; width: 14px; height: 14px; left: 2px; top: 2px;
                      background: #cfd3d8; border-radius: 50%; transition: .15s; }
.switch input:checked + span { background: var(--accent); border-color: var(--accent); }
.switch input:checked + span::after { transform: translateX(16px); background: #fff; }

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 20px;
        font-size: 12px; font-weight: 600; white-space: nowrap; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.off { background: var(--panel-3); color: var(--muted); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: none; }
.dot.ok { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.dot.bad { background: var(--bad); box-shadow: 0 0 0 3px var(--bad-soft); }
.dot.warn { background: var(--warn); }

.card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); }
.card-head { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.card-head h2 { font-size: 14.5px; margin: 0; font-weight: 650; }
.card-head .right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.card-body { padding: 18px; display: flex; flex-direction: column; gap: 16px; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); }
.num { font-variant-numeric: tabular-nums; }

.empty { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 70px 20px; color: var(--muted); text-align: center; }
.empty svg { width: 40px; height: 40px; stroke-width: 1.4; color: var(--border-2); }
.empty h3 { margin: 0; color: var(--text); font-size: 16px; }

/* ---------- live ---------- */
.live-grid { display: grid; gap: 10px; grid-template-columns: repeat(var(--cols, 2), minmax(0, 1fr)); }
.tile { position: relative; background: #000; border-radius: var(--radius); overflow: hidden; aspect-ratio: 16/9;
        border: 1px solid var(--border); }
.tile iframe, .tile img { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; object-fit: contain; }
.tile .overlay { position: absolute; inset: 0; pointer-events: none;
                 background: linear-gradient(180deg, rgba(0,0,0,.55), transparent 22%, transparent 78%, rgba(0,0,0,.45)); }
.tile .tag { position: absolute; left: 12px; top: 10px; display: flex; align-items: center; gap: 8px;
             font-weight: 600; font-size: 13px; text-shadow: 0 1px 2px #000; pointer-events: none; }
.rec { display: inline-flex; align-items: center; gap: 5px; font-size: 10.5px; font-weight: 700; letter-spacing: .6px;
       padding: 2px 6px; border-radius: 4px; background: rgba(242, 85, 90, .9); color: #fff; text-shadow: none; }
.rec::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #fff; animation: blink 1.6s infinite; }
.rec.off { background: rgba(60, 66, 74, .9); }
.rec.off::before { animation: none; opacity: .6; }
@keyframes blink { 50% { opacity: .25; } }
.tile .tools { position: absolute; right: 8px; top: 8px; display: flex; gap: 4px; opacity: 0; transition: .15s; }
.tile:hover .tools, .tile:focus-within .tools { opacity: 1; }
.tile .tools .btn { background: rgba(20, 23, 27, .75); border-color: rgba(255,255,255,.08); backdrop-filter: blur(6px); }
.tile .tools .btn.on { color: var(--accent); }
.tile .offline { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: 13px; }

/* ---------- playback ---------- */
.pb { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 16px; }
.cam-list { display: flex; flex-direction: column; gap: 6px; }
.cam-pick { display: flex; align-items: center; gap: 10px; padding: 6px; border-radius: 8px; cursor: pointer;
            border: 1px solid transparent; background: none; text-align: left; width: 100%; color: var(--text-2); }
.cam-pick:hover { background: var(--panel); }
.cam-pick.on { background: var(--panel); border-color: var(--accent); color: #fff; }
.cam-pick img, .cam-pick .ph { width: 64px; aspect-ratio: 16/9; object-fit: cover; border-radius: 5px; background: #000; flex: none; }
.cam-pick span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.player { background: #000; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); position: relative; }
.player video { display: block; width: 100%; aspect-ratio: 16/9; background: #000; }
.player .nodata { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); pointer-events: none; }
.transport { display: flex; align-items: center; gap: 8px; padding: 12px 0; flex-wrap: wrap; }
.clock { font: 600 22px var(--mono); letter-spacing: .5px; min-width: 112px; font-variant-numeric: tabular-nums; }
.datebox { display: flex; align-items: center; gap: 4px; }
.datebox input { width: 150px; }
.spacer { flex: 1; }
.marks { display: flex; align-items: center; gap: 6px; font: 12.5px var(--mono); color: var(--text-2); }
.timeline { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 6px 8px 8px; }
.timeline canvas { display: block; width: 100%; height: 70px; cursor: crosshair; touch-action: none; }
.tl-hint { font-size: 12px; color: var(--muted); padding-top: 8px; }

/* ---------- cameras ---------- */
.cam-table { display: flex; flex-direction: column; gap: 8px; }
.cam-row { display: grid; grid-template-columns: 136px minmax(0, 1.4fr) minmax(0, 1fr) 120px 110px auto; gap: 16px;
           align-items: center; padding: 10px 14px 10px 10px; }
.cam-row .thumb { width: 136px; aspect-ratio: 16/9; border-radius: 6px; background: #000 center/cover; position: relative; overflow: hidden; }
.cam-row .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cam-row .name { font-weight: 600; font-size: 14.5px; }
.cam-row .meta { color: var(--muted); font-size: 12.5px; display: flex; gap: 6px; flex-wrap: wrap; }
.cam-row .stat { font-size: 13px; }
.cam-row .stat small { display: block; color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: .5px; }
.cam-row .acts { display: flex; align-items: center; gap: 6px; justify-content: flex-end; }
.cam-row.disabled .thumb { opacity: .35; }
.cam-head { display: grid; grid-template-columns: 136px minmax(0, 1.4fr) minmax(0, 1fr) 120px 110px auto; gap: 16px;
            padding: 0 14px 0 10px; font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; }

/* drawer */
.scrim { position: fixed; inset: 0; background: rgba(0, 0, 0, .55); z-index: 40; animation: fade .15s; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(500px, 100vw); background: var(--panel);
          border-left: 1px solid var(--border); z-index: 41; display: flex; flex-direction: column; animation: slide .2s ease-out; }
.drawer-head { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.drawer-head h2 { margin: 0; font-size: 16px; }
.drawer-head .btn { margin-left: auto; }
.drawer-body { flex: 1; overflow: auto; padding: 20px; display: flex; flex-direction: column; gap: 22px; }
.drawer-foot { display: flex; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--border); }
.drawer-foot .grow { flex: 1; }
.section-title { font-size: 11.5px; text-transform: uppercase; letter-spacing: .7px; color: var(--muted); font-weight: 600; margin-bottom: -8px; }
.fieldset { display: flex; flex-direction: column; gap: 14px; }
details.adv summary { cursor: pointer; color: var(--text-2); 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: "›"; display: inline-block; transition: .15s; font-size: 16px; }
details.adv[open] summary::before { transform: rotate(90deg); }
details.adv .fieldset { margin-top: 14px; }
.test-result { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--bg-2); }
.test-result img { width: 100%; display: block; aspect-ratio: 16/9; object-fit: cover; background: #000; }
.test-lines { padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; font-size: 13px; }
.test-line { display: flex; gap: 10px; align-items: baseline; }
.test-line b { width: 46px; color: var(--muted); font-weight: 500; flex: none; }
.test-line .ok { color: var(--ok); }
.test-line .bad { color: var(--bad); }
.spinner { width: 16px; height: 16px; border: 2px solid rgba(255,255,255,.25); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fade { from { opacity: 0; } }
@keyframes slide { from { transform: translateX(30px); opacity: 0; } }

/* modal */
.modal { position: fixed; z-index: 51; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(420px, calc(100vw - 32px));
         background: var(--panel); border: 1px solid var(--border-2); border-radius: 12px; box-shadow: 0 20px 60px rgba(0,0,0,.5); }
.modal .mb { padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.modal h3 { margin: 0; font-size: 16px; }
.modal p { margin: 0; color: var(--text-2); }
.modal .mf { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--border); }
.check { display: flex; gap: 9px; align-items: center; color: var(--text-2); cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--bad); }

/* toasts */
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 60; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--panel-3); border: 1px solid var(--border-2); border-radius: 9px; padding: 10px 14px; min-width: 240px;
         max-width: 380px; box-shadow: 0 10px 30px rgba(0,0,0,.4); display: flex; gap: 10px; align-items: center; animation: slide .2s; }
.toast.bad { border-color: rgba(242, 85, 90, .5); }
.toast.ok .dot { background: var(--ok); }
.toast.bad .dot { background: var(--bad); }

/* ---------- system ---------- */
.sys-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr)); align-items: start; }
.big-stat { display: flex; align-items: baseline; gap: 8px; }
.big-stat b { font-size: 28px; font-weight: 650; font-variant-numeric: tabular-nums; letter-spacing: -.5px; }
.big-stat span { color: var(--muted); }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-2); }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.meter.lg { height: 10px; border-radius: 5px; }
.set-row { display: flex; align-items: center; gap: 16px; }
.set-row .txt { flex: 1; }
.set-row .txt div:first-child { font-weight: 500; }
.set-row .txt div + div { color: var(--muted); font-size: 12.5px; }
.set-row .ctl { width: 150px; flex: none; }
.stream-cap { display: grid; grid-template-columns: auto 1fr 130px; gap: 12px; align-items: center; padding: 12px;
              background: var(--bg-2); border: 1px solid var(--border); border-radius: 9px; }
.stream-cap .est { grid-column: 2 / 4; font-size: 12.5px; color: var(--muted); }
.stream-cap .est b { color: var(--text); font-weight: 600; }
.notice { display: flex; gap: 10px; padding: 11px 13px; border-radius: 8px; font-size: 13px; background: var(--warn-soft); color: #f6c27a; }
.notice.bad { background: var(--bad-soft); color: #ff9a9d; }
.notice.info { background: var(--accent-soft); color: #9cc3ff; }
table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th { text-align: left; font-weight: 500; color: var(--muted); font-size: 11.5px; text-transform: uppercase;
                letter-spacing: .5px; padding: 0 10px 8px; }
table.data td { padding: 9px 10px; border-top: 1px solid var(--border); font-variant-numeric: tabular-nums; }
table.data td:first-child, table.data th:first-child { padding-left: 0; }
.savebar { position: sticky; bottom: -40px; margin: 20px -24px -40px; padding: 12px 24px; background: rgba(11, 13, 16, .92);
           backdrop-filter: blur(8px); border-top: 1px solid var(--border); display: flex; align-items: center; gap: 10px; }

/* hub site chip */
.site-chip { display: flex; align-items: center; gap: 8px; margin: -8px 4px 12px; padding: 8px 10px; border-radius: 8px;
             border: 1px solid var(--border); background: var(--panel); color: var(--text); font-weight: 500; }
.site-chip:hover { border-color: var(--border-2); }
.site-chip .nm { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.site-chip svg { width: 15px; height: 15px; color: var(--muted); }
.tile video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; }

/* storage drives */
#storeLoc { display: flex; flex-direction: column; gap: 10px; }
#storeLoc:empty { display: none; }
.loc-row, .dc-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.loc-row { padding: 12px; border: 1px solid var(--border); border-radius: 9px; background: var(--bg-2); }
.loc-row .txt, .dc-head .txt { flex: 1; min-width: 160px; }
.loc-row .txt .muted, .dc-head .txt .muted { font-size: 12.5px; }
.loc-row .pill { margin-left: 6px; }
.loc-row .mono, .prev-row .mono { word-break: break-all; }
.loc-ic { width: 38px; height: 38px; border-radius: 9px; background: var(--panel-3); display: grid; place-items: center; color: var(--text-2); flex: none; }
.prev-row { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--text-2); flex-wrap: wrap; }
.prev-row span { flex: 1; min-width: 200px; }
.drive-card { border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-2); padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.part-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px; background: var(--panel); font-size: 13px; }
.part-row .txt { flex: 1; min-width: 0; }
.dc-foot { display: flex; justify-content: flex-end; }

/* google drive */
.gd-account { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--border);
              border-radius: 9px; background: var(--bg-2); flex-wrap: wrap; }
.gd-account .txt { flex: 1; min-width: 180px; }
.gd-account .txt .muted { font-size: 12.5px; }
.gd-logo { width: 38px; height: 38px; border-radius: 9px; background: #fff; display: grid; place-items: center; flex: none; }
.steps { display: flex; gap: 6px; padding: 12px 20px 0; }
.steps span { flex: 1; font-size: 12px; color: var(--muted); padding-bottom: 8px; border-bottom: 2px solid var(--border-2); }
.steps span.on { color: var(--text); border-color: var(--accent); }
.steps span.done { color: var(--text-2); border-color: var(--ok); }
details.guide ol { margin: 12px 0 0; padding-left: 20px; display: flex; flex-direction: column; gap: 9px; color: var(--text-2); font-size: 13px; }
details.guide b { color: var(--text); font-weight: 600; }
.gd-code { display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 26px 16px; border: 1px solid var(--border);
           border-radius: var(--radius); background: var(--bg-2); }
.gd-code .code { font-size: 34px; font-weight: 700; letter-spacing: 4px; }
.gd-code-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.gd-wait { display: flex; align-items: center; gap: 10px; color: var(--text-2); font-size: 13px; }
.choice { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.choice .opt { display: flex; gap: 10px; padding: 12px; border: 1px solid var(--border-2); border-radius: 9px; cursor: pointer; background: var(--bg-2); }
.choice .opt.on { border-color: var(--accent); background: var(--accent-soft); }
.choice .opt input { accent-color: var(--accent); margin-top: 3px; }
.choice .opt b { display: block; font-weight: 600; }
.choice .opt span { font-size: 12px; color: var(--muted); }
.keybox { display: flex; flex-direction: column; gap: 10px; padding: 12px 14px; border-radius: 9px; background: var(--bg-2); border: 1px solid var(--border); }
.keybox small { display: block; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.keybox span { word-break: break-all; user-select: all; }

/* cloud library */
.cloud-main { min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.cloud-main #cPlayer { margin-bottom: 8px; }
.section-head { display: flex; align-items: baseline; gap: 12px; margin-top: 4px; }
.section-head h3 { margin: 0; font-size: 14px; font-weight: 650; }
.section-head .muted { font-size: 12.5px; }
.strip { height: 8px; border-radius: 3px; }
.day-strip { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.day-card { flex: none; width: 168px; text-align: left; padding: 10px 12px; border-radius: 9px; cursor: pointer;
            background: var(--panel); border: 1px solid var(--border); color: var(--text); display: flex; flex-direction: column; gap: 6px; }
.day-card:hover { border-color: var(--border-2); }
.day-card.on { border-color: var(--accent); background: var(--accent-soft); }
.dc-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.dc-top .pill { font-size: 10.5px; padding: 1px 7px; }
.dc-date { font-size: 11.5px; color: var(--muted); }
.dc-meta, .ht-meta { font-size: 12px; color: var(--muted); }
.hour-grid { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.hour-tile { text-align: left; padding: 10px 12px; border-radius: 9px; cursor: pointer; background: var(--panel);
             border: 1px solid var(--border); color: var(--text); display: flex; flex-direction: column; gap: 7px; }
.hour-tile:hover:not(:disabled) { border-color: var(--border-2); }
.hour-tile.on { border-color: var(--accent); background: var(--accent-soft); }
.hour-tile.empty { opacity: .4; cursor: default; }
.ht-top { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; }
.minute-strip { display: grid; grid-template-columns: repeat(60, 1fr); gap: 2px; padding: 8px; background: var(--panel);
                border: 1px solid var(--border); border-radius: var(--radius); }
.minute-strip button { height: 26px; border: 0; border-radius: 2px; background: var(--panel-3); padding: 0; cursor: default; }
.minute-strip button.has { background: var(--rec); cursor: pointer; }
.minute-strip button.has:hover { background: var(--accent); }
.minute-strip button.now { background: #fff; }
.cam-pick small { font-size: 11.5px; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .cam-row, .cam-head { grid-template-columns: 112px minmax(0, 1fr) 110px auto; }
  .cam-row .thumb { width: 112px; }
  .cam-row .c-addr, .cam-head .c-addr, .cam-row .c-store, .cam-head .c-store { display: none; }
}
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; grid-template-rows: 1fr auto; }
  .sidebar { grid-row: 2; flex-direction: row; padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); border-right: 0;
             border-top: 1px solid var(--border); justify-content: space-around; }
  .brand, .sidebar-foot, .nav-item .count { display: none; }
  .nav-item { flex-direction: column; gap: 3px; font-size: 11px; padding: 6px 10px; width: auto; align-items: center; }
  .topbar { padding: 12px 16px; }
  .content { padding: 16px 16px 32px; }
  .pb { grid-template-columns: 1fr; }
  .cam-list { flex-direction: row; overflow-x: auto; }
  .cam-pick { width: auto; flex: none; }
  .live-grid { --cols: 1 !important; }
  .site-chip { margin: 0; padding: 6px 8px; align-self: center; }
  .site-chip .nm { display: none; }
  .minute-strip { grid-template-columns: repeat(30, 1fr); }
  .nav-item { padding: 6px 6px; }
  .row, .choice { grid-template-columns: 1fr; }
  table.data { display: block; overflow-x: auto; white-space: nowrap; }
  .cam-row, .cam-head { grid-template-columns: 96px minmax(0, 1fr) auto; }
  .cam-row .thumb { width: 96px; }
  .cam-row .c-rate, .cam-head .c-rate { display: none; }
  .cam-head, .cam-row .id, .cam-row .pbk { display: none; }
  .cam-row { gap: 12px; padding: 8px 10px 8px 8px; }
  .cam-row .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .cam-row .meta { margin-top: 4px; }
  .savebar { margin: 20px -16px -32px; padding: 12px 16px; }
  .tile .tools { opacity: 1; }
}
