:root {
  color-scheme: dark;
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;

  --background: #071009;
  --surface: #101a12;
  --surface-2: #17231a;
  --surface-3: #1d2b20;
  --text: #f1f8f2;
  --muted: #a8b8ab;
  --border: rgba(255, 255, 255, 0.13);
  --accent: #76ff32;
  --accent-soft: rgba(118, 255, 50, 0.12);
  --warning: #ffd166;
  --danger: #ff7777;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.32);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(
      circle at top,
      #162c1b 0,
      var(--background) 36rem
    );
}

a {
  color: inherit;
}

button,
input,
select {
  font: inherit;
}

button,
select {
  cursor: pointer;
}

.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1.25rem;
  padding: 0.9rem clamp(1rem, 3vw, 2.5rem);
  border-bottom: 1px solid var(--border);
  background: rgba(7, 16, 9, 0.94);
  backdrop-filter: blur(14px);
}

.brand {
  color: var(--text);
  font-size: 1.35rem;
  font-weight: 900;
  letter-spacing: -0.04em;
  text-decoration: none;
}

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

.main-nav,
.account-nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.9rem;
}

.main-nav {
  justify-content: center;
}

.main-nav a,
.account-nav a {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
  text-decoration: none;
}

.main-nav a:hover,
.account-nav a:hover,
.main-nav a[aria-current="page"] {
  color: var(--accent);
}

.shell {
  width: min(1480px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 2.4rem 0 5rem;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(420px, 0.7fr);
  align-items: end;
  gap: 2rem;
  margin-bottom: 1.5rem;
}

.eyebrow {
  margin: 0 0 0.4rem;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  max-width: 820px;
  margin: 0;
  font-size: clamp(2.35rem, 6vw, 5rem);
  line-height: 0.98;
  letter-spacing: -0.055em;
}

.hero-copy {
  max-width: 760px;
  margin: 1rem 0 0;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.65;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
}

.stats-grid article {
  min-height: 96px;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(16, 26, 18, 0.9);
}

.stats-grid strong {
  display: block;
  color: var(--accent);
  font-size: 1.65rem;
}

.stats-grid span {
  color: var(--muted);
  font-size: 0.86rem;
}

.filter-panel {
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: rgba(16, 26, 18, 0.96);
  box-shadow: var(--shadow);
}

#filterForm {
  display: grid;
  grid-template-columns:
    minmax(280px, 2.2fr)
    repeat(4, minmax(150px, 1fr));
  gap: 0.85rem;
}

#filterForm label {
  display: grid;
  align-content: end;
  gap: 0.42rem;
  min-width: 0;
}

#filterForm label > span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

#filterForm input,
#filterForm select {
  width: 100%;
  min-width: 0;
  height: 50px;
  padding: 0 0.85rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  outline: none;
  background: #09120b;
  color: var(--text);
}

#filterForm input:focus,
#filterForm select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.search-field {
  grid-column: span 2;
}

.filter-actions {
  display: flex;
  align-items: end;
  gap: 0.65rem;
}

.primary-button,
.secondary-button,
.detail-button,
.page-button,
.dialog-close {
  min-height: 44px;
  border-radius: 11px;
  font-weight: 850;
}

.primary-button,
.detail-button {
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #081009;
}

.secondary-button,
.page-button,
.dialog-close {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
}

.filter-actions button {
  flex: 1;
  height: 50px;
  padding: 0 0.9rem;
}

.filter-note {
  margin: 0.9rem 0 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.results-section {
  margin-top: 2rem;
}

.results-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.results-heading h2 {
  margin: 0;
  font-size: clamp(1.45rem, 3vw, 2.1rem);
}

#dataFreshness {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.state-panel {
  padding: 2rem;
  border: 1px dashed var(--border);
  border-radius: 16px;
  color: var(--muted);
  text-align: center;
}

.parts-grid {
  display: grid;
  grid-template-columns:
    repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

.part-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 390px;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 18px;
  background:
    linear-gradient(
      180deg,
      rgba(29, 43, 32, 0.96),
      rgba(13, 22, 15, 0.98)
    );
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.2);
}

.part-card.exact-verified {
  border-color: rgba(118, 255, 50, 0.48);
}

.card-topline,
.card-meta,
.metric-grid,
.card-actions,
.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.card-topline {
  align-items: center;
  justify-content: space-between;
}

.rank-score {
  color: var(--accent);
  font-weight: 900;
}

.badge,
.metric-chip {
  display: inline-flex;
  align-items: center;
  min-height: 27px;
  padding: 0.26rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.035);
  font-size: 0.72rem;
  font-weight: 800;
}

.badge.verified {
  border-color: rgba(118, 255, 50, 0.4);
  color: var(--accent);
  background: var(--accent-soft);
}

.badge.warning {
  border-color: rgba(255, 209, 102, 0.35);
  color: var(--warning);
}

.platform-name {
  margin: 0.75rem 0 0.25rem;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 750;
}

.part-card h3 {
  margin: 0;
  font-size: 1.3rem;
  line-height: 1.15;
}

.card-meta {
  margin-top: 0.6rem;
  color: var(--muted);
  font-size: 0.78rem;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 0.9rem;
}

.metric {
  padding: 0.7rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.12);
}

.metric small {
  display: block;
  margin-bottom: 0.2rem;
  color: var(--muted);
  font-size: 0.68rem;
}

.metric strong {
  font-size: 0.92rem;
}

.why-list {
  margin: 0.9rem 0;
  padding-left: 1.1rem;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.45;
}

.why-list li + li {
  margin-top: 0.28rem;
}

.card-actions {
  margin-top: auto;
}

.detail-button {
  width: 100%;
  padding: 0.72rem 0.9rem;
}

.pagination {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 1.4rem;
}

.page-button {
  min-width: 44px;
  padding: 0.55rem 0.8rem;
}

.page-button[aria-current="page"] {
  border-color: var(--accent);
  color: var(--accent);
}

.page-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

dialog {
  width: min(980px, calc(100% - 1rem));
  max-height: calc(100vh - 1rem);
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text);
  background: var(--surface);
  box-shadow: var(--shadow);
}

dialog::backdrop {
  background: rgba(0, 0, 0, 0.76);
  backdrop-filter: blur(6px);
}

.dialog-shell {
  position: relative;
  max-height: calc(100vh - 1rem);
  padding: clamp(1rem, 4vw, 2rem);
  overflow: auto;
}

.dialog-close {
  position: sticky;
  z-index: 2;
  top: 0;
  float: right;
  width: 44px;
  padding: 0;
  font-size: 1.5rem;
}

.dialog-title {
  padding-right: 3.5rem;
}

.dialog-title h2 {
  margin: 0;
  font-size: clamp(1.7rem, 4vw, 2.7rem);
}

.dialog-title p {
  margin: 0.4rem 0 0;
  color: var(--muted);
}

.detail-section {
  margin-top: 1.3rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--border);
}

.detail-section h3 {
  margin: 0 0 0.7rem;
}

.detail-table {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.7rem;
}

.detail-table article {
  padding: 0.8rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-2);
}

.detail-table small {
  display: block;
  margin-bottom: 0.25rem;
  color: var(--muted);
}

.number-list,
.source-list,
.listing-list {
  display: grid;
  gap: 0.55rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.number-list li,
.source-list li,
.listing-list li {
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--surface-2);
}

.number-value {
  font-family:
    ui-monospace,
    SFMono-Regular,
    Consolas,
    monospace;
  font-weight: 850;
}

.listing-list a {
  color: var(--accent);
  font-weight: 800;
  text-decoration: none;
}

.data-warning {
  padding: 0.8rem;
  border: 1px solid rgba(255, 209, 102, 0.32);
  border-radius: 11px;
  color: var(--warning);
  background: rgba(255, 209, 102, 0.08);
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.4rem clamp(1rem, 3vw, 2.5rem);
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.82rem;
}

.site-footer p {
  max-width: 620px;
  margin: 0;
}

[hidden] {
  display: none !important;
}

@media (max-width: 1250px) {
  #filterForm {
    grid-template-columns:
      repeat(3, minmax(150px, 1fr));
  }

  .search-field {
    grid-column: span 2;
  }

  .parts-grid {
    grid-template-columns:
      repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 920px) {
  .topbar {
    grid-template-columns: 1fr;
  }

  .main-nav,
  .account-nav {
    justify-content: flex-start;
  }

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

  #filterForm {
    grid-template-columns:
      repeat(2, minmax(140px, 1fr));
  }

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

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

@media (max-width: 620px) {
  .shell {
    width: min(100% - 1rem, 1480px);
    padding-top: 1.4rem;
  }

  .stats-grid,
  #filterForm,
  .parts-grid,
  .detail-table {
    grid-template-columns: 1fr;
  }

  .search-field {
    grid-column: auto;
  }

  .results-heading,
  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .part-card {
    min-height: 0;
  }
}
