/* Шрифты — со своего сервера (раньше грузились с fonts.googleapis.com и задерживали первую
   отрисовку). Fraunces и IBM Plex — лицензия SIL OFL 1.1, см. static/fonts/README.txt.
   Наборы: латиница и кириллица; браузер скачивает только нужный по unicode-range.
   У Fraunces нет кириллицы — русские заголовки, как и раньше, рисуются запасным Georgia. */
@font-face { font-family: 'Fraunces'; font-style: normal; font-weight: 400; font-display: optional;
  src: url(/static/fonts/fraunces-latin-ext.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Fraunces'; font-style: normal; font-weight: 400; font-display: optional;
  src: url(/static/fonts/fraunces-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Fraunces'; font-style: normal; font-weight: 600; font-display: optional;
  src: url(/static/fonts/fraunces-latin-ext.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Fraunces'; font-style: normal; font-weight: 600; font-display: optional;
  src: url(/static/fonts/fraunces-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Fraunces'; font-style: normal; font-weight: 700; font-display: optional;
  src: url(/static/fonts/fraunces-latin-ext.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Fraunces'; font-style: normal; font-weight: 700; font-display: optional;
  src: url(/static/fonts/fraunces-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 500; font-display: optional;
  src: url(/static/fonts/plex-mono-cyrillic-ext.woff2) format('woff2'); unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; }
@font-face { font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 500; font-display: optional;
  src: url(/static/fonts/plex-mono-cyrillic.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 500; font-display: optional;
  src: url(/static/fonts/plex-mono-latin-ext.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 500; font-display: optional;
  src: url(/static/fonts/plex-mono-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 400; font-display: optional;
  src: url(/static/fonts/plex-sans-cyrillic-ext.woff2) format('woff2'); unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; }
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 400; font-display: optional;
  src: url(/static/fonts/plex-sans-cyrillic.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 400; font-display: optional;
  src: url(/static/fonts/plex-sans-latin-ext.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 400; font-display: optional;
  src: url(/static/fonts/plex-sans-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 500; font-display: optional;
  src: url(/static/fonts/plex-sans-cyrillic-ext.woff2) format('woff2'); unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; }
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 500; font-display: optional;
  src: url(/static/fonts/plex-sans-cyrillic.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 500; font-display: optional;
  src: url(/static/fonts/plex-sans-latin-ext.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 500; font-display: optional;
  src: url(/static/fonts/plex-sans-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 600; font-display: optional;
  src: url(/static/fonts/plex-sans-cyrillic-ext.woff2) format('woff2'); unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; }
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 600; font-display: optional;
  src: url(/static/fonts/plex-sans-cyrillic.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 600; font-display: optional;
  src: url(/static/fonts/plex-sans-latin-ext.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 600; font-display: optional;
  src: url(/static/fonts/plex-sans-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* ===== Дизайн-токены ===== */
:root {
  --ink: #16302B;        /* фон — глубокий бутылочно-зелёный, цвет дорожки */
  --ink-light: #1E3D36;
  --paper: #EDE7D9;      /* поверхности карточек — тёплый пергамент */
  --paper-dim: #E0D9C8;
  --steel: #99A3AB;      /* второстепенный текст, рамки (светлее прежнего #8B96A0 — контраст AA на карточках) */
  --steel-dark: #5C6570;
  --touch: #C1272D;      /* акцент "укол" — для меток и предупреждений */
  --success: #437050;    /* положительное действие — кнопки "вперёд" (темнее прежнего #4A7C59 — контраст AA для текста на кнопке) */
  --success-light: #8BAB95; /* зелёный для ТЕКСТА на тёмном фоне */
  --success-dark: #3C6549;
  --touch-dark: #9C1E23;
  --gold: #BD9F72;       /* второстепенный акцент — золотое шитьё эполет (светлее прежнего #B08D57 — контраст AA) */

  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'IBM Plex Sans', -apple-system, sans-serif;
  --font-mono: 'IBM Plex Mono', 'Courier New', monospace;

  --radius: 4px;
  --max-width: 1100px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

body {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

/* ===== Фирменный элемент: разметка дорожки ===== */
.piste-line {
  position: relative;
  height: 2px;
  background: var(--steel);
  margin: 1.5rem 0;
  opacity: 0.6;
}
.piste-line::before,
.piste-line::after {
  content: '';
  position: absolute;
  top: -6px;
  width: 2px;
  height: 14px;
  background: var(--steel);
}
.piste-line::before { left: 12%; }
.piste-line::after { left: 88%; }

/* ===== Шапка ===== */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  max-width: var(--max-width);
  margin: 0 auto;
  width: 100%;
  padding: 1.5rem 1.5rem 1rem;
  background: var(--ink);
}

.logo-block {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  flex-shrink: 0;
}

.logo {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.tagline {
  font-size: 0.75rem;
  color: var(--steel);
  letter-spacing: 0.02em;
}

.main-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1.25rem;
  font-size: 0.95rem;
  row-gap: 0.5rem;
}

.main-nav a {
  opacity: 0.85;
  transition: opacity 0.15s;
  white-space: nowrap;
}

.nav-divider {
  width: 1px;
  height: 1.1rem;
  background: rgba(139, 150, 160, 0.3);
  flex-shrink: 0;
}
.main-nav a:hover { opacity: 1; }

.nav-logout { color: var(--steel); }

.nav-bot-link {
  font-size: 0.85rem;
  color: var(--steel);
}
.nav-bot-link:hover { color: var(--gold); }

/* ===== Главный блок ===== */
main {
  flex: 1;
  max-width: var(--max-width);
  margin: 0 auto;
  width: 100%;
  padding: 0 1.5rem 3rem;
}

.hero {
  padding: 0.5rem 0 2rem;
  text-align: center;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 700;
  margin: 0 0 0.5rem;
  letter-spacing: 0.01em;
}

.hero-subtitle {
  color: var(--steel);
  font-size: 1.1rem;
  max-width: 520px;
  margin: 0 auto;
}

.login-box, .welcome-box {
  margin-top: 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.login-card {
  background: var(--ink-light);
  border-radius: var(--radius);
  padding: 2rem 2.5rem;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}

.login-box p, .welcome-box p {
  color: var(--paper-dim);
  font-size: 0.95rem;
}

.login-box-title { margin-bottom: 0.25rem; }

.login-options {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
}

.login-option {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  width: 100%;
}

.login-divider {
  color: var(--steel);
  font-size: 0.85rem;
}

.btn-max {
  padding: 0.6rem 1.5rem;
  font-size: 0.95rem;
}

/* ===== Кнопки ===== */
.btn {
  display: inline-block;
  padding: 0.75rem 1.75rem;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  border: none;
  cursor: pointer;
  transition: transform 0.12s, background 0.15s;
}
.btn:hover { transform: translateY(-1px); }

.btn-primary {
  background: var(--success);
  color: var(--paper);
}
.btn-primary:hover { background: var(--success-dark); }

/* ===== Цены (моноширинный, как табло фиксации) ===== */
.price {
  font-family: var(--font-mono);
  font-weight: 500;
  color: #C09D67;
}

/* ===== Подвал ===== */
.site-footer {
  max-width: var(--max-width);
  margin: 0 auto;
  width: 100%;
  padding: 0 1.5rem 2rem;
  text-align: center;
}

.site-footer p {
  color: var(--steel);
  font-size: 0.85rem;
}

.copyright {
  font-size: 0.75rem;
  margin-top: 0.25rem;
}

/* ===== Мобильная адаптация ===== */
.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--steel);
  color: var(--paper);
  font-size: 1.3rem;
  line-height: 1;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius);
  cursor: pointer;
}

.filter-toggle {
  display: none;
}

@media (max-width: 640px) {
  .site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem 0.85rem;
    transition: padding 0.15s;
  }
  .site-header.is-scrolled {
    padding-top: 0.6rem;
    padding-bottom: 0.6rem;
  }
  .site-header.is-scrolled .tagline {
    display: none;
  }

  .nav-toggle {
    display: block;
  }

  .main-nav {
    display: none;
    flex-basis: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0.2rem;
    font-size: 0.95rem;
    margin-top: 0.25rem;
  }
  .main-nav.is-open {
    display: flex;
  }
  .main-nav a {
    display: block;
    width: 100%;
    text-align: right;
    padding: 0.75rem 0.4rem;
  }
  .nav-divider {
    display: none;
  }

  .hero { padding: 2rem 0 1.5rem; }

  .filter-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    background: var(--ink-light);
    border: 1px solid rgba(139, 150, 160, 0.3);
    border-radius: var(--radius);
    color: var(--paper);
    padding: 0.75rem 1rem;
    font-family: var(--font-body);
    font-size: 0.95rem;
    margin: 1rem 0 0.75rem;
    cursor: pointer;
  }

  .filter-bar.collapsible-filter {
    display: none;
  }
  .filter-bar.collapsible-filter.is-open {
    display: flex;
  }
}

/* ===== Общие элементы страниц ===== */
.page-title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 600;
  margin: 0.5rem 0 1rem;
}

.back-link {
  display: inline-block;
  color: var(--steel);
  font-size: 0.9rem;
  margin-top: 1.5rem;
  transition: color 0.15s;
}
.back-link:hover { color: var(--paper); }

/* Навигационная цепочка на странице объявления: Главная › Б/у экипировка › Категория */
.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.2rem 0.45rem;
  margin-top: 1.5rem;
  font-size: 0.9rem;
  color: var(--steel);
}
.breadcrumbs a { color: var(--steel); transition: color 0.15s; }
.breadcrumbs a:hover { color: var(--paper); }

/* Проданное или снятое объявление: плашка над карточкой, ниже — похожие объявления */
.ad-detail.ad-detail-closed { grid-template-columns: minmax(0, 1fr); max-width: 760px; }
.ad-closed-banner {
  margin: 1rem 0 0;
  padding: 0.85rem 1.1rem;
  border: 1px solid rgba(189, 159, 114, 0.45);
  border-left: 4px solid var(--gold);
  border-radius: var(--radius);
  background: var(--ink-light);
  color: var(--paper);
  font-size: 0.95rem;
}

.results-count {
  color: var(--steel);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

.empty-state {
  color: var(--steel);
  padding: 2rem 0;
  text-align: center;
}

.empty-state-page {
  text-align: center;
  padding: 4rem 0;
}
.empty-state-icon { font-size: 3rem; margin: 0; }

.hint-text {
  color: var(--steel);
  font-size: 0.9rem;
}

/* ===== Сетка категорий ===== */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.category-tile {
  background: var(--paper);
  color: var(--ink);
  border-radius: var(--radius);
  padding: 1.75rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.6rem;
  transition: transform 0.15s, box-shadow 0.15s;
}
.category-tile:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
}

.category-tile-icon {
  font-size: 2.3rem;
  line-height: 1;
}

.category-tile-label {
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.3;
}

.category-tile-count {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--steel-dark);
}

/* ===== Фильтры ===== */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 1rem 0 1.5rem;
}

.filter-bar input,
.filter-bar select {
  background: var(--ink-light);
  border: 1px solid rgba(139, 150, 160, 0.35);
  border-radius: var(--radius);
  color: var(--paper);
  padding: 0.55rem 0.75rem;
  font-family: var(--font-body);
  font-size: 0.9rem;
}

.filter-bar input[type="text"] { flex: 1 1 220px; }
.filter-bar input[type="number"] { width: 110px; }

.btn-secondary {
  background: transparent;
  border: 1px solid var(--steel);
  color: var(--paper);
}
.btn-secondary:hover { border-color: var(--gold); }

/* ===== Сетка объявлений ===== */
.ad-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.25rem;
  margin-top: 1rem;
}

.ad-card {
  background: var(--ink-light);
  color: var(--paper);
  border-radius: var(--radius);
  overflow: hidden;
  display: block;
  border: 1px solid rgba(139, 150, 160, 0.15);
  transition: transform 0.12s, box-shadow 0.15s, border-color 0.15s;
}
.ad-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
  border-color: rgba(176, 141, 87, 0.35);
}

.ad-card-image {
  position: relative;
  aspect-ratio: 4 / 3;
  background: var(--paper-dim);
  overflow: hidden;
}
.ad-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.ad-card-noimage {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  color: var(--steel);
}

.ad-badge {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--paper);
}
.ad-badge-sold { background: var(--touch); }
.ad-badge-reserved { background: var(--gold); }
.ad-badge-kit { background: var(--success); color: var(--paper); }
.ad-badge-sold ~ .ad-badge-kit, .ad-badge-reserved ~ .ad-badge-kit { top: 2.6rem; }

.ad-card-body { padding: 0.85rem 1rem 1rem; }

.ad-card-title {
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0 0 0.4rem;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ===== Пагинация ===== */
.pagination {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  margin-top: 2rem;
}

/* ===== Карточка объявления (детально) ===== */
.ad-detail {
  display: grid;
  grid-template-columns: minmax(280px, 420px) 1fr;
  gap: 2.5rem;
  margin-top: 2rem;
}

.ad-detail-image {
  position: relative;
  background: var(--paper-dim);
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 4 / 3;
}
.ad-detail-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.ad-detail-noimage { font-size: 4rem; }

/* Галерея объявления: миниатюры под главным фото (несколько фото) */
.ad-gallery {
  list-style: none;
  margin: 0.6rem 0 0;
  padding: 0;
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  scrollbar-width: thin;
}
.ad-gallery li { flex: 0 0 auto; }
.ad-gallery-thumb {
  display: block;
  width: 84px;
  height: 63px;
  border-radius: calc(var(--radius) / 2);
  overflow: hidden;
  border: 2px solid transparent;
  background: var(--paper-dim);
}
.ad-gallery-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ad-gallery-thumb.is-active, .ad-gallery-thumb:hover, .ad-gallery-thumb:focus-visible { border-color: var(--gold); }

.ad-detail-category {
  color: var(--steel);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 0.3rem;
}

.ad-detail-info h1 {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  margin: 0 0 0.75rem;
}

.price-large { font-size: 1.5rem; margin: 0 0 1.25rem; }

.ad-attributes {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}
/* Комплект: состав и «только комплектом / по отдельности» на странице объявления */
.ad-kit {
  background: var(--ink-light);
  border-left: 3px solid var(--success-light);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  margin: 0 0 1.25rem;
}
.ad-kit-title { margin: 0 0 0.4rem; font-weight: 600; }
.ad-kit-items { margin: 0; padding-left: 1.2rem; columns: 2; column-gap: 1.5rem; }
.ad-kit-items li { break-inside: avoid; }
.ad-kit-split { margin: 0.6rem 0 0; color: var(--steel); font-size: 0.92rem; }
.ad-guide-link { margin: 1.5rem 0 0; }
.landing-map { margin-top: 1rem; }
.landing-map summary { cursor: pointer; color: var(--steel); margin-bottom: 0.5rem; }

/* Форма подачи: состав комплекта */
.kit-fields-title { margin: 0 0 0.5rem; font-weight: 600; }
.kit-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 0.25rem 1rem; margin-bottom: 0.5rem; }
.kit-item { margin: 0; }

.ad-attr {
  background: var(--ink-light);
  border: 1px solid rgba(139, 150, 160, 0.3);
  border-radius: var(--radius);
  padding: 0.35rem 0.7rem;
  font-size: 0.85rem;
  color: var(--paper-dim);
}

.ad-description {
  color: var(--paper-dim);
  white-space: pre-wrap;
  margin-bottom: 1.25rem;
}

.ad-location {
  color: var(--steel);
  font-size: 0.9rem;
  margin-bottom: 1.25rem;
}

.ad-contact-box {
  background: var(--ink-light);
  border-left: 3px solid var(--touch);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
}
.ad-contact-label {
  color: var(--steel);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 0.3rem;
}

.contact-source-badge {
  text-transform: none;
  letter-spacing: normal;
  background: var(--ink);
  border-radius: 999px;
  padding: 0.15rem 0.6rem;
  font-size: 0.75rem;
  color: var(--gold);
  margin-left: 0.4rem;
}
.ad-contact-value {
  font-family: var(--font-mono);
  font-size: 1rem;
  margin: 0;
}

.ad-contact-value a {
  color: var(--gold);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.ad-contact-value a:hover {
  color: var(--touch);
}

@media (max-width: 720px) {
  .ad-detail { grid-template-columns: 1fr; gap: 1.5rem; }
}

/* ===== Форма подачи объявления ===== */
.post-form {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  max-width: 560px;
  margin-top: 1.5rem;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-field label {
  font-size: 0.85rem;
  color: var(--steel);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

@media (max-width: 560px) {
  .form-row {
    grid-template-columns: 1fr;
    gap: 1.1rem;
  }
}

.post-form input[type="text"],
.post-form input[type="number"],
.post-form select,
.post-form textarea {
  width: 100%;
  box-sizing: border-box;
  background: var(--ink-light);
  border: 1px solid rgba(139, 150, 160, 0.35);
  border-radius: var(--radius);
  color: var(--paper);
  padding: 0.65rem 0.85rem;
  font-family: var(--font-body);
  font-size: 0.95rem;
}

.post-form select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%238B96A0' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.85rem center;
  padding-right: 2.2rem;
  cursor: pointer;
}

.post-form textarea { resize: vertical; }

.post-form input:focus,
.post-form select:focus,
.post-form textarea:focus {
  border-color: var(--gold);
  outline: none;
}

.post-form input[type="file"] {
  width: 100%;
  box-sizing: border-box;
  background: var(--ink-light);
  border: 1px solid rgba(139, 150, 160, 0.35);
  border-radius: var(--radius);
  color: var(--paper-dim);
  padding: 0.5rem 0.85rem;
  font-family: var(--font-body);
  font-size: 0.9rem;
}

.post-form input[type="file"]::file-selector-button {
  background: var(--ink);
  color: var(--paper);
  border: 1px solid var(--steel);
  border-radius: var(--radius);
  padding: 0.45rem 0.9rem;
  margin-right: 0.85rem;
  font-family: var(--font-body);
  font-size: 0.85rem;
  cursor: pointer;
  transition: border-color 0.15s;
}

.post-form input[type="file"]::file-selector-button:hover {
  border-color: var(--gold);
}

.post-form .hint-text {
  margin: 0;
}

.post-form button {
  margin-top: 0.5rem;
  align-self: flex-start;
}

.form-error {
  background: rgba(193, 39, 45, 0.15);
  border-left: 3px solid var(--touch);
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  color: var(--paper);
  margin: 1rem 0;
}

/* ===== Личный кабинет ===== */
.cabinet-nav {
  display: flex;
  gap: 1.5rem;
  margin: 1rem 0 2rem;
  border-bottom: 1px solid rgba(139, 150, 160, 0.25);
  padding-bottom: 0.75rem;
}
.cabinet-nav a { color: var(--steel); font-size: 0.95rem; }
.cabinet-nav a:hover { color: var(--paper); }
.cabinet-nav-active { color: var(--paper) !important; font-weight: 600; }

.cabinet-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.cabinet-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--ink-light);
  border-radius: var(--radius);
  padding: 0.75rem;
}

.cabinet-item-thumb {
  flex-shrink: 0;
  width: 72px;
  height: 72px;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--paper-dim);
  display: block;
}
.cabinet-item-thumb img { width: 100%; height: 100%; object-fit: cover; }
.cabinet-item-thumb .ad-card-noimage { font-size: 1.5rem; }

.cabinet-item-body { flex: 1; min-width: 0; }

.cabinet-item-status {
  font-size: 0.8rem;
  color: var(--steel);
  margin: 0 0 0.2rem;
}

.cabinet-item-title {
  display: block;
  font-weight: 600;
  margin-bottom: 0.2rem;
}

.cabinet-item-reason {
  font-size: 0.8rem;
  color: var(--touch);
  margin: 0.2rem 0 0;
}

.btn-small {
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  flex-shrink: 0;
}

/* ===== Подписки ===== */
.section-title {
  font-family: var(--font-display);
  font-size: 1.4rem;
  margin: 2.5rem 0 0.5rem;
}

.cabinet-item-sub { align-items: flex-start; }

.sub-detail {
  font-size: 0.85rem;
  color: var(--steel);
  margin: 0.15rem 0;
}

/* ===== Вход через MAX ===== */
.max-login-box {
  max-width: 420px;
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
}

.max-login-code {
  font-family: var(--font-mono);
  font-size: 2.2rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  color: var(--gold);
  background: var(--ink-light);
  border-radius: var(--radius);
  padding: 0.75rem 1.5rem;
  margin: 0.25rem 0;
}

/* ===== Статичные страницы (О проекте, Поддержка) ===== */
.static-page {
  max-width: 640px;
  margin-top: 1.5rem;
  color: var(--paper-dim);
  line-height: 1.7;
}

.static-page ul {
  padding-left: 1.2rem;
  margin: 0.75rem 0 1.5rem;
}

.static-page li {
  margin-bottom: 0.5rem;
}

.static-page .ad-contact-box {
  max-width: 320px;
  margin-bottom: 1rem;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem 1.5rem;
  margin-bottom: 0.75rem;
  font-size: 0.85rem;
  padding: 0 1rem;
}
.footer-nav a { color: var(--steel); }
.footer-nav a:hover { color: var(--paper); }

/* ===== Согласие на обработку ПДн ===== */
.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  font-size: 0.85rem;
  color: var(--paper-dim);
  line-height: 1.5;
  cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
  margin-top: 0.2rem;
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  accent-color: var(--touch);
}

.checkbox-label a {
  color: var(--gold);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.legal-hint {
  font-size: 0.8rem;
  margin-top: 0.75rem;
}

/* ===== Юридические документы ===== */
.legal-page h2.section-title {
  margin-top: 2rem;
}

.legal-page ul, .legal-page ol {
  padding-left: 1.2rem;
  margin: 0.5rem 0 1rem;
}

.legal-page li {
  margin-bottom: 0.4rem;
}

.legal-meta {
  color: var(--steel);
  font-size: 0.85rem;
}

.required-mark {
  color: var(--touch);
  font-weight: 600;
}

/* ===== Ссылки внутри обычного текста — чтобы было видно, что это ссылка ===== */
.static-page a,
.hint-text a,
.empty-state a {
  color: var(--gold);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.static-page a:hover,
.hint-text a:hover,
.empty-state a:hover {
  color: var(--touch);
}

/* ===== Последние объявления на главной ===== */
.recent-ads {
  margin-top: 1rem;
}

.recent-ads-title {
  text-align: center;
  margin-bottom: 0.5rem;
}

.recent-ads-more {
  display: flex;
  justify-content: center;
  margin-top: 2rem;
}

/* ===== Скрытый контакт (показывается по клику) ===== */
.contact-hidden {
  display: none;
}

.btn-show-contact {
  background: var(--ink);
  border: 1px solid var(--steel);
  color: var(--paper);
  border-radius: var(--radius);
  padding: 0.6rem 1.2rem;
  font-family: var(--font-body);
  font-size: 0.9rem;
  cursor: pointer;
  transition: border-color 0.15s;
}
.btn-show-contact:hover {
  border-color: var(--gold);
}

.ad-login-prompt {
  margin-top: 0.5rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(139, 150, 160, 0.2);
}
.ad-login-prompt .login-options {
  margin: 0.75rem 0;
}

/* ===== Админ-панель ===== */
.nav-admin-link {
  color: var(--gold) !important;
}

.admin-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
  max-width: 500px;
}

.admin-card {
  background: var(--paper);
  color: var(--ink);
  border-radius: var(--radius);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  transition: transform 0.15s, box-shadow 0.15s;
}
.admin-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
}
.admin-card-static:hover {
  transform: none;
  box-shadow: none;
}

.admin-card-number {
  font-family: var(--font-mono);
  font-size: 2.2rem;
  font-weight: 600;
}

.admin-card-label {
  font-size: 0.9rem;
  color: var(--steel-dark);
}

.admin-card-hint {
  font-size: 0.75rem;
  color: var(--steel);
  font-style: italic;
}

/* --- Список на модерации --- */
.admin-pending-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1.5rem;
}

.admin-pending-item {
  display: grid;
  grid-template-columns: 100px 1fr auto;
  gap: 1.25rem;
  background: var(--ink-light);
  border-radius: var(--radius);
  padding: 1rem;
  align-items: start;
}

.admin-pending-thumb {
  width: 100px;
  height: 100px;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--paper-dim);
  flex-shrink: 0;
}
.admin-pending-thumb img { width: 100%; height: 100%; object-fit: cover; }
.admin-pending-thumb .ad-card-noimage { font-size: 1.8rem; }

.admin-pending-platform {
  font-size: 0.78rem;
  color: var(--steel);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin: 0 0 0.3rem;
}

.admin-pending-title {
  font-weight: 600;
  margin: 0 0 0.3rem;
}

.admin-pending-meta {
  font-size: 0.85rem;
  color: var(--paper-dim);
  margin: 0.2rem 0;
}

.admin-pending-actions {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  min-width: 180px;
}

.admin-reject-form {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.admin-reject-form input {
  background: var(--ink);
  border: 1px solid rgba(139, 150, 160, 0.35);
  border-radius: var(--radius);
  color: var(--paper);
  padding: 0.45rem 0.7rem;
  font-family: var(--font-body);
  font-size: 0.85rem;
}

@media (max-width: 640px) {
  .admin-pending-item {
    grid-template-columns: 1fr;
  }
  .admin-pending-thumb { width: 100%; height: 160px; }
}

/* --- Лог ошибок --- */
.admin-error-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0 1.5rem;
}
.admin-error-summary-item {
  background: var(--ink-light);
  border-radius: var(--radius);
  padding: 0.35rem 0.7rem;
  font-size: 0.8rem;
  color: var(--steel);
  font-family: var(--font-mono);
}

.admin-errors-table {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.admin-error-row {
  background: var(--ink-light);
  border-left: 3px solid var(--touch);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
}

.admin-error-meta {
  font-size: 0.8rem;
  color: var(--steel);
  font-family: var(--font-mono);
  margin: 0 0 0.3rem;
}

.admin-error-handler {
  font-size: 0.85rem;
  color: var(--gold);
  margin: 0 0 0.3rem;
}

.admin-error-message {
  font-size: 0.9rem;
  color: var(--paper-dim);
  margin: 0 0 0.3rem;
  word-break: break-word;
}

.admin-error-context {
  font-size: 0.8rem;
  color: var(--steel-dark);
  margin: 0;
}

/* ===== История просмотров ===== */
.history-checkbox {
  display: flex;
  align-items: center;
  padding-right: 0.5rem;
}
.history-checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--gold);
  cursor: pointer;
}

/* ===== Сравнение объявлений ===== */
.compare-table-wrap {
  overflow-x: auto;
  margin-top: 1.5rem;
}

.compare-table {
  border-collapse: collapse;
  width: 100%;
  min-width: 500px;
  table-layout: fixed;
}

.compare-table th,
.compare-table td {
  border: 1px solid rgba(139, 150, 160, 0.25);
  padding: 0.85rem 1rem;
  text-align: left;
  vertical-align: top;
  font-size: 0.9rem;
}

.compare-table th {
  background: var(--ink-light);
  width: 180px;
}

.compare-row-label {
  color: var(--steel);
  font-size: 0.85rem;
  white-space: nowrap;
  background: var(--ink-light);
  width: 140px;
}

.compare-thumb {
  display: block;
  width: 140px;
  height: 105px;
  object-fit: cover;
  border-radius: var(--radius);
  margin: 0 auto 0.5rem;
}
.ad-card-noimage.compare-thumb {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  background: var(--paper-dim);
}

.compare-title {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--paper);
  line-height: 1.3;
}

/* ===== Модальное окно входа ===== */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal-overlay.is-open { display: flex; }
body.modal-open { overflow: hidden; }

.modal-box {
  position: relative;
  background: var(--ink-light);
  border: 1px solid rgba(176, 141, 87, 0.45);
  border-radius: var(--radius);
  padding: 2rem;
  max-width: 420px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  text-align: center;
}

.modal-box .login-box-title {
  margin-bottom: 1.25rem;
  font-size: 1.15rem;
}

.modal-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: none;
  border: none;
  color: var(--steel);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
}
.modal-close:hover { color: var(--paper); }

.max-modal-step2 {
  text-align: center;
  margin: 1rem 0;
  padding: 1rem;
  background: var(--ink);
  border-radius: var(--radius);
}
.max-modal-code {
  font-family: var(--font-mono);
  font-size: 1.8rem;
  letter-spacing: 0.1em;
  color: var(--gold);
  margin: 0.5rem 0;
}

/* ===== Иконка избранного на карточке ===== */
.ad-card-fav {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(22, 48, 43, 0.65);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  z-index: 2;
}
.ad-card-fav:hover { transform: scale(1.1); }
.ad-card-fav svg {
  fill: none;
  stroke: var(--paper);
  stroke-width: 2;
  transition: fill 0.15s, stroke 0.15s;
}
.ad-card-fav.is-favorited {
  background: rgba(22, 48, 43, 0.85);
}
.ad-card-fav.is-favorited svg {
  fill: var(--touch);
  stroke: var(--touch);
}

/* ===== Ссылка "Войти" в шапке ===== */
.nav-login-link {
  font-weight: 600;
  color: var(--gold) !important;
}

/* ===== Всегда видимая строка поиска (не сворачивается на мобильном,
   в отличие от цены/сортировки — без неё страница поиска бесполезна) ===== */
.search-input-row {
  display: flex;
  gap: 0.6rem;
  margin: 1rem 0 0.75rem;
}
.search-input-row input[type="text"] {
  flex: 1;
  background: var(--ink-light);
  border: 1px solid rgba(139, 150, 160, 0.35);
  border-radius: var(--radius);
  color: var(--paper);
  padding: 0.6rem 0.85rem;
  font-family: var(--font-body);
  font-size: 0.95rem;
}

/* ===== Веб-панель расписания клуба ===== */

.btn-danger {
  background: var(--touch);
  color: var(--paper);
}
.btn-danger:hover { background: var(--touch-dark); }

.schedule-role-badge {
  display: inline-block;
  background: var(--paper-dim);
  color: var(--ink);
  border-radius: var(--radius);
  padding: 0.15rem 0.6rem;
  font-size: 0.85rem;
  font-weight: 600;
}

.schedule-role-line {
  color: var(--steel);
  margin-bottom: 1.5rem;
}

.schedule-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.schedule-club-list, .schedule-group-list, .schedule-member-list, .schedule-training-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.schedule-club-card, .schedule-group-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--ink-light);
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  color: var(--paper);
  transition: border-color 0.15s, transform 0.15s;
}
.schedule-club-card:hover, .schedule-group-card:hover {
  border-color: var(--gold);
  transform: translateY(-2px);
}

.schedule-group-desc {
  color: var(--steel);
  font-size: 0.9rem;
  margin-left: 0.75rem;
}

.schedule-member-row, .schedule-training-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  background: var(--ink-light);
  border-radius: var(--radius);
  padding: 0.85rem 1.25rem;
  flex-wrap: wrap;
}

.schedule-member-info {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-wrap: wrap;
}

.schedule-training-row > div:first-child {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.schedule-training-cancelled {
  opacity: 0.55;
}

.schedule-training-location {
  color: var(--steel);
  font-size: 0.9rem;
}

.schedule-cancelled-badge {
  color: var(--touch);
  font-weight: 600;
  font-size: 0.85rem;
}

.schedule-invite-box {
  background: var(--paper-dim);
  color: var(--ink);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
}

.schedule-invite-box-error {
  background: var(--touch);
  color: var(--paper);
}

.schedule-invite-link {
  display: block;
  word-break: break-all;
  background: var(--paper);
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius);
  margin-top: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.9rem;
}

.schedule-training-form {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
  max-width: 520px;
  margin-top: 1.5rem;
}
.schedule-training-form label {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  color: var(--paper);
  font-size: 0.9rem;
}
.schedule-training-form input {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--steel);
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1rem;
}

.schedule-training-form select {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--steel);
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1rem;
}

.schedule-reminder-toggle {
  flex-direction: row !important;
  align-items: center;
  gap: 0.6rem !important;
}
.schedule-reminder-toggle input[type="checkbox"] {
  width: 1.15rem;
  height: 1.15rem;
  accent-color: var(--gold);
}
.schedule-training-form .btn {
  margin-top: 0.5rem;
  align-self: flex-start;
}

.schedule-form-row {
  display: flex;
  gap: 1.5rem;
}
.schedule-form-row > label {
  flex: 1;
  min-width: 0;
}

@media (max-width: 560px) {
  .schedule-form-row {
    flex-direction: column;
    gap: 1.75rem;
  }
}

.schedule-training-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.schedule-weekday-fieldset {
  border: 1px solid var(--steel);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
}
.schedule-weekday-fieldset legend {
  color: var(--paper);
  padding: 0 0.4rem;
  font-size: 0.9rem;
}

.schedule-weekday-checkboxes {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.schedule-weekday-checkbox {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--paper);
  font-size: 0.9rem;
  flex-direction: row !important;
}

/* ===== Навигация по месяцам ===== */

.schedule-month-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  margin: 1rem 0 1.5rem;
}

.schedule-month-nav-label {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
  min-width: 11rem;
  text-align: center;
}

.schedule-month-nav-link {
  color: var(--steel);
  text-decoration: none;
  white-space: nowrap;
}

.schedule-month-nav-link:hover {
  color: var(--gold);
}

/* ===== Календарная таблица расписания ===== */

.schedule-calendar {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-bottom: 2rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
}

.schedule-calendar-header, .schedule-calendar-week {
  display: grid;
  grid-template-columns: repeat(7, minmax(130px, 1fr));
  gap: 3px;
}

.schedule-calendar-header-cell {
  text-align: center;
  font-weight: 600;
  color: var(--steel);
  padding: 0.4rem;
  font-size: 0.85rem;
}
.schedule-calendar-header-cell.is-weekend { color: var(--touch); }

.schedule-calendar-day {
  background: var(--ink-light);
  border-radius: var(--radius);
  border: 1px solid transparent;
  padding: 0.5rem;
  min-height: 88px;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.schedule-calendar-day.is-weekend { background: rgba(193, 39, 45, 0.08); }
.schedule-calendar-day.is-today { border-color: var(--gold); }
.schedule-calendar-day.is-outside-range { opacity: 0.35; }

.schedule-calendar-date {
  font-size: 0.78rem;
  color: var(--steel);
  font-weight: 600;
}

.schedule-calendar-training {
  background: var(--ink);
  border-radius: 4px;
  padding: 0.3rem 0.5rem;
  font-size: 0.8rem;
}
.schedule-calendar-training.is-cancelled {
  opacity: 0.45;
  text-decoration: line-through;
}

.schedule-calendar-training-info {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.schedule-calendar-training-time {
  color: var(--gold);
  font-weight: 600;
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

.schedule-calendar-training-title {
  color: var(--paper);
  line-height: 1.25;
}

.schedule-calendar-training-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.schedule-calendar-action-link {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.85rem;
  opacity: 0.75;
  padding: 0;
  line-height: 1;
}
.schedule-calendar-action-link:hover { opacity: 1; }

.schedule-calendar-action-form { display: inline; }

.schedule-delete-group-form {
  margin-top: 0.75rem;
}
.schedule-delete-group-link {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--touch);
  opacity: 0.75;
  padding: 0;
}
.schedule-delete-group-link:hover { opacity: 1; }

.schedule-orphan-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.schedule-orphan-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  background: var(--paper-dim);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
}
.schedule-orphan-info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.schedule-orphan-role {
  font-size: 0.85rem;
  color: var(--steel);
}
.schedule-orphan-form {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

@media (max-width: 640px) {
  .schedule-calendar-header, .schedule-calendar-week {
    grid-template-columns: repeat(7, minmax(100px, 1fr));
  }
}

/* ===== «Сколько стоит новая» (цены нового в магазинах, сервис BestPrice) ===== */
.new-price-box {
  background: var(--ink-light);
  border-left: 3px solid var(--gold);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin: 0 0 1.5rem;
}
.new-price-heading { color: var(--gold); font-weight: 600; margin: 0 0 0.35rem; }
.new-price-summary { color: var(--paper); font-size: 1.05rem; margin: 0 0 0.5rem; }
.new-price-compare { color: var(--paper-dim); margin: 0 0 0.5rem; }
.new-price-compare strong { color: var(--paper); }
.new-price-compare-warn { color: var(--gold); }
.new-price-note { color: var(--steel); font-size: 0.9rem; margin: 0 0 0.5rem; }
.new-price-offers { list-style: none; margin: 0 0 0.5rem; padding: 0; }
.new-price-offers li {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.25rem 0.75rem;
  padding: 0.4rem 0; border-top: 1px solid rgba(139, 150, 160, 0.2);
}
.new-price-offers a { color: var(--paper); flex: 1 1 14rem; min-width: 0; overflow-wrap: anywhere; }
.new-price-store { color: var(--steel); font-size: 0.85rem; }
.new-price-value { color: var(--paper); font-family: var(--font-mono); white-space: nowrap; }
.new-price-oos { color: var(--steel); font-family: var(--font-body); font-size: 0.8rem; }
.new-price-footnote { color: var(--steel); font-size: 0.8rem; margin: 0; }
.new-price-inline { color: var(--paper-dim); margin: -0.25rem 0 1rem; }
.new-price-inline-note { color: var(--steel); font-size: 0.85rem; }
.new-price-subscribe { text-align: center; }

/* =====================================================================
   Главная (новая) и раздел «Лучшая цена»
   ===================================================================== */

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.eyebrow {
  margin: 0 0 0.5rem;
  color: var(--steel);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.eyebrow-gold { color: var(--gold); }

.main-nav a[aria-current="page"] { opacity: 1; color: var(--paper); box-shadow: inset 0 -2px 0 var(--gold); }
.nav-best-price { color: var(--gold); }

/* --- Кнопки --- */
.btn-gold { background: var(--gold); color: var(--ink); }
.btn-gold:hover { background: #C49E66; }
.btn-block { display: block; width: 100%; text-align: center; }

/* --- Большая поисковая строка --- */
.big-search {
  display: flex;
  gap: 0.5rem;
  background: var(--ink-light);
  border: 1px solid rgba(139, 150, 160, 0.35);
  border-radius: calc(var(--radius) + 2px);
  padding: 0.35rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.big-search:focus-within { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(176, 141, 87, 0.18); }
.big-search input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  color: var(--paper);
  font-family: var(--font-body);
  font-size: 1.05rem;
  padding: 0.65rem 0.75rem;
}
.big-search input::placeholder { color: var(--steel); }
.big-search input:focus { outline: none; }
.big-search .btn { padding: 0.7rem 1.4rem; white-space: nowrap; }
.big-search-compact input { font-size: 0.98rem; }

/* --- Чипы --- */
.chip-row { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1rem; }
.chip-row-tight { margin-top: 0.75rem; }
.chip-row-center { justify-content: center; }
.chip {
  display: inline-flex; align-items: center; gap: 0.35rem;
  padding: 0.4rem 0.8rem; border-radius: 999px;
  border: 1px solid rgba(139, 150, 160, 0.35); background: rgba(30, 61, 54, 0.6);
  color: var(--paper-dim); font-size: 0.88rem; line-height: 1.2; white-space: nowrap;
  transition: border-color 0.15s, color 0.15s;
}
.chip:hover { border-color: var(--gold); color: var(--paper); }
.chip-count { font-family: var(--font-mono); font-size: 0.75rem; color: var(--steel); }
.chip-more { color: var(--gold); border-style: dashed; }
.chip-ghost { background: transparent; }

.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.section-head .section-title { margin: 0; }
.section-link { color: var(--gold); font-size: 0.92rem; white-space: nowrap; }
.section-link:hover { text-decoration: underline; }
.home-section { margin-top: 2.5rem; }

/* --- Первый экран главной: заголовок + «две двери» (с рук / новая) --- */
.home-intro { padding: 1rem 0 1.25rem; max-width: 46rem; }
.home-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4.4vw, 3rem);
  line-height: 1.12;
  font-weight: 700;
  margin: 0 0 0.6rem;
}
.home-lead { color: var(--paper-dim); font-size: 1.05rem; margin: 0; }

.doors { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; }
.doors-single { grid-template-columns: minmax(0, 1fr); max-width: 44rem; }
.door {
  display: flex; flex-direction: column; gap: 0.85rem;
  background: var(--ink-light);
  border: 1px solid rgba(139, 150, 160, 0.2);
  border-top: 3px solid var(--success);
  border-radius: calc(var(--radius) + 2px);
  padding: 1.35rem 1.35rem 1.1rem;
  min-width: 0;
}
.door-new { border-top-color: var(--gold); background: linear-gradient(160deg, var(--ink-light), #1A3731); }
.door-head { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap; }
.door-title { font-family: var(--font-display); font-size: 1.55rem; line-height: 1.2; margin: 0; }
.nowrap { white-space: nowrap; }
.door-title-link { color: inherit; text-decoration: none; }
.door-title-link:hover, .door-title-link:focus-visible { text-decoration: underline; text-underline-offset: 0.2em; }
.door-badge {
  font-family: var(--font-mono); font-size: 0.78rem; color: var(--paper-dim);
  border: 1px solid rgba(139, 150, 160, 0.35); border-radius: 999px; padding: 0.15rem 0.6rem; white-space: nowrap;
}
.door-badge-gold { font-family: var(--font-body); color: var(--gold); border-color: rgba(176, 141, 87, 0.5); }
.door-text { margin: 0; color: var(--paper-dim); font-size: 0.95rem; }
.door .chip-row { margin-top: 0; }
.door-link { margin-top: auto; color: var(--success-light); font-size: 0.92rem; font-weight: 600; }
.door-link-gold { color: var(--gold); filter: none; }
.door-link:hover { text-decoration: underline; }
.chip-gold:hover { border-color: var(--gold); }

.sell-strip {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem 2rem; flex-wrap: wrap;
  margin-top: 1.25rem;
  background: var(--paper); color: var(--ink);
  border-left: 4px solid var(--touch);
  border-radius: calc(var(--radius) + 2px);
  padding: 1rem 1.35rem;
}
.sell-strip-title { font-family: var(--font-display); font-size: 1.25rem; margin: 0 0 0.15rem; }
.sell-strip-text p { margin: 0; color: var(--steel-dark); font-size: 0.93rem; }
.sell-strip-actions { display: flex; align-items: center; gap: 0.5rem 1rem; flex-wrap: wrap; }
.sell-strip-link { font-size: 0.88rem; color: var(--steel-dark); }
.sell-strip-link a, a.sell-strip-link { color: var(--ink); text-decoration: underline; text-underline-offset: 2px; }

/* Шапка разделов «С рук» / «Новая экипировка» */
.section-hero { max-width: 46rem; margin-bottom: 1.5rem; }
.section-hero .page-title { margin-top: 0; }
.section-hero-lead { color: var(--paper-dim); margin: 0 0 1rem; }
.cross-link { margin: 0.6rem 0 0; color: var(--steel); font-size: 0.9rem; }
.cross-link a { color: var(--gold); }
.cross-link a:hover { text-decoration: underline; }
.cross-link-top { margin: -0.5rem 0 0.5rem; }

/* --- Блок «Лучшая цена» на главной --- */
.bp-band {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 2rem;
  background: linear-gradient(135deg, var(--ink-light), #1A3731);
  border: 1px solid rgba(176, 141, 87, 0.35);
  border-radius: calc(var(--radius) + 2px);
  padding: 1.75rem;
}
.bp-band-title { font-family: var(--font-display); font-size: clamp(1.5rem, 3vw, 2rem); line-height: 1.2; margin: 0 0 0.6rem; }
.bp-band-text { color: var(--paper-dim); margin: 0 0 1.1rem; }
.bp-anchors-title { margin: 0 0 0.5rem; color: var(--steel); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.06em; }
.bp-anchors-note { text-transform: none; letter-spacing: 0; }
.anchor-list { list-style: none; margin: 0 0 0.75rem; padding: 0; }
.anchor-row {
  display: grid; grid-template-columns: 1.8rem 1fr auto; align-items: center; gap: 0.6rem;
  padding: 0.55rem 0.25rem; border-bottom: 1px solid rgba(139, 150, 160, 0.18); transition: background 0.15s;
}
.anchor-row:hover { background: rgba(176, 141, 87, 0.08); }
.anchor-icon { font-size: 1.2rem; text-align: center; }
.anchor-label { display: flex; flex-direction: column; line-height: 1.25; }
.anchor-meta { color: var(--steel); font-size: 0.78rem; }
.anchor-price { font-family: var(--font-mono); color: #C09D67; font-size: 1.05rem; white-space: nowrap; }

/* --- Как это работает --- */
.how-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.25rem; margin-top: 1rem; }
.how-item { background: var(--ink-light); border-radius: var(--radius); padding: 1.25rem 1.25rem 1rem; border: 1px solid rgba(139, 150, 160, 0.15); }
.how-num { font-family: var(--font-display); font-size: 2rem; line-height: 1; color: var(--gold); }
.how-item h3 { margin: 0.4rem 0 0.35rem; font-size: 1.05rem; }
.how-item p { margin: 0; color: var(--paper-dim); font-size: 0.92rem; }

/* --- Раздел «Лучшая цена» --- */
.bp-hero { max-width: 760px; margin: 0 auto; text-align: center; padding: 0.5rem 0 0.5rem; }
.bp-hero .chip-row { justify-content: center; }
.bp-hero-compact { text-align: left; max-width: none; }
.bp-hero-compact .bp-page-title { font-size: clamp(1.5rem, 3vw, 2rem); }
.bp-page-title { margin-top: 0; }
.bp-lead { color: var(--paper-dim); font-size: 1.05rem; margin: 0 auto 1.5rem; max-width: 40rem; }
.bp-lead strong { color: var(--paper); }
.bp-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1rem; margin-top: 0.85rem; }
.segmented { display: inline-flex; flex-wrap: wrap; border: 1px solid rgba(139, 150, 160, 0.35); border-radius: var(--radius); overflow: hidden; }
.segmented label { position: relative; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span { display: inline-block; padding: 0.45rem 0.8rem; font-size: 0.88rem; color: var(--paper-dim); cursor: pointer; }
.segmented input:checked + span { background: var(--paper); color: var(--ink); font-weight: 600; }
.segmented input:focus-visible + span { outline: 2px solid var(--gold); outline-offset: -2px; }
.toggle { display: inline-flex; align-items: center; gap: 0.45rem; font-size: 0.9rem; color: var(--paper-dim); cursor: pointer; }
.toggle input { accent-color: var(--gold); width: 1.05rem; height: 1.05rem; }
.bp-sort select {
  background: var(--ink-light); color: var(--paper); border: 1px solid rgba(139, 150, 160, 0.35);
  border-radius: var(--radius); padding: 0.45rem 0.6rem; font-family: var(--font-body); font-size: 0.88rem;
}

.bp-summary { margin: 1.5rem 0 0.75rem; }
.bp-summary-main { margin: 0; font-size: 1.05rem; }
.bp-what { font-weight: 600; }
.bp-relaxed { color: var(--gold); margin: 0.35rem 0 0; font-size: 0.92rem; }

.used-strip {
  background: rgba(193, 39, 45, 0.08);
  border-left: 3px solid var(--touch);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  margin: 0 0 1.5rem;
}
.used-strip-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap; }
.used-strip-head p { margin: 0; color: var(--paper-dim); }
.used-strip-head a { color: var(--gold); }
.ad-grid-compact { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 0.85rem; margin-top: 0.75rem; }
.ad-grid-compact .ad-card-title { font-size: 0.88rem; }

.bp-results { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.85rem; }
.bp-product {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) auto;
  gap: 1rem;
  background: var(--ink-light);
  border: 1px solid rgba(139, 150, 160, 0.15);
  border-radius: var(--radius);
  padding: 0.9rem;
}
.bp-product-image {
  width: 96px; height: 96px; border-radius: var(--radius); overflow: hidden;
  background: var(--paper); display: flex; align-items: center; justify-content: center;
}
.bp-product-image img { width: 100%; height: 100%; object-fit: contain; }
.bp-noimage { font-size: 2rem; color: var(--steel); }
.bp-product-name { font-family: var(--font-body); font-size: 1rem; font-weight: 600; margin: 0 0 0.2rem; line-height: 1.35; }
.bp-product-meta { margin: 0 0 0.5rem; color: var(--steel); font-size: 0.85rem; }
.bp-oos { color: var(--touch); }
.bp-offers { list-style: none; margin: 0; padding: 0; }
.bp-offer { border-top: 1px solid rgba(139, 150, 160, 0.15); font-size: 0.9rem; }
.bp-offer-row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto; align-items: baseline; gap: 0.75rem;
  padding: 0.4rem 0.35rem; margin: 0 -0.35rem; border-radius: var(--radius); transition: background 0.15s;
}
.bp-offer-row:hover { background: rgba(176, 141, 87, 0.1); }
.bp-offer-row:hover .bp-offer-link { text-decoration: underline; }
.bp-offer-store { color: var(--paper-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bp-offer-price { font-family: var(--font-mono); color: var(--paper); white-space: nowrap; }
.bp-offer.is-best .bp-offer-price { color: #C09D67; }
.bp-offer-stock { color: var(--steel); font-size: 0.8rem; white-space: nowrap; }
.bp-offer-link { color: var(--gold); white-space: nowrap; }

.bp-more-offers summary { cursor: pointer; color: var(--steel); font-size: 0.85rem; padding: 0.35rem 0; }
.bp-more-offers summary:hover { color: var(--paper); }
.bp-product-price { display: flex; flex-direction: column; align-items: flex-end; min-width: 7.5rem; }
.bp-from { color: var(--steel); font-size: 0.8rem; }
.bp-price { font-size: 1.35rem; white-space: nowrap; }
.bp-disclaimer { margin-top: 1.5rem; }
.bp-price-mobile { display: none; }

.store-list { list-style: none; padding: 0; margin: 0.75rem 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 0.6rem; }
.store-list li { display: flex; justify-content: space-between; gap: 0.5rem; background: var(--ink-light); border-radius: var(--radius); padding: 0.6rem 0.85rem; border: 1px solid rgba(139, 150, 160, 0.15); }
.store-name { font-weight: 600; }
.store-count { color: var(--steel); font-family: var(--font-mono); font-size: 0.8rem; }

/* --- Мобильные --- */
.bp-band-intro, .bp-anchors { min-width: 0; }
@media (max-width: 860px) {
  .doors, .bp-band { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .home-intro { padding-top: 0.5rem; }
  .door { padding: 1.1rem 1rem 1rem; }
  .door .chip-row { margin-right: -1rem; padding-right: 1rem; }
  .sell-strip { padding: 1rem; }
  .sell-strip-actions .btn { width: 100%; text-align: center; }
  .home-section .ad-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; }
  .home-section .ad-card-body { padding: 0.6rem 0.7rem 0.75rem; }
  .home-section .ad-card-title { font-size: 0.88rem; }

  .chip-row { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 0.35rem; margin-right: -1.5rem; padding-right: 1.5rem;
    scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .chip-row::-webkit-scrollbar { display: none; }
  .bp-hero .chip-row, .chip-row-center { justify-content: flex-start; }
  .big-search .btn { padding: 0.7rem 1rem; }
  .bp-band { padding: 1.25rem; }
  /* карточка: фото + название и цена в первой строке, предложения магазинов — на всю ширину ниже */
  .bp-product { grid-template-columns: 64px minmax(0, 1fr); column-gap: 0.75rem; row-gap: 0.15rem; align-items: start; }
  .bp-product-body { display: contents; }
  .bp-product-image { width: 64px; height: 64px; grid-row: 1 / span 3; }
  .bp-product-name, .bp-price-mobile, .bp-product-meta { grid-column: 2; }
  .bp-offers, .bp-more-offers { grid-column: 1 / -1; }
  .bp-offers { margin-top: 0.5rem; }
  .bp-product-price { display: none; }
  .bp-price-mobile { display: block; margin: 0 0 0.35rem; font-size: 1.1rem; }
  .bp-offer-row { grid-template-columns: minmax(0, 1fr) auto auto; padding: 0.55rem 0.35rem; }
  .bp-offer-stock { display: none; }
  .bp-hero { text-align: left; }
  .bp-hero .chip-row { justify-content: flex-start; }
}

/* Страница «Как мы собираем цены» (/bot) */
.bot-ua {
    white-space: pre-wrap;
    word-break: break-word;
    font-family: var(--font-mono);
    background: var(--paper-dim);
    color: var(--ink);
    border-radius: var(--radius);
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    overflow-x: auto;
}
.new-price-footnote a { white-space: nowrap; }
.static-page code { font-family: var(--font-mono); color: var(--paper); }

/* Фильтр по магазинам в «Новой экипировке» */
.bp-stores { position: relative; }
.bp-stores summary {
  list-style: none; cursor: pointer; user-select: none;
  padding: 0.45rem 0.8rem; font-size: 0.88rem; color: var(--paper-dim);
  background: var(--ink-light); border: 1px solid rgba(139, 150, 160, 0.35); border-radius: var(--radius);
}
.bp-stores summary::-webkit-details-marker { display: none; }
.bp-stores summary::after { content: " ▾"; color: var(--steel); }
.bp-stores[open] summary::after { content: " ▴"; }
.bp-stores.is-active summary { border-color: var(--gold); color: var(--paper); font-weight: 600; }
.bp-stores summary:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.bp-stores-panel {
  position: absolute; z-index: 30; top: calc(100% + 0.4rem); left: 0;
  width: max-content; min-width: 260px; max-width: min(360px, calc(100vw - 2rem));
  background: var(--ink-light); border: 1px solid rgba(139, 150, 160, 0.35); border-radius: var(--radius);
  padding: 0.75rem 0.9rem; box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
}
.bp-stores-hint { margin: 0 0 0.35rem; font-size: 0.82rem; color: var(--steel); }
.bp-stores-list { list-style: none; margin: 0 0 0.75rem; padding: 0; max-height: min(460px, 60vh); overflow-y: auto; }
.bp-stores-list li { padding: 0.28rem 0; }
.bp-stores-list .toggle { display: flex; width: 100%; }
.bp-stores-list .chip-count { margin-left: auto; padding-left: 0.75rem; }
.bp-stores-actions { display: flex; align-items: center; gap: 1rem; }
.bp-stores-reset { font-size: 0.88rem; color: var(--gold); }
.bp-store-note { margin: 0.35rem 0 0; font-size: 0.9rem; color: var(--paper-dim); }
.bp-store-note a { color: var(--gold); }
@media (max-width: 640px) {
  .bp-stores { width: 100%; }
  .bp-stores summary { display: block; }
  .bp-stores-panel { position: static; width: auto; max-width: none; margin-top: 0.4rem; box-shadow: none; }
  .bp-stores-list { max-height: none; }
}

/* ===== «Что умеет …» — блиц по возможностям (главная, «О проекте») ===== */
.bz { margin-top: 2.75rem; }
.bz-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 0.75rem 1.5rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.bz-title { font-family: var(--font-display); font-size: clamp(1.55rem, 3vw, 2.1rem); line-height: 1.15; margin: 0; }
.bz-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.bz-card {
  position: relative; display: flex; flex-direction: column; min-width: 0;
  background: var(--ink-light); border: 1px solid rgba(139, 150, 160, 0.18); border-radius: 14px;
  padding: 1.3rem 1.3rem 0; overflow: hidden; min-height: 300px; color: var(--paper); text-decoration: none;
  transition: border-color 0.15s, transform 0.15s;
}
.bz-card:hover { border-color: rgba(176, 141, 87, 0.6); transform: translateY(-2px); }
.bz-card:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.bz-card h3 { margin: 0 0 0.35rem; font-size: 1.08rem; font-weight: 600; font-family: var(--font-body); }
.bz-card > p { margin: 0; font-size: 0.9rem; color: #A7B0AE; line-height: 1.45; }
.bz-visual { margin-top: auto; padding-top: 1.1rem; }
.bz-screen {
  background: #122824; border: 1px solid rgba(139, 150, 160, 0.22); border-bottom: none;
  border-radius: 12px 12px 0 0; padding: 0.85rem 0.95rem; height: 158px; overflow: hidden;
  font-size: 0.8rem; line-height: 1.35; box-shadow: 0 -8px 26px rgba(0, 0, 0, 0.2);
}
.bz-mono { font-family: var(--font-mono); }
.bz-muted { color: #8B96A0; }
.bz-right { text-align: right; }
.bz-row { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.bz-row + .bz-row { margin-top: 0.45rem; }
.bz-ad-title { font-weight: 600; font-size: 0.86rem; color: var(--paper); }
.bz-ad-price { font-family: var(--font-mono); color: #C09D67; font-size: 0.95rem; white-space: nowrap; }
.bz-ad-meta { margin: 0.2rem 0 0.6rem; }
.bz-check { color: #7FD39A; font-weight: 700; }
.bz-bar { height: 8px; border-radius: 999px; background: rgba(139, 150, 160, 0.25); overflow: hidden; margin: 0.55rem 0 0.4rem; }
.bz-bar > span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #4A7C59, #B08D57); }
.bz-percent { font-family: var(--font-mono); font-size: 1.5rem; color: #E2C48F; line-height: 1; }
.bz-chat { background: #0E1621; border-color: rgba(106, 179, 243, 0.18); }
.bz-bubble { background: #182533; color: #E8EEF2; border-radius: 12px 12px 12px 4px; padding: 0.55rem 0.7rem; max-width: 94%; font-size: 0.78rem; }
.bz-bubble b { color: #fff; }
.bz-bubble-me { background: #2B5278; border-radius: 12px 12px 4px 12px; margin-left: auto; }
.bz-bubble + .bz-bubble { margin-top: 0.4rem; }
.bz-tg-btn { margin-top: 0.4rem; text-align: center; background: rgba(106, 179, 243, 0.14); color: #9CCBF5; border-radius: 8px; padding: 0.3rem; font-size: 0.76rem; }
.bz-time { float: right; margin: 0.25rem 0 0 0.5rem; font-size: 0.66rem; color: #BCC6D0; }
.bz-offers-title { margin-bottom: 0.5rem; }
.bz-offers-note { margin-top: 0.45rem; }
.bz-offer { display: grid; grid-template-columns: 1fr auto auto; gap: 0.6rem; align-items: center; padding: 0.42rem 0.55rem; border-radius: 8px; background: rgba(237, 231, 217, 0.04); }
.bz-offer + .bz-offer { margin-top: 0.35rem; }
.bz-offer-best { background: rgba(176, 141, 87, 0.14); outline: 1px solid rgba(176, 141, 87, 0.45); }
.bz-offer .p { font-family: var(--font-mono); color: #C09D67; white-space: nowrap; }
.bz-tag { font-size: 0.66rem; padding: 0.1rem 0.4rem; border-radius: 999px; background: var(--gold); color: var(--ink); font-weight: 700; }
.bz-seg { display: inline-flex; border: 1px solid rgba(139, 150, 160, 0.35); border-radius: 6px; overflow: hidden; }
.bz-seg span { padding: 0.28rem 0.6rem; font-size: 0.76rem; color: var(--paper-dim); }
.bz-seg span.on { background: var(--paper); color: var(--ink); font-weight: 600; }
.bz-pills { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.6rem; }
.bz-pill {
  display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.22rem 0.55rem; border-radius: 999px;
  border: 1px solid rgba(139, 150, 160, 0.35); color: var(--paper-dim); font-size: 0.74rem; white-space: nowrap;
}
.bz-pill-on { border-color: rgba(74, 124, 89, 0.9); background: rgba(74, 124, 89, 0.22); color: #CFE8D6; }
.bz-act { margin-top: 0.6rem; background: rgba(237, 231, 217, 0.07); border: 1px solid rgba(139, 150, 160, 0.25); border-radius: 8px; padding: 0.35rem 0.55rem; font-size: 0.78rem; color: var(--paper-dim); }
.bz-login { background: var(--paper); color: var(--ink); border-radius: 10px; padding: 0.75rem; text-align: center; }
.bz-login-title { font-family: var(--font-display); font-size: 1rem; margin-bottom: 0.5rem; }
.bz-login-btn { display: block; border-radius: 8px; padding: 0.42rem; font-weight: 600; font-size: 0.8rem; color: #fff; }
.bz-login-btn + .bz-login-btn { margin-top: 0.35rem; }
.bz-tg { background: #1E7BAB; }
.bz-max { background: #4A4DE6; }
@media (max-width: 860px) {
  .bz-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  /* карточки листаются пальцем: видна текущая и край следующей */
  .bz-grid { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 0.75rem; padding-bottom: 0.5rem; scrollbar-width: none; }
  .bz-grid::-webkit-scrollbar { display: none; }
  .bz-grid > .bz-card { flex: 0 0 84%; scroll-snap-align: start; min-height: 290px; }
  .bz-card:hover { transform: none; }
}
@media (prefers-reduced-motion: reduce) { .bz-card { transition: none; } .bz-card:hover { transform: none; } }


/* ===== Посадочные страницы «Новой экипировки» (/best-price/maski и т.п.) ===== */
.chip-active { background: var(--gold); color: var(--ink); border-color: var(--gold); font-weight: 600; }
.chip-active .chip-count { color: var(--ink); }
.landing-stats strong { color: var(--paper); }
.landing-checked { display: inline-block; color: var(--steel); font-size: 0.9rem; }
.bp-hero .chip-row { margin-top: 0.9rem; }
.landing-text { max-width: 760px; margin: 1.5rem 0 1rem; color: var(--paper); line-height: 1.6; }
.landing-text p { margin: 0 0 0.75rem; }
.landing-more { margin: 1rem 0 0; text-align: center; }
.landing-tips ul { max-width: 760px; margin: 0.75rem 0 0; padding-left: 1.2rem; line-height: 1.6; }
.landing-tips li { margin-bottom: 0.55rem; }
.landing-bu p { max-width: 760px; line-height: 1.6; }
.landing-subtitle { font-family: var(--font-body); font-size: 1rem; font-weight: 600; color: var(--steel); margin: 1.25rem 0 0.25rem; }
/* Б/у категория: живая статистика и текст о категории */
.category-stats { color: var(--paper); margin: 0.25rem 0 0.75rem; line-height: 1.55; }
.category-stats strong { color: var(--gold); }
.category-intro { max-width: 760px; margin: 0 0 1rem; line-height: 1.6; color: var(--paper); }
.category-about { max-width: 760px; margin-top: 2.5rem; line-height: 1.6; color: var(--paper); }
.category-about p { margin: 0 0 0.75rem; }
.category-about .section-link, .landing-bu .section-link, .landing-more .btn { white-space: normal; }
/* На посадочных всё в шапке — по левому краю, как заголовок */
.bp-hero-compact .bp-lead { margin: 0.25rem 0 0.5rem; max-width: none; }
.bp-hero-compact .chip-row { justify-content: flex-start; }

/* ===== Статьи (/guides): гайды с живыми ценами ===== */
.guide { max-width: 760px; color: var(--paper); line-height: 1.7; }
.guide-header { margin-top: 0.5rem; }
.guide-title, .guide-index-header .page-title { margin-bottom: 0.5rem; line-height: 1.2; }
.guide-lead { color: var(--paper-dim); font-size: 1.1rem; line-height: 1.55; margin: 0 0 0.75rem; max-width: 46rem; }
.guide-meta { color: var(--steel); font-size: 0.9rem; margin: 0 0 1.5rem; }
.guide h2 { font-family: var(--font-display); font-size: 1.45rem; line-height: 1.3; margin: 2.25rem 0 0.6rem; }
.guide h3 { font-family: var(--font-body); font-size: 1.05rem; font-weight: 600; margin: 1.5rem 0 0.4rem; }
.guide p { margin: 0 0 0.9rem; }
.guide ul, .guide ol { padding-left: 1.3rem; margin: 0.4rem 0 1.1rem; }
.guide li { margin-bottom: 0.45rem; }
.guide strong { color: var(--paper); }
.guide a { color: var(--gold); text-decoration: underline; text-underline-offset: 2px; }
.guide a:hover { color: var(--paper); }
.guide-toc { border-left: 3px solid var(--gold); padding: 0.25rem 0 0.25rem 1rem; margin: 0 0 1.5rem; }
.guide-toc p { margin: 0 0 0.3rem; color: var(--steel); font-size: 0.9rem; }
.guide-toc ol { margin: 0; }
.guide-toc li { margin-bottom: 0.2rem; }
/* Врезка: важное и «не делайте так» */
.guide-note { background: var(--ink-light); border-left: 4px solid var(--gold); border-radius: var(--radius); padding: 0.8rem 1rem; margin: 1.1rem 0; }
.guide-note p:last-child { margin-bottom: 0; }
.guide-note-warn { border-left-color: var(--touch); }
/* Блок живых цен */
.guide-price { background: var(--ink-light); border: 1px solid rgba(189, 159, 114, 0.35); border-radius: var(--radius); padding: 0.75rem 1rem; margin: 1rem 0 1.25rem; }
.guide-price p { margin: 0 0 0.3rem; }
.guide-price p:last-child { margin-bottom: 0; }
.guide-price-label { font-weight: 600; color: var(--paper); }
.guide-price-note { font-weight: 400; color: var(--steel); }
.guide-price-line { color: var(--paper-dim); }
.guide-price-line strong { color: var(--gold); }
.guide-price-meta { color: var(--steel); font-size: 0.9rem; }
.guide .guide-price-link { white-space: nowrap; font-size: 0.95rem; }
.guide-price-na { color: var(--steel); }
/* Таблицы: на телефоне прокручиваются внутри блока, страница не ездит */
.guide-table-wrap { overflow-x: auto; margin: 1rem 0 1.4rem; -webkit-overflow-scrolling: touch; }
.guide-table { width: 100%; border-collapse: collapse; font-size: 0.95rem; min-width: 420px; }
.guide-table caption { text-align: left; color: var(--steel); font-size: 0.9rem; padding-bottom: 0.4rem; }
.guide-table th, .guide-table td { text-align: left; padding: 0.5rem 0.6rem; border-bottom: 1px solid rgba(153, 163, 171, 0.25); vertical-align: top; }
.guide-table thead th { color: var(--steel); font-weight: 600; font-size: 0.85rem; }
.guide-table tbody th { font-weight: 400; }
.guide-table td { font-family: var(--font-mono); font-size: 0.9rem; white-space: nowrap; }
.guide-table tfoot th, .guide-table tfoot td { border-bottom: none; padding-top: 0.7rem; color: var(--paper); }
.guide-table-text td { font-family: var(--font-body); white-space: normal; font-size: 0.95rem; }
.guide-muted { color: var(--steel); font-family: var(--font-body); }
/* Чек-листы */
.guide-check { list-style: none; padding-left: 0; }
.guide-check li { position: relative; padding-left: 1.7rem; }
.guide-check li::before { content: "☐"; position: absolute; left: 0; top: 0; color: var(--gold); }
/* Частые вопросы */
.guide-faq { margin-top: 2rem; }
.guide-faq details { border-bottom: 1px solid rgba(153, 163, 171, 0.25); padding: 0.6rem 0; }
.guide-faq summary { cursor: pointer; font-weight: 600; color: var(--paper); }
.guide-faq details p { margin: 0.5rem 0 0.2rem; color: var(--paper-dim); }
.guide-disclaimer { margin-top: 2rem; }
/* Карточки статей: список раздела и «Читайте также» */
.guide-index-header { max-width: 760px; }
.guide-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; margin-top: 1rem; }
.guide-cards-index { margin-top: 1.5rem; }
.guide-card { display: flex; flex-direction: column; gap: 0.4rem; background: var(--ink-light); border: 1px solid rgba(153, 163, 171, 0.25); border-radius: var(--radius); padding: 1rem 1.1rem; color: var(--paper); transition: border-color 0.15s; }
.guide-card:hover { border-color: var(--gold); }
.guide-card-emoji { font-size: 1.6rem; line-height: 1; }
.guide-card-title { font-family: var(--font-display); font-size: 1.15rem; line-height: 1.3; }
.guide-card-lead { color: var(--paper-dim); font-size: 0.92rem; line-height: 1.5; }
.guide-card-meta { color: var(--steel); font-size: 0.85rem; margin-top: auto; }
/* Ссылка на статью с посадочной и со страницы категории */
.guide-teaser { max-width: 760px; margin: 1.25rem 0 0; color: var(--paper-dim); }
.guide-teaser a { color: var(--gold); text-decoration: underline; text-underline-offset: 2px; }
@media (max-width: 640px) {
  .guide h2 { font-size: 1.25rem; }
  .guide .guide-price-link { white-space: normal; }
}


/* --- theme --- */
/* Тема skiswap.ru — поверх style.css: палитра «сумерки в горах» и метки сложности трасс вместо разметки дорожки. */
:root {
  --ink: #16232E;        /* фон — глубокий сумеречный синий склона */
  --ink-light: #1E2F3D;
  --paper: #F2F6F5;      /* карточки — холодный снежный оттенок */
  --paper-dim: #E3EAEC;
  --steel: #93A1AC;      /* второстепенный текст, рамки (контраст AA на тёмном фоне) */
  --steel-dark: #52606B;
  --touch: #D6553F;      /* акцент — альпийское зарево на снегу */
  --success: #3F7A5A;    /* «вперёд» — хвойный зелёный (контраст AA для белого текста) */
  --success-light: #8EBFA3;
  --success-dark: #33664A;
  --touch-dark: #B8432F;
  --gold: #6FA8C9;       /* второстепенный акцент — ледниковый голубой */
}

/* Фирменный элемент: метки сложности трассы — зелёный кружок и красный ромб */
.piste-line { height: 1px; margin: 1.75rem 0; opacity: 0.45; }
.piste-line::before {
  top: 50%; left: 10%; width: 7px; height: 7px; background: var(--success);
  border-radius: 50%; transform: translate(-50%, -50%);
}
.piste-line::after {
  top: 50%; left: 90%; right: auto; width: 8px; height: 8px; background: var(--touch);
  border-radius: 0; transform: translate(-50%, -50%) rotate(45deg);
}
