/* База сенбернаров — вариант Б «справочник». Цвета и шрифты из принятых макетов. */
:root {
  --ink: #1E1A16;
  --ink-2: #4A4038;
  --muted: #665B50;
  --line: #E6DFD5;
  --line-2: #EFE9E1;
  --field: #CFC5B8;
  --paper: #FFFFFF;
  --sand: #F7F4EF;
  --sand-2: #FBFAF8;
  --accent: #8F3F12;
  --accent-dark: #6E2F0B;
  --chip: #F3E6DA;
  --male: #1F4E79;
  --female: #C2662D;
  --warn-line: #C98A2B;
  --warn-bg: #FCEFD6;
  --serif: "PT Serif", Georgia, serif;
  --sans: Manrope, system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--sans); font-size: 16px; line-height: 1.5; }
a { color: var(--accent); }
a:hover { color: var(--accent-dark); }
h1, h2, h3 { font-family: var(--serif); line-height: 1.15; margin: 0; }
h1 { font-size: clamp(28px, 5vw, 40px); }
h2 { font-size: clamp(22px, 3.5vw, 28px); }
img { max-width: 100%; }
button, input { font: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.wrap { max-width: 1200px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 640px) { .wrap { padding: 0 24px; } }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.tiny { font-size: 13px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.between { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hp { display: none !important; }

/* Шапка и подвал */
.test-banner { background: var(--warn-bg); border-bottom: 1px solid var(--warn-line); color: var(--ink); text-align: center; font-size: 14px; padding: 8px 40px; position: relative; }
.test-banner .tb-short { display: none; }
.tb-hidden .test-banner { display: none; }
.tb-close { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 32px; height: 32px; border: 0; background: none; font-size: 22px; line-height: 1; color: var(--ink-2); }
.site-header { border-bottom: 1px solid var(--line); background: var(--paper); }
.hdr { display: flex; align-items: center; gap: 12px 24px; padding-top: 12px; padding-bottom: 12px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); flex: none; }
.brand:hover { color: var(--ink); }
.brand-name { display: block; font-family: var(--serif); font-weight: 700; font-size: 21px; line-height: 1.15; }
.brand-sub { display: block; font-size: 12px; color: var(--muted); line-height: 1.2; }
.menu { display: flex; align-items: center; gap: 12px 24px; flex: 1; min-width: 0; }
.nav { display: flex; gap: 4px 22px; align-items: center; font-weight: 600; font-size: 15px; }
.nav > a, .dd > summary { white-space: nowrap; text-decoration: none; color: var(--ink); padding: 10px 0; border-bottom: 2px solid transparent; }
.nav > a:hover, .dd > summary:hover { color: var(--accent); }
.nav .current { color: var(--accent); border-bottom-color: var(--accent); }
.hdr-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.hdr-actions .btn { min-height: 40px; padding: 8px 16px; white-space: nowrap; }
.hdr-actions form { margin: 0; }
.only-mobile { display: none; }
.nav .m-only { display: none; }
.hdr-icon { display: none; align-items: center; justify-content: center; gap: 6px; min-width: 44px; min-height: 44px; padding: 0 8px; border: 1px solid var(--field); border-radius: 8px; background: var(--paper); color: var(--ink); font-weight: 600; font-size: 15px; text-decoration: none; }
.hdr-icon:hover { color: var(--accent); }
/* Выпадающие меню: «Инструменты», аккаунт. */
.dd { position: relative; }
.dd > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; user-select: none; }
.dd > summary::-webkit-details-marker { display: none; }
.dd > summary::after { content: ""; width: 7px; height: 7px; border: solid currentColor; border-width: 0 2px 2px 0; transform: rotate(45deg) translateY(-2px); margin-left: 2px; }
.dd ul { position: absolute; z-index: 20; top: calc(100% + 6px); left: 0; min-width: 210px; list-style: none; margin: 0; padding: 6px; background: var(--paper); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 24px rgba(30, 26, 22, .12); font-weight: 600; font-size: 15px; }
.dd-right ul { left: auto; right: 0; }
.dd li a, .dd li button { display: flex; align-items: center; gap: 6px; width: 100%; padding: 10px 12px; border-radius: 6px; color: var(--ink); text-decoration: none; background: none; border: 0; text-align: left; font: inherit; }
.dd li a:hover, .dd li button:hover { background: var(--sand); color: var(--ink); }
.account > summary { min-height: 40px; padding: 6px 12px; border: 1px solid var(--field); border-radius: 8px; font-weight: 600; font-size: 15px; }
.account > summary.current { border-color: var(--accent); }
.acc-name { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Узкий экран: логотип, поиск и «Меню»; пункты — выпадающей панелью. */
@media (max-width: 1440px) {
  .brand-sub { display: none; }
  .nav { gap: 4px 18px; }
}
@media (max-width: 1100px) {
  .nav { gap: 4px 16px; }
  .btn-add { display: none; }
}
@media (max-width: 900px) {
  .hdr { flex-wrap: wrap; gap: 8px; padding-top: 8px; padding-bottom: 8px; }
  .brand { margin-right: auto; }
  .brand svg { width: 30px; height: 30px; }
  .brand-name { font-size: 18px; }
  .only-mobile, .hdr-icon { display: inline-flex; }
  .menu { display: none; flex-basis: 100%; flex-direction: column; align-items: stretch; gap: 0; padding: 8px 0 12px; border-top: 1px solid var(--line-2); }
  html.js .menu.open, html:not(.js) .menu { display: flex; }
  .nav { flex-direction: column; align-items: stretch; gap: 0; font-size: 17px; }
  .nav > a, .nav .dd > summary { padding: 12px 4px; border-bottom: 1px solid var(--line-2); }
  .nav .current { border-bottom-color: var(--line-2); }
  .nav .dd { display: none; }
  .nav .m-only { display: block; }
  .hdr-actions { margin: 14px 0 0; flex-wrap: wrap; gap: 10px; }
  .btn-add { display: inline-flex; }
  .test-banner .tb-full { display: none; }
  .test-banner .tb-short { display: inline; }
  .test-banner { font-size: 13px; padding: 6px 40px; }
}
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 18px; border-radius: 8px; border: 0; background: var(--accent); color: #fff; font-weight: 700; text-decoration: none; }
.btn:hover { color: #fff; background: var(--accent-dark); }
.btn-ghost { background: var(--paper); color: var(--ink); border: 1px solid var(--field); font-weight: 600; }
.btn-ghost:hover { color: var(--ink); background: var(--sand); }
.btn-edit { align-self: flex-start; min-height: 38px; padding: 6px 14px; font-size: 14px; }
.site-footer { border-top: 1px solid var(--line); background: var(--sand); margin-top: 56px; }
.site-footer .wrap { padding-top: 28px; padding-bottom: 28px; display: flex; flex-wrap: wrap; gap: 12px 32px; justify-content: space-between; font-size: 14px; color: var(--ink-2); }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.site-footer .footer-note { flex-basis: 100%; margin: 0; font-size: 12px; color: var(--ink-3, var(--ink-2)); }
body { min-height: 100vh; display: flex; flex-direction: column; }
main { display: block; flex: 1 0 auto; }
.page { padding-top: 24px; display: flex; flex-direction: column; gap: 36px; }
.narrow { max-width: 760px; }
.err-code { margin: 0; font-family: var(--serif); font-size: 72px; line-height: 1; color: var(--accent); }
.crumbs { font-size: 14px; color: var(--muted); }

/* Поиск на главной */
.hero { background: var(--sand); border-bottom: 1px solid var(--line); }
.hero .wrap { padding-top: 48px; padding-bottom: 56px; display: flex; flex-direction: column; gap: 18px; }
.hero h1 { font-size: clamp(30px, 6vw, 44px); max-width: 760px; }
.lead { margin: 0; font-size: 18px; color: var(--ink-2); max-width: 680px; }
.searchbox { position: relative; max-width: 720px; margin-top: 8px; }
.searchbox label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 8px; }
.searchbox .fields { display: flex; gap: 8px; }
.searchbox input { flex: 1; min-width: 0; font-size: 18px; padding: 13px 16px; border: 1px solid var(--field); border-radius: 10px; background: var(--paper); color: var(--ink); }
.searchbox .btn { border-radius: 10px; min-height: 52px; padding: 0 22px; }
.suggest { list-style: none; margin: 6px 0 0; padding: 6px; background: var(--paper); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 24px rgba(30, 26, 22, .10); }
.suggest[hidden] { display: none; }
.suggest a, .result { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px; padding: 12px; border-radius: 8px; text-decoration: none; color: var(--ink); }
.suggest a:hover, .suggest a[aria-selected="true"], .result:hover { background: var(--sand); color: var(--ink); }
.r-title { font-weight: 700; display: block; }
.r-sub { font-size: 14px; color: var(--muted); display: block; }
.r-meta { font-size: 14px; color: var(--muted); align-self: center; }
.results { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 12px; }
.results li + li { border-top: 1px solid var(--line-2); }
.result-dog { flex-wrap: nowrap; align-items: center; gap: 0 14px; }
.result-dog .card-ico { width: 48px; height: 48px; }
.result-dog .r-body { flex: 1; min-width: 0; }
@media (max-width: 560px) { .result-dog { flex-wrap: wrap; } .result-dog .r-body { flex-basis: calc(100% - 64px); } .result-dog .r-meta { margin-left: 62px; } }
.filters summary { cursor: pointer; font-weight: 600; color: var(--accent); }
.filter-form { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: flex-end; margin-top: 12px; padding: 16px; background: var(--sand); border-radius: 12px; }
.filter-form label { display: flex; flex-direction: column; gap: 4px; font-size: 14px; font-weight: 600; }
.filter-form select, .filter-form input { max-width: 100%; min-height: 40px; padding: 6px 10px; border: 1px solid var(--field); border-radius: 8px; background: var(--paper); font: inherit; font-weight: 400; }
.filter-form input[type=number] { width: 96px; }
.note { margin: 0; font-size: 13px; color: var(--muted); }

/* Плитки */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; padding-top: 40px; }
.stat { border: 1px solid var(--line); border-radius: 12px; padding: 20px 22px; display: flex; flex-direction: column; gap: 4px; }
.stat b { font-family: var(--serif); font-size: 36px; color: var(--accent); line-height: 1.1; }
@media (max-width: 560px) {
  .stats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat { padding: 14px; }
  .stat b { font-size: 28px; }
  .stat span { font-size: 14px; }
}
.stat span { color: var(--ink-2); }
.section { padding-top: 40px; display: flex; flex-direction: column; gap: 18px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.card { display: flex; gap: 14px; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: 12px; text-decoration: none; color: var(--ink); background: var(--paper); }
.card:hover { color: var(--ink); border-color: var(--field); }
.card-ico { width: 56px; height: 56px; flex: none; border-radius: 10px; background: var(--sand); display: flex; align-items: center; justify-content: center; }
.card-ico img { width: 100%; height: 100%; object-fit: cover; border-radius: 10px; display: block; }
.card-name { font-weight: 700; font-size: 15px; line-height: 1.25; display: block; }
.card-meta { font-size: 13px; color: var(--muted); display: block; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px; }
.gallery a { display: flex; flex-direction: column; gap: 8px; text-decoration: none; color: var(--ink); }
.gallery .ph { aspect-ratio: 3 / 4; border-radius: 12px; }

/* Фото в рамке: целиком, поля — размытая копия (blur) или фон (plain), либо обрезка (crop).
   Режим выбирается в «Настройках сайта». */
.ph { position: relative; display: block; overflow: hidden; background: var(--sand); }
.ph img { position: relative; width: 100%; height: 100%; object-fit: contain; display: block; }
.frame-blur .ph img, .frame-plain .ph img { object-position: 50% 50% !important; }
.frame-blur .ph::before { content: ""; position: absolute; inset: -16px; background: var(--ph) center / cover no-repeat; filter: blur(14px) brightness(.92); }
.frame-crop .ph img { object-fit: cover; }

/* Карточка собаки */
.dog-top { display: flex; flex-wrap: wrap; gap: 32px; }
.dog-photos { flex: 1 1 320px; max-width: 460px; display: flex; flex-direction: column; gap: 10px; }
/* Главное фото — в родных пропорциях, без обрезки: и вертикальное, и горизонтальное. */
.dog-photos .main { width: 100%; height: auto; max-height: 80vh; object-fit: contain; border-radius: 14px; background: var(--sand); display: block; }
.dog-photos .noimg { width: 100%; aspect-ratio: 4 / 3; border-radius: 14px; background: var(--sand); display: flex; align-items: center; justify-content: center; color: var(--muted); }
.thumbs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.thumbs button { border: 2px solid transparent; padding: 2px; background: var(--paper); border-radius: 9px; }
.thumbs button[aria-pressed="true"] { border-color: var(--accent); }
.thumbs .ph { aspect-ratio: 1; border-radius: 6px; }
.dog-info { flex: 999 1 420px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.kicker { font-size: 14px; font-weight: 600; color: var(--accent); }
.alt-name { font-size: 20px; color: var(--ink-2); }
.chip { background: var(--sand); color: var(--ink-2); font-size: 14px; padding: 6px 12px; border-radius: 999px; }
.chip-strong { background: var(--chip); color: var(--accent-dark); font-weight: 600; }
.facts { margin: 0; display: grid; grid-template-columns: minmax(130px, max-content) 1fr; gap: 10px 24px; border-top: 1px solid var(--line); padding-top: 18px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.share { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; background: var(--sand); border-radius: 12px; padding: 12px 14px; }
.share code { font-size: 14px; background: var(--paper); border: 1px solid var(--line); border-radius: 6px; padding: 4px 8px; overflow-wrap: anywhere; }
.share .btn { margin-left: auto; min-height: 40px; padding: 8px 14px; }
.parents { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.parent { border: 1px solid var(--line); border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.parent-label { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.parent-label.s { color: var(--male); }
.parent-label.m { color: var(--accent); }
.dlink { text-decoration: none; color: var(--ink); display: flex; gap: 8px; align-items: center; }
.dlink:hover { color: var(--accent-dark); }
.dlink:hover .t { text-decoration: underline; text-underline-offset: 3px; }
.dlink .t::after { content: " →"; color: var(--accent); font-weight: 600; opacity: 0; transition: opacity .15s; }
.dlink:hover .t::after, .dlink:focus-visible .t::after { opacity: 1; }
.dlink img { width: 36px; height: 36px; object-fit: cover; border-radius: 6px; flex: none; }
.dlink .t { font-weight: 700; display: block; }
.dlink .m { color: var(--muted); font-size: 14px; display: block; }
.parent > .dlink .t { font-size: 18px; }
.grand { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; border-top: 1px solid var(--line-2); padding-top: 12px; font-size: 14px; }
.grand .t { font-weight: 600; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill { text-decoration: none; color: var(--ink); border: 1px solid var(--line); border-radius: 999px; padding: 8px 14px; font-size: 14px; display: inline-flex; gap: 8px; align-items: center; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; }
.dot.s { background: var(--male); }
.dot.m { background: var(--female); }
.sex { font-weight: 700; line-height: 1; flex: none; font-family: "Segoe UI Symbol", "DejaVu Sans", "Noto Sans Symbols", sans-serif; font-size: 1.15em; }
.sex.s { color: var(--male); }
.sex.m { color: var(--female); }
.node > .dot { display: none; }
.node .sex { font-size: 17px; }
.legend { font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 16px; }
.legend span { display: inline-flex; gap: 6px; align-items: center; }
.locked { border: 1px solid var(--warn-line); border-radius: 14px; padding: 18px 20px; display: flex; flex-wrap: wrap; gap: 14px 20px; align-items: center; background: var(--warn-bg); }
.locked .lock-ico { color: var(--accent); display: flex; flex: none; }
.locked .txt { flex: 1 1 260px; display: flex; flex-direction: column; gap: 4px; }
.locked .txt .small { color: var(--ink-2); }
.locked .row { flex: none; }
.preview { margin: 0; border: 1px dashed var(--field); border-radius: 14px; padding: 16px; background: var(--sand-2); display: flex; flex-direction: column; gap: 12px; }
.preview figcaption { font-size: 13px; color: var(--muted); }
.pv-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.pv-stats span { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: var(--paper); display: flex; flex-direction: column; gap: 6px; }
.pv-stats b { font-family: var(--serif); color: var(--accent); font-size: 22px; line-height: 1; }
.pv-stats i, .pv-col i { display: block; height: 8px; border-radius: 4px; background: var(--line); }
.pv-list { display: flex; flex-direction: column; gap: 8px; }
.pv-list span { display: grid; grid-template-columns: 48px 1fr; gap: 6px 12px; align-items: center; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: var(--paper); }
.pv-list b { grid-row: span 2; font-family: var(--serif); color: var(--accent); font-size: 22px; }
.pv-list i { display: block; height: 8px; border-radius: 4px; background: var(--line); }
.pv-list i.short { width: 55%; }
.pv-tree { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; align-items: center; }
.pv-col { display: flex; flex-direction: column; justify-content: space-around; gap: 6px; height: 120px; }
.pv-col i { height: 14px; background: var(--paper); border: 1px solid var(--line); }
.litters { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.litter { display: flex; flex-wrap: wrap; gap: 6px 24px; padding: 14px 18px; }
.litter + .litter { border-top: 1px solid var(--line-2); }
.litter .when { flex: 0 0 150px; font-weight: 700; }
.litter .who { flex: 1 1 260px; display: flex; flex-direction: column; gap: 4px; }
.h2-count { font-family: var(--sans); font-size: 16px; color: var(--muted); font-weight: 500; }

/* Родословная */
.ped-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; background: var(--sand-2); }
.ped { min-width: 1100px; padding: 14px 14px 18px; display: flex; flex-direction: column; gap: 10px; --leaves: 16; --cols: 5; }
.ped-head, .ped-grid { display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); gap: 12px; }
.ped-head { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.ped-grid { height: calc(var(--leaves) * 86px); }
.ped.cols-4 { --leaves: 8; } .ped.cols-3 { --leaves: 8; min-width: 880px; } .ped.cols-2 { --leaves: 4; min-width: 700px; } .ped.cols-1 { --leaves: 2; min-width: 600px; }
.ped.with-lock.cols-3 { --cols: 4; } .ped.with-lock.cols-2 { --cols: 3; } .ped.with-lock.cols-1 { --cols: 2; } .ped.with-lock.cols-4 { --cols: 5; }
.ped-lockcol { justify-content: center; }
.ped-lockcol .locked { flex-direction: column; align-items: flex-start; }
.ped-lockcol .locked .txt { flex: none; }
/* Телефон: та же сетка, что на компьютере и в бумажной родословной (отец сверху, мать снизу,
   поколения колонками), только компактнее; дальние поколения — прокруткой вбок. */
.ped-hint { display: none; }
@media (max-width: 700px) {
  .ped-hint { display: block; font-size: 13px; color: var(--muted); margin: 0 0 6px; }
  .ped-hint[hidden] { display: none; }
  /* Колонки 2-го и 3-го поколения сдвинуты лишь на треть карточки: первые три поколения
     помещаются на экран целиком. 4-е и 5-е стоят плотно, поэтому идут полным шагом. */
  .ped { --cw: 192px; min-width: calc(var(--cols) * var(--cw) - var(--cw) * 4 / 3 + (var(--cols) - 1) * 6px + 20px) !important; padding: 10px 10px 12px; gap: 6px; }
  .ped-head, .ped-grid { grid-template-columns: repeat(var(--cols), var(--cw)); gap: 6px; }
  .ped-head > *, .ped-grid > .ped-col { position: relative; }
  .ped-head > :nth-child(2), .ped-grid > .ped-col:nth-child(2) { left: calc(var(--cw) * -2 / 3 - 6px); }
  .ped-head > :nth-child(n+3), .ped-grid > .ped-col:nth-child(n+3) { left: calc(var(--cw) * -4 / 3 - 12px); }
  .ped-head { font-size: 10.5px; letter-spacing: .03em; }
  /* Подписи колонок лесенкой, чтобы не налезали друг на друга. */
  .ped-head { align-items: end; }
  .ped-head > :nth-child(1) { padding-bottom: 36px; } .ped-head > :nth-child(2) { padding-bottom: 18px; }
  .ped-head > * { white-space: nowrap; padding-left: 2px; }
  .ped-grid { height: calc(var(--leaves) * 104px); }
  /* Высота дерева — по самому дальнему открытому поколению (data-depth ставит site.js). */
  .ped[data-depth="1"] .ped-grid, .ped[data-depth="2"] .ped-grid { height: 440px; }
  .ped[data-depth="3"] .ped-grid { height: calc(16 * 58px); }
  .ped[data-depth="4"] .ped-grid { height: calc(16 * 62px); }
  .ped[data-depth="3"]:not(.with-lock) { --cols: 3; }
  .ped[data-depth="4"]:not(.with-lock) { --cols: 4; }
  .ped[data-depth="3"] .ped-head > :nth-child(n+4):not(:last-child),
  .ped[data-depth="3"] .ped-grid > .ped-col:not(.ped-lockcol):nth-child(n+4),
  .ped[data-depth="4"] .ped-grid > .ped-col:not(.ped-lockcol):nth-child(n+5) { display: none; }
  .ped[data-depth="3"]:not(.with-lock) .ped-head > :nth-child(n+4),
  .ped[data-depth="4"]:not(.with-lock) .ped-head > :nth-child(n+5) { display: none; }
  /* Скобка у левого края колонки соединяет отца и мать предыдущей карточки. */
  .ped-grid > .ped-col:not(.ped-lockcol) .slot { position: relative; padding-left: 9px; pointer-events: none; }
  .ped-grid .slot > .node { pointer-events: auto; position: relative; z-index: 1; }  /* сдвинутые колонки перекрывают соседние — пустые места не должны мешать нажатиям */
  .ped-grid > .ped-col:not(.ped-lockcol) .slot:has(> .node:not([hidden]))::before { content: ""; position: absolute; left: 2px; width: 2px; background: var(--accent); opacity: .45; border-radius: 1px; z-index: 0; }
  .ped-grid > .ped-col .slot:nth-child(odd)::before { top: 50%; bottom: 0; }
  .ped-grid > .ped-col .slot:nth-child(even)::before { top: 0; bottom: 50%; }
  .slot { padding: 1px 0; }
  .node { padding: 5px 6px !important; gap: 5px; border-radius: 8px; }
  .node img { display: none; }
  .node .sex { font-size: 14px; }
  .node .nm { font-size: 11.5px !important; line-height: 1.15; white-space: normal !important; display: -webkit-box !important; -webkit-box-orient: vertical; -webkit-line-clamp: 2 !important; overflow: hidden; word-break: break-word; }
  .node .sb { font-size: 10.5px !important; }
  .node .x2 { font-size: 10px; padding: 1px 4px; }
  .node .tg { width: 24px; height: 24px; font-size: 14px; }
  .ped-lockcol .locked { padding: 10px; font-size: 13px; }
}
.ped-col { display: flex; flex-direction: column; min-height: 0; }
.slot { flex: 1 1 0; min-height: 0; display: flex; align-items: center; padding: 2px 0; }
.node { width: 100%; display: flex; align-items: center; gap: 8px; border-radius: 10px; border: 1px solid var(--line); background: var(--paper); }
.node.rep { border-color: var(--warn-line); background: var(--warn-bg); }
.node[hidden] { display: none; }
.node .dot { width: 8px; height: 8px; }
.node a { flex: 1; min-width: 0; text-decoration: none; color: var(--ink); display: flex; flex-direction: column; gap: 1px; }
.node .nm { font-weight: 700; line-height: 1.2; }
.node .sb { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.node img { flex: none; object-fit: cover; border-radius: 6px; }
.node .x2 { flex: none; font-size: 11px; font-weight: 700; color: var(--accent-dark); background: #F6D9A8; border-radius: 999px; padding: 2px 6px; }
.node .tg { flex: none; width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--field); background: var(--paper); color: var(--accent); font-weight: 700; font-size: 16px; line-height: 1; display: flex; align-items: center; justify-content: center; padding: 0; }
.g1 { padding: 10px 12px; } .g1 .nm { font-size: 15px; } .g1 .sb { font-size: 13px; } .g1 img { width: 52px; height: 52px; }
.g2 { padding: 9px 11px; } .g2 .nm { font-size: 14px; } .g2 .sb { font-size: 12.5px; } .g2 img { width: 44px; height: 44px; }
.g3 { padding: 7px 9px; } .g3 .nm { font-size: 13px; } .g3 .sb { font-size: 12px; } .g3 img { width: 34px; height: 34px; }
.g4 { padding: 5px 8px; } .g4 .nm { font-size: 12px; } .g4 .sb { font-size: 11.5px; } .g4 img { width: 26px; height: 26px; }
.g5 { padding: 3px 8px; } .g5 .nm { font-size: 11.5px; } .g5 .sb { font-size: 11px; } .g5 img { display: none; }
.g1 .nm, .g2 .nm, .g3 .nm { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.g4 .nm, .g5 .nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.alert { border: 1px solid var(--warn-line); background: var(--warn-bg); border-radius: 12px; padding: 16px 18px; display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: center; }
.alert[hidden] { display: none; }
.alert-danger { border-color: #B3261E; background: #FCE8E6; }
.alert-ico { flex: none; width: 28px; height: 28px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; background: var(--warn-line); color: #fff; }
.alert-danger .alert-ico { background: #B3261E; }
.stat-danger { border-color: #B3261E; } .stat-danger b { color: #B3261E; }
.stat-warn { border-color: var(--warn-line); }
.alert .txt { flex: 1 1 300px; display: flex; flex-direction: column; gap: 2px; }

/* Формы входа */
.flash { margin-top: 16px; }
.flash p { margin: 0 0 8px; border: 1px solid var(--line); background: var(--sand); border-radius: 10px; padding: 12px 16px; }
.form-card { max-width: 440px; border: 1px solid var(--line); border-radius: 14px; padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.form-card p { margin: 0; }
.form-card label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.form-card input[type=text], .form-card input[type=password], .form-card input[type=email] { width: 100%; padding: 11px 14px; border: 1px solid var(--field); border-radius: 8px; }
.form-card .helptext { display: block; font-size: 13px; color: var(--muted); margin-top: 4px; }
.form-card .helptext ul { margin: 4px 0 0; padding-left: 18px; }
.errorlist { color: #A12A12; margin: 4px 0 0; padding-left: 18px; font-size: 14px; }

/* Пробная вязка */
.planner-form { display: grid; grid-template-columns: 1fr; gap: 20px 24px; align-items: start; }
@media (min-width: 760px) { .planner-form { grid-template-columns: 1fr 1fr; } .planner-form > div:last-child { grid-column: 1 / -1; } }
.picker { max-width: none; margin-top: 0; }
.picker label { display: flex; align-items: center; gap: 8px; }
.picker input[type=search] { width: 100%; }
.picker .picked { margin-top: 6px; font-size: 14px; }
.picker-error { margin-top: 6px; color: #A12A12; font-size: 14px; }

/* Заявка на добавление собаки */
.form-card.wide { max-width: 640px; }
/* Отдельная форма (вход, регистрация, «Добавить собаку») — по центру страницы. */
.page > .form-card:not(.wide), .page > .form-card:first-child { width: 100%; margin-left: auto; margin-right: auto; }
.form-card input[type=date], .form-card textarea { width: 100%; padding: 11px 14px; border: 1px solid var(--field); border-radius: 8px; font: inherit; }
.form-card input[type=file] { width: 100%; padding: 10px; border: 1px dashed var(--field); border-radius: 8px; background: var(--sand-2); font: inherit; font-size: 14px; }
.drop-over input[type=file] { border-color: currentColor; border-style: solid; }
.file-zone { position: relative; display: flex; align-items: center; justify-content: center; min-height: 96px; padding: 18px; border: 2px dashed var(--field); border-radius: 12px; background: var(--sand-2); color: var(--ink-2); text-align: center; transition: border-color .15s, background .15s; }
.file-zone:hover, .file-zone:focus-within, .file-zone.drop-over { border-color: var(--accent); background: var(--sand); }
.file-zone:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.file-zone.has-file { border-style: solid; color: var(--ink); font-weight: 600; }
.fz-text { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 15px; pointer-events: none; }
.fz-text svg { color: var(--accent); }
.form-card .file-zone input[type=file], .file-zone input[type=file] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; padding: 0; border: 0; }
.file-list { list-style: none; margin: 8px 0 0; padding: 0; font-size: 14px; }
.file-list li { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 0; border-bottom: 1px solid var(--field); overflow-wrap: anywhere; }
.file-thumb { flex: none; width: 56px; height: 56px; border-radius: 6px; background: var(--sand-2); display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; overflow: hidden; }
.file-thumb img { width: 100%; height: 100%; object-fit: cover; }
.file-thumb canvas { max-width: 100%; max-height: 100%; background: #fff; }
.file-name { flex: 1; min-width: 0; }
.file-remove { border: 0; background: none; font-size: 20px; line-height: 1; cursor: pointer; padding: 0 6px; color: inherit; }
.form-card .two { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 560px) { .form-card .two { grid-template-columns: 1fr 1fr; } }
.form-card .choices { display: flex; gap: 20px; }
.form-card .choices label { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; margin: 0; }
.form-card .req { color: var(--accent); }
.form-card select { width: 100%; padding: 10px 12px; border: 1px solid var(--field); border-radius: 8px; background: var(--paper); color: inherit; font: inherit; }
.show-rows { display: flex; flex-direction: column; gap: 18px; }
.show-row { display: flex; flex-direction: column; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; }
.form-card fieldset { border: 0; border-top: 1px solid var(--line); margin: 4px 0 0; padding: 16px 0 0; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.form-card legend { font-weight: 700; font-size: 17px; padding: 0 8px 0 0; }
.sub-details { display: grid; grid-template-columns: max-content 1fr; gap: 2px 12px; margin: 4px 0; }
.sub-details dt { color: var(--muted); }
.sub-details dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 480px) { .sub-details { grid-template-columns: 1fr; } .sub-details dd { margin-bottom: 6px; } }
.subs { display: flex; flex-direction: column; gap: 12px; max-width: 760px; }
.sub { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; }
.sub-head { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: baseline; justify-content: space-between; }
.sub-name { font-weight: 700; }
.status { font-size: 13px; font-weight: 700; padding: 2px 10px; border-radius: 999px; background: var(--chip); color: var(--ink-2); }
.status-published { background: #E3F1E4; color: #24622A; }
.status-rejected { background: #F8E1DC; color: #A12A12; }
.sub-note { background: var(--sand); border-radius: 8px; padding: 8px 12px; font-size: 14px; }
.notice { border: 1px solid var(--warn-line); background: var(--warn-bg); border-radius: 10px; padding: 12px 16px; max-width: 760px; }

/* Обращения и переписка */
.ticket-row { text-decoration: none; color: var(--ink); }
.ticket-row:hover { border-color: var(--field); background: var(--sand-2); color: var(--ink); }
.ticket-row.unread { border-color: var(--accent); }
.new-mark { color: var(--accent); }
.status-new, .status-open { background: var(--chip); color: var(--ink-2); }
.status-waiting { background: var(--warn-bg); color: #7A4E0E; }
.status-done { background: #E3F1E4; color: #24622A; }
.topic-cards { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 640px) { .topic-cards { grid-template-columns: 1fr 1fr; } }
.topic-card { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; color: var(--ink); text-decoration: none; }
a.topic-card:hover { border-color: var(--field); background: var(--sand-2); color: var(--ink); }
.form-card .choices-col { flex-direction: column; gap: 8px; }
.form-card .choices-col label { font-weight: 500; display: inline; margin: 0; }
.thread { display: flex; flex-direction: column; gap: 12px; max-width: 760px; margin-top: 20px; }
.msg { border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; display: flex; flex-direction: column; gap: 6px; overflow-wrap: anywhere; }
.msg-staff { background: var(--sand); border-color: var(--line-2); }
.msg-head { display: flex; gap: 10px; align-items: baseline; justify-content: space-between; }
.diff { width: 100%; border-collapse: collapse; font-size: 14px; }
.diff th, .diff td { text-align: left; padding: 6px 8px; border-top: 1px solid var(--line-2); vertical-align: top; overflow-wrap: anywhere; }
.diff th { font-weight: 600; color: var(--muted); border-top: 0; }
.att-photos { display: flex; flex-wrap: wrap; gap: 8px; }
.att-photos img { height: 96px; border-radius: 6px; }
.site-header .badge { display: inline-block; min-width: 20px; padding: 0 6px; margin-left: 4px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 12px; text-align: center; line-height: 20px; }

/* --- языки --- */
.langs { position: relative; font-size: 14px; }
.langs summary { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 4px 10px; border: 1px solid var(--field); border-radius: 8px; cursor: pointer; list-style: none; letter-spacing: .04em; color: var(--ink); user-select: none; }
.langs summary::-webkit-details-marker { display: none; }
.langs summary::after { content: ""; width: 6px; height: 6px; margin: -3px 0 0 2px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); }
.langs[open] summary::after { margin-top: 3px; transform: rotate(-135deg); }
.langs summary:hover { background: var(--sand); }
.langs ul { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; min-width: 160px; margin: 0; padding: 6px; list-style: none; background: var(--paper); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 24px rgba(0, 0, 0, .12); }
.langs li a, .langs li b { display: block; padding: 8px 12px; border-radius: 6px; font-weight: 500; text-decoration: none; color: var(--ink); }
.langs li b { font-weight: 700; background: var(--line); }
.langs li a:hover { background: var(--sand); color: var(--accent); }
.langs.to-left ul { left: 0; right: auto; }
.lang-hint { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px 12px; padding: 8px 16px; background: var(--line-2); border-bottom: 1px solid var(--line); font-size: 14px; }
.lang-hint .btn { min-height: 34px; padding: 4px 12px; font-size: 14px; }

/* Тесты здоровья */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
table.shows .award { font-weight: 600; white-space: nowrap; }
.half-head { font-size: 17px; margin: 0; }
.half-group { display: flex; flex-direction: column; gap: 6px; }
table.health { width: 100%; border-collapse: collapse; font-size: 15px; }
table.health th, table.health td { text-align: left; vertical-align: top; padding: 10px 14px; }
table.health th { font-size: 13px; color: var(--muted); font-weight: 600; background: var(--sand-2); }
table.health tr + tr td, table.health tbody tr td { border-top: 1px solid var(--line-2); }
.grade { display: inline-block; padding: 1px 8px; border-radius: 6px; font-weight: 700; background: var(--chip); color: var(--ink); white-space: nowrap; }
.grade-1, .grade-2 { background: #E2F0E0; color: #24562A; }
.grade-3 { background: var(--warn-bg); color: #6B4A10; }
.grade-4, .grade-5 { background: #F6DCD6; color: #8A2A1A; }

/* --- питомники --- */
.form-card input[type=number], .form-card input[type=url], .form-card input[type=tel] { width: 100%; padding: 11px 14px; border: 1px solid var(--field); border-radius: 8px; }
.verified { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; padding: 2px 10px; border-radius: 999px; background: #E3F1E4; color: #24622A; }
.verified::before { content: "✓"; }
.kennel-head { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.kennel-logo { width: 96px; height: 96px; object-fit: contain; border-radius: 14px; border: 1px solid var(--line); background: var(--paper); }
.kennel-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; color: var(--muted); }
.kennel-about { max-width: 760px; }
.kennel-about p { margin: 0 0 12px; }
.kennel-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.kennel-photos img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 10px; display: block; }
.kennel-photos form { display: flex; flex-direction: column; gap: 6px; }
.kennel-filter { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.kennel-filter select { padding: 9px 12px; border: 1px solid var(--field); border-radius: 8px; background: var(--paper); font: inherit; max-width: 100%; }
.sub-box { margin-top: 20px; max-width: 640px; border: 1px solid var(--line); border-radius: 14px; padding: 20px 24px; display: flex; flex-direction: column; gap: 12px; }
.sub-box p { margin: 0; }
.eyebrow { font-size: 14px; font-weight: 700; color: var(--accent); text-transform: uppercase; letter-spacing: .04em; }
.litter-photos { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.litter-photos a:first-child { grid-column: span 2; grid-row: span 2; }
@media (max-width: 560px) { .litter-photos { grid-template-columns: 1fr 1fr; } }
.litter-top { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px 32px; align-items: start; }
@media (min-width: 900px) { .litter-top { grid-template-columns: minmax(0, 1fr) 360px; } }
.litter-top .sub-box { margin-top: 0; }
.link-btn { text-align: left; border: 0; background: none; padding: 0; color: var(--accent); text-decoration: underline; font: inherit; cursor: pointer; }
.pup-name .sex { font-size: 17px; }
/* Щенки на телефоне — карточками вместо таблицы. */
@media (max-width: 560px) {
  .pups-wrap { border: 0; overflow: visible; }
  .pups thead { display: none; }
  .pups, .pups tbody { display: block; }
  .pups tr { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 8px; }
  .pups td { display: block; padding: 0 !important; border: 0 !important; }
  .pups .pup-name { grid-column: 1; }
  .pups .pup-st { grid-column: 2; grid-row: 1; text-align: right; }
  .pups .pup-coat { grid-column: 1; color: var(--muted); font-size: 14px; }
  .pups .pup-price { grid-column: 2; grid-row: 2; text-align: right; font-size: 14px; }
}
.plans { margin: 0; padding-left: 20px; }
/* помёты */
.puppy-row { border: 1px solid var(--line); border-radius: 10px; padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.litter-admin { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.litter-admin li { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; padding-bottom: 10px; border-bottom: 1px solid var(--line-2); }
.litter-admin form { margin-left: auto; }
.pup-free { color: #24622A; font-weight: 600; }
.pup-reserved { color: #8A5A00; }
.pup-sold { color: var(--muted); }
[hidden] { display: none !important; }

/* Подбор пары */
.matches { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.match { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: var(--paper); }
.match-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.match-rank { font-family: var(--serif); font-size: 20px; color: var(--muted); min-width: 1.6em; text-align: right; }
.match-name { flex: 1 1 220px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.match-name .r-title { text-decoration: none; }
.match-score, .match-coi { display: flex; flex-direction: column; align-items: center; min-width: 72px; }
.match-score b { font-family: var(--serif); font-size: 28px; color: var(--accent); line-height: 1.1; }
.match-coi b { font-size: 17px; }
.match-why { margin-top: 8px; }
.match-why summary { cursor: pointer; font-size: 14px; color: var(--ink-2); }
.match-why table { border-collapse: collapse; margin-top: 8px; font-size: 14px; }
.match-why th { text-align: left; font-weight: 600; padding: 4px 12px 4px 0; white-space: nowrap; vertical-align: top; }
.match-why td { padding: 4px 12px 4px 0; vertical-align: top; }
.match-why td.pts { white-space: nowrap; color: var(--muted); }
.match-why tr.warn td { color: #8A2A1A; }
@media (max-width: 560px) { .match-head .btn { width: 100%; text-align: center; } }
/* соцсети питомника */
.links-box { display: flex; flex-direction: column; gap: 10px; }
.link-row { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; }
.link-row + .link-row { padding-top: 10px; border-top: 1px dashed var(--line); }
@media (min-width: 560px) {
  .link-row { grid-template-columns: 190px minmax(0, 1fr); }
  .link-row + .link-row { padding-top: 0; border-top: 0; }
  .link-row .errorlist { grid-column: 1 / -1; }
}
.form-card .link-row input[type=text] { width: 100%; padding: 11px 14px; border: 1px solid var(--field); border-radius: 8px; }
.socials { display: flex; flex-wrap: wrap; gap: 8px; }
.social { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px 7px 10px; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; color: var(--ink); background: var(--paper); font-size: 14px; }
.social:hover { border-color: var(--field); color: var(--ink); }
.social svg { flex: none; }
.social span { white-space: nowrap; }
/* Карточка питомника на телефоне: подпись над значением, без узкой правой колонки */
@media (max-width: 560px) {
  .facts-stack { grid-template-columns: 1fr; gap: 0; }
  .facts-stack dt { font-size: 14px; }
  .facts-stack dd { margin-bottom: 14px; }
  .facts-stack dd:last-child { margin-bottom: 0; }
}

/* --- статистика породы --- */
.bstats { max-width: 980px; }
.bstats { --g1: #3F8A4A; --g2: #9CC88C; --g3: #D9A53A; --g4: #D46F3A; --g5: #A8321E; }
.bs-section h3 { font-size: 18px; }
.bs-locked { display: flex; gap: 6px; align-items: center; margin: 0; }
.bs-chart { margin: 0; display: flex; flex-direction: column; gap: 6px; }
.bs-chart figcaption { font-size: 14px; font-weight: 600; }
.cols { display: flex; align-items: flex-end; gap: 2px; height: 150px; border-bottom: 1px solid var(--field); }
.cols .col { flex: 1 1 0; height: 100%; display: flex; align-items: flex-end; min-width: 0; cursor: default; }
.cols .col i { display: block; width: 100%; background: var(--accent); border-radius: 3px 3px 0 0; min-height: 1px; }
.cols .col:hover i { background: var(--accent-dark); }
.cols-x { display: flex; gap: 2px; font-size: 11px; color: var(--muted); }
.cols-x span { flex: 1 1 0; min-width: 0; overflow: visible; white-space: nowrap; text-align: center; }
.cols-wide, .cols-wide + .cols-x { gap: 6px; }
.cols-x.cols-wide { gap: 6px; font-size: 12px; }
.bs-section details summary { cursor: pointer; color: var(--accent); font-size: 14px; }
.bs-section details .table-wrap { margin-top: 8px; max-height: 360px; overflow-y: auto; }
.bs-health { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px 32px; }
.bs-test { display: flex; flex-direction: column; gap: 8px; }
.bs-test p { margin: 0; }
.stackbar { display: flex; gap: 2px; height: 22px; border-radius: 6px; overflow: hidden; background: var(--line-2); }
.stackbar .seg { flex-basis: 0; min-width: 3px; }
.hg1 { background: var(--g1); } .hg2 { background: var(--g2); } .hg3 { background: var(--g3); }
.hg4 { background: var(--g4); } .hg5 { background: var(--g5); }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; vertical-align: baseline; margin-right: 4px; }
.bs-legend { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 14px; }
.bs-two { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 24px 40px; }
.hbars { display: grid; grid-template-columns: minmax(0, max-content) minmax(60px, 1fr) max-content; gap: 6px 12px; align-items: center; font-size: 14px; }
.hb-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 260px; }
.hb-track { height: 10px; }
.hb-track i { display: block; height: 100%; background: var(--accent); border-radius: 0 4px 4px 0; min-width: 2px; }
.hb-val { white-space: nowrap; text-align: right; }
@media (max-width: 560px) { .hb-label { max-width: 140px; } .cols { height: 120px; } }
.bstats .stats { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }

.chart-tip { position: absolute; z-index: 30; width: 220px; padding: 8px 10px; border-radius: 8px; background: var(--ink); color: #fff; font-size: 13px; text-align: center; pointer-events: none; }
.chart-tip[hidden] { display: none; }
.bs-section [title] { cursor: pointer; }

/* Страницы и статьи (раздел «О породе», политика) */
.prose { display: flex; flex-direction: column; gap: 14px; line-height: 1.6; }
.prose h2 { margin-top: 18px; }
.prose h3 { font-size: 20px; margin-top: 8px; }
.prose p, .prose ul, .prose ol, .prose table { margin: 0; }
.prose ul, .prose ol { padding-left: 22px; display: flex; flex-direction: column; gap: 6px; }
.prose table { border-collapse: collapse; width: 100%; font-size: 15px; }
.prose th, .prose td { border-bottom: 1px solid var(--line); padding: 6px 8px; text-align: left; vertical-align: top; }
.prose blockquote { margin: 0; padding: 4px 0 4px 16px; border-left: 3px solid var(--line); color: var(--ink-2); }
.article-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 4px; }
.article-list a { display: flex; flex-direction: column; gap: 4px; padding: 14px 0; border-bottom: 1px solid var(--line); text-decoration: none; color: inherit; }
.article-list a:hover b { color: var(--accent); }

/* Плашка о cookie */
.cookie-bar { position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 50; max-width: 760px; margin: 0 auto; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 6px 24px rgba(0,0,0,.12); padding: 14px 16px; display: flex; gap: 12px 16px; align-items: center; flex-wrap: wrap; font-size: 15px; }
.cookie-bar p { margin: 0; flex: 1 1 320px; }
.cookie-bar .btns { display: flex; gap: 8px; }
.form-card label.check, .check { display: flex; gap: 8px; align-items: flex-start; font-weight: 400; }
.check input { width: auto; margin-top: 4px; }
.chip-sm { font-size: 12px; padding: 2px 8px; }
.steps { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 6px; }
.kennel-ind { padding-top: 0; }
.kstats td, .kstats th { white-space: nowrap; }
textarea#badge-code { width: 100%; font-family: monospace; font-size: 13px; }
.claim { max-width: 760px; }

/* --- покупатели щенков --- */
.entries { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.entry { display: flex; flex-direction: column; gap: 8px; padding: 18px 20px; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); color: var(--ink); text-decoration: none; }
.entry:hover { border-color: var(--field); color: var(--ink); }
.entry b { font-size: 19px; }
.entry span { font-size: 14px; color: var(--ink-2); flex: 1; }
.entry em { font-style: normal; font-weight: 600; color: var(--accent); font-size: 14px; }
.parent-litters { margin-top: 24px; padding: 18px 20px; border-radius: 14px; background: var(--sand); display: flex; flex-direction: column; gap: 12px; }
.parent-litters h2 { font-size: 20px; margin: 0; }
.litter-parents { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; }
.lp-card { display: flex; gap: 14px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; align-items: flex-start; }
.lp-photo { width: 96px; height: 96px; flex: none; border-radius: 10px; background: var(--sand); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.lp-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lp-card .grade { margin: 0 4px 4px 0; }
.trust { max-width: 760px; background: var(--sand); border-radius: 14px; padding: 16px 20px; }
.trust h2 { font-size: 18px; margin: 0 0 8px; }
.trust ul { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; }
.share-btns { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; margin-top: 12px; }
.share-btns a { font-size: 14px; font-weight: 600; }
.linklike { background: none; border: 0; padding: 0; font: inherit; font-size: 14px; color: var(--accent); cursor: pointer; text-decoration: underline; }
.alert-list, .inquiry-list { list-style: none; margin: 0 0 16px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.alert-list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; }
.inquiry-list li { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; display: flex; flex-direction: column; gap: 4px; }
.inquiry-list li.done { opacity: .6; }
.inquiry-list form { align-self: flex-start; }
.alert-box h2 { margin: 0; }
.place-links ul { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.article-author { margin: -4px 0 8px; font-size: 15px; color: var(--ink-2); display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
