/* =============================================================================
   Landing / онбординг-экран, слоты загрузки стилей, sticky-поиск, скролл-снэп
   ============================================================================= */

:root {
  --landing-bg: #f3efe7;
  --landing-fg: #1c1c1c;
  --landing-card-bg: #e3ddd0;
  --landing-accent: #ec7a2d;
  --panel-bg: rgba(243, 239, 231, 0.86);
  --panel-border: rgba(0, 0, 0, 0.1);
  --json-bg: #f7f4ec;
  --json-fg: #2b2b2b;
  --json-dot: rgba(0, 0, 0, 0.07);
  --json-k: #b34700;
  --json-s: #1a7a4c;
  --json-n: #b03050;
  --json-b: #6a3fb5;
  --json-null: #888;

  /* ---- Тёплая палитра лендинга (всегда кремово-бежевая, не зависит от темы стиля) ---- */
  --home-bg:        #f4ede1;
  --home-bg-2:      #f8f3ea;
  --home-fg:        #1d1a16;
  --home-head:      #234d2b;   /* тёмно-зелёный заголовок */
  --home-muted:     #8a8073;
  --home-card:      #fffdf9;
  --home-card-line: rgba(60, 45, 25, 0.07);
  --home-line:      rgba(60, 45, 25, 0.11);  /* тонкие линии сетки */
  --home-pill:      #f3ece0;
  --home-pill-2:    #ece3d4;
  --home-accent:    #ec7a2d;
  --home-accent-2:  #d9661c;
  --home-glow-a:    rgba(240, 160, 75, 0.22);
  --home-glow-b:    rgba(236, 122, 45, 0.12);
  --home-shadow:    rgba(80, 55, 25, 0.10);
  --home-pad:       64px;      /* боковые отступы внутри рамки-сетки */
  --home-frame:     1800px;    /* макс. ширина контентной колонки */
}

html[data-app-theme="dark"] {
  --landing-bg: #11172a;
  --landing-fg: #f3f4f8;
  --landing-card-bg: #2a3349;
  --landing-accent: #ff8a3d;
  --panel-bg: rgba(20, 26, 45, 0.82);
  --panel-border: rgba(255, 255, 255, 0.1);
  --json-bg: #0d1220;
  --json-fg: #e7eaf3;
  --json-dot: rgba(255, 255, 255, 0.05);
  --json-k: #7ec8ff;
  --json-s: #b5fcdb;
  --json-n: #ffd8d1;
  --json-b: #cfcce6;
  --json-null: #9aa0b5;
}

html[data-app-theme="light"] {
  --landing-bg: #f3efe7;
  --landing-fg: #1c1c1c;
  --landing-card-bg: #e3ddd0;
  --landing-accent: #ec7a2d;
  --panel-bg: rgba(243, 239, 231, 0.86);
  --panel-border: rgba(0, 0, 0, 0.1);
  --json-bg: #f7f4ec;
  --json-fg: #2b2b2b;
  --json-dot: rgba(0, 0, 0, 0.07);
  --json-k: #b34700;
  --json-s: #1a7a4c;
  --json-n: #b03050;
  --json-b: #6a3fb5;
  --json-null: #888;
}


/* ===================== Скролл-контейнер =====================
   Переключение между экранами анимируется вручную в landing.js
   (smoothScrollTo), поэтому CSS scroll-snap здесь не используется —
   он конфликтовал с кастомным easing и давал резкие прыжки. */

.scroll-root {
  height: 100vh;
  overflow-y: auto;

  /* Скрываем скроллбар страницы (скролл работает, полоса не видна) */
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.scroll-root::-webkit-scrollbar {
  display: none;
}

/* Обе секции занимают ровно 100vh */
.landing-section,
.content-section {
  height: 100vh;
  overflow: hidden;
}




/* ===================== Лэндинг ===================== */

.landing-section {
  position: relative;
  color: var(--home-fg);
  display: flex;
  flex-direction: column;
  overflow: hidden;

  /* Кремово-бежевый фон + еле заметные тёплые свечения (без сплошной штриховки) */
  background-color: var(--home-bg);
  background-image:
    radial-gradient(1100px 720px at 92% -10%, var(--home-glow-a) 0%, transparent 62%),
    radial-gradient(900px 680px at 4% 114%,   var(--home-glow-b) 0%, transparent 60%),
    linear-gradient(160deg, var(--home-bg-2) 0%, var(--home-bg) 60%, #efe6d6 100%);
}

/* Диагональная фактура — только в отдельных прямоугольных секциях (панель + полоса статистики) */
.landing-topbar,
.hero-stats {
  background-image: repeating-linear-gradient(135deg, rgba(120, 90, 40, 0.05) 0 1px, transparent 1px 10px);
}

/* Рамка-сетка: центрированная колонка с тонкими вертикальными линиями по краям */
.landing-frame {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: var(--home-frame);
  margin: 0 auto;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--home-line);
  border-right: 1px solid var(--home-line);
}

.landing-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px var(--home-pad);
  font-size: 17px;
  border-bottom: 1px solid var(--home-line);
}

.landing-logo {
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -0.01em;
  color: var(--home-fg);
}

/* Навигация — две отдельные «пилюли» */
.landing-nav {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Перенос между стилями — отдельная утилита, а генератор и редактор работают
   с единым стилем. Разделитель делает это различие понятным ещё в навигации. */
.landing-nav-divider {
  width: 1px;
  height: 28px;
  background: rgba(0, 0, 0, 0.16);
  margin: 0 2px;
}

.landing-nav a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--home-fg);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: 999px;
  white-space: nowrap;
  background: rgba(255, 253, 249, 0.9);
  border: 1px solid var(--home-card-line);
  box-shadow: 0 4px 14px var(--home-shadow);
  transition: background 0.16s, color 0.16s, transform 0.16s, box-shadow 0.16s;
}

.landing-nav a svg { opacity: 0.7; }

.landing-nav a:hover {
  background: var(--home-accent);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(236, 122, 45, 0.3);
}
.landing-nav a:hover svg { opacity: 1; }

/* Круглая кнопка «Сменить ключ доступа» — ведёт на страницу ввода кода (login.html).
   Позволяет перевойти под админ/гостевым ключом без чистки кэша браузера. */
.landing-nav .landing-nav-exit {
  width: 40px;
  height: 40px;
  padding: 0;
  gap: 0;
  justify-content: center;
  flex: 0 0 auto;
}
.landing-nav .landing-nav-exit svg { min-width: 16px; opacity: 0.7; }
.landing-nav .landing-nav-exit:hover svg { opacity: 1; }

/* Вкладки (Перенос / Генератор) всегда доступны — они умеют загружать стили сами */

.landing-grid {
  position: relative;
  z-index: 2;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 30px var(--home-pad) 0;
  min-height: 0;
}

/* ---- Hero (заголовок + бейдж + описание) ---- */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 14px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--home-fg);
  background: rgba(255, 253, 249, 0.9);
  border: 1px solid var(--home-card-line);
  border-radius: 999px;
  padding: 7px 16px 7px 12px;
  box-shadow: 0 6px 18px var(--home-shadow);
}

.badge-icon {
  width: 18px;
  height: 18px;
  object-fit: contain;
  display: block;
}

.landing-title {
  font-size: 50px;
  font-weight: 900;
  line-height: 1.14;
  letter-spacing: -0.02em;
  margin: 0;
  color: var(--home-head);
}

/* Цветные иконки (карта / карандаш) вместо эмодзи */
.title-emoji {
  display: inline-block;
  height: 0.92em;
  width: auto;
  vertical-align: -0.12em;
  margin: 0 0.04em;
}

/* Акцентное слово с «рисованным» оранжевым подчёркиванием */
.landing-title .hl {
  position: relative;
  color: var(--home-accent-2);
  font-style: italic;
  white-space: nowrap;
}

.landing-title .hl::after {
  content: '';
  position: absolute;
  left: -2px;
  right: -2px;
  bottom: -12px;
  height: 13px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 12' preserveAspectRatio='none'%3E%3Cpath d='M3 8 Q 50 1 100 6 T 197 5' stroke='%23ec7a2d' stroke-width='3.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat center;
  background-size: 100% 100%;
}

/* Карандаш + декоративные «искры» справа-сверху от него (в пустом месте, не на тексте) */
.title-pen {
  position: relative;
  display: inline-block;
}

.hl-spark {
  position: absolute;
  top: -1.35em;
  right: -0.85em;
  width: 1.1em;
  height: 1.1em;
  pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M21 2.5 13.5 8.5M23 12.5l-8 1M17.5 22l-2.5-8' stroke='%23ec7a2d' stroke-width='2.8' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat center;
  background-size: contain;
}

.hero-sub {
  margin: 8px 0 0;
  max-width: 660px;
  font-size: 16px;
  line-height: 1.65;
  color: var(--home-muted);
}

/* ---- Ряд статистики: прижат к низу, во всю ширину рамки, с верхней линией ---- */
.hero-stats {
  margin-top: auto;
  margin-inline: calc(-1 * var(--home-pad));
  padding: 22px var(--home-pad);
  border-top: 1px solid var(--home-line);
  display: flex;
  align-items: stretch;
}

.stat {
  flex: 1;
  padding: 2px 24px;
  text-align: center;
}

.stat + .stat {
  border-left: 1px solid var(--home-line);
}

.stat-num {
  font-size: 32px;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: var(--home-head);
  line-height: 1.1;
}

.stat-cap {
  margin-top: 5px;
  font-size: 13px;
  color: var(--home-muted);
}


/* ---- Сводка изменений на первом экране студии ---- */

/* Полоса прижата к низу первого экрана (margin-top:auto) и служит входом в
   личный кабинет. Классы собственные, а не .hero-stats: тот намеренно погашен
   для студии в design-system.css и свёрстан под маркетинговый лендинг. */
.home-summary {
  margin-top: auto;
  margin-inline: calc(-1 * var(--home-pad));
  padding: 12px var(--home-pad);
  border-top: 1px solid var(--home-line);
  display: flex;
  align-items: stretch;
  background-image: repeating-linear-gradient(135deg, rgba(120, 90, 40, 0.05) 0 1px, transparent 1px 10px);
}

.home-stat {
  flex: 1;
  padding: 2px 20px;
  text-align: center;
  text-decoration: none;
  color: inherit;
}

.home-stat + .home-stat {
  border-left: 1px solid var(--home-line);
}

.home-stat:hover .home-stat-num {
  color: var(--home-accent-2);
}

.home-stat-num {
  display: block;
  font-size: 26px;
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--home-head);
}

.home-stat-cap {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: var(--home-muted);
}

/* Первый экран не прокручивается (height:100vh + overflow:hidden), поэтому всё
   лишнее не уезжает вниз, а срезается. На невысоких окнах сводка ужимается, а
   на совсем низких убирается совсем — карточки загрузки стиля важнее. */
@media (max-height: 820px) {
  /* Отступы самой .landing-grid ужимаются в design-system.css: там они заданы
     через !important и переопределить их отсюда невозможно. */
  .home-summary { padding: 8px var(--home-pad); }
  .home-stat-num { font-size: 20px; }
  .home-stat-cap { margin-top: 2px; font-size: 11px; }
}

@media (max-height: 660px) {
  .home-summary { display: none; }
}


/* ===================== Рабочее пространство (второй экран) =====================
   Экран занимает 100vh, как лэндинг и контент, но прокручивается внутри себя:
   история и заметки в один экран не помещаются. За позиции экранов отвечает
   landing.js — он берёт их у самих секций, поэтому порядок здесь свободный. */

.workspace-section {
  height: 100vh;
  overflow: hidden;
  background-color: var(--home-bg);
  background-image: linear-gradient(180deg, var(--home-bg-2) 0%, var(--home-bg) 40%);
  border-top: 1px solid var(--home-line);
}

.workspace-scroll {
  height: 100%;
  overflow-y: auto;
  scrollbar-width: none;
}

.workspace-scroll::-webkit-scrollbar { display: none; }

.workspace-inner {
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
  padding: 44px 0 56px;
}

.workspace-head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 26px;
}

.workspace-title {
  margin: 0;
  font-size: 34px;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: var(--home-head);
}

.ws-columns {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 18px;
  margin-bottom: 18px;
}

.ws-panel {
  border: 1px solid var(--home-card-line);
  border-radius: 18px;
  background: rgba(255, 253, 249, 0.94);
  box-shadow: 0 10px 30px var(--home-shadow);
  overflow: hidden;
}

.ws-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--home-line);
}

.ws-panel-head h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
  color: var(--home-head);
}

.ws-count {
  font-size: 11px;
  color: var(--home-muted);
}

.ws-body { padding: 8px; }

.ws-empty {
  padding: 34px 18px;
  text-align: center;
  font-size: 12px;
  color: var(--home-muted);
}

/* ---- Карточка стиля в истории ---- */

.ws-style {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  padding: 11px;
  border-radius: 13px;
}

.ws-style:hover { background: rgba(120, 90, 40, 0.045); }

.ws-style-thumb {
  width: 42px;
  height: 42px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(145deg, #26354f, #8296bd);
}

.ws-style-thumb.light {
  color: #6b4a1f;
  background: linear-gradient(145deg, #f6e6c8, #e8cf9f);
}

/* Обе темы в одном стиле: значок делится пополам, а не выбирает одну из них. */
.ws-style-thumb.pair {
  display: flex;
  overflow: hidden;
  background: none;
}

.ws-style-thumb.pair span {
  flex: 1;
  display: grid;
  place-items: center;
}

.ws-style-thumb.pair span:first-child { color: #fff; background: linear-gradient(145deg, #26354f, #8296bd); }
.ws-style-thumb.pair span:last-child  { color: #6b4a1f; background: linear-gradient(145deg, #f6e6c8, #e8cf9f); }

.ws-style-main { min-width: 0; }

.ws-style-name {
  margin: 0 0 3px;
  font-size: 13px;
  font-weight: 700;
  color: var(--home-head);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ws-style-meta {
  margin: 0;
  font-size: 10px;
  color: var(--home-muted);
}

.ws-style-when {
  font-size: 10px;
  color: var(--home-muted);
  white-space: nowrap;
}

/* ---- Ярлыки ---- */

.ws-labels {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 7px;
}

.ws-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border: 1px solid var(--home-card-line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.75);
  font-size: 10px;
  font-weight: 600;
  color: var(--home-fg);
}

.ws-label button {
  border: 0;
  padding: 0;
  background: none;
  color: var(--home-muted);
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
}

.ws-label button:hover { color: var(--home-accent-2); }

.ws-label-add {
  padding: 3px 9px;
  border: 1px dashed var(--home-card-line);
  border-radius: 999px;
  background: none;
  font-size: 10px;
  font-weight: 600;
  color: var(--home-muted);
  cursor: pointer;
}

.ws-label-add:hover {
  border-style: solid;
  color: var(--home-accent-2);
}

/* ---- Лента изменений ---- */

.ws-event {
  display: grid;
  grid-template-columns: 7px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 11px 10px;
  border-bottom: 1px solid rgba(120, 90, 40, 0.09);
}

.ws-event:last-child { border-bottom: 0; }

.ws-event i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--home-accent-2);
}

.ws-event strong {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--home-head);
}

.ws-event span,
.ws-event time {
  font-size: 10px;
  color: var(--home-muted);
}

.ws-event span {
  display: block;
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---- Заметки ---- */

.ws-note-form {
  display: flex;
  gap: 8px;
}

.ws-select,
.ws-note-form input {
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--home-card-line);
  border-radius: 9px;
  background: #fffdfa;
  font-size: 11px;
  color: var(--home-fg);
}

.ws-note-form input { width: 260px; }

.ws-btn {
  height: 34px;
  padding: 0 14px;
  border: 1px solid var(--home-card-line);
  border-radius: 9px;
  background: #fffdfa;
  font-size: 11px;
  font-weight: 700;
  color: var(--home-fg);
  cursor: pointer;
}

.ws-btn.primary {
  border-color: var(--home-accent-2);
  background: var(--home-accent-2);
  color: #fff;
}

.ws-note {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) 22px;
  gap: 10px;
  align-items: center;
  padding: 11px 12px;
  border-radius: 11px;
  cursor: pointer;
}

.ws-note:hover { background: rgba(120, 90, 40, 0.045); }

.ws-note input { accent-color: var(--home-accent-2); }

.ws-note strong {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--home-head);
}

.ws-note small {
  display: block;
  margin-top: 2px;
  font-size: 9px;
  color: var(--home-muted);
}

.ws-note.done strong,
.ws-note.done small {
  color: var(--home-muted);
  text-decoration: line-through;
}

.ws-note button {
  border: 0;
  background: none;
  color: var(--home-muted);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}

@media (max-width: 980px) {
  .ws-columns { grid-template-columns: 1fr; }
  .ws-note-form { width: 100%; }
  .ws-note-form input { flex: 1; width: auto; }
  .workspace-title { font-size: 26px; }
}


/* ---- Код синхронизации с RapidMap ---- */

/* Кнопка, а не текст: код существует затем, чтобы его скопировали и вставили
   в RapidMap, поэтому всё поле целиком и есть кнопка копирования. */
.rapid-code {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-top: 10px;
  padding: 7px 12px;
  border: 1px solid var(--home-card-line);
  border-radius: 999px;
  background: rgba(255, 253, 249, 0.9);
  color: var(--home-fg);
  cursor: pointer;
}

.rapid-code:hover {
  border-color: var(--home-accent-2);
  color: var(--home-accent-2);
}

.rapid-code.copied {
  border-color: #2e9b72;
  color: #2e9b72;
}

.rapid-code-cap {
  font: 700 9px/1.2 ui-monospace, SFMono-Regular, Consolas, monospace;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--home-muted);
}

.rapid-code.copied .rapid-code-cap { color: inherit; }

.rapid-code-value {
  font: 700 13px/1 ui-monospace, SFMono-Regular, Consolas, monospace;
  letter-spacing: 0.04em;
}


/* ===================== Слоты загрузки стиля ===================== */

.landing-slots {
  flex: 1;
  display: flex;
  gap: 22px;
  min-height: 0;
}

.style-slot {
  border-radius: 24px;
  min-height: 220px;
  flex: 1;
  min-height: 0;
}

.landing-slots.single .style-slot:nth-child(2) {
  display: none;
}

.style-slot-empty {
  height: 100%;
  min-height: 220px;
  border-radius: 24px;
  background:
    repeating-linear-gradient(45deg, rgba(120, 90, 40, 0.04) 0 1px, transparent 1px 16px),
    var(--home-card);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  text-align: center;
  padding: 24px;
  cursor: pointer;
  border: 2px dashed rgba(120, 90, 40, 0.22);
  box-shadow: 0 18px 50px var(--home-shadow);
  transition: border-color 0.18s, transform 0.18s, box-shadow 0.18s;
}

.style-slot-empty:hover {
  transform: translateY(-3px);
  border-color: var(--home-accent);
  box-shadow: 0 26px 60px rgba(80, 55, 25, 0.16);
}

.style-slot-empty.dragover {
  border-color: var(--home-accent);
  border-style: solid;
  background:
    repeating-linear-gradient(45deg, rgba(236, 122, 45, 0.06) 0 1px, transparent 1px 16px),
    #fff7ee;
}

/* Иконка в мягком скруглённом бейдже */
.dz-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 76px;
  height: 76px;
  border-radius: 22px;
  color: var(--home-accent);
  background: linear-gradient(160deg, #fff3e6 0%, #ffe6cf 100%);
  box-shadow: inset 0 0 0 1px rgba(236, 122, 45, 0.18), 0 8px 22px rgba(236, 122, 45, 0.18);
}

.dz-text {
  font-size: 16px;
  line-height: 1.55;
  max-width: 360px;
  color: var(--home-muted);
}

.dz-text .accent {
  color: var(--home-accent);
  font-weight: 700;
}


/* ===================== Карточка загруженного стиля ===================== */

.style-card {
  display: flex;
  border-radius: 24px;
  background: var(--home-card);
  overflow: hidden;
  height: 100%;
  min-height: 220px;
  cursor: pointer;
  border: 1px solid var(--home-card-line);
  box-shadow: 0 18px 50px var(--home-shadow);
  outline: 2px solid transparent;
  outline-offset: 2px;
  transition: outline-color 0.18s, transform 0.18s, box-shadow 0.18s;
}

.style-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 26px 64px rgba(80, 55, 25, 0.16);
}

.style-card.active {
  outline-color: var(--home-accent);
}

.style-card-info {
  flex: 1;
  padding: 26px 26px 22px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Бейдж темы (луна/солнце) + заголовок */
.style-card-titlerow {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.style-card-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  flex-shrink: 0;
  background: linear-gradient(160deg, #fff3e6 0%, #ffe6cf 100%);
  color: var(--home-accent);
  box-shadow: inset 0 0 0 1px rgba(236, 122, 45, 0.18);
}

.style-card-title {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.meta-row {
  font-size: 14px;
  color: var(--home-muted);
  background: var(--home-pill);
  border-radius: 10px;
  padding: 8px 14px;
}

.meta-row b {
  color: var(--home-fg);
  font-weight: 700;
}

.meta-good     { color: #2f9e57 !important; }
.meta-warn     { color: var(--home-accent) !important; }
.meta-conflict { color: #e0463d !important; }
.meta-muted    { color: var(--home-muted) !important; opacity: 0.7; }

.style-card-replace {
  margin-top: auto;
  align-self: flex-start;
  display: flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--home-card-line);
  background: var(--home-pill);
  border-radius: 999px;
  padding: 9px 16px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--home-muted);
  cursor: pointer;
  transition: background 0.16s, color 0.16s, border-color 0.16s;
}

.style-card-replace:hover {
  background: var(--home-pill-2);
  color: var(--home-fg);
  border-color: rgba(120, 90, 40, 0.18);
}

.style-card-preview {
  flex: 1;
  position: relative;
  overflow: hidden;
  margin: 14px 14px 14px 0;
  border-radius: 18px;
}

.style-card-preview img {
  position: absolute;
  inset: -6%;
  width: 112%;
  height: 112%;
  object-fit: cover;
  transform: translate3d(var(--tx, 0px), var(--ty, 0px), 0);
  transition: transform 0.08s linear;
}


/* ===================== Sticky-бар (поиск + переключатель стиля) ===================== */

.sticky-bar {
  position: relative; /* sticky больше не нужен — родитель overflow:hidden */
  top: 0;
  z-index: 40;
  flex-shrink: 0;     /* не сжимается, сохраняет свою высоту в flex-цепочке */
  background: #fff;
  color: #222;
  border-radius: 0 0 16px 16px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
  padding: 18px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  opacity: 0.45;
  pointer-events: none;
}

.sticky-bar.ready {
  opacity: 1;
  pointer-events: auto;
}

.sticky-bar-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ===================== Глобальная тонкая шапка ===================== */

.global-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  height: 36px;
  flex-shrink: 0;
  background: rgba(0, 0, 0, 0.03);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  position: relative;
  z-index: 45;
}

.global-topbar.ready {
  opacity: 1;
  pointer-events: auto;
}

.global-topbar-links {
  display: flex;
  align-items: center;
  gap: 4px;
}

.global-topbar-divider {
  width: 1px;
  height: 22px;
  background: rgba(0, 0, 0, 0.16);
  margin: 0 7px;
}

.global-topbar-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12.5px;
  font-weight: 500;
  color: rgba(0, 0, 0, 0.42);
  text-decoration: none;
  padding: 4px 10px;
  border-radius: 6px;
  transition: color 0.14s, background 0.14s;
  white-space: nowrap;
}

.global-topbar-link:hover {
  color: rgba(0, 0, 0, 0.75);
  background: rgba(0, 0, 0, 0.05);
}

/* ===================== Колокольчик уведомлений ===================== */

.notif-bell-btn {
  position: relative;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 5px 7px;
  border-radius: 7px;
  color: rgba(0, 0, 0, 0.42);
  transition: color 0.14s, background 0.14s;
  display: flex;
  align-items: center;
}

.notif-bell-btn:hover {
  color: rgba(0, 0, 0, 0.75);
  background: rgba(0, 0, 0, 0.05);
}

.notif-badge {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ec7a2d;
  border: 1.5px solid #fff;
  transition: opacity 0.2s;
}

.notif-badge.hidden {
  display: none;
}

/* ===================== Панель уведомлений ===================== */

.notif-panel {
  position: absolute;
  top: 36px;            /* под global-topbar */
  right: 24px;
  width: 360px;
  max-height: 480px;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.14), 0 2px 8px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(0, 0, 0, 0.07);
  z-index: 200;
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px) scale(0.98);
  transform-origin: top right;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.notif-panel.open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.notif-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 12px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.07);
  flex-shrink: 0;
}

.notif-panel-title {
  font-size: 13px;
  font-weight: 700;
  color: #1a1a1a;
  letter-spacing: 0.01em;
}

.notif-panel-close {
  border: none;
  background: transparent;
  cursor: pointer;
  color: rgba(0, 0, 0, 0.38);
  padding: 3px 5px;
  border-radius: 5px;
  transition: background 0.12s, color 0.12s;
  display: flex;
  align-items: center;
}

.notif-panel-close:hover {
  background: rgba(0, 0, 0, 0.06);
  color: #222;
}

.notif-list {
  overflow-y: auto;
  flex: 1;
  padding: 8px 0;
}

.notif-empty {
  padding: 32px 16px;
  text-align: center;
  font-size: 13px;
  color: rgba(0, 0, 0, 0.38);
}

.notif-item {
  padding: 10px 16px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  transition: background 0.12s;
}

.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: rgba(0, 0, 0, 0.018); }

.notif-item.notif-new .notif-item-title::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ec7a2d;
  margin-right: 6px;
  vertical-align: middle;
  flex-shrink: 0;
}

.notif-item-body {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-bottom: 8px;
}

.notif-item-icon {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  background: rgba(0, 0, 0, 0.05);
  color: rgba(0, 0, 0, 0.52);
  margin-top: 1px;
}

.notif-item-icon svg {
  display: block;
  flex-shrink: 0;
}

.notif-item-text { min-width: 0; }

.notif-item-title {
  font-size: 12.5px;
  font-weight: 600;
  color: #222;
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.notif-item.notif-rolled .notif-item-title {
  text-decoration: line-through;
  color: rgba(0, 0, 0, 0.38);
}

.notif-item-desc {
  font-size: 11px;
  color: rgba(0, 0, 0, 0.4);
  margin-bottom: 5px;
}

.notif-preview-row {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
  font-size: 11.5px;
  margin-top: 2px;
}

/* Переиспользуем json-diff-chip / json-diff-arrow из diff-panel, но нужен
   сброс font-size чтобы в маленькой нотификации всё поместилось */
.notif-preview-row .json-diff-chip {
  font-size: 11px;
}

.notif-line-preview {
  display: inline-flex;
  align-items: center;
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(0, 0, 0, 0.09);
  border-radius: 4px;
  padding: 3px 8px;
}

.notif-item-btns {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.notif-jump,
.notif-rollback,
.notif-restore {
  border: none;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  padding: 4px 9px;
  transition: background 0.12s, color 0.12s;
}

.notif-jump {
  background: rgba(0, 0, 0, 0.06);
  color: #444;
}
.notif-jump:hover { background: rgba(0, 0, 0, 0.1); }

.notif-rollback {
  background: rgba(236, 122, 45, 0.1);
  color: #c05e10;
}
.notif-rollback:hover { background: rgba(236, 122, 45, 0.18); }

.notif-restore {
  background: rgba(52, 168, 83, 0.1);
  color: #1a7a35;
}
.notif-restore:hover { background: rgba(52, 168, 83, 0.18); }

/* ===================== Анимация подсветки при переходе к правке ===================== */

@keyframes notifCardFlash {
  0%   { box-shadow: none; outline: none; }
  15%  { box-shadow: 0 0 0 3px rgba(236, 122, 45, 0.65), 0 0 18px rgba(236, 122, 45, 0.25); outline: 2px solid rgba(236, 122, 45, 0.4); }
  60%  { box-shadow: 0 0 0 3px rgba(236, 122, 45, 0.4); }
  100% { box-shadow: none; outline: none; }
}

.notif-flash {
  animation: notifCardFlash 1.3s ease-out forwards;
  border-radius: 10px;
}

.sticky-bar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.sticky-search {
  flex: 1;
  max-width: 320px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #ddd;
  border-radius: 10px;
  padding: 10px 14px;
  color: inherit;
  transition: max-width 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

.sticky-search:focus-within,
.sticky-search.expanded {
  max-width: 480px;
}

.search-icon-svg {
  flex-shrink: 0;
  opacity: 0.45;
  display: block;
}

.sticky-search input {
  border: none;
  outline: none;
  flex: 1;
  font-size: 14px;
  background: transparent;
  color: inherit;
  min-width: 0;
}

.search-clear-btn {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: rgba(128,128,128,0.15);
  border: none;
  border-radius: 5px;
  width: 20px;
  height: 20px;
  cursor: pointer;
  color: inherit;
  opacity: 0.6;
  transition: opacity 0.12s, background 0.12s;
}

.search-clear-btn svg {
  display: block;
  stroke: currentColor;
}

.search-clear-btn:hover {
  opacity: 1;
  background: rgba(128,128,128,0.25);
}


.sticky-filter-btn {
  border: 1px solid #ddd;
  background: transparent;
  color: inherit;
  border-radius: 10px;
  padding: 10px 16px;
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
}

.sticky-filter-btn.disabled,
.sticky-filter-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

.sticky-filter-btn:hover {
  background: rgba(0, 0, 0, 0.04);
}

.sticky-style-info {
  color: inherit;
  white-space: nowrap;
  font-size: 14px;
}

.active-style-link {
  border: none;
  background: transparent;
  padding: 0;
  text-decoration: underline;
  font-weight: 600;
  font-size: 14px;
  color: inherit;
  cursor: pointer;
}

.active-style-link:disabled {
  cursor: default;
  text-decoration: none;
  opacity: 0.7;
}


/* ===================== Кнопка "Взять новый стиль" ===================== */

.diff-btn {
  border: 1.5px solid #ddd;
  background: transparent;
  color: #999;
  border-radius: 10px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  cursor: not-allowed;
  white-space: nowrap;
  transition: background 0.2s, color 0.2s, border-color 0.2s, box-shadow 0.2s;
}

/* Есть изменения — кнопка кликабельна, но в покое это просто обводка (без заливки). */
.diff-btn.active {
  border-color: var(--landing-accent);
  background: transparent;
  color: var(--landing-accent);
  cursor: pointer;
}

.diff-btn.active:hover {
  background: rgba(236, 122, 45, 0.1);
}

/* Короткая оранжевая вспышка с быстрым затуханием — сразу после внесения правки. */
.diff-btn.flash {
  animation: diffBtnFlash 1.3s ease-out;
}

@keyframes diffBtnFlash {
  0% {
    background: var(--landing-accent);
    color: #fff;
    border-color: var(--landing-accent);
    box-shadow: 0 6px 18px rgba(236, 122, 45, 0.4);
  }
  35% {
    background: var(--landing-accent);
    color: #fff;
    border-color: var(--landing-accent);
    box-shadow: 0 6px 18px rgba(236, 122, 45, 0.4);
  }
  100% {
    background: transparent;
    color: var(--landing-accent);
    border-color: var(--landing-accent);
    box-shadow: 0 0 0 rgba(236, 122, 45, 0);
  }
}


/* ===================== Кнопка "Скачать стиль" + версия ===================== */

.dl-cluster {
  display: flex;
  align-items: center;
  gap: 10px;
}

.dl-cluster[hidden] {
  display: none;
}

.dl-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1.5px solid var(--landing-accent);
  background: var(--landing-accent);
  color: #fff;
  border-radius: 10px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 6px 18px rgba(236, 122, 45, 0.32);
  transition: background 0.18s, box-shadow 0.18s, transform 0.12s;
}

.dl-btn:hover {
  background: var(--home-accent-2);
}
.dl-btn:disabled,
.dl-btn:disabled:hover {
  color: var(--home-muted);
  border-color: var(--panel-border);
  background: var(--home-pill-2);
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
}

.dl-btn:active {
  transform: translateY(1px);
}

.dl-btn svg {
  display: block;
  flex-shrink: 0;
}

/* --- Контрол версии --- */
.ver-ctl {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1.5px solid var(--panel-border, #ddd);
  border-radius: 10px;
  padding: 3px 4px 3px 8px;
  background: rgba(127, 127, 127, 0.06);
}

.ver-input {
  border: none;
  background: transparent;
  color: inherit;
  font-size: 13px;
  font-weight: 600;
  font-family: Consolas, monospace;
  width: 78px;
  padding: 4px 2px;
  cursor: default;
}

.ver-input:focus {
  outline: none;
}

.ver-spin {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ver-up,
.ver-down {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 12px;
  padding: 0;
  border: none;
  background: rgba(127, 127, 127, 0.14);
  border-radius: 4px;
  color: inherit;
  cursor: pointer;
  opacity: 0.7;
  transition: background 0.12s, opacity 0.12s;
}

.ver-up svg,
.ver-down svg {
  display: block;
}

.ver-up:hover,
.ver-down:hover {
  opacity: 1;
  background: var(--landing-accent);
  color: #fff;
}

.ver-edit {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border: none;
  border-radius: 7px;
  background: rgba(127, 127, 127, 0.14);
  color: inherit;
  cursor: pointer;
  opacity: 0.75;
  transition: background 0.12s, opacity 0.12s;
}

.ver-edit:hover {
  opacity: 1;
  background: var(--landing-accent);
  color: #fff;
}

.ver-edit svg {
  display: block;
}

/* Поповер для ввода кастомного названия версии */
.ver-pop {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  width: 210px;
  background: var(--panel-bg, #fff);
  backdrop-filter: blur(14px) saturate(1.1);
  -webkit-backdrop-filter: blur(14px) saturate(1.1);
  border: 1px solid var(--panel-border, rgba(0, 0, 0, 0.12));
  border-radius: 12px;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.25);
}

.ver-pop[hidden] {
  display: none;
}

.ver-pop-label {
  font-size: 12px;
  font-weight: 600;
  opacity: 0.7;
}

.ver-pop-input {
  border: 1.5px solid var(--panel-border, #ddd);
  background: rgba(127, 127, 127, 0.06);
  color: inherit;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px;
  font-family: Consolas, monospace;
}

.ver-pop-input:focus {
  outline: none;
  border-color: var(--landing-accent);
}

.ver-pop-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.ver-pop-btn {
  border: 1px solid var(--panel-border, #ddd);
  background: rgba(127, 127, 127, 0.08);
  color: inherit;
  border-radius: 7px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.ver-pop-btn.primary {
  border-color: var(--landing-accent);
  background: var(--landing-accent);
  color: #fff;
}

.ver-pop-btn:hover {
  filter: brightness(0.96);
}


/* ===================== Панель изменений стиля (выезжает сверху) ===================== */

.diff-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.diff-overlay.hidden {
  display: none;
}

.diff-panel {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  background: var(--panel-bg);
  backdrop-filter: blur(18px) saturate(1.1);
  -webkit-backdrop-filter: blur(18px) saturate(1.1);
  color: var(--landing-fg);
  border-radius: 0 0 22px 22px;
  border-bottom: 1px solid var(--panel-border);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
  transform: translateY(-100%);
  transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1), background 0.3s, color 0.3s;
  max-height: 78vh;
  display: flex;
  flex-direction: column;
}

.diff-overlay:not(.hidden) {
  opacity: 1;
}

.diff-panel.open {
  transform: translateY(0);
}

.diff-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 28px;
  border-bottom: 1px solid var(--panel-border);
}

.diff-panel-title {
  font-size: 19px;
  font-weight: 700;
}

.diff-panel-close {
  border: none;
  background: none;
  color: inherit;
  opacity: 0.6;
  font-size: 16px;
  cursor: pointer;
}

.diff-panel-close:hover {
  opacity: 1;
}

.diff-panel-body {
  flex: 1;
  display: flex;
  gap: 28px;
  padding: 24px 28px 28px;
  overflow: hidden;
}

.diff-tree {
  width: 220px;
  flex-shrink: 0;
  overflow-y: auto;
  font-size: 14px;
}

.diff-node {
  cursor: pointer;
  white-space: nowrap;
}

/* Тема (Dark/Light) — старшая ступень иерархии, крупнее и заметнее всего остального. */
.diff-node-theme {
  cursor: default;
  font-weight: 800;
  font-size: 24px;
  letter-spacing: -0.01em;
  margin-bottom: 10px;
}

.diff-theme-body {
  margin: 0 0 22px 2px;
  padding-left: 14px;
  border-left: 2px solid var(--landing-accent);
}

.diff-node-cat {
  font-weight: 700;
  font-size: 15px;
  opacity: 0.85;
  margin-bottom: 8px;
}

.diff-children {
  position: relative;
  margin: 0 0 18px 6px;
  padding-left: 16px;
  border-left: 1px solid var(--panel-border);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.diff-node-zoom {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  opacity: 0.65;
  padding: 3px 0;
  font-size: 14px;
}

.diff-node-zoom::before {
  content: '';
  position: absolute;
  left: -16px;
  top: 50%;
  width: 11px;
  height: 2px;
  background: currentColor;
  opacity: 0.4;
}

.diff-node-zoom:hover {
  opacity: 0.85;
}

.diff-node-zoom.selected {
  opacity: 1;
  font-weight: 700;
  font-size: 15px;
}

.diff-node-zoom.selected::before {
  background: var(--landing-accent);
  opacity: 1;
  height: 3px;
}

.diff-node-count {
  font-size: 11px;
  opacity: 0.6;
}

/* --- Кнопки Undo/Redo в sticky-баре --- */
.undo-redo { display: flex; align-items: center; gap: 4px; }
.ur-btn {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border: 1.5px solid #ddd; background: transparent; color: #8a8a8a;
  border-radius: 9px; cursor: pointer;
  transition: background .18s, color .18s, border-color .18s, opacity .18s;
}
.ur-btn svg { flex-shrink: 0; }
.ur-btn:disabled { opacity: .4; cursor: not-allowed; }
.ur-btn:not(:disabled):hover {
  border-color: var(--landing-accent);
  color: var(--landing-accent);
  background: rgba(236, 122, 45, 0.08);
}

/* --- Контролы узла в дереве изменений (удалить / глазик) --- */
.diff-node-label { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1; }
.diff-node-ctl { display: flex; align-items: center; gap: 2px; margin-left: auto; opacity: 0; transition: opacity .12s; flex-shrink: 0; }
.diff-node-zoom:hover .diff-node-ctl { opacity: 1; }
.dn-btn {
  width: 24px; height: 24px;
  display: flex; align-items: center; justify-content: center;
  border: none; background: transparent; color: inherit;
  border-radius: 6px; cursor: pointer; opacity: .65;
  transition: background .12s, color .12s, opacity .12s;
}
.dn-btn svg { flex-shrink: 0; }              /* SVG как flex-элемент иначе схлопывается до 0 ширины */
.dn-btn:hover { opacity: 1; background: rgba(0, 0, 0, 0.06); }
.dn-del:hover { color: #e74c3c; }
.diff-node-hidden .diff-node-label { opacity: .45; text-decoration: line-through; }
.diff-node-hidden .diff-node-ctl { opacity: 1; }
.diff-node-hidden .dn-eye { color: var(--landing-accent); opacity: 1; }

.diff-empty {
  opacity: 0.5;
  font-size: 13px;
}

.diff-json-pane {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.diff-json {
  flex: 1;
  margin: 0;
  background-color: var(--json-bg);
  background-image: radial-gradient(var(--json-dot) 1px, transparent 1px);
  background-size: 14px 14px;
  color: var(--json-fg);
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  padding: 18px 20px;
  font-family: Consolas, monospace;
  font-size: 13px;
  line-height: 1.6;
  overflow: auto;
  white-space: normal;   /* белое пространство теперь у .json-seg */
  word-break: break-word;
}

/* --- Аннотированный JSON: сегменты и бэджи «НОВОЕ» --- */

.json-seg {
  white-space: pre-wrap;
  word-break: break-word;
}

.json-seg-anno {
  border: 1.5px dashed rgba(236, 122, 45, 0.5);
  border-radius: 8px;
  padding: 8px 10px;
  margin: 4px -6px;
  background: rgba(236, 122, 45, 0.035);
}

html[data-app-theme="dark"] .json-seg-anno {
  background: rgba(236, 122, 45, 0.055);
}

.json-seg-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(236, 122, 45, 0.22);
  white-space: normal;
}

.json-seg-code {
  white-space: pre-wrap;
  word-break: break-word;
}

.json-new-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(236, 122, 45, 0.09);
  border: 1px solid rgba(236, 122, 45, 0.32);
  border-radius: 6px;
  padding: 2px 6px 2px 4px;
  font-size: 11px;
  font-family: system-ui, sans-serif;
  line-height: 1.4;
  color: var(--landing-fg);
  max-width: 100%;
}

.json-badge-hidden { opacity: 0.5; }
.json-badge-hidden .json-badge-label { text-decoration: line-through; }

.json-badge-tag {
  background: var(--landing-accent);
  color: #fff;
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  flex-shrink: 0;
  white-space: nowrap;
}

.json-badge-label {
  opacity: 0.85;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.json-new-badge .dn-btn {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.55;
}
.json-new-badge .dn-btn:hover { opacity: 1; }

/* --- Строка «было → стало» внутри аннотационного блока --- */
.json-diff-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  row-gap: 4px;
  padding: 5px 0 7px;
  border-bottom: 1px solid rgba(236, 122, 45, 0.16);
  margin-bottom: 5px;
  white-space: normal;
  font-family: system-ui, sans-serif;
  font-size: 12px;
}

.json-diff-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(0, 0, 0, 0.09);
  border-radius: 4px;
  padding: 2px 7px;
  line-height: 1.4;
}

html[data-app-theme="dark"] .json-diff-chip {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
}

.json-diff-arrow {
  color: var(--landing-accent);
  font-weight: 700;
  opacity: 0.85;
  flex-shrink: 0;
}

.json-diff-multi-sep {
  opacity: 0.25;
  margin: 0 3px;
  font-size: 13px;
}

.diff-nil { opacity: 0.38; font-style: italic; }

.diff-value-code {
  font-family: Consolas, monospace;
  font-size: 11px;
}

.diff-chip-icon {
  margin-left: 0;
  width: 16px;
  height: 16px;
}

.diff-json .jk    { color: var(--json-k); }
.diff-json .js    { color: var(--json-s); }
.diff-json .jn    { color: var(--json-n); }
.diff-json .jb    { color: var(--json-b); }
.diff-json .jnull { color: var(--json-null); }

.diff-json-foot {
  margin-top: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.diff-copy-btn {
  border: 1px solid var(--panel-border);
  background: rgba(127, 127, 127, 0.08);
  color: inherit;
  border-radius: 8px;
  padding: 9px 16px;
  font-size: 13px;
  cursor: pointer;
}

.diff-copy-btn:hover {
  background: rgba(127, 127, 127, 0.16);
}

/* Цветной кружок рядом с hex/hsl кодом */
.diff-cdot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.25);
  margin-left: 5px;
  vertical-align: middle;
  flex-shrink: 0;
}

/* SVG-превью иконки рядом с названием */
.diff-icon-preview {
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-left: 5px;
  vertical-align: middle;
  opacity: 0.85;
  object-fit: contain;
}

/* ===================== Панель фильтров ===================== */

.filter-wrap {
  position: relative;
}

.filter-panel {
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  width: 280px;
  background: #fff;
  color: #222;
  border-radius: 14px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
  padding: 18px 20px;
  display: none;
  flex-direction: column;
  gap: 6px;
  z-index: 50;
}

.filter-panel.open {
  display: flex;
}

.filter-panel-title {
  font-size: 13px;
  font-weight: 700;
  opacity: 0.6;
  margin: 6px 0 4px;
}

.filter-panel-title:first-child {
  margin-top: 0;
}

.zoom-range {
  position: relative;
  height: 24px;
  margin-top: 6px;
}

.zoom-range-track {
  position: absolute;
  left: 8px;
  right: 8px;
  top: 50%;
  height: 4px;
  transform: translateY(-50%);
  border-radius: 2px;
  background-color: rgba(0, 0, 0, 0.12);
  background-image: repeating-linear-gradient(to right, rgba(0, 0, 0, 0.3) 0 1px, transparent 1px calc(100% / 20));
}

.zoom-range-fill {
  position: absolute;
  top: 50%;
  height: 4px;
  transform: translateY(-50%);
  border-radius: 2px;
  background: var(--landing-accent);
  pointer-events: none;
}

.zoom-range-input {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  width: 100%;
  height: 24px;
  margin: 0;
  background: transparent;
  -webkit-appearance: none;
  appearance: none;
  pointer-events: none;
  z-index: 3;
}

.zoom-range-input::-webkit-slider-runnable-track {
  background: transparent;
}

.zoom-range-input::-moz-range-track {
  background: transparent;
}

.zoom-range-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  pointer-events: auto;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--landing-accent);
  cursor: pointer;
  margin-top: 4px;
}

.zoom-range-input::-moz-range-thumb {
  pointer-events: auto;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--landing-accent);
  cursor: pointer;
}

.zoom-range-labels {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  opacity: 0.65;
  margin-bottom: 4px;
}

.filter-radio,
.filter-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  padding: 4px 0;
  cursor: pointer;
}

.filter-check-icon {
  width: 15px;
  height: 15px;
  opacity: 0.6;
  flex-shrink: 0;
}
html[data-app-theme="dark"] .filter-check-icon {
  filter: brightness(0) invert(1);
  opacity: 0.5;
}

.filter-reset-btn {
  margin-top: 12px;
  border: 1px solid #ddd;
  background: transparent;
  border-radius: 8px;
  padding: 8px;
  font-size: 13px;
  cursor: pointer;
  color: inherit;
}

.filter-reset-btn:hover {
  background: rgba(0, 0, 0, 0.04);
}


/* ===================== Контентная секция ===================== */

.content-section {
  background: #fff;
  transition: background 0.3s, color 0.3s;
  /* Отступ для сайдбара управляется в stats.css */
  /* Flex-колонка: sticky-bar + остаток, без выхода за 100vh */
  display: flex;
  flex-direction: column;
  position: relative; /* якорь для .notif-panel */
}

#contentInner {
  color: inherit;
  flex: 1;            /* занимает всё место после sticky-bar */
  min-height: 0;      /* разрешаем flex-ребёнку быть меньше контента */
  overflow: hidden;   /* не даём #out растягивать страницу */
  display: flex;
  flex-direction: column;
}

/* #out — контейнер view-панелей — тоже должен занять всё место */
#out {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}


/* ===================== Тост блокировки скролла ===================== */

.scroll-toast {
  position: fixed;
  top: 18px;
  right: 18px;
  background: var(--home-accent);
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  padding: 12px 18px;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(236, 122, 45, 0.35);
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 0.35s ease, transform 0.35s ease;
  pointer-events: none;
  z-index: 100;
}

.scroll-toast.show {
  opacity: 1;
  transform: translateY(0);
}


@media (max-width: 1100px) {
  :root { --home-pad: 32px; }
  .landing-title { font-size: 40px; }
}

@media (max-width: 900px) {
  :root { --home-pad: 22px; }
  .landing-slots { flex-direction: column; }
  .landing-title { font-size: 32px; }
  .hero-sub { font-size: 15px; }
  .landing-nav a span,
  .landing-nav a { font-size: 13px; }
  .stat { padding: 2px 10px; }
  .stat-num { font-size: 22px; }
  .stat-cap { font-size: 11px; }
}

/* Планшет-портрет / телефон: шапка и навигация переносятся, а не обрезаются. */
@media (max-width: 768px) {
  .landing-topbar { flex-wrap: wrap; gap: 10px; padding: 14px var(--home-pad); }
  .landing-nav { flex-wrap: wrap; }
  .landing-nav a { padding: 8px 14px; }

  /* Sticky-бар «Выбран стиль …»: переносим, имя файла — с многоточием. */
  .sticky-bar { flex-wrap: wrap; padding: 12px var(--home-pad); gap: 10px 14px; }
  .sticky-bar-left, .sticky-bar-right { flex-wrap: wrap; min-width: 0; }
  .sticky-search { max-width: none; }
  .sticky-style-info {
    overflow: hidden; text-overflow: ellipsis; min-width: 0;
    max-width: 100%;
  }
}


/* ===================== Тёмная тема: content-section и global-topbar ===================== */

html[data-app-theme="dark"] .content-section {
  background: #11172a;
}

html[data-app-theme="dark"] .global-topbar {
  background: rgba(255, 255, 255, 0.04);
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

html[data-app-theme="dark"] .global-topbar-link {
  color: rgba(255, 255, 255, 0.45);
}

html[data-app-theme="dark"] .global-topbar-link:hover {
  color: rgba(255, 255, 255, 0.85);
  background: rgba(255, 255, 255, 0.07);
}
html[data-app-theme="dark"] .global-topbar-divider { background: rgba(255, 255, 255, 0.2); }

html[data-app-theme="dark"] .notif-bell-btn {
  color: rgba(255, 255, 255, 0.45);
}

html[data-app-theme="dark"] .notif-bell-btn:hover {
  color: rgba(255, 255, 255, 0.85);
  background: rgba(255, 255, 255, 0.07);
}
