:root {
  --bg: #0a0d12;
  --panel: #10141c;
  --panel-2: #161b26;
  --panel-3: #1d2431;
  --line: #242c3a;
  --text: #e9edf4;
  --muted: #8a94a6;
  --dim: #5d677a;
  --accent: #38cdff;
  --accent-strong: #12b6f5;
  --accent-soft: rgba(56, 205, 255, .16);
  --ok: #3ddc97;
  --warn: #ffb84d;
  --err: #ff6b6b;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .45);
  --top-h: 56px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 "Inter", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
[hidden] { display: none !important; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.tnum { font-variant-numeric: tabular-nums; }

/* ── шапка ── */
.top {
  position: sticky; top: 0; z-index: 30;
  height: var(--top-h);
  display: flex; align-items: center; gap: 14px;
  padding: 0 max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left));
  background: rgba(10, 13, 18, .86);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 650; letter-spacing: .1px; white-space: nowrap; }
.brand-sub { color: var(--accent); font-weight: 600; }
.site-chip {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 12px; border-radius: 999px;
  background: var(--panel-2); border: 1px solid var(--line);
  font-size: 13.5px; font-weight: 550;
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--dim); box-shadow: 0 0 0 3px rgba(255,255,255,.04); }
.dot.ok { background: var(--ok); box-shadow: 0 0 0 3px rgba(61, 220, 151, .16); }
.dot.err { background: var(--err); box-shadow: 0 0 0 3px rgba(255, 107, 107, .16); }
.nav { display: flex; gap: 2px; }
.nav a { padding: 7px 12px; border-radius: 9px; color: var(--muted); font-weight: 550; font-size: 14px; transition: background .15s, color .15s; }
.nav a:hover { color: var(--text); background: var(--panel-2); }
.nav a.on { color: var(--text); background: var(--panel-3); }
.top-spacer { flex: 1; }
.dev-info { color: var(--dim); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── кнопки ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 36px; padding: 0 14px;
  border-radius: var(--radius-sm); border: 1px solid var(--line);
  background: var(--panel-2); color: var(--text);
  font-weight: 550; font-size: 14px; white-space: nowrap;
  transition: background .15s, border-color .15s, transform .05s;
}
.btn:hover { background: var(--panel-3); border-color: #33405a; }
.btn:active { transform: translateY(1px); }
.btn.ghost { background: transparent; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #04121c; font-weight: 650; }
.btn.primary:hover { background: #7bd4ff; }
.btn.wide { width: 100%; height: 44px; font-size: 15px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
select.sel { height: 38px; padding: 0 10px; max-width: 250px; cursor: pointer; }
input[type="date"].input { height: 38px; padding: 0 10px; color-scheme: dark; }
.icon-btn {
  width: 40px; height: 40px; padding: 0; border-radius: 10px;
  display: inline-grid; place-items: center;
  background: transparent; border: 1px solid transparent; color: var(--text);
  transition: background .15s;
}
.icon-btn:hover { background: var(--panel-3); }
.icon-btn[disabled] { opacity: .35; cursor: not-allowed; }
.icon-btn.attn { color: var(--accent); background: var(--accent-soft); }
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn.big { width: 48px; height: 48px; background: var(--accent); color: #04121c; border-radius: 50%; }
.icon-btn.big:hover { background: #7bd4ff; }
.icon-btn.big svg { width: 22px; height: 22px; }

/* ── вход ── */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background: radial-gradient(900px 500px at 50% -10%, rgba(56,205,255,.16), transparent 60%), var(--bg); }
.login-card {
  width: min(400px, 100%); padding: 32px 28px 28px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 14px;
}
.login-card h1 { margin: 6px 0 0; font-size: 22px; letter-spacing: -.2px; }
.login-card p { margin: 0; color: var(--muted); }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); margin-top: 6px; }
.field input, .input {
  height: 44px; padding: 0 14px; border-radius: var(--radius-sm);
  background: var(--bg); border: 1px solid var(--line); color: var(--text); font-size: 15px;
}
.field input:focus, .input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
/* кнопка «показать пароль» внутри поля */
.pass-wrap { position: relative; display: block; }
.pass-wrap input { width: 100%; padding-right: 50px; }
.pass-eye { position: absolute; right: 3px; top: 50%; transform: translateY(-50%); width: 42px; height: 38px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 8px; background: transparent; color: var(--muted); }
.pass-eye:hover { color: var(--text); background: var(--panel-2); }
.pass-eye svg { width: 20px; height: 20px; }
.login-error { min-height: 20px; color: var(--err); font-size: 13.5px; }
.login-note { margin: 2px 0 0; color: var(--dim); font-size: 12.5px; }
.inv-info { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; margin: 4px 0 2px; font-size: 14px; }
.inv-info dt { color: var(--muted); } .inv-info dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
#invBody { display: flex; flex-direction: column; gap: 14px; }
#invBody p { margin: 0; color: var(--muted); }
.user-btn { max-width: 190px; overflow: hidden; text-overflow: ellipsis; }

/* ── окна и формы ── */
.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; background: rgba(4, 6, 10, .66); backdrop-filter: blur(4px); overflow: auto; }
.modal-card { width: min(480px, 100%); max-height: calc(100vh - 32px); display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); }
.modal-card.wide { width: min(720px, 100%); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 16px 4px 22px; }
.modal-head h2 { margin: 0; font-size: 18px; letter-spacing: -.2px; }
.modal-body { padding: 10px 22px 22px; overflow: auto; }
.modal-body > p { margin: 0 0 12px; color: var(--muted); }
.form { display: flex; flex-direction: column; gap: 14px; }
.form .field { margin-top: 0; }
.form .input { width: 100%; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .field:first-child { grid-column: 1 / -1; }
.form-grid.three { grid-template-columns: 1.3fr 1fr 1fr; }
.form-grid.three .field:first-child { grid-column: auto; }
input[type="time"].input { height: 44px; padding: 0 10px; color-scheme: dark; }
.form input[type="date"].input { height: 44px; }
.quick-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.bar.wide { width: 100%; height: 8px; }
#xWork p { margin: 0; }
#xDone a.btn { text-decoration: none; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 2px; }
.hint { margin: 0; color: var(--dim); font-size: 12.5px; }
.fs { margin: 0; padding: 12px 14px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); display: flex; flex-direction: column; gap: 8px; }
.fs legend { padding: 0 6px; color: var(--muted); font-size: 13px; }
.chk { display: flex; align-items: center; gap: 9px; font-size: 14px; cursor: pointer; }
.chk input { width: 17px; height: 17px; accent-color: var(--accent); flex: none; }
.chk:has(input:disabled) { opacity: .5; cursor: default; }
.cam-checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 7px 14px; max-height: 190px; overflow: auto; padding: 8px 2px 2px; border-top: 1px solid var(--line); }
#uCaps { display: grid; gap: 7px; }
.copy-row { display: flex; gap: 8px; margin-bottom: 12px; }
.copy-row .input { flex: 1; min-width: 0; font-size: 13px; }

/* ── таблицы ── */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; padding: 11px 14px; color: var(--muted); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .sub { color: var(--muted); font-size: 12.5px; margin-top: 1px; }
.tbl .acts { text-align: right; white-space: nowrap; }
.tbl .nowrap { white-space: nowrap; }
.btn.sm { height: 30px; padding: 0 10px; font-size: 13px; }
.btn.danger:hover:not([disabled]) { border-color: rgba(255, 107, 107, .6); color: var(--err); }
.tag { padding: 1px 7px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 11.5px; font-weight: 600; }
.st { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.st::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--dim); }
.st.ok::before { background: var(--ok); } .st.wait::before { background: var(--warn); } .st.off::before { background: var(--err); }

/* ── список камер ── */
.page { max-width: 1680px; margin: 0 auto; padding: 22px max(16px, env(safe-area-inset-left)) 60px; }
.page-head { display: flex; flex-wrap: wrap; align-items: end; gap: 14px 20px; margin-bottom: 18px; }
.page-head h1 { margin: 0; font-size: 24px; letter-spacing: -.3px; }
.page-head .sub { color: var(--muted); font-size: 14px; margin-top: 2px; }
.tools { margin-left: auto; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.search { position: relative; }
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--dim); pointer-events: none; }
.search input { height: 38px; width: 220px; padding: 0 12px 0 36px; }
.seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; }
.seg button {
  height: 30px; padding: 0 12px; border: 0; border-radius: 7px; background: transparent; color: var(--muted);
  font-size: 13.5px; font-weight: 550;
}
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--panel-3); color: var(--text); box-shadow: 0 1px 0 rgba(255,255,255,.05) inset; }

.notice {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 12px 14px; margin-bottom: 18px;
  background: rgba(255, 184, 77, .07); border: 1px solid rgba(255, 184, 77, .25); border-radius: var(--radius);
  color: #f1dcb6; font-size: 13.5px;
}
.notice svg { flex: none; width: 18px; height: 18px; margin-top: 1px; color: var(--warn); }
.notice b { color: #ffe2b0; }

.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(var(--card-w, 300px), 1fr)); }
.card {
  position: relative; display: block; overflow: hidden;
  aspect-ratio: 16 / 9; border-radius: var(--radius);
  background: var(--panel); border: 1px solid var(--line);
  transition: transform .18s ease, border-color .18s, box-shadow .18s;
}
.card:hover { transform: translateY(-2px); border-color: #3a4a66; box-shadow: var(--shadow); }
.card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .35s; }
.card img.ready { opacity: 1; }
.card .ph {
  position: absolute; inset: 0; display: grid; place-items: center; color: var(--dim); font-size: 13px; text-align: center; padding: 12px;
  background: linear-gradient(110deg, var(--panel) 30%, var(--panel-2) 50%, var(--panel) 70%); background-size: 220% 100%;
}
.card.loading .ph { animation: shimmer 1.4s linear infinite; }
@keyframes shimmer { to { background-position: -220% 0; } }
.card .shade { position: absolute; inset: auto 0 0 0; height: 62%; background: linear-gradient(to top, rgba(4,7,11,.92), rgba(4,7,11,0)); pointer-events: none; }
.card .meta { position: absolute; left: 14px; right: 14px; bottom: 11px; display: flex; align-items: end; justify-content: space-between; gap: 10px; }
.card .name { font-weight: 620; font-size: 15px; line-height: 1.25; text-shadow: 0 1px 2px rgba(0,0,0,.6); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card .when { color: #c5cddb; font-size: 12.5px; white-space: nowrap; }
.card .badges { position: absolute; top: 10px; left: 10px; display: flex; gap: 6px; }
.badge {
  padding: 3px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600; letter-spacing: .2px;
  background: rgba(8, 11, 16, .72); border: 1px solid rgba(255,255,255,.1); backdrop-filter: blur(6px);
}
.badge.off { color: var(--err); border-color: rgba(255,107,107,.4); }
.badge.snd { color: var(--accent); border-color: rgba(56,205,255,.5); }
.card .open {
  position: absolute; top: 10px; right: 10px; opacity: 0; transform: translateY(-3px); transition: .18s;
  padding: 4px 10px; border-radius: 999px; background: var(--accent); color: #04121c; font-size: 12px; font-weight: 650;
}
.card:hover .open, .card:focus-visible .open { opacity: 1; transform: none; }
.empty { padding: 60px 20px; text-align: center; color: var(--muted); }

/* ── плеер ── */
.player { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 18px; max-width: 1760px; margin: 0 auto; padding: 16px max(16px, env(safe-area-inset-left)) 40px; }
.p-main { min-width: 0; }
.p-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; min-height: 40px; flex-wrap: wrap; }
.p-title { display: flex; align-items: center; gap: 6px; min-width: 0; }
.p-title h1 { margin: 0; font-size: 20px; letter-spacing: -.2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p-title input { height: 36px; width: 260px; }
.p-date { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.p-date .day { min-width: 150px; text-align: center; font-weight: 600; }

.stage { position: relative; background: #000; border-radius: var(--radius); overflow: hidden; aspect-ratio: 16 / 9; max-height: calc(100vh - var(--top-h) - 250px); min-height: 220px; width: 100%; border: 1px solid var(--line); }
.stage video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; }
/* Живой кадр растягиваем до настоящих пропорций камеры (--ar): обычный снимок регистратор отдаёт сжатым по ширине */
.stage { container-type: size; }
.stage #liveImg, .stage video.ar {
  position: absolute; inset: auto; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(100cqw, calc(100cqh * var(--ar, 1.7778)));
  height: min(100cqh, calc(100cqw / var(--ar, 1.7778)));
  object-fit: fill; background: #000; cursor: pointer;
}
.stage:fullscreen { max-height: none; border-radius: 0; border: 0; }
/* внизу слева: вверху слева камера сама пишет дату и время, внизу справа — своё имя */
.osd { position: absolute; left: 14px; bottom: 12px; display: flex; gap: 8px; pointer-events: none; }
.osd .pill { padding: 5px 10px; border-radius: 999px; background: rgba(6, 9, 13, .7); backdrop-filter: blur(8px); font-size: 13px; font-weight: 600; border: 1px solid rgba(255,255,255,.08); }
.osd .pill.rec { color: var(--accent); }
.osd .pill.live { color: #ff8585; }
.osd .pill.live::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 7px; border-radius: 50%; background: #ff5252; vertical-align: 1px; animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .3; } }
.overlay { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 20px; background: rgba(5, 8, 12, .55); backdrop-filter: blur(2px); }
.overlay.solid { background: #05080c; }
.overlay .box { max-width: 460px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.overlay .title { font-size: 16px; font-weight: 620; }
.overlay .text { color: var(--muted); font-size: 13.5px; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid rgba(255,255,255,.14); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.bar { width: 240px; height: 5px; border-radius: 99px; background: rgba(255,255,255,.12); overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 99px; transition: width .4s; }
.buf-chip { position: absolute; right: 12px; top: 12px; display: flex; align-items: center; gap: 8px; padding: 5px 11px; border-radius: 999px; background: rgba(6, 9, 13, .72); backdrop-filter: blur(8px); font-size: 12.5px; color: #d5dbe6; border: 1px solid rgba(255,255,255,.08); }
.buf-chip .spinner { width: 13px; height: 13px; border-width: 2px; }

.controls { display: flex; align-items: center; gap: 4px; margin-top: 10px; padding: 8px 10px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); flex-wrap: wrap; }
.controls .clock { margin: 0 10px; font-size: 16px; font-weight: 620; white-space: nowrap; }
.controls .clock small { color: var(--muted); font-weight: 500; font-size: 13px; margin-right: 6px; }
.controls .sp { flex: 1; }
.controls select { height: 36px; padding: 0 8px; border-radius: var(--radius-sm); background: var(--panel-2); border: 1px solid var(--line); }

/* ── вкладка «Выгрузить видео» ── */
.x-title { padding: 5px 12px; border-radius: 999px; background: rgba(255, 196, 77, .14); border: 1px solid rgba(255, 196, 77, .45); color: #ffd98a; font-weight: 650; font-size: 13.5px; white-space: nowrap; }
.x-panel { margin-top: 10px; padding: 14px; background: var(--panel); border: 1px solid rgba(255, 196, 77, .45); border-radius: var(--radius); display: flex; flex-direction: column; gap: 12px; }
.x-top { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; }
.x-top b { font-size: 17px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.x-top .hint { flex: 1; min-width: 240px; font-size: 13px; color: var(--muted); }
.x-top .warn { color: var(--warn); }
.x-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.x-row .sp { flex: 1; }
.x-row .btn svg { width: 16px; height: 16px; }
.x-row a.btn { text-decoration: none; }
.x-row select.sel { height: 36px; }
#xWork { display: flex; flex-direction: column; gap: 8px; }
#xWork p { margin: 0; font-size: 13.5px; }
.player.is-export .tl { cursor: col-resize; }

.tl-wrap { margin-top: 10px; padding: 12px 12px 10px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.tl-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.tl-head .sum { color: var(--muted); font-size: 13px; }
.tl-head .sp { flex: 1; }
.tl { position: relative; height: 92px; touch-action: none; cursor: crosshair; user-select: none; }
.tl canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; border-radius: 8px; }
.tl-tip { position: absolute; top: -6px; transform: translate(-50%, -100%); padding: 4px 8px; border-radius: 7px; background: #000; border: 1px solid var(--line); font-size: 12.5px; font-weight: 600; pointer-events: none; white-space: nowrap; z-index: 3; }
.legend { display: flex; gap: 16px; margin-top: 8px; color: var(--dim); font-size: 12px; flex-wrap: wrap; }
.legend i { display: inline-block; width: 12px; height: 8px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }

.p-side { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.panel h2 { margin: 0 0 10px; font-size: 13px; font-weight: 620; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.cal-head b { font-size: 15px; text-transform: capitalize; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.cal .dow { text-align: center; color: var(--dim); font-size: 11.5px; padding: 2px 0 4px; }
.cal button { aspect-ratio: 1; border: 0; border-radius: 8px; background: transparent; color: var(--dim); font-size: 13.5px; position: relative; }
.cal button.has { color: var(--text); background: var(--panel-2); }
.cal button.has::after { content: ""; position: absolute; left: 50%; bottom: 4px; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: var(--accent); }
.cal button.has:hover { background: var(--panel-3); }
.cal button.today { box-shadow: inset 0 0 0 1px #3a4a66; }
.cal button.sel { background: var(--accent); color: #04121c; font-weight: 700; }
.cal button.sel::after { background: #04121c; }
.cal button:disabled { cursor: default; }
.quick { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.quick .btn { height: 34px; font-size: 13px; padding: 0 8px; }
.quick .btn.full { grid-column: 1 / -1; }

.cam-list { display: flex; flex-direction: column; gap: 2px; max-height: 46vh; overflow: auto; margin: 0 -6px; padding: 0 6px; }
.cam-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px; border: 0; background: transparent; text-align: left; width: 100%; color: var(--text); }
.cam-row:hover { background: var(--panel-2); }
.cam-row.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.cam-row .n { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.cam-row .t { color: var(--dim); font-size: 11.5px; }
.cam-row .num { width: 26px; height: 22px; display: grid; place-items: center; border-radius: 6px; background: var(--panel-3); color: var(--muted); font-size: 11.5px; font-weight: 650; flex: none; }
.cam-row.on .num { background: var(--accent); color: #04121c; }

/* ── галерея записей ── */
.g-title { display: flex; align-items: center; gap: 10px; }
.g-hour { margin-bottom: 24px; }
.g-hour h2 { position: sticky; top: var(--top-h); z-index: 5; display: flex; align-items: baseline; gap: 12px; margin: 0 0 6px; padding: 10px 0 8px; font-size: 18px; letter-spacing: -.2px; background: linear-gradient(var(--bg) 78%, rgba(10, 13, 18, 0)); }
.g-hour h2 span { color: var(--muted); font-size: 13px; font-weight: 500; letter-spacing: 0; }
.g-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.g-tile { position: relative; display: block; overflow: hidden; aspect-ratio: 16 / 9; border-radius: 10px; background: var(--panel); border: 1px solid var(--line); transition: transform .15s ease, border-color .15s; }
.g-tile:hover, .g-tile:focus-visible { transform: translateY(-2px); border-color: #3a4a66; }
.g-tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .3s; }
.g-tile img.ready { opacity: 1; }
.g-tile .ph { position: absolute; inset: 0; display: grid; place-items: center; color: var(--dim); font-size: 12px; background: linear-gradient(110deg, var(--panel) 30%, var(--panel-2) 50%, var(--panel) 70%); background-size: 220% 100%; }
.g-tile.loading .ph { animation: shimmer 1.4s linear infinite; }
.g-time, .g-dur { position: absolute; bottom: 6px; padding: 2px 7px; border-radius: 6px; background: rgba(6, 9, 13, .8); font-size: 12px; font-weight: 600; }
.g-time { left: 6px; }
.g-dur { right: 6px; color: #c5cddb; font-weight: 500; }

.toast { position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 20px); z-index: 60; max-width: min(560px, calc(100vw - 32px)); padding: 11px 16px; border-radius: 12px; background: #1d2431; border: 1px solid #33405a; box-shadow: var(--shadow); font-size: 14px; opacity: 0; pointer-events: none; transition: .22s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { border-color: rgba(255,107,107,.5); }

/* ── вкладки объектов ── */
/* заголовок страницы камер занимает строку целиком, чтобы ряд чипов переносился, а не уезжал за край */
.grid-title { flex: 1 1 100%; min-width: 0; }
.site-seg { margin-bottom: 6px; }
.site-seg button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 16px; font-size: 15.5px; font-weight: 620; }
.site-seg .dot { box-shadow: none; }
.cam-site { grid-column: 1 / -1; margin-top: 4px; color: var(--muted); font-size: 12px; font-weight: 620; text-transform: uppercase; letter-spacing: .5px; }
.notice .btn { margin-left: 8px; vertical-align: middle; }

/* ── чипы зон ── */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 6px; }
.chip { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 13px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel-2); color: var(--muted); font-size: 13.5px; font-weight: 560; white-space: nowrap; transition: background .15s, color .15s, border-color .15s; }
.chip:hover { color: var(--text); border-color: #33405a; }
.chip span { color: var(--dim); font-size: 12px; font-weight: 600; }
.chip.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.chip.on span { color: var(--accent); }
.grid-sep { grid-column: 1 / -1; margin: 6px 0 -4px; color: var(--muted); font-size: 14px; font-weight: 620; }
.grid-sep:first-child { margin-top: 0; }
/* вкладка «Зоны»: группы-площадки, в каждой — карточки камер с кадром и выбором зоны */
.z-group { margin-bottom: 24px; }
.z-group h2 { display: flex; align-items: baseline; gap: 10px; margin: 0 0 10px; font-size: 17px; letter-spacing: -.2px; }
.z-group h2 span { color: var(--muted); font-size: 13px; font-weight: 500; letter-spacing: 0; }
.z-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.z-card { display: flex; flex-direction: column; gap: 8px; min-width: 0; padding: 10px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; }
.z-thumb { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 7px; background: var(--panel-2); }
.z-name { display: flex; flex-direction: column; min-width: 0; }
.z-name b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14.5px; }
.z-name span { color: var(--muted); font-size: 12.5px; }
.z-card select.sel { width: 100%; max-width: none; height: 38px; }
#uZones { margin-top: 2px; }

/* ── телефон и планшет ── */
/* значки разделов, короткие подписи и кнопка профиля нужны только на узком экране */
.nav a svg, .nav .nav-short, .user-btn svg { display: none; }
.only-compact, .for-touch { display: none; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { -webkit-tap-highlight-color: transparent; }
a, button, select, label { touch-action: manipulation; }
.user-btn span { overflow: hidden; text-overflow: ellipsis; }
.acct-exit { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
@media (hover: none) and (pointer: coarse) {
  .for-touch { display: inline; }
  .for-mouse { display: none; }
  /* на сенсорном экране «наведение» залипает после касания */
  .card:hover, .g-tile:hover { transform: none; border-color: var(--line); box-shadow: none; }
  .card .open { display: none; }
}

@media (max-width: 1240px) { .dev-info { display: none; } }
@media (max-width: 1080px) {
  .player { grid-template-columns: 1fr; }
  .stage { max-height: calc(100vh - 110px); max-height: calc(100dvh - 110px); }
  .cam-list { max-height: 300px; }
}

/* Узкий экран или телефон на боку: шапка не прилипает, разделы — на панели у нижнего края */
@media (max-width: 900px), (max-height: 500px) {
  :root { --top-h: 0px; --tab-h: 58px; }
  body.authed { height: auto; min-height: 100%; padding-bottom: calc(var(--tab-h) + env(safe-area-inset-bottom)); } /* у body высота 100%: без этого отступ под панель не удлиняет страницу */
  .top { position: static; height: auto; min-height: 52px; gap: 10px; padding-top: env(safe-area-inset-top); background: var(--bg); backdrop-filter: none; border-bottom: 0; }
  .brand-name, .brand-sub, .dev-info, #logoutBtn { display: none; }
  .site-chip { padding: 6px 2px; background: none; border: 0; font-size: 16px; font-weight: 650; }
  .user-btn { width: 42px; height: 42px; padding: 0; border-radius: 50%; background: var(--panel-2); border-color: var(--line); }
  .user-btn svg { display: block; width: 21px; height: 21px; }
  .user-btn span { display: none; }
  .only-compact { display: block; }
  .nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; gap: 0;
    height: calc(var(--tab-h) + env(safe-area-inset-bottom));
    padding: 0 max(6px, env(safe-area-inset-right)) env(safe-area-inset-bottom) max(6px, env(safe-area-inset-left));
    background: rgba(13, 17, 24, .97); border-top: 1px solid var(--line);
  }
  .nav a { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; padding: 0 2px; border-radius: 0; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
  .nav a, .nav a:hover, .nav a.on { background: none; }
  .nav a.on { color: var(--accent); }
  .nav a svg { display: block; width: 23px; height: 23px; }
  .nav .nav-full { display: none; }
  .nav .nav-short { display: inline; }
  .toast { bottom: calc(var(--tab-h) + 14px + env(safe-area-inset-bottom)); }
  .login { min-height: 100vh; min-height: 100dvh; }
}

/* Телефон на боку: разделы уезжают в узкую колонку слева, чтобы не отнимать высоту у видео */
@media (max-height: 500px) and (orientation: landscape) {
  :root { --rail-w: 56px; }
  body.authed { padding-bottom: 0; padding-left: calc(var(--rail-w) + env(safe-area-inset-left)); }
  .nav { top: 0; right: auto; width: calc(var(--rail-w) + env(safe-area-inset-left)); height: auto; flex-direction: column; justify-content: center; gap: 4px; padding: 8px 0 8px env(safe-area-inset-left); border-top: 0; border-right: 1px solid var(--line); }
  .nav a { flex: 0 0 auto; padding: 12px 2px; }
  .nav a span, .nav .nav-short { display: none; } /* в узкой колонке — только значки */
  .nav a svg { width: 25px; height: 25px; }
  #gLink { display: none; }
  .p-head { margin-bottom: 8px; }
  .toast { bottom: 16px; }
  .player { padding-top: 6px; }
  .stage { max-height: calc(100vh - 12px); max-height: calc(100dvh - 12px); min-height: 0; }
}

/* Телефон */
@media (max-width: 640px) {
  /* мельче 16 пикселей нельзя: айфон при вводе приближает страницу */
  .field input, .input, select.sel, .controls select, input[type="date"].input { font-size: 16px; }
  .btn { height: 40px; }
  .btn.sm { height: 38px; font-size: 13.5px; }
  .btn.wide { height: 48px; }
  .icon-btn { width: 44px; height: 44px; }
  .wide-only { display: none; }
  .empty { padding: 36px 12px; }
  .seg { display: flex; }
  .seg button { flex: 1 1 auto; height: 36px; padding: 0 10px; }

  /* вход */
  .login { padding: 16px; }
  .login-card { padding: 26px 20px 22px; border-radius: 18px; }
  .field input, .input { height: 48px; }

  /* список камер: три, две или одна плитка в ряд */
  .page { padding: 10px 12px 28px; }
  .page-head { gap: 10px; margin-bottom: 12px; }
  .page-head h1 { font-size: 20px; }
  .page-head .sub { font-size: 13px; }
  .grid-title { flex: 1 1 100%; min-width: 0; }
  /* чипы зон — одной прокручиваемой строкой */
  .chips { flex-wrap: nowrap; overflow-x: auto; margin: 6px -12px 6px; padding: 0 12px 2px; scrollbar-width: none; }
  .chips::-webkit-scrollbar { display: none; }
  .chip { flex: none; height: 38px; }
  .z-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .z-card { padding: 8px; }
  .z-card select.sel { height: 44px; }
  .site-seg button { height: 42px; padding: 0 8px; }
  .tools { margin-left: 0; width: 100%; gap: 8px; }
  .search { flex: 1 1 100%; }
  .search input { width: 100%; height: 44px; }
  .tools .seg { flex: 1 1 auto; }
  .notice { margin-bottom: 12px; }
  .grid { gap: 8px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid[data-size="s"] { gap: 6px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid[data-size="l"] { gap: 10px; grid-template-columns: minmax(0, 1fr); }
  .card { border-radius: 10px; }
  .card .meta { left: 8px; right: 8px; bottom: 6px; }
  .card .name { font-size: 13px; }
  .card .when { display: none; }
  .card .ph { padding: 6px 6px 24px; font-size: 11.5px; }
  .grid[data-size="s"] .card .ph { font-size: 0; } /* на мелкой плитке надпись не помещается — остаётся переливание */
  .card .badges { top: 6px; left: 6px; right: 6px; gap: 4px; flex-wrap: wrap; }
  .badge { padding: 2px 6px; font-size: 10.5px; }
  .grid[data-size="s"] .badge:not(.off) { display: none; }
  .grid[data-size="s"] .card .name { font-size: 11.5px; }
  .grid[data-size="l"] .card .name { font-size: 15px; }
  .grid[data-size="l"] .card .when { display: inline; }
  .grid[data-size="l"] .badge { padding: 3px 8px; font-size: 11.5px; }

  /* плеер: видео во всю ширину экрана, под ним кнопки, шкала, календарь и камеры */
  .player { display: flex; flex-direction: column; gap: 10px; padding: 6px 12px 24px; }
  .p-main { display: contents; }
  .p-head { margin: 0; gap: 6px 8px; min-height: 0; }
  .p-title { flex: 1 1 calc(100% - 60px); }
  .p-title h1 { font-size: 17px; }
  .p-title input { width: 100%; min-width: 0; height: 44px; }
  #gLink { display: none; }
  .p-head .seg { order: 3; flex: 1 1 auto; }
  .p-head .p-date { order: 4; margin: 0; flex: 1 1 auto; justify-content: space-between; }
  .p-date .day { min-width: 0; flex: 1; font-size: 14.5px; white-space: nowrap; }
  .p-date .icon-btn { width: 40px; height: 40px; }
  .x-title { display: none; } /* раздел и так подсвечен на нижней панели */
  .stage { margin: 0 -12px; width: auto; min-height: 0; max-height: none; border-radius: 0; border-left: 0; border-right: 0; }
  .osd { left: 8px; bottom: 8px; gap: 6px; }
  .osd .pill { padding: 3px 8px; font-size: 11.5px; }
  .buf-chip { right: 8px; top: 8px; padding: 4px 9px; font-size: 11.5px; max-width: calc(100% - 16px); }
  .overlay { padding: 10px; }
  .overlay .box { gap: 8px; }
  .overlay .title { font-size: 15px; }
  .overlay .text { font-size: 12.5px; line-height: 1.35; }
  .bar { width: 180px; }
  .controls { margin: 0; padding: 6px; gap: 2px 0; justify-content: space-evenly; border-radius: 12px; }
  .controls .clock { display: none; }
  .controls .sp { flex: 0 0 100%; height: 0; }
  .controls .icon-btn.big { width: 54px; height: 54px; }
  .controls select { height: 40px; }
  .controls .btn { height: 40px; padding: 0 12px; }
  /* в эфире перемотки нет — остаётся один ряд кнопок */
  .player.is-live .controls .sp, .player.is-live #bPrev, .player.is-live #bBack, .player.is-live #bFwd, .player.is-live #bNext, .player.is-live #rate, .player.is-live #bDl { display: none; }
  .tl-wrap { margin: 0; padding: 10px 10px 8px; border-radius: 12px; }
  .tl-head { gap: 6px; }
  .tl-head .sum { flex: 1 1 100%; font-size: 12.5px; }
  .tl-head .sp { display: none; }
  .tl-head .seg { flex: 1 1 100%; }
  .legend { gap: 4px 14px; font-size: 11.5px; }
  .x-panel { margin: 0; padding: 12px; border-radius: 12px; }
  .x-top b { font-size: 16px; }
  .x-top .hint { flex: 1 1 100%; min-width: 0; }
  .x-row { display: grid; grid-template-columns: 1fr 1fr; }
  .x-row .sp { display: none; }
  .x-row .btn { height: 44px; padding: 0 8px; min-width: 0; }
  .x-row select.sel { height: 46px; max-width: none; }
  .x-row select.sel, #xGo { grid-column: 1 / -1; }
  #xGo { height: 48px; font-size: 15px; }
  #xDone { display: flex; }
  #xDone a.btn { flex: 1; height: 48px; font-size: 15px; }
  .p-side { gap: 10px; }
  .panel { padding: 12px; border-radius: 12px; }
  .cal { gap: 4px; }
  .cal button { aspect-ratio: auto; height: 42px; font-size: 15px; }
  .quick .btn { height: 42px; font-size: 14px; }
  .cam-list { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; max-height: none; overflow: visible; margin: 0; padding: 0; }
  .cam-row { min-width: 0; padding: 10px 8px; background: var(--panel-2); }
  .cam-row .t { display: none; }

  /* галерея */
  .g-title { flex: 1 1 100%; }
  .tools select.sel { flex: 1 1 100%; max-width: none; height: 44px; }
  .tools .p-date { flex: 1 1 100%; gap: 6px; margin: 0; }
  .tools .p-date .input { flex: 1; min-width: 0; height: 44px; }
  .g-hour { margin-bottom: 16px; }
  .g-hour h2 { font-size: 16px; padding: 8px 0 6px; }
  .g-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }

  /* таблицы превращаются в карточки */
  .table-wrap { overflow: visible; background: none; border: 0; border-radius: 0; }
  .tbl, .tbl tbody { display: block; }
  .tbl thead { display: none; }
  .tbl tr { display: grid; grid-template-columns: 1fr 1fr; grid-auto-flow: dense; gap: 8px 12px; margin-bottom: 8px; padding: 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; }
  .tbl td { display: block; min-width: 0; padding: 0; border: 0; overflow-wrap: anywhere; }
  .tbl td[data-l]::before { content: attr(data-l); display: block; margin-bottom: 1px; color: var(--dim); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .4px; }
  .tbl td.main, .tbl td.wide, .tbl td.acts { grid-column: 1 / -1; }
  .tbl .nowrap, .tbl .st { white-space: normal; }
  .tbl .acts { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 2px; text-align: left; white-space: normal; }
  .tbl .acts .btn { margin: 0; }
  #aAdd { flex: 1 1 100%; height: 46px; }
  .quick-row .btn { flex: 1 1 100%; }

  /* окна выезжают снизу на всю ширину */
  .modal { padding: 0; align-items: end; justify-items: stretch; }
  .modal-card, .modal-card.wide { width: 100%; max-height: 92vh; max-height: 92dvh; border-radius: 18px 18px 0 0; border-bottom: 0; }
  .modal-head { padding: 12px 8px 2px 16px; }
  .modal-body { padding: 8px 16px calc(18px + env(safe-area-inset-bottom)); }
  .form-grid, .form-grid.three { grid-template-columns: 1fr; }
  .form-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .form-actions .btn { height: 46px; }
  .copy-row { flex-direction: column; }
  .copy-row .btn { height: 46px; }
  .cam-checks { grid-template-columns: 1fr 1fr; max-height: 220px; }
  .chk { min-height: 32px; }
  .chk input { width: 20px; height: 20px; }
}
/* телефон в руке вертикально: видео остаётся на экране, пока листают шкалу, календарь и список камер */
@media (max-width: 640px) and (orientation: portrait) {
  .stage { position: sticky; top: 0; z-index: 20; }
}
/* ── неон: голубой ярче, вокруг чипов, вкладок, кнопок и плиток — рассеянное свечение ── */
:root {
  --accent: #38cdff;
  --accent-strong: #12b6f5;
  --accent-soft: rgba(56, 205, 255, .16);
  --neon: 56, 205, 255; /* тот же голубой по частям — для свечения разной силы */
  --glow-soft: 0 0 0 1px rgba(var(--neon), .24), 0 0 14px rgba(var(--neon), .16);
  --glow: 0 0 0 1px rgba(var(--neon), .6), 0 0 12px rgba(var(--neon), .45), 0 0 34px rgba(var(--neon), .22);
  --glow-strong: 0 0 0 1px rgba(var(--neon), .85), 0 0 16px rgba(var(--neon), .65), 0 0 46px rgba(var(--neon), .32);
}
/* чипы зон: слабое свечение у каждого, яркое — у выбранного */
.chip { border-color: rgba(var(--neon), .45); box-shadow: 0 0 14px rgba(var(--neon), .2), 0 0 30px rgba(var(--neon), .07); }
.chip:hover { border-color: rgba(var(--neon), .65); box-shadow: var(--glow-soft); }
.chip.on { background: rgba(var(--neon), .18); border-color: var(--accent); color: #e4f8ff; box-shadow: var(--glow); text-shadow: 0 0 10px rgba(var(--neon), .75); }
.chip.on span { color: var(--accent); }
/* вкладки и переключатели */
.seg { border-color: rgba(var(--neon), .3); box-shadow: 0 0 18px rgba(var(--neon), .12); }
.seg button.on { background: rgba(var(--neon), .16); color: #e4f8ff; box-shadow: var(--glow); text-shadow: 0 0 10px rgba(var(--neon), .6); }
.nav a.on { background: rgba(var(--neon), .14); color: #e4f8ff; box-shadow: var(--glow-soft); text-shadow: 0 0 10px rgba(var(--neon), .6); }
.site-chip { border-color: rgba(var(--neon), .32); box-shadow: 0 0 14px rgba(var(--neon), .13); }
.brand-sub { text-shadow: 0 0 12px rgba(var(--neon), .75); }
.top { border-bottom-color: rgba(var(--neon), .22); box-shadow: 0 1px 20px rgba(var(--neon), .08); }
/* кнопки */
.btn:hover { border-color: rgba(var(--neon), .5); box-shadow: 0 0 14px rgba(var(--neon), .16); }
.btn.primary { box-shadow: 0 0 14px rgba(var(--neon), .5), 0 0 38px rgba(var(--neon), .22); }
.btn.primary:hover { background: #7fe0ff; box-shadow: var(--glow-strong); }
.btn.on { box-shadow: var(--glow); }
.btn[disabled], .btn[disabled]:hover { box-shadow: none; }
.btn.danger:hover:not([disabled]) { box-shadow: 0 0 14px rgba(255, 107, 107, .2); }
.icon-btn.big { box-shadow: 0 0 16px rgba(var(--neon), .6), 0 0 42px rgba(var(--neon), .25); }
.icon-btn.big:hover { background: #7fe0ff; box-shadow: var(--glow-strong); }
.icon-btn.attn { box-shadow: var(--glow-soft); }
.pass-eye:hover { box-shadow: none; }
/* плитки камер и записей */
.card { border-color: rgba(var(--neon), .24); box-shadow: 0 0 18px rgba(var(--neon), .07); }
.z-card { border-color: rgba(var(--neon), .18); }
.card:hover, .card:focus-visible { border-color: rgba(var(--neon), .75); box-shadow: var(--glow), var(--shadow); }
.g-tile { border-color: rgba(var(--neon), .14); }
.g-tile:hover, .g-tile:focus-visible { border-color: rgba(var(--neon), .65); box-shadow: var(--glow-soft); }
.badge.snd { box-shadow: 0 0 10px rgba(var(--neon), .4); }
.card .open { box-shadow: 0 0 14px rgba(var(--neon), .55); }
/* плеер и панели: тонкая светящаяся кромка */
.stage { border-color: rgba(var(--neon), .22); box-shadow: 0 0 28px rgba(var(--neon), .09); }
.panel, .controls, .tl-wrap, .table-wrap, .modal-card { border-color: rgba(var(--neon), .15); }
.login-card { border-color: rgba(var(--neon), .22); box-shadow: var(--shadow), 0 0 46px rgba(var(--neon), .13); }
.osd .pill.rec { border-color: rgba(var(--neon), .4); box-shadow: 0 0 12px rgba(var(--neon), .3); }
.cam-row.on { box-shadow: var(--glow-soft); }
.cal button.sel { box-shadow: var(--glow); }
.cal button.has::after { box-shadow: 0 0 6px rgba(var(--neon), .9); }
.bar i { box-shadow: 0 0 10px rgba(var(--neon), .7); }
.tag { box-shadow: 0 0 10px rgba(var(--neon), .28); }
.spinner { filter: drop-shadow(0 0 6px rgba(var(--neon), .55)); }
.field input:focus, .input:focus { box-shadow: 0 0 0 3px var(--accent-soft), 0 0 20px rgba(var(--neon), .32); }
@media (hover: none) and (pointer: coarse) {
  /* на сенсорном экране «наведение» залипает: свечение остаётся только у выбранного */
  .card:hover, .g-tile:hover { border-color: rgba(var(--neon), .24); box-shadow: 0 0 18px rgba(var(--neon), .07); }
  .btn:hover:not(.primary):not(.on) { box-shadow: none; border-color: var(--line); }
  .chip:hover:not(.on) { border-color: rgba(var(--neon), .45); box-shadow: 0 0 14px rgba(var(--neon), .2), 0 0 30px rgba(var(--neon), .07); }
}
@media (max-width: 900px), (max-height: 500px) {
  /* нижняя панель разделов: светится линия сверху и выбранный раздел */
  .top { box-shadow: none; }
  .nav { border-top-color: rgba(var(--neon), .3); box-shadow: 0 -2px 24px rgba(var(--neon), .13); }
  .nav a.on { background: none; box-shadow: none; color: var(--accent); text-shadow: 0 0 12px rgba(var(--neon), .85); }
  .nav a.on svg { filter: drop-shadow(0 0 6px rgba(var(--neon), .95)); }
  .site-chip { box-shadow: none; }
  .user-btn { border-color: rgba(var(--neon), .38); box-shadow: 0 0 14px rgba(var(--neon), .18); }
}
@media (max-height: 500px) and (orientation: landscape) {
  .nav { border-right-color: rgba(var(--neon), .3); box-shadow: 2px 0 24px rgba(var(--neon), .13); }
}
@media (max-width: 640px) {
  /* ряд чипов прокручивается вбок: оставляем место, чтобы свечение не обрезалось */
  .chips { margin: 0 -12px; padding: 10px 12px 12px; }
  .stage { box-shadow: none; }
}
@media (prefers-reduced-motion: reduce) { * { animation-duration: .001s !important; transition-duration: .001s !important; } }
