:root {
  --bg: #f3efe6;
  --ink: #1c1a16;
  --muted: #6b655a;
  --line: #d8d0c2;
  --card: #fffdf8;
  --accent: #0f6a4f;
  --accent-soft: #d9eee5;
  --shadow: 0 10px 30px rgba(40, 30, 10, 0.06);
  --font: "Segoe UI", "IBM Plex Sans", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html {
  overflow-x: clip;
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(1200px 500px at 10% -10%, #e8f3ee 0%, transparent 55%),
    linear-gradient(180deg, #f7f3ea 0%, var(--bg) 40%, #ebe4d7 100%);
  min-height: 100vh;
  overflow-x: clip;
  max-width: 100vw;
}

.top {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1.5rem 1.75rem 1rem;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 253, 248, 0.75);
  backdrop-filter: blur(8px);
}

.top-main {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
  position: relative;
}

.top-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  justify-content: flex-end;
}

.mobile-nav-toggle {
  display: none;
  flex-shrink: 0;
  width: 2.5rem;
  height: 2.5rem;
  margin-left: auto;
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  background: var(--card);
  padding: 0;
  cursor: pointer;
  position: relative;
  z-index: 1100;
}

.mobile-nav-toggle-bars {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 1.15rem;
  margin: 0 auto;
}

.mobile-nav-toggle-bars span {
  display: block;
  height: 2px;
  border-radius: 999px;
  background: var(--ink);
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.mobile-nav-toggle.is-open .mobile-nav-toggle-bars span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.mobile-nav-toggle.is-open .mobile-nav-toggle-bars span:nth-child(2) {
  opacity: 0;
}

.mobile-nav-toggle.is-open .mobile-nav-toggle-bars span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

.mobile-nav-shell {
  display: none;
}

.brand-name {
  margin: 0;
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand-link {
  color: inherit;
  text-decoration: none;
}

.brand-link:hover {
  color: var(--accent);
}

.brand-sub {
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.pill {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.pill.accent {
  background: var(--accent-soft);
  border-color: #b7dccb;
  color: var(--accent);
  font-weight: 600;
}

main {
  max-width: 1440px;
  margin: 0 auto;
  padding: 1.25rem 1.25rem 3rem;
}

.tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  padding-bottom: 0.15rem;
}

.tabs > .tab,
.tabs > .import-presets {
  flex: 0 0 auto;
}

.tab {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--muted);
  font-weight: 600;
  text-decoration: none;
}

.tab:hover {
  color: var(--accent);
  border-color: #b7dccb;
}

.tab.active {
  background: var(--accent-soft);
  border-color: #b7dccb;
  color: var(--accent);
}

.tab-count {
  min-width: 1.4rem;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  background: rgba(15, 106, 79, 0.12);
  color: var(--accent);
  font-size: 0.78rem;
  text-align: center;
}

.import-presets {
  position: relative;
}

.import-presets-trigger {
  cursor: pointer;
  font: inherit;
}

.import-presets.is-open .import-presets-trigger {
  background: var(--accent-soft);
  border-color: #b7dccb;
  color: var(--accent);
}

.import-presets-menu {
  /* Fixed so the menu is not clipped by .tabs { overflow-x: auto }. */
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1400;
  display: none;
  gap: 0.35rem;
  min-width: 20rem;
  max-width: min(24rem, calc(100vw - 2rem));
  padding: 0.45rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  box-shadow: 0 10px 28px rgba(28, 26, 22, 0.12);
}

.import-presets.is-open .import-presets-menu {
  display: grid;
}

.import-preset-link {
  display: block;
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.35;
  text-decoration: none;
}

.import-preset-link:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

.filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1rem;
  box-shadow: var(--shadow);
  align-items: end;
}

.filters label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.filters input,
.filters select,
.filters button {
  font: inherit;
  border-radius: 10px;
  border: 1px solid var(--line);
  padding: 0.55rem 0.65rem;
  background: #fff;
  color: var(--ink);
}

.filters button {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  cursor: pointer;
  font-weight: 600;
}

.filters button:hover {
  filter: brightness(1.05);
}

.filters-panel {
  margin-bottom: 1rem;
}

.filters-panel-head {
  display: none;
}

.filters-panel-toggle {
  appearance: none;
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  box-shadow: var(--shadow);
  cursor: pointer;
}

.filters-panel-toggle-label {
  line-height: 1.2;
}

.filters-panel-badge {
  min-width: 1.35rem;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  background: var(--accent-soft);
  border: 1px solid #b7dccb;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.3;
}

.make-model-filters {
  grid-column: 1 / -1;
  padding-bottom: 0.75rem;
  margin-bottom: 0.25rem;
  border-bottom: 1px solid var(--line);
}

.vehicle-hierarchy-rows {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.vehicle-hierarchy-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 32px;
  gap: 0.75rem;
  align-items: end;
}

.vehicle-hierarchy-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}

.vehicle-hierarchy-label {
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.2;
}

.vehicle-hierarchy-field select {
  width: 100%;
  box-sizing: border-box;
  font: inherit;
  border-radius: 10px;
  border: 1px solid var(--line);
  padding: 0.65rem 0.75rem;
  min-height: 44px;
  background: #fff;
  color: var(--ink);
  font-size: 0.95rem;
  cursor: pointer;
}

.vehicle-hierarchy-field select:disabled {
  background: #f8faf9;
  color: var(--muted);
  cursor: not-allowed;
}

.vehicle-hierarchy-field select:focus {
  outline: 2px solid rgba(15, 106, 79, 0.25);
  border-color: var(--accent);
}

.vehicle-hierarchy-remove {
  width: 32px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--muted);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

.vehicle-hierarchy-remove:hover {
  color: #b42318;
  border-color: #fecdca;
  background: #fff5f5;
}

.vehicle-hierarchy-actions {
  margin-top: 0.65rem;
}

.vehicle-hierarchy-add {
  appearance: none;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--accent);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0.55rem 0.85rem;
}

.vehicle-hierarchy-add:hover {
  border-color: var(--accent);
  background: rgba(15, 106, 79, 0.06);
}

.year-range-filters {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding-bottom: 0.75rem;
  margin-bottom: 0.25rem;
  border-bottom: 1px solid var(--line);
}

.year-range-label {
  font-size: 0.8rem;
  color: var(--muted);
}

.year-range-inputs {
  display: grid;
  grid-template-columns: repeat(2, minmax(120px, 1fr));
  gap: 0.75rem;
  max-width: 360px;
}

.year-range-inputs select {
  width: 100%;
  box-sizing: border-box;
  font: inherit;
  border-radius: 10px;
  border: 1px solid var(--line);
  padding: 0.65rem 0.75rem;
  min-height: 44px;
  background: #fff;
  color: var(--ink);
  font-size: 0.95rem;
  cursor: pointer;
}

.year-range-filters.is-active .year-range-inputs select {
  border-color: var(--accent);
}

.spec-filters-row {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.75rem;
  padding-bottom: 0.75rem;
  margin-bottom: 0.25rem;
  border-bottom: 1px solid var(--line);
  align-items: end;
}

.volume-range-filters {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}

.volume-range-label {
  font-size: 0.8rem;
  color: var(--muted);
}

.volume-range-inputs {
  display: grid;
  grid-template-columns: repeat(2, minmax(72px, 1fr));
  gap: 0.5rem;
}

.volume-range-inputs select {
  width: 100%;
  box-sizing: border-box;
  font: inherit;
  border-radius: 10px;
  border: 1px solid var(--line);
  padding: 0.65rem 0.75rem;
  min-height: 44px;
  background: #fff;
  color: var(--ink);
  font-size: 0.95rem;
  cursor: pointer;
}

.volume-range-filters.is-active .volume-range-inputs select {
  border-color: var(--accent);
}

.filters .catalog-filter-field.catalog-multi-select {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.8rem;
  color: var(--muted);
  min-width: 0;
}

.catalog-multi-select {
  position: relative;
  min-width: 0;
  z-index: 1;
}

.catalog-multi-select.is-open {
  z-index: 50;
}

.filters:has(.catalog-multi-select.is-open) {
  overflow: visible;
}

.catalog-multi-select-trigger {
  position: relative;
  align-self: stretch;
  display: flex;
  align-items: center;
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.65rem 2rem 0.65rem 0.75rem;
  min-height: 44px;
  background: #fff;
  color: var(--ink);
  font-size: 0.95rem;
  line-height: 1.15;
  cursor: pointer;
}

.catalog-multi-select-trigger::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 12px;
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid var(--muted);
  transform: translateY(-35%);
  pointer-events: none;
}

.catalog-multi-select-trigger:focus {
  outline: 2px solid rgba(15, 106, 79, 0.25);
  border-color: var(--accent);
}

.catalog-filter-field.is-active .catalog-multi-select-trigger {
  border-color: var(--accent);
  background: rgba(15, 106, 79, 0.04);
}

.catalog-multi-select-trigger-label {
  display: block;
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.catalog-multi-select-menu {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 60;
  min-width: 100%;
  width: max-content;
  max-width: min(420px, calc(100vw - 24px));
  padding: 4px 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: var(--shadow);
  max-height: 280px;
  overflow-y: auto;
  color: var(--ink);
}

.catalog-multi-select-menu.is-fit-content {
  max-height: none;
  overflow-y: visible;
}

.catalog-multi-select.is-open .catalog-multi-select-menu {
  display: grid;
  gap: 0;
}

.filters label.catalog-multi-select-row,
.filters label.catalog-multi-select-row-main {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0;
  width: auto;
  min-width: 0;
  margin: 0;
  font-size: 0.9rem;
  color: var(--ink);
}

.catalog-multi-select-row {
  padding: 6px 12px;
  line-height: 1.15;
  cursor: pointer;
  white-space: nowrap;
}

.catalog-multi-select-row-sub {
  padding-left: 28px;
}

.catalog-multi-select-row.is-selected {
  background: rgba(15, 106, 79, 0.12);
}

.catalog-multi-select-mark {
  flex: 0 0 22px;
  width: 22px;
  height: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.catalog-multi-select-row.is-selected .catalog-multi-select-mark {
  background: center / 13px 10px no-repeat
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 13 10'%3E%3Cpath fill='%230f6a4f' d='M4.8 9.5 0.5 5.2 1.6 4.1 4.8 7.3 11.4 0.7 12.5 1.8z'/%3E%3C/svg%3E");
}

.catalog-multi-select-input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: 0;
  padding: 0;
  pointer-events: none;
}

.catalog-multi-select-label {
  flex: 1 1 auto;
  min-width: 0;
}

.catalog-multi-select-values {
  display: none;
}

.summary {
  margin: 1rem 0;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
}

.summary p {
  margin: 0;
}

.listings-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
}

.cards-sort {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.cards-sort-label {
  white-space: nowrap;
}

.cards-sort-select {
  appearance: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%236b655a' d='M1 1l5 5 5-5'/%3E%3C/svg%3E") no-repeat right 0.7rem center;
  color: var(--ink);
  font: inherit;
  font-size: 0.85rem;
  padding: 0.4rem 1.8rem 0.4rem 0.85rem;
  cursor: pointer;
  min-width: 12rem;
}

.cards-sort-select:hover,
.cards-sort-select:focus {
  border-color: var(--accent);
  outline: none;
}

.listings-view-toggle {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
  background: var(--card);
}

.listings-view-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.85rem;
  padding: 0.4rem 0.85rem;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.listings-view-btn + .listings-view-btn {
  border-left: 1px solid var(--line);
}

.listings-view-btn.is-active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}

.listings-view-btn:hover:not(.is-active) {
  color: var(--ink);
  background: rgba(255, 253, 248, 0.8);
}

.catalog.listings-feed {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-top: 0.5rem;
}

.listing-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px;
  box-shadow: var(--shadow);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.listing-card:hover {
  transform: translateY(-2px);
  border-color: #b7dccb;
  box-shadow: 0 14px 32px rgba(15, 106, 79, 0.12);
}

.card-cover-link {
  position: relative;
  display: block;
  margin-bottom: 6px;
  border-radius: 8px;
  overflow: hidden;
  line-height: 0;
  text-decoration: none;
  aspect-ratio: 4 / 3;
  background: #eef2f0;
}

.card-cover-empty {
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-cover-placeholder {
  font-size: 0.85rem;
  color: var(--muted);
}

.catalog-cover {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  display: block;
  transition: transform 0.15s ease;
}

.card-cover-link:hover .catalog-cover {
  transform: scale(1.03);
}

.listings-feed-gallery {
  position: relative;
  margin-bottom: 6px;
}

.listings-feed-gallery .card-cover-link {
  margin-bottom: 0;
}

.listings-feed-gallery-nav {
  position: absolute;
  top: 50%;
  z-index: 2;
  transform: translateY(-50%);
  width: 32px;
  height: 36px;
  border: 0;
  padding: 0;
  background: rgba(15, 23, 42, 0.42);
  color: #fff;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s ease, background 0.15s ease;
}

.listings-feed-gallery-nav svg {
  display: block;
  width: 18px;
  height: 18px;
  margin: 0 auto;
}

.listings-feed-gallery-nav:hover,
.listings-feed-gallery-nav:focus-visible {
  background: rgba(15, 23, 42, 0.62);
  opacity: 1;
  outline: none;
}

.listings-feed-gallery-prev {
  left: 0;
  border-radius: 0 8px 8px 0;
}

.listings-feed-gallery-next {
  right: 0;
  border-radius: 8px 0 0 8px;
}

.listings-feed-gallery:hover .listings-feed-gallery-nav {
  opacity: 0.92;
}

.listings-feed-gallery-counter {
  position: absolute;
  right: 8px;
  bottom: 8px;
  z-index: 2;
  background: rgba(15, 23, 42, 0.55);
  color: #fff;
  border-radius: 999px;
  padding: 0.15rem 0.45rem;
  font-size: 0.72rem;
}

.listings-feed .listing-card {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.listing-card-title {
  margin: 0 0 4px;
  font-size: 15px;
  line-height: 1.25;
}

.listing-card-title a {
  display: inline;
  color: inherit;
  text-decoration: none;
}

.listing-card-title .listing-make,
.listing-card-title .listing-model,
.listing-card-title .listing-card-year {
  display: inline;
  white-space: normal;
  overflow: visible;
  max-width: none;
}

.listing-card-title .listing-model {
  margin-left: 0.25em;
}

.listing-card-year {
  font-weight: 600;
  color: var(--ink);
}

.listing-card-title a:hover {
  color: var(--accent);
}

.listing-card-meta {
  margin: 2px 0;
  font-size: 13px;
  line-height: 1.3;
}

.listing-card-desc {
  margin: 6px 0 0;
  font-size: 12px;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.listing-card-date {
  margin: 4px 0 0;
  font-size: 11px;
}

.listing-card-no-volume {
  margin-top: 6px;
}

.listing-spec-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}

.listing-spec-tags span {
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  border-radius: 999px;
  border: 1px solid #c8e6da;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11px;
}

.listings-feed .listings-feed-price {
  margin-top: auto;
  padding-top: 10px;
  margin-left: -10px;
  margin-right: -10px;
  margin-bottom: -10px;
  width: calc(100% + 20px);
}

.card-price-bar {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  height: 58px;
  box-sizing: border-box;
  border-top: 1px solid var(--line);
  border-radius: 0 0 13px 13px;
  overflow: visible;
  background: linear-gradient(180deg, #f8fbf9 0%, #edf5f1 100%);
}

.card-price-bar.card-price-vat {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  height: auto;
  min-height: 58px;
}

.card-price-cell {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 6px 8px;
  min-width: 0;
  box-sizing: border-box;
}

.listings-feed .card-price-bar.card-price-vat .card-price-cell {
  padding: 5px 4px;
}

.listings-feed .card-price-bar.card-price-vat .card-price-label {
  font-size: 8px;
}

.listings-feed .card-price-bar.card-price-vat .card-price-value {
  font-size: 0.78rem;
}

.card-price-cell + .card-price-cell {
  border-left: 1px solid var(--line);
}

.card-price-label {
  display: block;
  font-size: 9px;
  line-height: 1.15;
  text-transform: none;
  letter-spacing: 0;
  color: var(--muted);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-price-value {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-price-rb .card-price-value,
.card-price-vat .card-price-cell:nth-child(n + 3) .card-price-value {
  color: var(--ink);
}

.card-price-bar .price-rb-value {
  font-weight: 700;
}

.card-price-bar .price-vat-slot + .price-vat-slot {
  margin-top: 0;
}

.card-price-bar .price-vat-label-text {
  font-size: 10px;
}

.card-price-net {
  cursor: help;
}

.card-price-net::after {
  content: attr(data-tip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translateX(-50%);
  width: min(260px, 70vw);
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(20, 40, 30, 0.16);
  color: var(--ink);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.35;
  white-space: normal;
  text-align: left;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s ease;
  z-index: 40;
}

.card-price-net:hover::after,
.card-price-net:focus-within::after {
  opacity: 1;
}

.card-price-admin {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 6px 10px 8px;
  border-top: 1px solid var(--line);
  border-radius: 0 0 13px 13px;
  background: #f3f8f5;
}

.listings-feed-price:has(.card-price-admin) .card-price-bar {
  border-radius: 0;
}

.listings-feed .listing-card:has(.price-rb:focus-within),
.listings-feed .listing-card:has(.price-rb:hover),
.listings-feed .listing-card:has(.card-price-net:hover),
.listings-feed .listing-card:has(.card-price-net:focus-within) {
  position: relative;
  z-index: 25;
}

.table-wrap {
  overflow-x: auto;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.listings-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1180px;
  table-layout: fixed;
  --col-gutter: 0.45rem;
  --col-gutter-tight: 0.12rem;
}

/* Saved table layout (2026-09-01, user-tuned). */
.listings-table col.col-photo { width: 155px; }
.listings-table col.col-auto { width: calc((100% - 155px) * 0.0994); }
.listings-table col.col-engine { width: calc((100% - 155px) * 0.1348); }
.listings-table col.col-price-lt { width: calc((100% - 155px) * 0.0801); }
.listings-table col.col-price-rb { width: calc((100% - 155px) * 0.1171); }
.listings-table col.col-city { width: calc((100% - 155px) * 0.1308); }
.listings-table col.col-description { width: calc((100% - 155px) * 0.3054); }
.listings-table col.col-date { width: calc((100% - 155px) * 0.1324); }

th.col-price-lt .sort-link {
  justify-content: flex-start;
  flex-wrap: nowrap;
}

th.col-auto,
td.col-auto {
  padding-left: var(--col-gutter-tight);
  padding-right: var(--col-gutter-tight);
}

th.col-engine,
td.col-engine {
  padding-left: var(--col-gutter-tight);
  padding-right: var(--col-gutter-tight);
}

th.col-price-lt,
td.col-price-lt {
  padding-left: var(--col-gutter-tight);
  padding-right: 0.5cm;
  text-align: left;
  position: relative;
  z-index: 2;
}

th.col-price-lt.th-wrap .sort-label,
th.col-price-lt .sort-label {
  white-space: nowrap;
  word-break: keep-all;
  hyphens: manual;
}

th.col-price-rb,
td.col-price-rb {
  padding-left: 0.5cm;
  padding-right: var(--col-gutter-tight);
  text-align: left;
  position: relative;
  z-index: 1;
}

th.col-city,
td.col-city {
  padding-left: var(--col-gutter-tight);
}

.price-vat-slot + .price-vat-slot {
  margin-top: 0.35rem;
}

.price-vat-label-bridge {
  position: relative;
  min-height: 2.45em;
  margin-bottom: 0.08rem;
}

.price-vat-label-bridge-spacer {
  visibility: hidden;
}

td.col-price-lt .price-vat-label-text {
  position: absolute;
  left: 0;
  top: 0;
  width: calc(200% + 1cm);
  text-align: center;
  font-size: 0.72rem;
  line-height: 1.2;
  white-space: normal;
  pointer-events: none;
}

.price-vat-lt-value,
.price-vat-rb-value {
  white-space: nowrap;
}

.price-vat-rb-value {
  color: #1a4d8c;
  font-weight: 600;
}

.price-vat-rb-value .price-rb {
  display: inline-block;
}

.listing-admin-actions-under-price {
  margin-top: 0.45rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
}

.listing-admin-actions-under-price .button-link-small,
.listing-admin-actions-under-price .admin-inline-form button {
  padding: 0.16rem 0.34rem;
  font-size: 0.66rem;
  line-height: 1.15;
  white-space: nowrap;
}

.listing-admin-actions-under-price .admin-inline-form {
  display: flex;
  margin: 0;
}

.listing-admin-actions-under-price .admin-inline-form button {
  width: auto;
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

.button-link-small {
  padding: 0.28rem 0.55rem;
  font-size: 0.78rem;
}

.button-link:hover {
  border-color: #b7dccb;
}

.btn-archive {
  color: #fff;
  background: #c0392b;
  border: 2px solid #962d22;
  box-shadow: 0 2px 6px rgba(192, 57, 43, 0.35);
  font-weight: 700;
}

.btn-archive:hover:not(:disabled) {
  background: #a93226;
  border-color: #7b241c;
}

.btn-electric {
  color: #0b3d91;
  background: #e8f1ff;
  border: 2px solid #9dbcf0;
  font-weight: 700;
}

.btn-electric:hover:not(:disabled) {
  background: #d7e8ff;
  border-color: #6f9de6;
}

.btn-restore {
  color: var(--accent);
  background: var(--card);
  border: 2px solid #b7dccb;
  font-weight: 700;
}

.btn-restore:hover:not(:disabled) {
  background: var(--accent-soft);
  border-color: var(--accent);
}

.admin-inline-form {
  display: inline;
  margin: 0;
}

.admin-inline-form button {
  cursor: pointer;
  font: inherit;
  border-radius: 999px;
}

.admin-enter-link {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--accent);
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
  font-size: 0.82rem;
  white-space: nowrap;
}

.admin-enter-link:hover {
  background: var(--accent-soft);
}

.admin-mode-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  white-space: nowrap;
}

.admin-mode-link {
  color: inherit;
  text-decoration: underline;
  font-weight: 600;
}

tbody tr {
  height: 1px;
}

th, td {
  padding: 1.16rem var(--col-gutter, 0.45rem);
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

td {
  overflow: hidden;
}

td.col-price-lt,
td.col-price-rb {
  overflow: visible;
  white-space: normal;
  vertical-align: top;
}

th.photo-col,
td.photo {
  width: 155px;
  min-width: 155px;
  max-width: 155px;
  padding: 0;
  height: 100%;
  position: relative;
  overflow: hidden;
}

th {
  background: #faf7f0;
  position: sticky;
  top: 0;
  z-index: 1;
  vertical-align: middle;
  overflow: visible;
}

.listings-table thead th {
  text-align: left;
}

.table-layout-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem 0.75rem;
  margin: 0 0 0.65rem;
  padding: 0.55rem 0.75rem;
  background: #faf7f0;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 0.82rem;
}

.table-layout-hint {
  color: var(--muted);
  flex: 1 1 220px;
}

.table-layout-btn {
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  border-radius: 8px;
  padding: 0.35rem 0.75rem;
  font: inherit;
  cursor: pointer;
}

.table-layout-btn:hover {
  filter: brightness(0.95);
}

.table-layout-btn-muted {
  background: #fff;
  color: var(--accent);
}

.table-layout-status {
  min-height: 1.2em;
  color: var(--muted);
}

.table-layout-status[data-state="success"] {
  color: #1f6b43;
}

.table-layout-status[data-state="error"] {
  color: #b42318;
}

.col-resize-handle {
  position: absolute;
  top: 0;
  right: -4px;
  width: 8px;
  height: 100%;
  cursor: col-resize;
  z-index: 3;
  touch-action: none;
  user-select: none;
}

.col-resize-handle::after {
  content: "";
  position: absolute;
  top: 0.35rem;
  bottom: 0.35rem;
  left: 50%;
  width: 2px;
  margin-left: -1px;
  border-radius: 1px;
  background: transparent;
  transition: background 0.15s ease;
}

.col-resize-handle:hover::after,
body.col-resize-active .col-resize-handle::after {
  background: rgba(26, 77, 140, 0.45);
}

body.col-resize-active {
  cursor: col-resize !important;
  user-select: none;
}

body.col-resize-active * {
  cursor: col-resize !important;
}

.listings-table thead th,
.listings-table thead th .col-head-label,
.listings-table thead th .sort-label,
.listings-table thead th .sort-link,
.listings-table thead th .city-filter-toggle {
  font-family: var(--font);
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--muted);
}

th.th-wrap .sort-label,
th.th-wrap .col-head-label,
th.th-wrap {
  white-space: normal;
  word-break: break-word;
  hyphens: auto;
}

th.sortable .sort-link {
  color: inherit;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.25rem;
  width: 100%;
  min-height: 100%;
}

.sort-label,
.col-head-label {
  flex: 0 1 auto;
  min-width: 0;
  text-align: left;
}

.sort-indicator {
  font-size: inherit;
  line-height: 1;
  flex-shrink: 0;
}

th.sortable .sort-link:hover {
  color: var(--accent);
  text-decoration: none;
}

th.sortable.active .sort-link,
th.sortable.active .sort-label {
  color: var(--accent);
}

tr:hover td {
  background: #fbf8f1;
}

tr:hover td.col-price-lt {
  z-index: 4;
}

tr:hover td.photo {
  background: transparent;
}

.photo img,
.photo-empty {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  border-radius: 0;
  background: #e8e2d6;
  display: block;
}

.list-gallery {
  position: absolute;
  inset: 0;
}

.list-photo-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 1.55rem;
  height: 1.55rem;
  border: 0;
  border-radius: 999px;
  background: rgba(28, 26, 22, 0.55);
  color: #fff;
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.list-gallery:hover .list-photo-nav,
.list-gallery:focus-within .list-photo-nav {
  display: inline-flex;
}

.list-photo-nav:hover {
  background: rgba(28, 26, 22, 0.8);
}

.list-photo-prev {
  left: 0.3rem;
}

.list-photo-next {
  right: 0.3rem;
}

.list-photo-counter {
  position: absolute;
  right: 0.35rem;
  bottom: 0.3rem;
  z-index: 2;
  padding: 0.1rem 0.35rem;
  border-radius: 999px;
  background: rgba(28, 26, 22, 0.55);
  color: #fff;
  font-size: 0.65rem;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  pointer-events: none;
}

a {
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
}

a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.muted {
  color: var(--muted);
  font-size: 0.82rem;
  margin-top: 0.15rem;
}

.num {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.col-city {
  font-size: 0.88rem;
  line-height: 1.3;
  white-space: normal;
}

.city-name {
  font-weight: 600;
}

.city-distance {
  margin-top: 0.15rem;
}

.city-map-link {
  display: inline-block;
  margin-top: 0.2rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent);
}

.detail-city .city-distance {
  margin-top: 0;
  margin-left: 0.35rem;
}

.detail-city .city-map-link {
  margin-top: 0;
  margin-left: 0.5rem;
}

.city-filter-th {
  position: relative;
  overflow: visible;
}

.city-filter-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.25rem;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.city-filter-th.active .city-filter-toggle {
  color: var(--accent);
  font-weight: 700;
}

.city-filter-panel {
  position: absolute;
  top: calc(100% + 0.35rem);
  right: 0;
  z-index: 30;
  width: min(280px, 70vw);
  max-height: 360px;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fffdf8;
  box-shadow: 0 12px 32px rgba(40, 30, 10, 0.16);
  text-transform: none;
  letter-spacing: normal;
  color: var(--ink);
}

.city-filter-panel[hidden] {
  display: none;
}

.city-filter-list {
  overflow: auto;
  max-height: 260px;
  display: grid;
  gap: 0.35rem;
}

.city-filter-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.45rem;
  align-items: center;
  font-size: 0.82rem;
  font-weight: 500;
  text-transform: none;
  letter-spacing: normal;
  color: var(--ink);
  cursor: pointer;
}

.city-filter-count {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.city-filter-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
}

.city-filter-actions button {
  font: inherit;
  border-radius: 8px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  padding: 0.4rem 0.7rem;
  cursor: pointer;
  font-weight: 600;
}

.city-filter-actions a {
  color: var(--accent);
  font-weight: 600;
  text-transform: none;
  letter-spacing: normal;
  font-size: 0.82rem;
}

.listing-name {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.1rem;
  max-width: 100%;
  line-height: 1.25;
}

.listing-make {
  display: block;
  white-space: nowrap;
}

.listing-model {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.col-date {
  white-space: nowrap;
}

.col-engine {
  white-space: normal;
  line-height: 1.25;
  font-size: 0.82rem;
}

.col-engine .spec-year-line {
  white-space: nowrap;
}

.body-type-line {
  line-height: 1.25;
  font-size: 0.82rem;
}

.body-type-line + .body-type-line {
  margin-top: 0.08rem;
}

.engine-kpp-sub {
  margin-top: 0.12rem;
}

.no-volume-editor {
  margin-top: 0.55rem;
  display: grid;
  gap: 0.35rem;
}

.no-volume-field {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.no-volume-label {
  font-size: 0.72rem;
  color: var(--muted);
}

.no-volume-input {
  width: 100%;
  box-sizing: border-box;
  font: inherit;
  border-radius: 8px;
  border: 1px solid var(--line);
  padding: 0.4rem 0.5rem;
  background: #fff;
  color: var(--ink);
  font-size: 0.85rem;
}

.no-volume-input:focus {
  outline: 2px solid rgba(15, 106, 79, 0.25);
  border-color: var(--accent);
}

.no-volume-save {
  appearance: none;
  font: inherit;
  border-radius: 8px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.38rem 0.55rem;
  cursor: pointer;
}

.no-volume-save:hover:not(:disabled) {
  filter: brightness(1.05);
}

.no-volume-save:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.no-volume-status {
  min-height: 1rem;
  font-size: 0.72rem;
  color: var(--muted);
}

.no-volume-status.is-ok {
  color: var(--accent);
}

.no-volume-status.is-error {
  color: #b42318;
}

.no-volume-status.is-pending {
  color: var(--muted);
}

.col-price-lt,
.col-price-rb {
  white-space: normal;
}

.price-rb-line + .price-rb-line {
  margin-top: 0.35rem;
}

.price-rb-line .price-rb {
  display: inline-block;
}

.price-rb-value {
  white-space: nowrap;
}

.price-vat-line {
  line-height: 1.25;
}

.price-vat-line + .price-vat-line {
  margin-top: 0.35rem;
}

.price-vat-amount {
  margin-top: 0.08rem;
  font-size: 0.92rem;
  line-height: 1.2;
}

.price-vat-note {
  margin-top: 0.2rem;
  font-size: 0.78rem;
  line-height: 1.2;
  white-space: normal;
}

.col-price-rb {
  color: #1a4d8c;
  font-weight: 600;
}

.price-rb {
  position: relative;
  display: inline-block;
  cursor: help;
  z-index: 1;
}

.price-rb:hover,
.price-rb:focus-within {
  z-index: 2;
}

.price-rb-tooltip {
  display: block;
  position: fixed;
  z-index: 10000;
  min-width: 280px;
  max-width: 360px;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fffdf8;
  box-shadow: 0 12px 32px rgba(40, 30, 10, 0.16);
  color: var(--ink);
  font-weight: 500;
  font-size: 0.78rem;
  line-height: 1.35;
  white-space: normal;
  pointer-events: none;
  isolation: isolate;
}

.price-rb-tooltip[hidden] {
  display: none;
}

.price-rb-tooltip p {
  margin: 0 0 0.35rem;
}

.price-rb-tooltip p:last-child {
  margin-bottom: 0;
  margin-top: 0.45rem;
  padding-top: 0.45rem;
  border-top: 1px solid var(--line);
  font-weight: 700;
  color: #1a4d8c;
}

.date-added {
  line-height: 1.25;
}

.date-added-time {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 500;
}

td.col-description {
  position: relative;
  overflow: hidden;
  padding-top: 1.16rem;
  padding-bottom: 1.16rem;
  vertical-align: middle;
}

.list-description {
  position: absolute;
  inset: 1.16rem 0.25rem;
  font-size: 0.72rem;
  line-height: 1.25;
  color: var(--muted);
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 8;
  word-break: break-word;
  text-overflow: ellipsis;
}

.mono {
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 0.82rem;
  word-break: break-all;
}

.filters label.check {
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 0.45rem;
  min-height: 2.4rem;
}

.check input[type="checkbox"] {
  width: 1.1rem;
  height: 1.1rem;
  margin: 0;
  flex-shrink: 0;
}

.check span {
  line-height: 1.2;
  color: var(--ink);
}

.pager {
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: center;
  margin-top: 1.25rem;
  color: var(--muted);
}

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

.empty {
  padding: 2rem;
  text-align: center;
  color: var(--muted);
  background: var(--card);
  border: 1px dashed var(--line);
  border-radius: 14px;
}

.tag {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  background: #efe8da;
  color: var(--muted);
}

.tag.ok {
  background: var(--accent-soft);
  color: var(--accent);
}

.ext {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--muted);
}

.detail-archive-form {
  display: inline;
  margin: 0;
}

.detail-archive-btn {
  border: 1px solid #b42318;
  background: #fff;
  color: #b42318;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
}

.detail-archive-btn:hover {
  background: #fef3f2;
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 1.25rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.25rem 1.25rem 3rem;
  width: 100%;
  box-sizing: border-box;
}

.detail-layout-no-gallery {
  grid-template-columns: minmax(0, 1fr);
  max-width: 760px;
}

.detail-gallery,
.detail-info,
.gallery,
.gallery-stage,
.thumbs {
  min-width: 0;
  max-width: 100%;
}

.detail-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  grid-column: 1 / -1;
  min-width: 0;
}

.detail-heading-text {
  min-width: 0;
  flex: 1;
}

.detail-back-link {
  display: inline-block;
  margin-bottom: 0.35rem;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
}

.detail-back-link:hover {
  color: var(--accent);
}

.detail-title {
  margin: 0;
  font-size: 1.35rem;
  line-height: 1.25;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}

.detail-heading .favorite-form,
.detail-heading .favorite-login-link {
  flex-shrink: 0;
}

.detail-scrape-note {
  margin: 0 0 1rem;
  padding: 0.65rem 0.85rem;
  border-radius: 10px;
  background: #faf7f0;
  border: 1px dashed var(--line);
  font-size: 0.88rem;
  line-height: 1.45;
}

.detail-scrape-note a {
  font-weight: 600;
}

.detail-gallery,
.detail-info {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1rem;
  box-shadow: var(--shadow);
}

.gallery-stage {
  position: relative;
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  background: #e8e2d6;
  line-height: 0;
}

.hero {
  width: 100%;
  max-width: 100%;
  height: auto;
  max-height: none;
  min-width: 0;
  object-fit: contain;
  border-radius: 12px;
  background: #e8e2d6;
  cursor: zoom-in;
  display: block;
}

.hero-empty {
  width: 100%;
  min-height: 220px;
  border-radius: 12px;
}

.gallery-nav,
.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 2.4rem;
  height: 2.4rem;
  border: 0;
  border-radius: 999px;
  background: rgba(28, 26, 22, 0.55);
  color: #fff;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.gallery-nav:hover,
.lightbox-nav:hover,
.lightbox-close:hover {
  background: rgba(28, 26, 22, 0.8);
}

.gallery-nav-prev,
.lightbox-nav-prev {
  left: 0.6rem;
}

.gallery-nav-next,
.lightbox-nav-next {
  right: 0.6rem;
}

.gallery-counter,
.lightbox-counter {
  position: absolute;
  right: 0.75rem;
  bottom: 0.75rem;
  z-index: 2;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  background: rgba(28, 26, 22, 0.6);
  color: #fff;
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
}

.thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.thumb-btn {
  position: relative;
  display: block;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
  overflow: hidden;
  aspect-ratio: 4 / 3;
}

.thumb-btn.is-active {
  border-color: var(--accent);
}

.thumbs img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  border-radius: 8px;
  background: #e8e2d6;
  display: block;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.lightbox[hidden] {
  display: none;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(12, 11, 9, 0.88);
}

.lightbox-img {
  position: relative;
  z-index: 1;
  max-width: min(96vw, 1200px);
  max-height: 90vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.35);
}

.lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 3;
  width: 2.5rem;
  height: 2.5rem;
  border: 0;
  border-radius: 999px;
  background: rgba(28, 26, 22, 0.55);
  color: #fff;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}

.lightbox-nav {
  z-index: 3;
  width: 3rem;
  height: 3rem;
  font-size: 2rem;
}

.lightbox-counter {
  left: 50%;
  right: auto;
  bottom: 1.25rem;
  transform: translateX(-50%);
}

body.lightbox-open {
  overflow: hidden;
}

.detail-info h2 {
  margin: 0 0 0.75rem;
  font-size: 1.05rem;
}

.detail-info h2 + .kv,
.detail-info h2 + .description {
  margin-bottom: 1.25rem;
}

.kv {
  margin: 0;
  display: grid;
  gap: 0.55rem;
  min-width: 0;
  max-width: 100%;
}

.kv > div {
  display: grid;
  grid-template-columns: minmax(0, 38%) minmax(0, 1fr);
  gap: 0.75rem;
  padding-bottom: 0.45rem;
  border-bottom: 1px solid var(--line);
  min-width: 0;
}

.kv dt {
  color: var(--muted);
  font-size: 0.86rem;
  min-width: 0;
}

.kv dd {
  margin: 0;
  font-weight: 600;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.detail-price-rb .price-vat-line,
.detail-price-rb .price-rb-line {
  line-height: 1.25;
}

.detail-price-rb .price-vat-line + .price-vat-line,
.detail-price-rb .price-rb-line + .price-rb-line {
  margin-top: 0.35rem;
}

.detail-price-rb .price-vat-label {
  font-weight: 400;
}

.detail-price-rb .price-vat-amount,
.detail-price-rb .price-rb-value {
  color: #1a4d8c;
  font-weight: 600;
}

.detail-price-rb .price-rb {
  display: inline-block;
}

.detail-url-label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.detail-url {
  min-width: 0;
}

.listing-live-check {
  font: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
  padding: 0.28rem 0.5rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  cursor: pointer;
}

.listing-live-check:hover:not(:disabled) {
  border-color: #b7dccb;
  color: var(--accent);
  background: var(--accent-soft);
}

.listing-live-check:disabled {
  opacity: 0.65;
  cursor: wait;
}

.listing-live-status {
  display: inline;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
  background: none;
  border: 0;
  padding: 0;
  min-width: 0;
  height: auto;
  border-radius: 0;
  color: var(--muted);
}

.listing-live-status.is-available {
  color: #0b7a45;
}

.listing-live-status.is-unavailable {
  color: #b42318;
}

.listing-live-status.is-unknown,
.listing-live-status.is-loading {
  color: var(--muted);
}

.listing-live-reason {
  font-size: 0.78rem;
  font-weight: 500;
  line-height: 1.2;
  max-width: 18rem;
}

.description {
  margin: 0;
  line-height: 1.5;
  color: #3a352c;
}

.analytics-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.85rem;
  margin-bottom: 1.25rem;
}

.stat-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.9rem 1rem;
}

.stat-label {
  margin: 0;
  font-size: 0.78rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.stat-value {
  margin: 0.35rem 0 0;
  font-size: 1.35rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.stat-hint {
  margin: 0.35rem 0 0;
  font-size: 0.75rem;
  color: var(--muted);
}

.analytics-section {
  margin-top: 1.5rem;
}

.section-title {
  margin: 0 0 0.75rem;
  font-size: 1.05rem;
}

.summary-line {
  margin: 0 0 0.75rem;
}

.analytics-table th,
.analytics-table td {
  font-size: 0.88rem;
  vertical-align: top;
}

.runs-table .diff-cell span {
  display: inline-block;
  margin-right: 0.35rem;
}

.diff-new { color: #1f7a45; }
.diff-removed { color: #b45309; }
.diff-same { color: var(--muted); }

.fail-count { color: #b91c1c; }

.badge {
  display: inline-block;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  background: #efe8da;
  color: #5c5345;
}

.badge-incremental { background: #e0f2fe; color: #0369a1; }
.badge-full { background: #dcfce7; color: #166534; }
.badge-smoke { background: #fef3c7; color: #92400e; }
.badge-partial { background: #f3e8ff; color: #6b21a8; }
.badge-unknown { background: #f3f4f6; color: #6b7280; }

.run-details-row td {
  background: #faf8f4;
  padding-top: 0;
  border-bottom: 1px solid var(--line);
}

.run-details-row details {
  font-size: 0.82rem;
  color: var(--muted);
}

.page-stats-list {
  margin: 0.5rem 0 0.75rem 1.1rem;
  padding: 0;
}

.page-stats-list li {
  margin: 0.15rem 0;
}

.pill.warn {
  background: rgba(180, 35, 24, 0.12);
  color: #b42318;
}

.flash.ok {
  margin: 0 0 1rem;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  background: rgba(15, 106, 79, 0.1);
  color: var(--accent);
}

.catalog-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.catalog-filters {
  flex: 1 1 520px;
}

.catalog-sync-btn {
  appearance: none;
  border: 1px solid var(--accent);
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 600;
  padding: 0.65rem 1rem;
  cursor: pointer;
}

.catalog-sync-btn:hover {
  filter: brightness(1.05);
}

.catalog-tree {
  display: grid;
  gap: 1.5rem;
}

.catalog-new-section {
  padding: 1rem;
  border: 1px solid #fecdca;
  border-radius: 14px;
  background: rgba(180, 35, 24, 0.04);
}

.catalog-section-head {
  margin-bottom: 1rem;
}

.catalog-section-title {
  margin: 0;
  font-size: 1.2rem;
}

.catalog-section-hint {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.catalog-main-section {
  display: grid;
  gap: 1.5rem;
}

.catalog-row-new {
  background: rgba(180, 35, 24, 0.06);
}

.catalog-make-block,
.catalog-model-block {
  min-width: 0;
}

.catalog-make-title {
  margin: 0 0 0.75rem;
  font-size: 1.35rem;
}

.catalog-model-title {
  margin: 0 0 0.65rem;
  font-size: 1rem;
  color: var(--muted);
  font-weight: 600;
}

.catalog-model-block + .catalog-model-block {
  margin-top: 1rem;
}

.catalog-table {
  min-width: 760px;
}

.catalog-row-missing {
  background: rgba(180, 35, 24, 0.04);
}

.catalog-row-manual .catalog-cm3-input {
  border-color: var(--accent);
}

.catalog-edit-cell {
  width: 150px;
}

.catalog-suggested-btn {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  margin: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 0.15em;
}

.catalog-suggested-ready .catalog-suggested-btn {
  color: var(--accent);
  font-weight: 600;
  text-decoration-style: solid;
}

.catalog-suggested-btn:hover,
.catalog-suggested-btn:focus-visible {
  color: var(--accent);
}

.catalog-cm3-input {
  width: 100%;
  box-sizing: border-box;
  font: inherit;
  border-radius: 10px;
  border: 1px solid var(--line);
  padding: 0.55rem 0.65rem;
  min-height: 40px;
}

.catalog-actions {
  white-space: nowrap;
}

.catalog-save-btn {
  appearance: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 0.82rem;
  padding: 0.4rem 0.65rem;
  cursor: pointer;
}

.catalog-save-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.catalog-save-status {
  display: inline-block;
  margin-left: 0.35rem;
  font-size: 0.78rem;
  color: var(--muted);
}

.catalog-save-status.is-ok {
  color: var(--accent);
}

.catalog-save-status.is-error {
  color: #b42318;
}

@media (max-width: 1400px) {
  .catalog.listings-feed {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 1100px) {
  .catalog.listings-feed {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

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

  .catalog.listings-feed {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .filters-panel-head {
    display: block;
    margin-bottom: 0.65rem;
  }

  .filters-panel:not(.is-open) .filters-panel-body {
    display: none;
  }

  .listings-view-toggle {
    display: none;
  }

  .summary {
    gap: 0.75rem;
  }

  .listings-toolbar {
    width: 100%;
  }

  .cards-sort {
    flex: 1 1 auto;
  }

  .cards-sort-select {
    flex: 1 1 auto;
    min-width: 0;
  }
}

@media (max-width: 700px) {
  .top {
    padding: 0.85rem 0.9rem;
  }

  main {
    padding: 0.85rem;
    max-width: 100%;
    overflow-x: clip;
  }

  main.detail-layout {
    padding: 0 0 2rem;
    gap: 0.85rem;
  }

  .detail-heading {
    padding: 0.75rem 0.85rem 0;
    align-items: center;
  }

  .detail-title {
    font-size: 1.15rem;
  }

  .detail-gallery {
    border: 0;
    border-radius: 0;
    box-shadow: none;
    padding: 0;
    background: #111;
  }

  .gallery-stage {
    border-radius: 0;
    background: #111;
  }

  .hero,
  .hero-empty {
    border-radius: 0;
    width: 100%;
    max-width: 100%;
  }

  .gallery-nav {
    width: 2.6rem;
    height: 2.6rem;
  }

  .gallery-nav-prev {
    left: 0.35rem;
  }

  .gallery-nav-next {
    right: 0.35rem;
  }

  .thumbs {
    padding: 0.65rem 0.85rem 0.85rem;
    background: var(--card);
  }

  .detail-info {
    margin: 0 0.85rem;
  }

  .brand {
    min-width: 0;
    flex: 1;
  }

  .brand-name {
    font-size: 1.15rem;
  }

  .brand-sub {
    display: none;
  }

  .top {
    position: sticky;
    top: 0;
    z-index: 1200;
  }

  .top-main {
    align-items: center;
    flex-wrap: nowrap;
  }

  .mobile-nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    order: 2;
  }

  .top-meta {
    display: none;
  }

  .desktop-tabs {
    display: none;
  }

  body.mobile-nav-open {
    overflow: hidden;
  }

  .mobile-nav-shell {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 1100;
  }

  .mobile-nav-shell[hidden] {
    display: none !important;
  }

  .mobile-nav-backdrop {
    position: absolute;
    inset: 0;
    border: 0;
    padding: 0;
    margin: 0;
    background: rgba(28, 26, 22, 0.48);
    cursor: pointer;
  }

  .mobile-nav-panel {
    position: absolute;
    top: 3.6rem;
    left: 0.75rem;
    right: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    max-height: calc(100vh - 4.5rem);
    overflow-y: auto;
    margin: 0;
    padding: 0.55rem;
    border: 1px solid var(--line);
    border-radius: 0.9rem;
    background: var(--card);
    box-shadow: 0 18px 40px rgba(28, 26, 22, 0.22);
  }

  .mobile-nav-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    width: 100%;
    padding: 0.7rem 0.8rem;
    border: 0;
    border-radius: 0.7rem;
    background: transparent;
    color: var(--ink);
    font: inherit;
    font-weight: 600;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
  }

  .mobile-nav-link:hover,
  .mobile-nav-link.is-active {
    background: var(--accent-soft);
    color: var(--accent);
  }

  .mobile-nav-group-trigger::after {
    content: "▾";
    color: var(--muted);
    font-size: 0.85rem;
  }

  .mobile-nav-group.is-open .mobile-nav-group-trigger::after {
    content: "▴";
  }

  .mobile-nav-submenu {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    padding: 0.15rem 0 0.35rem 0.55rem;
  }

  .mobile-nav-submenu[hidden] {
    display: none !important;
  }

  .mobile-nav-sublink {
    display: block;
    padding: 0.55rem 0.7rem;
    border-radius: 0.6rem;
    color: var(--muted);
    text-decoration: none;
    font-size: 0.92rem;
  }

  .mobile-nav-sublink:hover {
    background: #f3f0e8;
    color: var(--accent);
  }

  .filters,
  .vehicle-hierarchy-filters,
  .spec-filters-row,
  .summary,
  .listings-toolbar,
  .catalog.listings-feed,
  .listing-card,
  .card-price-bar {
    max-width: 100%;
  }

  .filters {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.65rem;
  }

  .vehicle-hierarchy-row,
  .spec-filters-row,
  .volume-range-filters,
  .listings-toolbar {
    min-width: 0;
    max-width: 100%;
    flex-wrap: wrap;
  }

  .catalog.listings-feed {
    grid-template-columns: 1fr;
    gap: 0.65rem;
    width: calc(100% + 1.7rem);
    margin-left: -0.85rem;
    margin-right: -0.85rem;
  }

  .listings-feed .listing-card {
    border-radius: 0;
    border-left: 0;
    border-right: 0;
    box-shadow: none;
  }

  .listings-feed .listing-card:hover {
    transform: none;
  }

  .listings-feed .card-price-bar {
    border-radius: 0;
  }

  .listings-view-toggle,
  .table-layout-controls,
  .table-wrap {
    display: none !important;
  }

  .card-price-bar {
    height: 58px;
  }

  .card-price-cell {
    padding: 6px 6px;
  }

  .card-price-label {
    font-size: 8px;
  }

  .card-price-value {
    font-size: 0.8rem;
  }

  .listing-card-title {
    overflow-wrap: anywhere;
  }
}

.auth-page {
  display: flex;
  justify-content: center;
  padding: 2rem 1rem 3rem;
}

.auth-panel {
  width: min(100%, 28rem);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 1rem;
  box-shadow: var(--shadow);
  padding: 1.5rem;
}

.auth-title {
  margin: 0 0 0.5rem;
  font-size: 1.5rem;
}

.auth-lead {
  margin: 0 0 1.25rem;
  color: var(--muted);
  line-height: 1.5;
}

.auth-error {
  margin: 0 0 1rem;
  padding: 0.75rem 0.9rem;
  border-radius: 0.75rem;
  background: #fdecec;
  border: 1px solid #f0b8b8;
  color: #8a1f1f;
}

.auth-form {
  display: grid;
  gap: 1rem;
}

.auth-form label {
  display: grid;
  gap: 0.35rem;
  font-size: 0.92rem;
  font-weight: 600;
}

.auth-form input {
  width: 100%;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 0.65rem;
  font: inherit;
  background: #fff;
}

.auth-submit {
  margin-top: 0.25rem;
  padding: 0.75rem 1rem;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.auth-submit:hover {
  filter: brightness(1.05);
}

.auth-footer {
  margin: 1.25rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
  text-align: center;
}

.auth-footer a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

.auth-footer a:hover {
  text-decoration: underline;
}

.cabinet-panel .cabinet-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.cabinet-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.cabinet-meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.cabinet-page {
  max-width: 1440px;
  margin: 0 auto;
  padding: 2rem 1rem 3rem;
}

.cabinet-section-title {
  margin: 0 0 0.5rem;
  font-size: 1.15rem;
}

.cabinet-rb-panel {
  margin-top: 1rem;
}

.cabinet-rb-form {
  display: grid;
  gap: 0.85rem;
  margin-top: 1rem;
}

.cabinet-rb-field {
  display: grid;
  gap: 0.35rem;
  font-weight: 600;
  color: var(--ink);
}

.cabinet-rb-field input {
  width: 100%;
  max-width: 16rem;
  padding: 0.65rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  background: #fff;
  font: inherit;
}

.cabinet-rb-save {
  justify-self: start;
  border: 1px solid var(--line);
  background: var(--accent-soft);
  color: var(--accent);
  cursor: pointer;
}

.cabinet-rb-save:hover {
  text-decoration: none;
  border-color: #b7dccb;
}

.cabinet-favorites {
  margin-top: 2rem;
}

.cabinet-favorites-head {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.cabinet-favorites-title {
  margin: 0;
  font-size: 1.35rem;
}

.cabinet-favorites-count {
  margin: 0;
}

.cabinet-favorites-empty {
  padding: 1.5rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 1rem;
}

.favorite-form {
  margin: 0;
  display: inline-flex;
}

.favorite-btn {
  appearance: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  width: 2.25rem;
  height: 2.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  padding: 0;
  text-decoration: none;
}

.favorite-btn-labeled {
  width: auto;
  min-height: 2.25rem;
  height: auto;
  gap: 0.35rem;
  padding: 0.45rem 0.85rem;
  font-size: 0.92rem;
  font-weight: 600;
}

.favorite-btn-label {
  white-space: nowrap;
}

.favorite-btn:hover,
.favorite-btn.is-active {
  border-color: #e6b800;
  color: #c99700;
  background: #fffbea;
}

.favorite-login-link:hover {
  text-decoration: none;
}

.listing-card-top {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 0.35rem;
}

.listing-auto-row {
  display: flex;
  gap: 0.35rem;
  align-items: flex-start;
}

.listing-auto-main {
  min-width: 0;
}

.meta .favorite-btn {
  width: auto;
  min-width: 2.25rem;
  padding: 0 0.65rem;
}
