﻿:root {
  --bg: #f5f6f8;
  --card: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --line: #dde1e7;
  --accent: #1d4ed8;
  --accent-soft: #e5edff;
  --ok: #0f766e;
  --btn-shadow: 0 10px 22px rgba(15, 23, 42, .12);
  --btn-shadow-hover: 0 14px 30px rgba(15, 23, 42, .18);
  --mobile-panel-offset: 0px;
}

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scrollbar-gutter: stable;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.4;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
  white-space: nowrap;
}

.topbar {
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.topbar-inner {
  width: min(1180px, calc(100% - 24px));
  margin: 0 auto;
  min-height: 56px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  padding: 8px 0;
  font-size: 15px;
}

.topbar a {
  color: #0f172a;
  text-decoration: none;
  padding: 10px 20px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, .55);
  background: linear-gradient(180deg, #ffffff 0%, #eef2f7 100%);
  box-shadow: 0 4px 10px rgba(15, 23, 42, .08), inset 0 1px 0 rgba(255, 255, 255, .86);
  font-weight: 700;
  font-size: 15px;
  line-height: 1.2;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.topbar a:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(15, 23, 42, .14), inset 0 1px 0 rgba(255, 255, 255, .9);
  border-color: rgba(148, 163, 184, .72);
}


.container {
  width: min(1180px, calc(100% - 24px));
  margin: 26px auto 40px;
}

h1 {
  margin: 0 0 16px;
  font-size: clamp(28px, 3vw, 42px);
  line-height: 1.1;
}

.title-logo {
  display: block;
  height: clamp(34px, 4.5vw, 72px);
  max-width: min(100%, 760px);
  width: auto;
  margin: 0 auto;
}

.lead {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 15px;
}

.hero-logo-wrap {
  margin: 6px 0 10px;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 16px;
}

.hero-cta a {
  text-decoration: none;
  border-radius: 999px;
  min-height: 42px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  font-weight: 700;
  font-size: 14px;
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #1e293b;
  box-shadow: 0 6px 14px rgba(15, 23, 42, .08);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.hero-cta a:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(15, 23, 42, .13);
  border-color: #94a3b8;
}

.hero-cta .primary {
  border-color: #1d4ed8;
  color: #fff;
  background: linear-gradient(180deg, #3b82f6 0%, #1d4ed8 100%);
  box-shadow: 0 10px 22px rgba(29, 78, 216, .28);
}

.quick-sections {
  margin: 0 0 14px;
  display: grid;
  gap: 8px;
}

.quick-sections-title {
  margin: 0;
  font-size: 13px;
  line-height: 1.3;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #64748b;
}

.quick-sections-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.quick-section-link {
  text-decoration: none;
  min-height: 36px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid #cbd5e1;
  background: linear-gradient(180deg, #ffffff 0%, #f1f5f9 100%);
  color: #0f172a;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 6px 14px rgba(15, 23, 42, .08);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.quick-section-link:hover {
  transform: translateY(-1px);
  border-color: #94a3b8;
  box-shadow: 0 10px 18px rgba(15, 23, 42, .12);
}

.panel {
  position: relative;
  background: #f7f9fc;
  border: 1px solid #d6deea;
  border-radius: 14px;
  padding: 10px;
  margin-bottom: 12px;
  box-shadow: 0 8px 20px rgba(15, 23, 42, .07);
  overflow: hidden;
}

.admin-panel {
  margin-bottom: 18px;
  padding: 16px;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, .32);
  background: #fff;
  box-shadow: 0 10px 22px rgba(15, 23, 42, .08);
}

.hidden {
  display: none !important;
}

.admin-title {
  margin: 0 0 10px;
  font-size: 18px;
  font-weight: 800;
  color: #0f172a;
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.admin-grid .full {
  grid-column: 1 / -1;
}

.admin-grid input,
.admin-grid textarea,
.admin-grid select {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
  background: #fff;
}

.admin-grid textarea {
  min-height: 90px;
  resize: vertical;
}

.admin-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 10px;
}

.admin-add {
  border: 1px solid #1d4ed8;
  background: linear-gradient(180deg, #3b82f6 0%, #1d4ed8 100%);
  color: #fff;
  height: 40px;
  padding: 0 16px;
  border-radius: 10px;
  font-weight: 700;
  cursor: pointer;
}

.admin-status {
  font-size: 13px;
  color: #334155;
}

.owner-login {
  margin-bottom: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.owner-login input {
  width: min(320px, 92vw);
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  background: #fff;
}

.owner-login button {
  border: 1px solid #1d4ed8;
  background: linear-gradient(180deg, #3b82f6 0%, #1d4ed8 100%);
  color: #fff;
  height: 40px;
  padding: 0 16px;
  border-radius: 10px;
  font-weight: 700;
  cursor: pointer;
}

.owner-hint {
  font-size: 13px;
  color: #475569;
}

.panel::before {
  display: none;
}

.search-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-bottom: 8px;
  align-items: center;
  position: relative;
  z-index: 1;
}

.search-row.is-focused {
  grid-template-columns: 1fr auto;
}

.search-input-wrap {
  position: relative;
  min-width: 0;
}

.search-row input,
.search-row select,
.search-row button:not(.search-clear) {
  height: 44px;
  border: 1px solid #c9d4e3;
  border-radius: 12px;
  font-size: 15px;
}

.search-row input,
.search-row select {
  width: 100%;
  padding: 0 12px;
  background: #fff;
  border: 1.5px solid #c9d4e3;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .95), 0 2px 8px rgba(15, 23, 42, .05);
  transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease;
}

.search-row input {
  padding-right: 44px;
}

.search-row input[type="search"]::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
  display: none;
}

.search-row input::-webkit-clear-button {
  -webkit-appearance: none;
  appearance: none;
  display: none;
}

.search-row input[type="search"]::-ms-clear {
  display: none;
  width: 0;
  height: 0;
}

.search-row input:focus,
.search-row select:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, .16);
}

.search-row .search-btn {
  display: none;
  min-width: 108px;
  border: 1px solid #1d4ed8;
  background: linear-gradient(180deg, #3b82f6 0%, #1d4ed8 100%);
  color: #fff;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  letter-spacing: .25px;
  padding: 0 16px;
  box-shadow: 0 6px 16px rgba(30, 64, 175, .26);
  appearance: none;
  -webkit-appearance: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
}

.search-row.is-focused .search-btn {
  display: inline-flex;
}

.search-row .search-clear {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%) scale(.92);
  width: 18px;
  height: 18px;
  min-width: 18px;
  min-height: 18px;
  max-width: 18px;
  max-height: 18px;
  flex: 0 0 18px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #5f6b7b;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  font-size: 0;
  line-height: 0;
  appearance: none;
  -webkit-appearance: none;
  box-shadow: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease, color .18s ease;
  user-select: none;
  -webkit-user-select: none;
}

.search-row.has-query:not(.is-focused) .search-clear {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(-50%) scale(1);
}

.search-row .search-clear::before,
.search-row .search-clear::after {
  content: "";
  position: absolute;
  width: 11px;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
}

.search-row .search-clear::before {
  transform: rotate(45deg);
}

.search-row .search-clear::after {
  transform: rotate(-45deg);
}

.search-row .search-clear:hover {
  color: #334155;
  background: transparent;
}

.search-row .search-clear:focus-visible {
  outline: none;
  box-shadow: none;
}

.search-btn-label {
  pointer-events: none;
  white-space: nowrap;
}

.search-row .search-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(30, 64, 175, .32);
  filter: saturate(1.02);
}

.search-row .search-btn:active {
  transform: translateY(0) scale(.98);
}

.search-row .search-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, .24), 0 8px 18px rgba(30, 64, 175, .25);
}

.search-suggest {
  margin: -1px 0 8px;
  border: 1px solid rgba(148, 163, 184, .4);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 10px 22px rgba(15, 23, 42, .10);
  overflow: hidden;
  position: relative;
  z-index: 2;
}

.search-suggest-item {
  width: 100%;
  border: 0;
  border-top: 1px solid rgba(226, 232, 240, .8);
  background: transparent;
  text-align: left;
  padding: 8px 12px;
  font-size: 13px;
  color: #0f172a;
  cursor: pointer;
  line-height: 1.35;
}

.search-suggest-item:first-child {
  border-top: 0;
}

.search-suggest-item:hover {
  background: #eff6ff;
}

.search-suggest-item.is-active,
.search-suggest-item:focus-visible {
  background: #dbeafe;
  outline: none;
}

.search-suggest-item strong {
  color: #1d4ed8;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  justify-content: flex-end;
  font-size: 13px;
  position: relative;
  z-index: 1;
  padding-top: 4px;
  border-top: 1px solid #e4eaf3;
}

.filters label {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  color: #334155;
  cursor: pointer;
  user-select: none;
  font-weight: 700;
  min-height: 34px;
  padding: 0 10px;
  border-radius: 10px;
  border: 1px solid #d0d9e8;
  background: #f1f5fb;
  box-shadow: none;
}

.filters select {
  min-height: 34px;
  border-radius: 10px;
  border: 1px solid #c7d1e1;
  padding: 0 10px;
  font-size: 12px;
  background: #fff;
  box-shadow: 0 2px 6px rgba(15, 23, 42, .05);
}

.filters select:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, .14);
}

.filters .reset {
  border: 1px solid #c7d1e1;
  background: #fff;
  color: #0f172a;
  height: 34px;
  padding: 0 14px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(15, 23, 42, .05);
  transition: transform .18s ease, box-shadow .18s ease;
}

.filters .reset:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 16px rgba(15, 23, 42, .12);
}

.filters .reset:focus-visible {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, .14);
}

.filters .reset:active {
  transform: translateY(0) scale(.98);
}

.sync-status {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid #dbeafe;
  background: #eff6ff;
  color: #1e3a8a;
  font-size: 13px;
  line-height: 1.35;
}

.sync-status[data-state="loading"] {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1e40af;
}

.sync-status[data-state="success"] {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #166534;
}

.sync-status[data-state="error"] {
  border-color: #fecaca;
  background: #fef2f2;
  color: #991b1b;
}

.meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin: 12px 0;
  color: var(--muted);
  font-size: 13px;
}

.search-fallback-note {
  margin: -4px 0 10px;
  border: 1px solid #dbe5f5;
  border-radius: 10px;
  background: #f8fbff;
  color: #334155;
  font-size: 13px;
  line-height: 1.4;
  padding: 8px 10px;
}

.pagination {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: 0 0 14px;
}

.page-btn {
  min-width: 36px;
  height: 40px;
  border: 1px solid #d2d9e4;
  background: linear-gradient(180deg, #ffffff 0%, #f2f5fa 100%);
  border-radius: 11px;
  cursor: pointer;
  font-size: 13px;
  color: #374151;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(15, 23, 42, .08), inset 0 1px 0 rgba(255, 255, 255, .75);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.page-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 12px 22px rgba(15, 23, 42, .14), inset 0 1px 0 rgba(255, 255, 255, .86);
  border-color: #c0cada;
}

.page-btn.active {
  background: linear-gradient(180deg, #3b82f6 0%, #1d4ed8 100%);
  border-color: #1e40af;
  color: #fff;
  font-weight: 700;
  box-shadow: 0 14px 24px rgba(29, 78, 216, .32), inset 0 1px 0 rgba(255, 255, 255, .3);
}

.page-btn:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.load-more-wrap {
  display: flex;
  justify-content: center;
  margin: 2px 0 16px;
}

.load-more-btn {
  min-width: 220px;
  height: 46px;
  border: 1px solid #1e40af;
  border-radius: 14px;
  background: linear-gradient(180deg, #3b82f6 0%, #1d4ed8 100%);
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: .01em;
  cursor: pointer;
  box-shadow: 0 14px 24px rgba(29, 78, 216, .3), inset 0 1px 0 rgba(255, 255, 255, .28);
  transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
}

.load-more-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 30px rgba(29, 78, 216, .36), inset 0 1px 0 rgba(255, 255, 255, .32);
  filter: saturate(1.06);
}

.load-more-btn:active {
  transform: translateY(0) scale(.985);
}

.load-more-btn:disabled {
  opacity: .55;
  cursor: not-allowed;
  filter: grayscale(.15);
  box-shadow: 0 8px 14px rgba(29, 78, 216, .18), inset 0 1px 0 rgba(255, 255, 255, .28);
}

.list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: 1fr;
  gap: 14px;
  align-items: stretch;
}

.card {
  background: #fff;
  border: 1px solid #dde1e7;
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
  align-self: stretch;
  box-shadow: none;
  transition: border-color .22s ease;
}

.card-image {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  padding: 0;
  overflow: hidden;
  background: #fff;
}

.card-image picture {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 0;
  background: #fff;
}

.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 0;
}

.thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  border: 1px solid #dde1e7;
  border-radius: 8px;
  background: #fff;
  min-height: 0;
  user-select: none;
  -webkit-user-drag: none;
  transition: transform .28s ease;
}

.card-image.contain .thumb {
  object-fit: contain;
  background: #fff;
}

.thumb-category {
  position: absolute;
  left: 6px;
  bottom: 6px;
  border-radius: 8px;
  border: 1px solid #d9e7db;
  background: #ffffff;
  color: #22a447;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  padding: 4px 7px;
  box-shadow: 0 4px 10px rgba(15, 23, 42, .08);
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
  max-width: calc(100% - 12px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  z-index: 2;
}

.card-body {
  padding: 11px 12px 12px;
  background: #fff;
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}

.card-title {
  margin: 0 0 7px;
  font-size: 18px;
  line-height: 1.22;
  min-height: calc(1.22em * 2);
  max-height: calc(1.22em * 2);
  font-weight: 700;
  overflow-wrap: break-word;
  overflow: hidden;
}

.card-title-link {
  color: inherit;
  text-decoration: none;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  max-height: calc(1.22em * 2);
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-title-link:hover {
  text-decoration: underline;
}

.card-title mark {
  background: #fef08a;
  color: #111827;
  border-radius: 4px;
  padding: 0 2px;
}

.card-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.action {
  position: relative;
  overflow: hidden;
  height: 34px;
  border-radius: 9px;
  --action-fill: #e5e7eb;
  --action-border: #e5e7eb;
  --action-text: #111827;
  border: 1px solid var(--action-border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1;
  color: var(--action-text);
  background: var(--action-fill);
  box-shadow: none;
  transition: transform .15s ease, background-color .15s ease, border-color .15s ease;
  gap: 0;
  white-space: nowrap;
  padding: 0 14px;
  min-width: 124px;
  justify-self: start;
  user-select: none;
  -webkit-user-drag: none;
  text-shadow: none;
}

.action::before {
  content: none;
}

.action > span {
  position: relative;
  z-index: 2;
}

.action-icon {
  display: none;
}

.action-icon svg {
  width: 12px;
  height: 12px;
  display: block;
  fill: currentColor;
}

.action:hover {
  transform: translateY(-1px);
  border-color: var(--action-border);
  background: var(--action-fill);
  filter: brightness(.97);
}

.action:active {
  transform: translateY(0) scale(.985);
}

.action:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, .2);
}

.action.open,
.action.shop {
  --action-fill: #23b100;
  --action-border: #23b100;
  --action-text: #ffffff;
}

.action.open .action-icon,
.action.shop .action-icon {
  color: #ffffff;
}

.action.file {
  --action-fill: #e5e7eb;
  --action-border: #e5e7eb;
  --action-text: #111827;
}

.action.file .action-icon {
  color: #ffffff;
}

.empty {
  padding: 20px;
  background: #fff;
  border: 1px dashed #cbd5e1;
  border-radius: 10px;
  color: #475569;
  font-size: 14px;
}

.empty-text {
  margin: 0 0 10px;
}

.did-you-mean {
  margin: 0 0 10px;
  font-size: 13px;
  color: #334155;
  line-height: 1.4;
}

.did-you-mean-title {
  margin-right: 6px;
  color: #0f172a;
  font-weight: 700;
}

.did-you-mean-option {
  border: 0;
  background: transparent;
  color: #1d4ed8;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
  margin: 0 8px 0 0;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.did-you-mean-option:last-child {
  margin-right: 0;
}

.empty-similar {
  height: 34px;
  border-radius: 10px;
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #1e293b;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  margin: 0 0 10px;
}

.empty-reset {
  height: 36px;
  border-radius: 10px;
  border: 1px solid #93c5fd;
  background: linear-gradient(180deg, #eff6ff 0%, #dbeafe 100%);
  color: #1d4ed8;
  padding: 0 14px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 14px rgba(59, 130, 246, .16);
}

.empty-reset:hover {
  filter: saturate(1.05);
}

.fallback-wrap {
  margin-top: 12px;
}

.fallback-title {
  margin: 0 0 10px;
  font-size: 22px;
  line-height: 1.2;
  color: #0f172a;
}

.site-footer {
  margin-top: 26px;
  background:
    radial-gradient(900px 360px at 0 -40%, rgba(16, 185, 129, .16), transparent 62%),
    radial-gradient(900px 380px at 100% -40%, rgba(59, 130, 246, .16), transparent 64%),
    linear-gradient(180deg, #242a33 0%, #1e232c 100%);
  border-top: 1px solid rgba(148, 163, 184, .24);
}

.site-footer-inner {
  width: min(1180px, calc(100% - 24px));
  margin: 0 auto;
  padding: 28px 0 18px;
  display: grid;
  gap: 20px;
}

.site-footer-inner-empty {
  min-height: 210px;
  display: grid;
  align-content: space-between;
  gap: 16px;
}

.site-footer-social {
  width: max-content;
  max-width: 100%;
}

.site-footer-social-title {
  margin: 0 0 6px;
  color: #f4f7fb;
  font-family: "Segoe UI", Arial, Helvetica, sans-serif;
  font-size: clamp(10px, 0.8vw, 15px);
  line-height: 1.2;
  font-weight: 400;
  letter-spacing: .04em;
  text-transform: uppercase;
  opacity: .88;
}

.site-footer-vk-link {
  display: inline-block;
  text-decoration: none;
  border: 0;
  background: transparent;
  padding: 0;
  transition: transform .16s ease, filter .16s ease;
}

.site-footer-vk-link img {
  width: 34px;
  height: 34px;
  object-fit: contain;
  border-radius: 9px;
  display: block;
  box-shadow: 0 10px 22px rgba(0, 0, 0, .24);
}

.site-footer-vk-link:hover {
  transform: translateY(-1px);
  filter: saturate(1.06);
}

.site-footer-brand {
  border: 1px solid rgba(148, 163, 184, .22);
  border-radius: 16px;
  padding: 16px;
  background: linear-gradient(180deg, rgba(30, 41, 59, .74) 0%, rgba(15, 23, 42, .62) 100%);
  box-shadow: 0 18px 32px rgba(0, 0, 0, .26);
}

.site-footer-logo {
  margin: 0;
  color: #f8fafc;
  font-size: clamp(24px, 2.7vw, 34px);
  line-height: 1.05;
  letter-spacing: -.01em;
  font-weight: 900;
}

.site-footer-lead {
  margin: 10px 0 0;
  color: #dbe5f4;
  font-size: 15px;
  line-height: 1.55;
  max-width: 760px;
}

.site-footer-stats {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.site-footer-stat {
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, .3);
  background: linear-gradient(180deg, rgba(51, 65, 85, .68) 0%, rgba(30, 41, 59, .72) 100%);
  padding: 10px 12px;
  display: grid;
  gap: 4px;
}

.site-footer-stat strong {
  font-size: 23px;
  line-height: 1;
  font-weight: 900;
  color: #f8fafc;
}

.site-footer-stat span {
  font-size: 12px;
  line-height: 1.35;
  color: #cbd5e1;
  font-weight: 600;
}

.site-footer-links {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.site-footer-col {
  border: 1px solid rgba(148, 163, 184, .2);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(30, 41, 59, .65) 0%, rgba(15, 23, 42, .6) 100%);
  padding: 14px;
  display: grid;
  gap: 9px;
  align-content: start;
}

.site-footer-col h3 {
  margin: 0 0 2px;
  color: #f8fafc;
  font-size: 15px;
  line-height: 1.3;
  font-weight: 800;
  letter-spacing: .02em;
}

.site-footer-col a {
  color: #dbe5f4;
  text-decoration: none;
  font-size: 14px;
  line-height: 1.3;
  font-weight: 600;
}

.site-footer-col a:hover {
  color: #93c5fd;
  text-decoration: underline;
}

.site-footer-bottom {
  border-top: 1px solid rgba(148, 163, 184, .24);
  padding-top: 12px;
}

.site-footer-bottom p {
  margin: 0;
  color: #cbd5e1;
  font-size: 13px;
  line-height: 1.4;
}

@media (hover: hover) {
  .card:hover,
  .card:hover .thumb {
    transform: none;
  }
}

@media (min-width: 761px) {
  .card-title {
    font-size: 10px;
    line-height: 1.2;
    min-height: calc(1.2em * 2);
    max-height: calc(1.2em * 2);
  }
  .card-title-link {
    -webkit-line-clamp: 2;
    line-clamp: 2;
    max-height: calc(1.2em * 2);
  }
  .card-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0;
    align-items: stretch;
    width: 100%;
  }
  .card-actions .action {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    height: 30px;
    min-height: 30px;
    max-height: 30px;
    font-size: 11px;
    border-radius: 0;
    justify-self: auto;
    padding: 0 8px;
  }
  .card-actions .action:first-child {
    border-radius: 8px 0 0 8px;
  }
  .card-actions .action:last-child {
    border-radius: 0 8px 8px 0;
    border-left: 0;
    margin-left: 0;
  }
}

@media (max-width: 960px) {
  .list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .container {
    margin: 14px auto 20px;
    width: min(1180px, calc(100% - 14px));
  }
  .panel {
    padding: 10px;
    border-radius: 12px;
  }
  .search-row {
    grid-template-columns: 1fr;
    gap: 6px;
    margin-bottom: 8px;
  }
  .search-row.is-focused {
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .search-row input,
  .search-row select,
  .search-row button:not(.search-clear) {
    height: 44px;
    border-radius: 12px;
    font-size: 15px;
  }
  .search-row .search-btn {
    min-width: 96px;
    width: auto;
  }
  .filters {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
    justify-content: stretch;
  }
  .filters label,
  .filters select,
  .filters .reset {
    width: 100%;
  }
  .filters label {
    justify-content: flex-start;
  }
  .meta {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
    margin: 10px 0;
  }
  .list {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .card-actions {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .action {
    height: 40px;
    font-size: 13px;
  }
}

@media (max-width: 640px) {
  .topbar-inner {
    gap: 8px;
    min-height: auto;
    overflow-x: auto;
    overflow-y: hidden;
    flex-wrap: nowrap;
    width: min(1180px, calc(100% - 20px));
    padding: 8px 2px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .topbar-inner::-webkit-scrollbar {
    display: none;
  }
  .topbar a {
    font-size: 13px;
    padding: 9px 12px;
    flex: 0 0 auto;
    text-align: center;
    min-width: 0;
    white-space: nowrap;
    min-height: 40px;
  }
  .container { margin: 16px auto 24px; width: min(1180px, calc(100% - 16px)); }
  h1 { margin: 0 0 10px; }
  .title-logo { height: auto; max-height: 56px; max-width: 100%; }
  .lead { font-size: 14px; margin-bottom: 14px; }
  .hero-cta { margin-bottom: 14px; }
  .hero-cta a { min-height: 40px; font-size: 13px; }
  .quick-sections { margin-bottom: 12px; }
  .quick-sections-title { font-size: 12px; }
  .quick-sections-list { display: grid; grid-template-columns: 1fr; gap: 7px; }
  .quick-section-link { min-height: 34px; font-size: 12px; justify-content: center; }
  .panel {
    padding: 10px;
    border-radius: 12px;
  }
  .search-row { grid-template-columns: 1fr; }
  .search-suggest {
    margin: -1px 0 8px;
    border-radius: 10px;
  }
  .search-suggest-item {
    padding: 8px 10px;
    font-size: 13px;
  }
  .filters {
    justify-content: stretch;
    display: grid;
    grid-template-columns: 1fr;
  }
  .list {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .admin-grid { grid-template-columns: 1fr; }
  .search-row input,
  .search-row select,
  .search-row button:not(.search-clear) { height: 44px; border-radius: 12px; font-size: 15px; }
  .search-row input {
    padding: 0 40px 0 12px;
    font-size: 15px;
    line-height: 1.2;
    appearance: none;
    -webkit-appearance: none;
  }
  .search-row .search-btn {
    min-width: 92px;
    width: auto;
    justify-self: auto;
  }
  .filters label,
  .filters select { min-height: 36px; height: 36px; font-size: 12px; }
  .filters .reset {
    min-height: 36px;
    height: 36px;
    padding: 0 14px;
    width: 100%;
  }
  .pagination {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
  }
  .page-btn {
    flex: 0 0 auto;
    min-width: 42px;
    height: 38px;
    font-size: 12px;
  }
  .load-more-wrap {
    margin: 0 0 14px;
  }
  .load-more-btn {
    width: 100%;
    min-width: 0;
    height: 44px;
    border-radius: 13px;
    font-size: 14px;
  }
  .card {
    border-radius: 10px;
  }
  .card-image {
    aspect-ratio: 4 / 3;
    padding: 0;
  }
  .thumb-category {
    left: 6px;
    bottom: 6px;
    font-size: 11px;
    padding: 5px 8px;
  }
  .card-body { padding: 9px 10px 10px; }
  .card-title {
    font-size: 17px;
    margin-bottom: 6px;
    min-height: calc(1.22em * 2);
  }
  .card-actions {
    gap: 8px;
    grid-template-columns: 1fr;
  }
  .action {
    height: 36px;
    font-size: 13px;
    padding: 0 11px;
    border-radius: 9px;
    gap: 7px;
    min-width: 0;
    justify-self: stretch;
  }
  .action-icon {
    width: 18px;
    height: 18px;
    flex-basis: 18px;
  }
  .action-icon svg {
    width: 11px;
    height: 11px;
  }
  .site-footer {
    margin-top: 18px;
  }
  .site-footer-inner {
    width: min(1180px, calc(100% - 14px));
    padding: 16px 0 14px;
    gap: 10px;
  }
  .site-footer-inner-empty {
    min-height: 120px;
    display: grid;
    align-content: space-between;
    gap: 10px;
  }
  .site-footer-vk-link img {
    width: 29px;
    height: 29px;
    border-radius: 8px;
  }
  .site-footer-social-title {
    font-size: 9px;
    margin-bottom: 6px;
    font-weight: 400;
    letter-spacing: .04em;
  }
  .site-footer-brand {
    border-radius: 12px;
    padding: 12px;
  }
  .site-footer-logo {
    font-size: 22px;
  }
  .site-footer-lead {
    margin-top: 8px;
    font-size: 14px;
  }
  .site-footer-stats {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .site-footer-links {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .site-footer-col {
    border-radius: 11px;
    padding: 11px;
    gap: 7px;
  }
  .site-footer-col h3 {
    font-size: 14px;
  }
  .site-footer-col a {
    font-size: 13px;
  }
  .site-footer-bottom p {
    font-size: 12px;
  }
}

@media (max-width: 420px) {
  .topbar a {
    flex: 0 0 auto;
    font-size: 12px;
  }
  .search-row input::placeholder { font-size: 14px; }
  .card-title {
    font-size: 16px;
    min-height: calc(1.22em * 2);
  }
  .pagination { gap: 5px; }
  .page-btn { min-width: 38px; }
}

@media (max-width: 520px) {
  .topbar-inner {
    width: min(1180px, calc(100% - 12px));
    gap: 6px;
  }
  .topbar a {
    flex: 0 0 auto;
    min-height: 42px;
    font-size: 13px;
    padding: 9px 10px;
  }
  .container {
    margin: 12px auto 18px;
    width: min(1180px, calc(100% - 12px));
  }
  .title-logo {
    max-height: 52px;
  }
  .lead {
    margin-bottom: 10px;
    font-size: 13px;
  }
  .panel {
    padding: 8px;
    border-radius: 12px;
  }
  .search-row {
    gap: 6px;
    margin-bottom: 8px;
  }
  .search-row input,
  .search-row select,
  .search-row button:not(.search-clear) {
    height: 42px;
    font-size: 14px;
  }
  .search-row input {
    padding: 0 40px 0 12px;
  }
  .search-row .search-btn {
    min-width: 88px;
    width: auto;
  }
  .list {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .filters {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
    justify-content: stretch;
  }
  .filters label {
    grid-column: 1 / -1;
    justify-self: start;
  }
  .filters select,
  .filters .reset {
    width: 100%;
    min-width: 0;
  }
  .meta {
    font-size: 12px;
    margin: 10px 0;
  }
  .pagination {
    gap: 4px;
  }
  .page-btn {
    min-width: 36px;
    height: 36px;
    font-size: 12px;
  }
  .load-more-btn {
    height: 42px;
    font-size: 13px;
    border-radius: 12px;
  }
  .card {
    border-radius: 10px;
  }
  .card-image {
    aspect-ratio: 4 / 3;
    padding: 0;
  }
  .thumb-category {
    left: 6px;
    bottom: 6px;
    font-size: 10px;
    padding: 4px 7px;
  }
  .card-body {
    padding: 8px 9px 9px;
  }
  .card-title {
    font-size: 14px;
    margin-bottom: 6px;
    min-height: calc(1.22em * 2);
  }
  .card-actions {
    gap: 8px;
    grid-template-columns: 1fr;
  }
  .action {
    height: 34px;
    font-size: 12px;
    gap: 5px;
    border-radius: 9px;
    padding: 0 10px;
    justify-self: stretch;
  }
  .action-icon {
    width: 18px;
    height: 18px;
    flex-basis: 18px;
  }
  .action-icon svg {
    width: 11px;
    height: 11px;
  }
  .empty {
    padding: 14px;
  }
  .empty-reset {
    width: 100%;
    min-height: 40px;
  }
}

@media (max-width: 420px) {
  .topbar a { flex: 0 0 auto; }
  .filters {
    grid-template-columns: 1fr;
  }
  .filters label {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 390px) {
  .list {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .card-title {
    font-size: 14px;
    min-height: calc(1.22em * 2);
  }
  .action {
    height: 32px;
    font-size: 11px;
  }
}

/* Final mobile overrides: keep latest search/card updates stable on phones. */
@media (max-width: 760px) {
  .panel {
    padding: 8px;
  }

  .search-row,
  .search-row.is-focused {
    display: block;
    grid-template-columns: 1fr;
    gap: 0;
  }

  .search-input-wrap {
    min-width: 0;
  }

  .search-row input#searchInput {
    height: 42px;
    border-radius: 14px;
    font-size: 16px;
    padding: 0 42px 0 12px;
  }

  .search-row button.search-btn:not(.search-clear) {
    display: inline-flex;
    position: absolute;
    top: 50%;
    right: 4px;
    transform: translateY(-50%);
    min-width: 84px;
    height: 34px;
    min-height: 34px;
    max-height: 34px;
    padding: 0 12px;
    border-radius: 10px;
    margin: 0;
    line-height: 1;
    font-size: 15px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    z-index: 3;
    box-shadow: 0 6px 14px rgba(30, 64, 175, .24);
  }

  .search-row.is-focused button.search-btn:not(.search-clear) {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .search-row button.search-btn:not(.search-clear):hover {
    transform: translateY(-50%);
  }

  .search-row button.search-btn:not(.search-clear):active {
    transform: translateY(-50%) scale(.98);
  }

  .search-row.is-focused input#searchInput {
    padding-right: 98px;
  }

  .search-row .search-clear {
    right: 12px;
    width: 20px;
    height: 20px;
    min-width: 20px;
    min-height: 20px;
    color: #4b5563;
  }

  .filters {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
    justify-content: stretch;
    padding-top: 6px;
  }

  .filters label {
    display: none;
  }

  .filters select {
    width: 100%;
    height: 40px;
    min-height: 40px;
    font-size: 14px;
  }

  .filters .reset {
    width: auto;
    min-width: 110px;
    height: 40px;
    min-height: 40px;
    padding: 0 14px;
    white-space: nowrap;
  }

  .list {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .card {
    border-radius: 10px;
  }

  .card-body {
    padding: 9px 10px 10px;
  }

  .card-title {
    font-size: 15px;
    line-height: 1.24;
    min-height: calc(1.24em * 2);
    max-height: calc(1.24em * 2);
  }

  .card-title-link {
    max-height: calc(1.24em * 2);
  }

  .card-actions {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .action {
    width: 100%;
    min-width: 0;
    height: 36px;
    font-size: 13px;
  }

  .did-you-mean {
    font-size: 14px;
  }

  .empty-similar,
  .empty-reset {
    width: 100%;
  }
}

@media (max-width: 420px) {
  .search-row button.search-btn:not(.search-clear) {
    min-width: 76px;
    height: 32px;
    min-height: 32px;
    max-height: 32px;
    font-size: 13px;
    padding: 0 10px;
  }

  .search-row.is-focused input#searchInput {
    padding-right: 90px;
  }

  .filters {
    grid-template-columns: 1fr;
  }

  .filters .reset {
    width: 100%;
  }

  .card-title {
    font-size: 14px;
  }
}

/* Final topbar buttons: clean style + stable adaptation for desktop/tablet/phone */
.topbar-inner {
  width: min(1180px, calc(100% - 24px));
  margin: 0 auto;
  min-height: 60px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 10px 0;
}

.topbar a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 24px;
  border-radius: 999px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #0f172a;
  text-decoration: none;
  font-weight: 700;
  font-size: clamp(15px, 1.45vw, 17px);
  line-height: 1.1;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(15, 23, 42, .08);
  transition: background-color .16s ease, border-color .16s ease, box-shadow .16s ease, color .16s ease, transform .16s ease;
}

.topbar a:hover {
  border-color: #b8c3d2;
  background: #f8fafc;
  color: #0f172a;
  box-shadow: 0 8px 18px rgba(15, 23, 42, .12);
  transform: translateY(-1px);
}

.topbar a:focus-visible {
  outline: 3px solid rgba(148, 163, 184, .30);
  outline-offset: 2px;
  border-color: #94a3b8;
}

.topbar a[aria-current="page"] {
  border-color: #94a3b8;
  background: #ffffff;
  color: #0f172a;
  box-shadow: 0 6px 14px rgba(15, 23, 42, .10);
}

@media (max-width: 1024px) {
  .topbar-inner {
    width: min(1180px, calc(100% - 20px));
    gap: 10px;
    min-height: 56px;
  }
  .topbar a {
    min-height: 46px;
    padding: 0 18px;
    font-size: 15px;
  }
}

@media (max-width: 760px) {
  .topbar-inner {
    width: min(1180px, calc(100% - 12px));
    display: flex;
    flex-wrap: nowrap;
    gap: 3px;
    min-height: auto;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 4px 1px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .topbar-inner::-webkit-scrollbar {
    display: none;
  }
  .topbar a {
    width: auto;
    min-height: 30px;
    padding: 0 7px;
    font-size: 11px;
    text-align: center;
    white-space: nowrap;
    flex: 0 0 auto;
  }
}

@media (max-width: 420px) {
  .topbar-inner {
    width: min(1180px, calc(100% - 10px));
    gap: 3px;
  }
  .topbar a {
    min-height: 28px;
    padding: 0 6px;
    font-size: 10px;
  }
}

@media (hover: none) {
  .search-row input,
  .search-row input:focus {
    transform: none;
  }
  .action::before {
    transform: none;
  }
  .card:hover {
    transform: none;
    box-shadow: 0 8px 16px rgba(15, 23, 42, .06);
  }
  .card:hover .thumb {
    transform: none;
  }
  .topbar a:hover,
  .search-row .search-btn:hover,
  .filters .reset:hover,
  .load-more-btn:hover,
  .page-btn:hover:not(:disabled),
  .action:hover {
    transform: none;
    filter: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .card,
  .thumb,
  .action,
  .action::before {
    transition: none !important;
  }
}
