.motor-page {
  --motor-content: min(1040px, calc(100vw - 40px));
  min-height: 100vh;
  background: var(--theme-bg-grouped);
}

.motor-page .site-header,
.motor-page .site-header.is-scrolled {
  width: min(1080px, calc(100vw - 24px));
  height: 64px;
  top: 10px;
  padding: 0 16px;
  border: 1px solid var(--theme-border);
  border-radius: 16px;
  background: var(--theme-header);
  box-shadow: 0 8px 28px rgb(28 28 30 / 8%);
  backdrop-filter: blur(20px);
}

.motor-page .brand img {
  border-color: var(--theme-border);
  box-shadow: none;
}

.motor-page .site-nav {
  gap: 24px;
}

.motor-page .site-nav a {
  color: var(--theme-muted);
}

.motor-page .site-nav a:hover {
  color: var(--theme-text);
}

.motor-page main {
  width: var(--motor-content);
  margin: 0 auto;
  padding: 142px 0 96px;
}

.library-intro {
  max-width: 760px;
  padding-bottom: 44px;
}

.library-intro > span {
  color: var(--theme-quiet);
  font-family: "Space Mono", monospace;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.library-intro h1 {
  margin-top: 13px;
  color: var(--theme-text);
  font-size: clamp(40px, 6vw, 62px);
  font-weight: 590;
  letter-spacing: -0.055em;
  line-height: 1;
}

.library-intro p {
  max-width: 700px;
  margin-top: 20px;
  color: var(--theme-muted);
  font-size: 16px;
  line-height: 1.65;
}

.catalog-section {
  border-top: 1px solid var(--theme-border);
  padding-top: 28px;
}

.motor-search-panel {
  display: grid;
  align-items: end;
  padding: 16px;
  border: 1px solid var(--theme-border);
  border-radius: 16px;
  grid-template-columns: minmax(260px, 1fr) minmax(220px, 290px) auto;
  gap: 12px;
  background: var(--theme-surface);
}

.search-field,
.select-field {
  display: grid;
  min-width: 0;
  gap: 7px;
}

.search-field > span,
.select-field > span {
  color: var(--theme-muted);
  font-size: 11px;
  font-weight: 700;
}

.search-field > div {
  position: relative;
}

.search-field i {
  position: absolute;
  z-index: 1;
  width: 13px;
  height: 13px;
  top: 50%;
  left: 14px;
  border: 1.5px solid var(--theme-quiet);
  border-radius: 50%;
  transform: translateY(-58%);
  pointer-events: none;
}

.search-field i::after {
  position: absolute;
  width: 6px;
  height: 1.5px;
  right: -5px;
  bottom: -3px;
  border-radius: 2px;
  background: var(--theme-quiet);
  content: "";
  transform: rotate(45deg);
}

.search-field input,
.select-field select {
  width: 100%;
  height: 44px;
  border: 1px solid var(--theme-border);
  border-radius: 11px;
  outline: none;
  background: var(--theme-surface-2);
  color: var(--theme-text);
  font: inherit;
}

.search-field input {
  padding: 0 44px 0 40px;
}

.select-field select {
  padding: 0 34px 0 12px;
}

.search-field input::placeholder {
  color: var(--theme-quiet);
}

.search-field input:focus,
.select-field select:focus {
  border-color: var(--theme-border-strong);
  background: var(--theme-surface);
  box-shadow: 0 0 0 3px var(--theme-accent-soft);
}

.search-field kbd {
  position: absolute;
  top: 50%;
  right: 11px;
  min-width: 22px;
  padding: 3px 6px;
  border: 1px solid var(--theme-border);
  border-radius: 6px;
  background: var(--theme-surface);
  color: var(--theme-quiet);
  font-family: "Space Mono", monospace;
  font-size: 9px;
  text-align: center;
  transform: translateY(-50%);
}

.clear-filters {
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--theme-border);
  border-radius: 11px;
  background: transparent;
  color: var(--theme-muted);
  font-size: 12px;
  font-weight: 700;
}

.clear-filters:hover {
  border-color: var(--theme-border-strong);
  color: var(--theme-text);
}

.catalog-status {
  padding: 18px 2px 12px;
  color: var(--theme-muted);
  font-size: 12px;
}

.catalog-status strong {
  color: var(--theme-text);
  font-family: "Space Mono", monospace;
}

.motor-grid {
  display: grid;
  gap: 10px;
}

.motor-card {
  overflow: hidden;
  border: 1px solid var(--theme-border);
  border-radius: 14px;
  background: var(--theme-surface);
}

.motor-card[hidden],
.motor-grid[hidden],
.no-results[hidden],
.clear-filters[hidden] {
  display: none;
}

.motor-card-header {
  padding: 19px 20px 17px;
}

.motor-card-header > div {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
}

.manufacturer-label,
.evidence-badge {
  font-family: "Space Mono", monospace;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.manufacturer-label {
  color: var(--theme-text);
}

.evidence-badge {
  color: var(--theme-quiet);
}

.evidence-badge::before {
  margin-right: 7px;
  color: var(--theme-border-strong);
  content: "·";
}

.motor-card h3 {
  margin-top: 8px;
  color: var(--theme-text);
  font-size: 19px;
  font-weight: 650;
  letter-spacing: -0.025em;
}

.motor-card-header > p {
  margin-top: 5px;
  color: var(--theme-muted);
  font-size: 11px;
  line-height: 1.45;
}

.motor-spec-grid {
  display: grid;
  margin: 0;
  border-top: 1px solid var(--theme-border);
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.motor-spec-grid > div {
  min-width: 0;
  padding: 14px 16px 15px;
}

.motor-spec-grid > div + div {
  border-left: 1px solid var(--theme-border);
}

.motor-spec-grid dt {
  color: var(--theme-quiet);
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
}

.motor-spec-grid dd {
  margin: 7px 0 0;
  overflow-wrap: anywhere;
  color: var(--theme-text);
  font-size: 13px;
  font-weight: 650;
  line-height: 1.35;
}

.motor-spec-grid small {
  display: block;
  margin-top: 4px;
  color: var(--theme-quiet);
  font-size: 9px;
  line-height: 1.35;
}

.motor-details {
  border-top: 1px solid var(--theme-border);
}

.motor-details summary {
  display: flex;
  min-height: 47px;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  color: var(--theme-muted);
  font-size: 11px;
  font-weight: 700;
  list-style: none;
  cursor: pointer;
}

.motor-details summary::-webkit-details-marker {
  display: none;
}

.motor-details summary:hover {
  color: var(--theme-text);
}

.motor-details summary span {
  color: var(--theme-quiet);
  font-size: 17px;
  transition: transform 140ms ease;
}

.motor-details[open] summary span {
  transform: rotate(45deg);
}

.detail-grid {
  display: grid;
  padding: 18px 20px 22px;
  border-top: 1px solid var(--theme-border);
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px 28px;
  background: var(--theme-surface-2);
}

.detail-block h4 {
  margin: 0 0 8px;
  color: var(--theme-text);
  font-size: 11px;
}

.detail-block ul {
  display: grid;
  gap: 6px;
}

.detail-block li {
  color: var(--theme-muted);
  font-size: 11px;
  line-height: 1.5;
}

.detail-block li strong {
  color: var(--theme-text);
  font-weight: 650;
}

.detail-block li small {
  display: block;
  margin-top: 2px;
  color: var(--theme-quiet);
  font-size: 9px;
}

.detail-sources {
  display: grid;
  align-content: start;
  gap: 7px;
}

.detail-sources h4 {
  margin-bottom: 1px;
}

.detail-sources a {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  color: var(--theme-link);
  font-size: 10px;
  font-weight: 650;
  line-height: 1.45;
}

.detail-sources a:hover {
  text-decoration: underline;
}

.detail-sources a span {
  flex: 0 0 auto;
}

.no-results {
  padding: 60px 20px;
  border: 1px solid var(--theme-border);
  border-radius: 14px;
  background: var(--theme-surface);
  text-align: center;
}

.no-results > strong {
  color: var(--theme-text);
  font-size: 17px;
}

.no-results p {
  margin-top: 8px;
  color: var(--theme-muted);
  font-size: 12px;
}

.no-results button {
  margin-top: 18px;
  padding: 10px 14px;
  border: 1px solid var(--theme-border);
  border-radius: 10px;
  background: var(--theme-surface-2);
  color: var(--theme-text);
  font-weight: 700;
}

.motor-footer {
  background: var(--theme-bg);
}

.motor-footer .footer-top > p,
.motor-footer .footer-top > div a,
.motor-footer .footer-bottom {
  color: var(--theme-muted);
}

@media (max-width: 900px) {
  .motor-page {
    --motor-content: min(720px, calc(100vw - 32px));
  }

  .motor-page .site-header,
  .motor-page .site-header.is-scrolled {
    width: calc(100vw - 24px);
  }

  .motor-page .site-nav {
    gap: 2px;
  }

  body.menu-open.motor-page .site-header,
  body.menu-open.motor-page .site-header.is-scrolled {
    width: 100%;
  }

  .motor-page main {
    padding-top: 126px;
  }

  .motor-search-panel {
    grid-template-columns: minmax(0, 1fr) minmax(210px, 250px) auto;
  }
}

@media (max-width: 680px) {
  .motor-page {
    --motor-content: calc(100vw - 24px);
  }

  .motor-page main {
    padding: 112px 0 72px;
  }

  .library-intro {
    padding: 0 4px 34px;
  }

  .library-intro h1 {
    font-size: clamp(38px, 13vw, 52px);
  }

  .library-intro p {
    font-size: 14px;
  }

  .catalog-section {
    padding-top: 20px;
  }

  .motor-search-panel {
    padding: 12px;
    grid-template-columns: 1fr;
  }

  .clear-filters {
    justify-self: start;
  }

  .motor-spec-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .motor-spec-grid > div + div {
    border-left: 0;
  }

  .motor-spec-grid > div:nth-child(even) {
    border-left: 1px solid var(--theme-border);
  }

  .motor-spec-grid > div:nth-child(n + 3) {
    border-top: 1px solid var(--theme-border);
  }

  .detail-grid {
    grid-template-columns: 1fr;
  }

  .motor-footer .footer-top,
  .motor-footer .footer-bottom {
    align-items: flex-start;
  }
}

@media (max-width: 420px) {
  .search-field kbd {
    display: none;
  }

  .search-field input {
    padding-right: 12px;
  }

  .motor-spec-grid {
    grid-template-columns: 1fr;
  }

  .motor-spec-grid > div:nth-child(even) {
    border-left: 0;
  }

  .motor-spec-grid > div + div {
    border-top: 1px solid var(--theme-border);
  }
}

@media (prefers-reduced-motion: reduce) {
  .motor-page *,
  .motor-page *::before,
  .motor-page *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
