/* ============================================================
   Конфигуратор видеонаблюдения (/cctv) — стили страницы.
   Токены и базовые компоненты (.btn, .chip, .card, .form) — style.css;
   здесь только то, чего нет у серверного конфигуратора: карточки точек,
   ползунки, шкала детализации, строки комплекта, сводка.
   ============================================================ */
.cc-crumbs { font-size: 13px; color: var(--muted); margin: 0 0 8px; }
.cc-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 24px; align-items: start; }
.cc-main { min-width: 0; }
.cc-side {
  position: sticky; top: 130px; max-height: calc(100vh - 150px); overflow-y: auto; background: #fff; border: 1px solid var(--line);
  border-radius: 14px; padding: 20px; box-shadow: var(--shadow-lift);
}
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.cc-step { margin: 0 0 26px; }
.cc-step h2 { display: flex; align-items: center; gap: 10px; font-size: 20px; margin: 0 0 6px; color: var(--title); }
.cc-step-n {
  display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
  background: var(--blue); color: #fff; font-size: 14px; font-weight: 700; flex: none;
}
.cc-step-sub { margin: 0 0 14px; color: #5c5c5c; font-size: 14px; max-width: 760px; }
.cc-label { display: block; font-size: 12px; font-weight: 700; color: var(--title); text-transform: uppercase; letter-spacing: .04em; margin: 0 0 6px; }
.cc-note, .cc-hint { font-size: 12.5px; color: #5c5c5c; margin: 6px 0 0; }
.cc-muted { font-size: 12.5px; color: var(--muted); font-weight: 400; }
.cc-nowrap { white-space: nowrap; }
.cc-link {
  background: none; border: 0; padding: 0; font: inherit; font-size: 13px; color: var(--blue);
  text-decoration: underline; cursor: pointer;
}
.cc-link:hover { color: var(--orange); }

/* Место под блоки, которые строит JS после загрузки данных: без него всё,
   что ниже, ехало вниз при отрисовке (CLS 0,24–0,31, аудит SEO 20.11.2026).
   Значения — фактическая высота готовых блоков минус небольшой запас. */
#cc-object { min-height: 262px; } #ln-object { min-height: 242px; } #up-object { min-height: 217px; }
#cc-points, #ln-points, #up-points { min-height: 800px; }

/* Объект */
.cc-presets { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 6px 0 16px; }
.cc-preset {
  text-align: left; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px;
  cursor: pointer; font: inherit; color: #333; transition: border-color var(--tr), box-shadow var(--tr);
}
.cc-preset b { display: block; font-size: 15px; color: var(--ink); }
.cc-preset span { display: block; font-size: 12.5px; color: #5c5c5c; margin-top: 2px; }
.cc-preset:hover { border-color: var(--blue); }
.cc-preset.active { border: 2px solid var(--blue); padding: 11px 13px; background: #F2F7FC; }
.cc-preset:focus-visible, .cc-seg:focus-visible, .cc-qty button:focus-visible { outline: 3px solid rgba(15,111,192,.4); outline-offset: 2px; }

/* Точка наблюдения */
.cc-point { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; margin: 0 0 14px; }
.cc-point-head { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; }
.cc-point-n {
  display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 8px;
  background: #F2F7FC; color: var(--blue); font-weight: 700; font-size: 13px; flex: none;
}
.cc-zone { flex: 1; min-width: 0; font-size: 15px; font-weight: 700; color: var(--ink); }
.cc-point select, .cc-kit-row select {
  padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font: inherit; font-size: 14px;
  max-width: 100%; min-width: 0;
}
.cc-point select:focus, .cc-kit-row select:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(15,111,192,.18); }
.cc-qty { display: flex; align-items: center; gap: 4px; font-size: 14px; color: var(--muted); }
.cc-qty button {
  width: 32px; height: 32px; border: 1px solid var(--line); background: #fff; border-radius: 8px;
  font-size: 18px; line-height: 1; cursor: pointer; color: var(--blue);
}
.cc-qty output { min-width: 26px; text-align: center; font-weight: 700; color: var(--ink); font-size: 15px; }
.cc-del {
  width: 32px; height: 32px; border: 0; background: none; color: var(--muted); font-size: 22px; cursor: pointer; border-radius: 8px;
}
.cc-del:hover { color: var(--bad-text); background: #fdecec; }
.cc-row { margin: 0 0 12px; }
.cc-segs { display: flex; flex-wrap: wrap; gap: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; width: max-content; max-width: 100%; }
.cc-seg {
  border: 0; border-right: 1px solid var(--line); background: #fff; padding: 8px 12px; font: inherit; font-size: 13.5px;
  cursor: pointer; color: #333;
}
.cc-seg:last-child { border-right: 0; }
.cc-seg:hover { color: var(--blue); }
.cc-seg.active { background: var(--blue); color: #fff; font-weight: 700; }
.cc-where { display: flex; gap: 8px; flex-wrap: wrap; }

.cc-sliders { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 22px; margin: 0 0 12px; }
.cc-slider label { display: block; font-size: 13px; color: var(--title); font-weight: 700; margin: 0 0 4px; }
.cc-slider-row { display: flex; align-items: center; gap: 12px; }
.cc-slider input[type="range"] { flex: 1; min-width: 0; accent-color: var(--blue); height: 28px; }
.cc-slider output { min-width: 64px; text-align: right; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }

/* Камера точки */
.cc-cam { border-top: 1px dashed var(--line); padding-top: 12px; }
.cc-cam-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.cc-pick { display: flex; gap: 12px; align-items: center; }
.cc-pick select { flex: 1; width: 100%; min-width: 0; }
.cc-kit-row select, .cc-cam-empty select { width: 100%; }
.cc-price { text-align: right; flex: none; line-height: 1.2; }
.cc-price b { display: block; font-size: 17px; color: var(--ink); white-space: nowrap; }
.cc-price span { font-size: 12px; color: var(--muted); white-space: nowrap; }
.cc-spec { font-size: 12.5px; color: #5c5c5c; margin: 6px 0 8px; }
.cc-dori { background: #F2F7FC; border-radius: 10px; padding: 10px 12px; }
.cc-dori p { margin: 8px 0 0; font-size: 13px; color: #333; }
.cc-dori.is-bad { background: #fdecec; }
.cc-dori.is-bad p b { color: var(--bad-text); }
.cc-dori:not(.is-bad) p b { color: var(--ok-text); }
.cc-meter { position: relative; height: 8px; border-radius: 4px; background: #dde6ef; }
.cc-meter-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 4px; background: var(--blue-bright); }
.cc-dori.is-bad .cc-meter-fill { background: var(--bad); }
.cc-meter-mark { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--ink); }
.cc-cam-empty { background: #fdecec; color: var(--bad-text); border-radius: 10px; padding: 12px; font-size: 14px; }
.cc-cam-empty select { margin-top: 8px; width: 100%; }
.cc-add { margin-top: 2px; }

/* Архив */
.cc-grid3 { display: grid; grid-template-columns: repeat(3, auto); gap: 14px 24px; justify-content: start; margin: 4px 0 14px; }
.cc-checks { display: flex; gap: 20px; flex-wrap: wrap; }
.cc-check { display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.cc-check input { width: 18px; height: 18px; accent-color: var(--blue); }

/* Комплект */
.cc-kit-row { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; margin: 0 0 10px; }
.cc-kit-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin: 0 0 8px; }
.cc-kit-head b { color: var(--ink); font-size: 15px; }
.cc-why { font-size: 12.5px; color: #5c5c5c; margin: 6px 0 0; }
.cc-kit-cam { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 12px; font-size: 13.5px; padding: 5px 0; border-top: 1px solid #f1f2f4; }
.cc-kit-cam:first-of-type { border-top: 0; }
.cc-kit-cam span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cc-kit-cam b { color: var(--ink); text-align: right; min-width: 90px; }

/* Сводка */
.cc-sum-label { margin: 0; font-size: 13px; color: var(--muted); }
.cc-total { margin: 0 0 12px; font-size: 32px; font-weight: 700; color: var(--ink); line-height: 1.1; font-variant-numeric: tabular-nums; }
.cc-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; margin: 0 0 14px; }
.cc-facts div { background: #F2F7FC; border-radius: 8px; padding: 7px 10px; }
.cc-facts dt { font-size: 11.5px; color: #5c5c5c; }
.cc-facts dd { margin: 0; font-weight: 700; color: var(--ink); font-size: 14px; }
.cc-msgs { border-radius: 10px; padding: 10px 12px; margin: 0 0 10px; font-size: 13px; }
.cc-msgs ul { margin: 0; padding-left: 18px; }
.cc-msgs li { margin: 0 0 5px; }
.cc-msgs-h { margin: 0 0 5px; font-weight: 700; }
.cc-msgs.is-err { background: #fdecec; border: 1px solid #f3c2c2; color: var(--bad-text); }
.cc-msgs.is-warn { background: #fff6e6; border: 1px solid #f3dcae; color: #6b4200; }
.cc-msgs .cc-link { font-size: 12.5px; }
.cc-oks { list-style: none; padding: 0; margin: 0 0 14px; font-size: 12.5px; color: #333; }
.cc-oks li { padding-left: 20px; position: relative; margin: 0 0 3px; }
.cc-oks li::before { content: "✓"; position: absolute; left: 2px; color: var(--ok-text); font-weight: 700; }
.cc-wide { display: block; width: 100%; text-align: center; margin: 0 0 8px; }
.cc-side .btn[disabled] { opacity: .5; cursor: not-allowed; }
.cc-block-note { font-size: 12px; color: var(--bad-text); margin: -2px 0 10px; }
.cc-disc { font-size: 11.5px; color: var(--muted); margin: 8px 0 0; line-height: 1.45; }

.cc-eng { margin-top: 30px; align-items: start; }
.cc-eng-list { padding-left: 18px; font-size: 13.5px; }
.cc-seo-h { margin-top: 40px; }
.cc-other { margin-top: 18px; font-size: 14px; }
.cc-bar { display: none; }

@media (max-width: 1100px) {
  .cc-layout { grid-template-columns: minmax(0, 1fr); }
  .cc-side { position: static; box-shadow: none; }
  .cc-bar {
    display: flex; align-items: center; gap: 10px; justify-content: space-between;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; background: #fff; border-top: 1px solid var(--line);
    box-shadow: 0 -6px 20px rgba(13,18,32,.08);
    padding: 10px max(16px, env(safe-area-inset-right, 0px)) calc(10px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
  }
  .cc-bar span { display: block; font-size: 11.5px; color: var(--muted); }
  .cc-bar b { font-size: 18px; color: var(--ink); white-space: nowrap; }
  .cc-bar-st { font-size: 12px !important; font-weight: 700; }
  .cc-bar-st.is-err { color: var(--bad-text) !important; }
  .cc-bar-st.is-ok { color: var(--ok-text) !important; }
  body { padding-bottom: 70px; }
  .spec-fab { bottom: 80px !important; }
}
@media (max-width: 760px) {
  #cc-object { min-height: 560px; } #ln-object { min-height: 605px; } #up-object { min-height: 545px; }
  #cc-points, #ln-points, #up-points { min-height: 1200px; }
  .cc-presets { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cc-sliders { grid-template-columns: minmax(0, 1fr); }
  .cc-grid3 { grid-template-columns: minmax(0, 1fr); }
  .cc-pick { flex-direction: column; align-items: stretch; gap: 6px; }
  .cc-price { text-align: left; display: flex; gap: 8px; align-items: baseline; }
  .cc-point { padding: 14px; }
  .cc-point-head { flex-wrap: wrap; }
  .cc-zone { flex: 1 1 calc(100% - 40px); }
  .cc-point-head .cc-qty { margin-left: 36px; }
  .cc-point-head .cc-del { margin-left: auto; }
  .cc-kit-head .cc-muted { display: none; }
  .cc-segs { width: 100%; }
  .cc-seg { flex: 1 1 45%; padding: 8px 9px; font-size: 13px; border-bottom: 1px solid var(--line); }
  .cc-kit-cam { grid-template-columns: minmax(0, 1fr) auto; }
  .cc-kit-cam > span:nth-child(2) { display: none; }
  .cc-total { font-size: 28px; }
}
