:root {
  --bg: #f5f7f3;
  --panel: #ffffff;
  --ink: #14201b;
  --muted: #607068;
  --line: #d9e0d7;
  --accent: #126a5b;
  --accent-dark: #0a4c41;
  --warn: #fff2cf;
  --shadow: 0 18px 44px rgba(20, 32, 27, 0.08);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
}
a { color: var(--accent); }
.notice {
  position: sticky;
  top: 0;
  z-index: 20;
  padding: 10px 18px;
  background: #253529;
  color: #f7fff8;
  text-align: center;
  font-size: 0.95rem;
  font-weight: 720;
}
.site-header {
  position: sticky;
  top: 38px;
  z-index: 10;
  background: rgba(245, 247, 243, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}
.nav {
  max-width: 1180px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
}
.brand {
  color: var(--ink);
  font-weight: 850;
  text-decoration: none;
}
.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 0.95rem;
}
.nav-links a {
  color: var(--muted);
  text-decoration: none;
}
main {
  max-width: 1180px;
  margin: 0 auto;
  padding: 34px 20px 58px;
}
.hero {
  min-height: 500px;
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.75fr);
  gap: 28px;
  align-items: center;
  padding: 48px 0 34px;
}
.hero h1,
.legal-page h1 {
  max-width: 860px;
  margin: 0;
  font-size: clamp(2.35rem, 5.8vw, 4.9rem);
  line-height: 0.98;
  letter-spacing: 0;
}
.lede {
  max-width: 740px;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 1.15rem;
}
.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.hero-actions {
  margin-top: 28px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  padding: 12px 16px;
  font: inherit;
  font-weight: 820;
  text-decoration: none;
  cursor: pointer;
}
.primary { background: var(--accent); color: #fff; }
.primary:hover { background: var(--accent-dark); }
.secondary { background: #e5ece4; color: var(--ink); }
.trust-card,
.stats,
.tool,
.top-prices-section,
.groups-section,
.sources,
.method,
.legal-page {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}
.trust-card {
  padding: 22px;
  box-shadow: var(--shadow);
}
.trust-card ul { margin: 12px 0 0; padding-left: 20px; color: var(--muted); }
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  overflow: hidden;
}
.stats div {
  padding: 18px;
  border-right: 1px solid var(--line);
}
.stats div:last-child { border-right: 0; }
.stats span,
.source-card span,
.badge {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 760;
}
.stats strong {
  display: block;
  margin-top: 4px;
  font-size: 1.08rem;
}
.tool,
.top-prices-section,
.groups-section,
.sources,
.method,
.legal-page {
  margin-top: 34px;
  padding: 28px;
}
.section-heading {
  max-width: 820px;
  margin-bottom: 22px;
}
.section-heading h2,
.method h2 {
  margin: 0;
  font-size: clamp(1.8rem, 3vw, 3rem);
  line-height: 1.05;
}
.section-heading p:not(.eyebrow),
.method p,
.legal-page p {
  color: var(--muted);
}
.filters {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 12px;
  margin-bottom: 18px;
}
label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 780;
}
input,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
  color: var(--ink);
  padding: 12px;
  font: inherit;
}
.table-wrap {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}
table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}
th,
td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
th {
  color: var(--muted);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
td strong { display: block; }
td small { display: block; margin-top: 3px; color: var(--muted); }
.seller-cell { font-weight: 760; }
.price { font-weight: 880; white-space: nowrap; }
.stock {
  display: inline-block;
  border-radius: 999px;
  padding: 4px 9px;
  background: #e6f2ed;
  color: #0c5a46;
  font-size: 0.82rem;
  font-weight: 820;
}
.stock.out_of_stock { background: #f4e8e5; color: #8e3d30; }
.stock.unknown { background: var(--warn); color: #73530f; }
.fine-print {
  color: var(--muted);
  font-size: 0.92rem;
}
.groups {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.top-price-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.group-card,
.top-price-card,
.source-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: #fbfcfa;
}
.group-card h3,
.top-price-card h3,
.source-card h3 {
  margin: 0;
}
.group-card p,
.top-price-card p,
.source-card p {
  color: var(--muted);
  margin-bottom: 0;
}
.top-price-heading {
  margin-bottom: 12px;
}
.top-price-heading p {
  margin-top: 6px;
}
.price-rank {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.price-rank li {
  display: grid;
  grid-template-columns: minmax(108px, 0.35fr) minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  padding: 11px 0;
  border-top: 1px solid var(--line);
}
.price-rank div strong,
.price-rank div span {
  display: block;
}
.price-rank div strong {
  color: var(--ink);
  font-size: 1.04rem;
}
.price-rank div span {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 780;
}
.price-rank p {
  margin: 0;
  overflow-wrap: anywhere;
}
.price-rank a {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  font-weight: 800;
}
.source-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
.source-card.ok { border-color: #9fd6bd; }
.source-card.failed { border-color: #e7b0a8; }
.marketplace-note {
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: #fff;
}
.marketplace-note h3 {
  margin: 0;
}
.marketplace-note p {
  margin-bottom: 0;
  color: var(--muted);
}
.method {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  background: #0e302c;
  color: #fff;
}
.method p { color: #d7ebe6; max-width: 780px; }
.legal-page {
  max-width: 880px;
}
.legal-page p { font-size: 1.05rem; }
.redirect-page {
  text-align: center;
}
.redirect-page h1 {
  font-size: clamp(2rem, 5vw, 3.6rem);
}
.redirect-error .redirect-page {
  border-color: #e7b0a8;
}
.footer {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 20px 36px;
  color: var(--muted);
}

@media (max-width: 860px) {
  .site-header {
    position: static;
  }
  .notice {
    position: static;
    text-align: left;
  }
  .nav,
  .method { align-items: flex-start; flex-direction: column; }
  .hero,
  .stats,
  .filters,
  .top-price-list,
  .groups,
  .source-list { grid-template-columns: 1fr; }
  .stats div { border-right: 0; border-bottom: 1px solid var(--line); }
  .stats div:last-child { border-bottom: 0; }
  .hero { min-height: auto; padding-top: 32px; }
  .hero h1,
  .legal-page h1 { font-size: 2.38rem; }
  .nav-links {
    width: 100%;
    gap: 8px;
  }
  .nav-links a {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    padding: 6px 0;
  }
  main {
    padding: 22px 14px 44px;
  }
  .tool,
  .top-prices-section,
  .groups-section,
  .sources,
  .method,
  .legal-page {
    padding: 18px;
  }
  .table-wrap {
    border: 0;
    overflow: visible;
  }
  table,
  thead,
  tbody,
  tr,
  td {
    display: block;
    width: 100%;
  }
  thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
  tr {
    margin-bottom: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 10px 26px rgba(20, 32, 27, 0.06);
    overflow: hidden;
  }
  td {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 10px;
    padding: 11px 12px;
    border-bottom: 1px solid var(--line);
    overflow-wrap: anywhere;
  }
  td:last-child {
    border-bottom: 0;
  }
  td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 850;
    text-transform: uppercase;
    letter-spacing: 0.04em;
  }
  .price {
    white-space: normal;
    font-size: 1.05rem;
  }
  .stock {
    width: fit-content;
  }
  .price-rank li {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .price-rank a {
    width: fit-content;
  }
}
