/* RF4 Spots — тёмная тема «инструмента»: плотно, спокойно, без декоративного шума.
   Никаких внешних шрифтов и ресурсов: только системные шрифты.
   Один хедер, один футер, одинаковые радиусы и отступы на всех страницах. */

:root {
  color-scheme: dark;

  --bg:        #0c1011;
  --bg-1:      #111617;
  --bg-2:      #171e20;
  --bg-3:      #1d2629;
  --line:      #273235;
  --line-soft: #1d2729;
  --text:      #e7eeea;
  --text-dim:  #c3cfc9;
  --muted:     #8b9a94;
  --muted-2:   #7f8f88;
  --accent:    #6fc394;
  --accent-bg: #24402f;
  --coords:    #f0c674;
  --danger:    #f08a7a;
  --danger-bg: #2a1614;
  --demo:      #e3bc70;
  --demo-bg:   #241f12;
  --radius:    8px;
  --topbar-h:  56px;

  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "Cascadia Mono", "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { min-height: 100%; }
html { scrollbar-gutter: stable; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 13px/1.45 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.modal-open { overflow: hidden; }

h1, h2, h3, p, dl, dd, dt, figure { margin: 0; }

a { color: var(--accent); }

button, input, select { font-family: inherit; }

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

/* ─────────────────────────── верхняя панель ─────────────────────────── */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: var(--topbar-h);
  padding: 8px max(18px, calc((100% - 1500px) / 2 + 18px));
  background: rgba(12, 16, 17, .94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(6px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.brand:hover .brand-text strong,
.brand:hover .brand-text h1 { color: var(--accent); }

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border: 1px solid #3c6b50;
  border-radius: var(--radius);
  background: linear-gradient(155deg, #213a2b, #131d17);
  color: #bfe8cd;
  font: 600 11px/1 var(--sans);
  letter-spacing: .4px;
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.brand-text strong,
.brand-text h1 {
  margin: 0;
  color: var(--text);
  font-size: 15px;
  font-weight: 650;
  line-height: 1.15;
  letter-spacing: .3px;
  white-space: nowrap;
  transition: color .15s;
}

.brand-text small,
.brand-text p {
  margin: 0;
  color: var(--muted-2);
  font-size: 10.5px;
  line-height: 1.2;
  white-space: nowrap;
}

.nav {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: auto;
  min-width: 0;
  padding: 2px;
  overflow-x: auto;
  scrollbar-width: none;
}

.nav::-webkit-scrollbar { display: none; }

.nav a {
  padding: 7px 12px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  transition: color .15s, background-color .15s, border-color .15s;
}

.nav a:hover {
  border-color: var(--line-soft);
  background: var(--bg-2);
  color: var(--text);
}

.nav a[aria-current="page"] {
  border-color: #33543f;
  background: var(--accent-bg);
  color: #cdeed9;
  font-weight: 600;
}

/* Страницы «Сборки» ещё используют старую разметку шапки — поддерживаем её. */

.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
  margin-left: auto;
}

.refresh-status {
  max-width: 260px;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.refresh-status:empty { display: none; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-right: 4px;
}

.nav-links a {
  padding: 6px 10px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  transition: color .15s, background-color .15s, border-color .15s;
}

.nav-links a:hover {
  border-color: var(--line-soft);
  background: var(--bg-2);
  color: var(--text);
}

.nav-links a[aria-current="page"] {
  border-color: #33543f;
  background: var(--accent-bg);
  color: #cdeed9;
}

/* ─────────────────────────── футер ─────────────────────────── */

.site-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 24px;
  max-width: 1500px;
  margin: 26px auto 0;
  padding: 14px 18px 26px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

/* ─────────────────────────── каркас ─────────────────────────── */

.shell {
  display: grid;
  grid-template-columns: 268px minmax(0, 1fr);
  align-items: start;
  max-width: 1500px;
  margin: 0 auto;
}

/* ─────────────────────────── фильтры ─────────────────────────── */

.filters {
  position: sticky;
  top: var(--topbar-h);
  display: flex;
  flex-direction: column;
  gap: 14px;
  height: calc(100vh - var(--topbar-h));
  padding: 16px;
  overflow-y: auto;
  border-right: 1px solid var(--line);
  background: var(--bg-1);
  scrollbar-width: thin;
  scrollbar-color: #2c3a3e transparent;
  scrollbar-gutter: stable;
}

.filters-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-bottom: 2px;
}

.filters-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.filters .filters-close { display: none; }

.filters-title {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .8px;
  text-transform: uppercase;
}

.filters-foot {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--line-soft);
}

.side-line {
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.field-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .6px;
  text-transform: uppercase;
}

input[type="search"],
select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-2);
  color: var(--text);
  font-size: 12.5px;
  line-height: 1.3;
  transition: border-color .15s, background-color .15s;
}

input[type="search"]::placeholder { color: var(--muted-2); }

input[type="search"]:hover,
select:hover { border-color: #35464b; }

input[type="search"]:focus,
select:focus {
  border-color: #3f6f57;
  outline: none;
}

input[type="search"]:focus-visible,
select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.field-search input[type="search"] {
  padding-left: 30px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Ccircle cx='5' cy='5' r='3.4' fill='none' stroke='%238b9a94' stroke-width='1.3'/%3E%3Cpath d='M7.7 7.7 10.6 10.6' stroke='%238b9a94' stroke-width='1.3' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 10px center;
}

select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 28px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%238b9a94' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  cursor: pointer;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-2);
}

.segmented button {
  padding: 6px 2px;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.2;
  cursor: pointer;
  transition: background-color .12s, color .12s;
}

.segmented button:hover { background: var(--bg-3); color: var(--text); }

.segmented button[aria-pressed="true"] {
  background: #2a3a33;
  color: #dcf2e4;
  font-weight: 600;
}

/* ─────────────────────────── кнопки ─────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-2);
  color: var(--text);
  font-size: 12px;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color .12s, border-color .12s, color .12s;
}

.btn:hover:not(:disabled) { border-color: #3a4b50; background: var(--bg-3); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.btn-accent {
  border-color: #3c6b50;
  background: var(--accent-bg);
  color: #d9f2e2;
}
.btn-accent:hover:not(:disabled) { border-color: #4d8563; background: #2b4d39; }

.btn-link {
  padding: 2px 4px;
  border: 0;
  background: none;
  color: var(--accent);
  font-size: 11.5px;
}
.btn-link:hover:not(:disabled) { background: none; color: #93ddb4; text-decoration: underline; }

.btn-copy {
  flex: 0 0 auto;
  padding: 6px 10px;
  border-color: var(--line);
  background: var(--bg-3);
  color: var(--muted);
  font-size: 11px;
}

.btn-copy.is-copied { border-color: #3c6b50; color: #a6e6bc; }

.btn-quiet {
  padding: 5px 10px;
  color: var(--muted);
  font-size: 11.5px;
}

.filters-toggle { display: none; }
.filters-apply { display: none; width: 100%; }

.count-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 17px;
  height: 17px;
  padding: 0 5px;
  border-radius: 999px;
  background: #2f4a3a;
  color: #cdeed9;
  font-size: 10px;
  line-height: 1;
}

/* ─────────────────────────── основная область ─────────────────────────── */

.main {
  min-width: 0;
  padding: 18px 20px 48px;
}

.notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 12px;
  padding: 9px 12px;
  border: 1px solid;
  border-radius: var(--radius);
  font-size: 12px;
  line-height: 1.4;
}

.notice-text { min-width: 0; overflow-wrap: anywhere; }

.notice-error {
  border-color: #5a2a24;
  background: var(--danger-bg);
  color: #f4b3a8;
}

.notice-demo {
  border-color: #594a22;
  background: var(--demo-bg);
  color: #e8cd8b;
}

.notice-demo strong { color: var(--demo); }

.notice-close,
.notice-action {
  flex: 0 0 auto;
  margin-left: auto;
  padding: 1px 6px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: none;
  color: inherit;
  font-size: 11.5px;
  line-height: 1.4;
  cursor: pointer;
}

.notice-close { font-size: 15px; line-height: 1; }
.notice-close:hover,
.notice-action:hover { border-color: currentColor; }
.notice-action { white-space: nowrap; }

/* ─────────────────────────── строка над лентой ─────────────────────────── */

.listbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 12px;
  margin-bottom: 14px;
}

.found {
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.listbar-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  min-width: 0;
}

.view-switch {
  grid-template-columns: repeat(2, minmax(64px, 1fr));
  width: auto;
}

.view-switch button {
  padding: 5px 14px;
  font-size: 11.5px;
}

.hint {
  color: var(--muted-2);
  font-size: 10.5px;
  white-space: nowrap;
}

/* ─────────────────────────── карточка поста ─────────────────────────── */

.cards {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  align-items: stretch;
}

.card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  height: 100%;
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-1);
  transition: border-color .15s;
}

.card:hover { border-color: #35464b; }

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.place {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 8px;
  min-width: 0;
}

.place h2 {
  font-size: 15.5px;
  font-weight: 650;
  line-height: 1.3;
  letter-spacing: .1px;
  overflow-wrap: anywhere;
}

.country {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.country::before {
  content: "·";
  margin-right: 6px;
  color: var(--muted-2);
}

.badge {
  flex: 0 0 auto;
  padding: 3px 7px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-2);
  color: var(--muted);
  font: 500 10px/1.25 var(--mono);
  letter-spacing: .3px;
  text-transform: uppercase;
  white-space: nowrap;
}

.badge[data-source="farmtrof"] {
  border-color: #2f5c41;
  background: #16251c;
  color: #9ed3ab;
}

.badge[data-source="rf4stat"] {
  border-color: #2c4a63;
  background: #141f29;
  color: #9cc3e6;
}

.badge[data-source="telegram"] {
  border-color: #2c4a5c;
  background: #141d26;
  color: #9cc8dd;
}

.badge[data-source="vk"] {
  border-color: #334a66;
  background: #151d28;
  color: #a5bfe0;
}

/* координата */

.coords {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--bg-2);
}

.coords-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.coords-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .6px;
  text-transform: uppercase;
}

.coord-value {
  color: var(--coords);
  font-family: var(--mono);
  font-size: 26px;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: .6px;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.coord-value.coord-empty {
  color: var(--muted-2);
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0;
}

.coords-note {
  margin: 0;
  padding: 9px 12px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted-2);
  font-size: 12px;
}

/* улов */

.catch-block {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.block-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .6px;
  text-transform: uppercase;
}

.catches {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  min-width: 0;
}

.catch-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  max-width: 100%;
  padding: 3px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg-2);
  color: var(--text-dim);
  font-size: 12px;
  line-height: 1.35;
}

.catch-chip .catch-name {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--text);
  font-weight: 600;
}

.catch-chip .catch-weight {
  flex: 0 0 auto;
  color: var(--coords);
  font: 500 11px/1.3 var(--mono);
  font-variant-numeric: tabular-nums;
}

/* наживка / клипса / способ */

.facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px 16px;
  min-width: 0;
}

.facts > div { min-width: 0; }

.facts dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .6px;
  text-transform: uppercase;
}

.facts dd {
  display: -webkit-box;
  overflow: hidden;
  color: var(--text-dim);
  font-size: 12.5px;
  line-height: 1.4;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

.card-text {
  display: -webkit-box;
  overflow: hidden;
  color: #aebbb4;
  font-size: 12.5px;
  line-height: 1.5;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
}

/* фото: ровная сетка, одна высота, object-fit: cover */

.photos {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  height: 150px;
  min-width: 0;
}

.photos[data-count="1"] { grid-template-columns: minmax(0, 1fr); }
.photos[data-count="2"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.photo-btn {
  position: relative;
  width: 100%;
  height: 100%;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-3);
  cursor: zoom-in;
}

/* Пока фото грузится (на 3G это несколько секунд) — мягкий скелетон,
   чтобы вместо чёрных прямоугольников было видно, что контент в пути. */
.photo-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 20%, rgba(231, 238, 234, .05) 40%, transparent 60%);
  background-size: 200% 100%;
  animation: photo-shimmer 1.6s linear infinite;
}

.photo-btn img {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .18s ease;
}

@keyframes photo-shimmer {
  from { background-position: 160% 0; }
  to { background-position: -60% 0; }
}

.photo-btn:hover img { transform: scale(1.035); }

.photo-btn.is-broken::after {
  content: "фото недоступно";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  background: var(--bg-3);
  color: var(--muted-2);
  font-size: 9.5px;
  text-align: center;
}

.photo-more {
  position: absolute;
  right: 6px;
  bottom: 6px;
  padding: 1px 6px;
  border-radius: var(--radius);
  background: rgba(6, 10, 10, .78);
  color: #dfe8e2;
  font: 10px/1.5 var(--mono);
}

/* подвал карточки */

.card-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px 12px;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--line-soft);
}

.byline {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.byline .author {
  max-width: 100%;
  overflow: hidden;
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.byline .community {
  max-width: 100%;
  overflow: hidden;
  color: var(--muted-2);
  font-size: 10.5px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.foot-right {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 4px 12px;
  margin-left: auto;
}

.card-date {
  color: var(--muted);
  font: 11px/1.4 var(--mono);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.source-link {
  color: var(--accent);
  font-size: 11.5px;
  text-decoration: none;
  white-space: nowrap;
  border-bottom: 1px solid transparent;
}

.source-link:hover { border-bottom-color: currentColor; }
.source-link.is-muted { color: var(--muted-2); }

/* заголовки групп по датам */

.group-head {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 2px 2px 0;
}

.group-head:not(:first-child) { margin-top: 8px; }

.group-date {
  flex: 0 0 auto;
  color: var(--muted);
  font: 600 11px/1.2 var(--mono);
  letter-spacing: .8px;
  text-transform: uppercase;
}

.group-rel {
  flex: 0 0 auto;
  color: var(--muted-2);
  font-size: 10.5px;
}

.group-head::after {
  content: "";
  flex: 1 1 auto;
  height: 1px;
  background: var(--line-soft);
}

/* ─────────────────────────── карточка точки ─────────────────────────── */

.cards.is-spots {
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
}

.spot-card {
  gap: 12px;
  padding: 15px 16px;
  border-left: 2px solid #33543f;
}

.spot-card:hover {
  border-color: #3a4b50;
  border-left-color: #4d8563;
}

.spot-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px 18px;
}

.spot-place {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.spot-title {
  font-size: 16px;
  font-weight: 650;
  line-height: 1.25;
  letter-spacing: .1px;
  overflow-wrap: anywhere;
}

.spot-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
}

.badge-posts {
  padding: 3px 8px;
  border-color: #3c6b50;
  background: var(--accent-bg);
  color: #cdeed9;
  font: 600 11px/1.35 var(--sans);
  letter-spacing: 0;
  text-transform: none;
}

.spot-last {
  color: var(--muted-2);
  font-size: 10.5px;
}

.spot-coord-box {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  min-width: 0;
}

.spot-coord {
  font-size: 32px;
  line-height: 1.05;
}

.spot-coord.coord-empty {
  font-size: 13px;
}

.spot-coord-box .btn-copy { margin-top: 4px; }

.spot-zone {
  display: block;
  margin-top: 2px;
  color: #8fb08f;
  font-size: 12px;
  letter-spacing: .2px;
}

.spot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px 18px;
  padding-top: 10px;
  border-top: 1px solid var(--line-soft);
}

.spot-block { min-width: 0; }

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  min-width: 0;
}

.chip {
  max-width: 100%;
  padding: 2px 7px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--bg-2);
  color: var(--text-dim);
  font-size: 11px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.chip-fish {
  border-color: #2f5c41;
  background: #16251c;
  color: #a9d9b8;
}

.chip-empty {
  color: var(--muted-2);
  font-size: 11px;
  font-style: italic;
}

/* ─────────────────────────── пусто / ещё / загрузка ─────────────────────────── */

.empty {
  padding: 46px 20px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  text-align: center;
}

.empty h2 {
  margin-bottom: 6px;
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
}

.empty p {
  margin-bottom: 15px;
  font-size: 12.5px;
  line-height: 1.55;
}

.loading-line {
  margin: 14px 0;
  color: var(--muted-2);
  font-size: 11.5px;
  text-align: center;
}

.loading-line::after {
  content: "…";
  animation: blink 1.2s steps(2) infinite;
}

@keyframes blink { 50% { opacity: .25; } }

.more {
  display: flex;
  justify-content: center;
  padding: 14px 0 4px;
}

.more .btn { min-width: 160px; }

.sentinel { height: 1px; }

/* ─────────────────────────── модальное окно ─────────────────────────── */

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 7, 8, .84);
  backdrop-filter: blur(3px);
}

.modal-dialog {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 92vw;
  max-width: min(1100px, 92vw);
  max-height: 90vh;
}

#modal-img {
  display: block;
  max-width: 100%;
  max-height: calc(90vh - 44px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #050808;
  object-fit: contain;
}

.modal-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  max-width: 100%;
  color: var(--muted);
  font-size: 11.5px;
}

.modal-caption {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.modal-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}

.modal-arrow {
  width: 28px;
  height: 26px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-2);
  color: var(--text-dim);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}

.modal-arrow:hover { background: var(--bg-3); }

.modal-counter {
  min-width: 46px;
  color: var(--muted);
  font: 10.5px/1 var(--mono);
  text-align: center;
}

.modal-close {
  position: fixed;
  top: 14px;
  right: 16px;
  z-index: 2;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(17, 22, 23, .9);
  color: var(--text);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.modal-close:hover { border-color: #46585d; background: var(--bg-3); }

/* ─────────────────────────── скроллбары ─────────────────────────── */

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { border: 3px solid var(--bg); border-radius: 6px; background: #2c3a3e; }
::-webkit-scrollbar-thumb:hover { background: #3a4b50; }

/* ─────────────────────────── адаптив ─────────────────────────── */

@media (min-width: 1100px) {
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Сводка справочника рыбы — только там, где для неё хватает ширины. */
@media (max-width: 1100px) {
  .topbar .fish-summary { display: none; }
}

@media (max-width: 980px) {
  .shell { grid-template-columns: minmax(0, 1fr); }

  .filters {
    position: static;
    display: none;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 14px;
  }

  .filters.is-open { display: flex; }

  .filters-toggle { display: inline-flex; }

  .filters-apply { display: none; }

  .filters.is-open .filters-apply {
    display: inline-flex;
    position: fixed;
    left: 14px;
    right: 14px;
    bottom: 14px;
    z-index: 30;
    width: auto;
    margin: 0;
    min-height: 48px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, .55);
  }

  .filters.is-open { padding-bottom: 76px; }

  .filters .filters-close { display: inline-flex; }

  .filters-foot { margin-top: 2px; }

  .main { padding: 14px 14px 40px; }
}

@media (max-width: 760px) {
  .nav-links { display: none; }
}

@media (max-width: 640px) {
  .topbar {
    flex-wrap: wrap;
    gap: 6px 12px;
    padding: 8px 12px;
  }

  .brand { flex: 0 0 auto; }
  .brand-mark { width: 30px; height: 30px; font-size: 10px; }
  .brand-text strong,
  .brand-text h1 { font-size: 13.5px; }
  .brand-text small,
  .brand-text p { display: none; }

  .nav {
    flex: 0 0 100%;
    order: 3;
    margin-left: 0;
    padding: 2px 0 0;
  }

  .nav a { padding: 7px 11px; font-size: 12px; }

  .btn { padding: 6px 10px; font-size: 11.5px; }

  .main { padding: 12px 10px 32px; }

  .listbar { align-items: center; }

  .listbar-tools { margin-left: auto; }

  .view-switch button { padding: 5px 10px; }

  .card { padding: 13px; gap: 11px; }

  .place h2 { font-size: 15px; }

  .coord-value { font-size: 24px; }

  .coords { padding: 8px 10px; }

  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 12px; }

  .photos { gap: 6px; height: 124px; }

  .spot-title { font-size: 15px; }
  .spot-coord { font-size: 26px; }
  .spot-coord-box { align-items: flex-start; }
  .spot-grid { grid-template-columns: minmax(0, 1fr); }

  .site-footer {
    flex-direction: column;
    gap: 4px;
    padding: 14px 12px 24px;
  }

  .modal { padding: 10px; }
  .modal-dialog { max-height: 94vh; }
  #modal-img { max-height: calc(94vh - 40px); }
}

@media (max-width: 480px) {
  .facts { grid-template-columns: minmax(0, 1fr); }
  .foot-right { margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    transition-duration: .001ms !important;
  }
}

/* ─────────────────────── доступность и тач-цели ─────────────────────── */

/* Заголовок страницы для скринридеров: визуально скрыт, но в структуре есть. */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* На тач-экранах и узких окнах увеличиваем цели до 44px:
   кнопки, сегменты, поля и ключевые ссылки. Плотность десктопа не меняем. */
@media (max-width: 980px) {
  .btn,
  .btn-copy,
  .filters-toggle,
  .btn-link,
  .nav a,
  .segmented button {
    min-height: 44px;
  }

  .nav a,
  .btn-link {
    display: inline-flex;
    align-items: center;
  }

  .brand { min-height: 44px; }

  body .hot-item { min-height: 44px; }

  body .fish-check input[type="checkbox"] { width: 20px; height: 20px; }

  input[type="search"],
  select {
    min-height: 44px;
  }

  .source-link {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0 2px;
  }

  .modal-arrow,
  .modal-close {
    width: 44px;
    height: 44px;
  }

  .notice-close,
  .notice-action {
    min-height: 44px;
    padding: 6px 8px;
  }

  body .guide-tab { min-height: 44px; }
  body .fish-detail-close { width: 44px; height: 44px; }
  body .back-link { display: inline-flex; align-items: center; min-height: 44px; }
  body .check input[type="checkbox"] { width: 20px; height: 20px; }
}
