:root {
  color-scheme: light;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #faf9f7;
  color: #232323;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #faf9f7;
}

button,
input,
select {
  font: inherit;
}

.page {
  width: min(960px, calc(100% - 32px));
  margin: 0 auto;
  padding: 56px 0 96px;
}

.hero {
  max-width: 720px;
}

.eyebrow,
.section-kicker {
  margin: 0 0 12px;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.1em;
}

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

h1 {
  margin: 0;
  font-size: clamp(2rem, 7vw, 3.6rem);
  line-height: 1.15;
}

.lead {
  margin: 24px 0 0;
  max-width: 42rem;
  line-height: 1.9;
}

.search-panel {
  margin-top: 48px;
  padding: clamp(20px, 4vw, 36px);
  border: 1px solid #dedbd5;
  border-radius: 20px;
  background: #ffffff;
}

.section-heading h2,
.results-summary h2 {
  margin: 0;
  font-size: clamp(1.45rem, 4vw, 2rem);
}

.filter-group {
  margin: 32px 0 0;
  padding: 0;
  border: 0;
}

.filter-group legend {
  margin-bottom: 12px;
  padding: 0;
  font-weight: 700;
  font-size: 1.05rem;
}

.field-help,
.form-note,
.observed-at,
.unverified-intro {
  color: #65615b;
  line-height: 1.7;
}

.field-help {
  margin: -4px 0 14px;
  font-size: 0.9rem;
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

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

.choice-grid--palette {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.choice {
  position: relative;
  display: flex;
  min-height: 48px;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border: 1px solid #d7d3cc;
  border-radius: 12px;
  cursor: pointer;
}

.choice:has(input:checked) {
  border-color: #4f4a43;
  background: #f2efe9;
}

.choice input {
  width: 1.1rem;
  height: 1.1rem;
  margin: 0;
  flex: 0 0 auto;
}

.choice-with-help {
  position: relative;
}

.choice-with-help .choice {
  padding-right: 48px;
}

.choice-help {
  position: absolute;
  top: 50%;
  right: 10px;
  z-index: 3;
  width: 30px;
  height: 30px;
  padding: 0;
  transform: translateY(-50%);
  border: 1px solid #c9c4bc;
  border-radius: 999px;
  background: #ffffff;
  color: #5f5a52;
  cursor: help;
  line-height: 1;
}

.choice-help:hover,
.choice-help:focus-visible,
.choice-with-help.is-open .choice-help {
  border-color: #6c6256;
  background: #f4f1eb;
  color: #232323;
}

.choice-tooltip {
  position: absolute;
  right: 8px;
  bottom: calc(100% + 10px);
  z-index: 20;
  display: none;
  width: min(280px, calc(100vw - 56px));
  padding: 10px 12px;
  border: 1px solid #d7d3cc;
  border-radius: 10px;
  background: #232323;
  color: #ffffff;
  font-size: 0.86rem;
  line-height: 1.6;
  box-shadow: 0 8px 24px rgb(0 0 0 / 14%);
  pointer-events: none;
}

.choice-tooltip::after {
  content: "";
  position: absolute;
  top: 100%;
  right: 14px;
  border: 7px solid transparent;
  border-top-color: #232323;
}

.choice-help:hover + .choice-tooltip,
.choice-help:focus-visible + .choice-tooltip,
.choice-with-help.is-open .choice-tooltip {
  display: block;
}

.choice-help:focus-visible {
  outline: 3px solid #6c6256;
  outline-offset: 3px;
}

@media (hover: none) {
  .choice-help {
    cursor: pointer;
  }

  .choice-help:hover + .choice-tooltip {
    display: none;
  }

  .choice-with-help.is-open .choice-tooltip {
    display: block;
  }
}

.number-field {
  display: grid;
  gap: 10px;
  max-width: 360px;
}

.range-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 12px;
  max-width: 620px;
  align-items: end;
}

.dimension-filter {
  margin-top: 22px;
}

.dimension-filter + .dimension-filter {
  padding-top: 22px;
  border-top: 1px solid #ece8e1;
}

.dimension-filter__label {
  margin: 0 0 10px;
  font-weight: 700;
}

.range-number-field {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.range-number-field > span:first-child {
  color: #5f5a52;
  font-size: 0.88rem;
  font-weight: 700;
}

.range-separator {
  padding-bottom: 14px;
  color: #777169;
  font-weight: 700;
}

.input-with-unit {
  display: flex;
  align-items: center;
  gap: 10px;
}

.input-with-unit input {
  width: min(220px, 100%);
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid #bdb8b0;
  border-radius: 10px;
  background: #fff;
}

.additional-filters {
  margin-top: 32px;
  border-top: 1px solid #e3dfd8;
  border-bottom: 1px solid #e3dfd8;
}

.additional-filters summary {
  padding: 18px 0;
  font-weight: 700;
  cursor: pointer;
}

.additional-filters__body {
  padding: 0 0 28px;
}

.form-actions {
  margin-top: 32px;
}

.search-button {
  width: min(100%, 360px);
  min-height: 52px;
  padding: 12px 20px;
  border: 0;
  border-radius: 12px;
  background: #232323;
  color: #ffffff;
  font-weight: 700;
  cursor: pointer;
}

.search-button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.form-note {
  margin: 10px 0 0;
  font-size: 0.88rem;
}

.search-status,
.results {
  margin-top: 32px;
}

.result-sort {
  display: flex;
  width: min(100%, 360px);
  margin-top: 18px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.92rem;
  font-weight: 700;
}

.result-sort select {
  min-width: 190px;
  min-height: 44px;
  padding: 8px 36px 8px 10px;
  border: 1px solid #bdb8b0;
  border-radius: 10px;
  background: #ffffff;
  color: #232323;
}


.search-status {
  padding: 16px 18px;
  border: 1px solid #dedbd5;
  border-radius: 12px;
  background: #ffffff;
  line-height: 1.7;
}

.result-group {
  margin-top: 36px;
}

.result-group__heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid #dedbd5;
  padding-bottom: 12px;
}

.result-group__heading h3,
.result-group__heading p {
  margin: 0;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 18px;
}

.empty-state {
  margin-top: 32px;
  padding: 24px;
  border: 1px solid #dedbd5;
  border-radius: 16px;
  background: #ffffff;
}

.empty-state h3,
.empty-state p {
  margin-top: 0;
}

.empty-state p {
  margin-bottom: 0;
}

[hidden] {
  display: none !important;
}

@media (max-width: 720px) {
  .page {
    width: min(100% - 24px, 960px);
    padding-top: 32px;
  }

  .search-panel {
    margin-top: 36px;
  }

  .choice-grid,
  .choice-grid--three,
  .choice-grid--palette,
  .product-grid {
    grid-template-columns: 1fr;
  }

  .result-group__heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  .result-sort {
    align-items: flex-start;
    flex-direction: column;
  }

  .result-sort select {
    width: 100%;
  }

  .range-field {
    grid-template-columns: 1fr;
  }

  .range-separator {
    display: none;
  }

  .range-number-field .input-with-unit input {
    width: 100%;
  }
}

.product-card {
  overflow: hidden;
  border: 1px solid #dedbd5;
  border-radius: 16px;
  background: #ffffff;
}

.product-card__image-wrap {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #f0eee9;
}

.product-card__image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.product-card__body {
  padding: 18px;
}

.product-card__title {
  margin: 0;
  font-size: 1rem;
  line-height: 1.55;
}

.product-card__price {
  margin: 14px 0 0;
  font-size: 1.2rem;
  font-weight: 700;
}

.product-card__shop {
  margin: 6px 0 0;
  color: #65615b;
  font-size: 0.9rem;
}

.product-attributes {
  display: grid;
  gap: 8px;
  margin: 18px 0 0;
}

.product-attribute {
  display: grid;
  grid-template-columns: 7.5rem minmax(0, 1fr);
  gap: 12px;
}

.product-attribute dt,
.product-attribute dd {
  margin: 0;
  line-height: 1.5;
}

.product-attribute dt {
  color: #65615b;
  font-size: 0.86rem;
}

.product-attribute dd {
  font-size: 0.92rem;
}

.product-card__outbound {
  display: inline-flex;
  width: 100%;
  min-height: 48px;
  margin-top: 20px;
  align-items: center;
  justify-content: center;
  padding: 11px 14px;
  border: 1px solid #232323;
  border-radius: 10px;
  color: #232323;
  font-weight: 700;
  line-height: 1.4;
  text-align: center;
  text-decoration: none;
}

.product-card__outbound:hover {
  background: #f2efe9;
}

.result-group--unverified {
  padding-top: 12px;
}

.product-card--unverified {
  border-style: dashed;
}

.unverified-notice {
  margin-top: 18px;
  padding: 12px 14px;
  border-radius: 10px;
  background: #f4f1eb;
}

.unverified-notice__heading {
  margin: 0;
  font-size: 0.86rem;
  font-weight: 700;
}

.unverified-notice__list {
  margin: 8px 0 0;
  padding-left: 1.2rem;
  color: #5f5a52;
  font-size: 0.88rem;
  line-height: 1.6;
}

.search-status[data-state="loading"] {
  color: #4d4943;
}

.search-status[data-state="error"] {
  border-color: #b68178;
  background: #fff8f6;
}

.results {
  scroll-margin-top: 20px;
}

.search-button:focus-visible,
.result-sort select:focus-visible,
.product-card__outbound:focus-visible,
.input-with-unit input:focus-visible,
.additional-filters summary:focus-visible,
.choice:has(input:focus-visible) {
  outline: 3px solid #6c6256;
  outline-offset: 3px;
}

.results:focus {
  outline: none;
}

.additional-filters summary {
  min-height: 48px;
  display: flex;
  align-items: center;
}

@media (max-width: 520px) {
  .product-attribute {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .product-card__body {
    padding: 16px;
  }
}
