:root {
  --practice-bg: #edf3ef;
  --practice-surface: #fffdf7;
  --practice-surface-strong: #ffffff;
  --practice-text: #17201d;
  --practice-muted: #5d6b64;
  --practice-line: #c9d7cf;
  --practice-accent: #0b7655;
  --practice-accent-strong: #07533d;
  --practice-accent-soft: #e2f1e9;
  --practice-warm: #f5c851;
}

.practice-app {
  display: grid;
  gap: 18px;
  padding: 0;
  background: var(--practice-surface-strong);
  color: var(--practice-text);
}

.practice-app__label {
  margin: 0;
  color: var(--practice-accent-strong);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.1em;
}

.practice-app h1,
.practice-app h2 {
  margin: 0;
  letter-spacing: -0.04em;
  line-height: 1.2;
}

.practice-app h1 {
  font-size: clamp(1.9rem, 4vw, 3.1rem);
}

.practice-app h2 {
  font-size: 1.45rem;
}

.practice-app__intro,
.practice-app__controls > p,
#controls-note {
  color: var(--practice-muted);
  line-height: 1.7;
}

.practice-app__intro {
  max-width: 48rem;
  margin: -5px 0 4px;
}

.practice-app__controls,
.practice-app__results {
  min-width: 0;
  padding: 20px;
  border: 1px solid var(--practice-line);
  border-radius: 17px;
  background: var(--practice-surface);
}

.practice-app__controls > p {
  margin: 10px 0 18px;
}

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

.search-controls label {
  display: grid;
  gap: 6px;
  color: var(--practice-text);
  font-weight: 800;
}

.search-controls label > span {
  color: var(--practice-muted);
  font-size: 0.78rem;
  font-weight: 500;
}

.search-controls input,
.search-controls select {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid #afc3b8;
  border-radius: 11px;
  background: #fbfdfb;
  color: var(--practice-text);
  font: inherit;
}

.search-controls input:focus,
.search-controls select:focus {
  border-color: var(--practice-accent);
  outline: 3px solid rgb(245 200 81 / 55%);
  outline-offset: 2px;
}

#controls-note {
  margin: 16px 0 0;
  font-size: 0.88rem;
}

.practice-results__header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 17px;
  border-bottom: 1px solid var(--practice-line);
}

.practice-results__header .practice-app__label {
  margin-bottom: 5px;
}

#result-count {
  margin: 0;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--practice-accent-soft);
  color: var(--practice-accent-strong);
  font-size: 0.82rem;
  font-weight: 900;
  white-space: nowrap;
}

.product-grid {
  display: grid;
  min-height: 280px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-content: start;
  gap: 12px;
  padding-top: 18px;
}

.product-card {
  display: grid;
  min-height: 168px;
  align-content: space-between;
  gap: 18px;
  padding: 17px;
  border: 1px solid #cbd8d0;
  border-radius: 15px;
  background: linear-gradient(160deg, #ffffff, #f5faf6);
  box-shadow: 0 8px 18px rgb(23 32 29 / 5%);
}

.product-card__top,
.product-card__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.product-card__id,
.product-card__meta {
  color: var(--practice-muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.75rem;
}

.product-card__id {
  color: var(--practice-accent-strong);
  font-weight: 900;
}

.product-card h3 {
  margin: 0;
  font-size: 1.16rem;
  line-height: 1.35;
}

.product-card__price {
  margin: 0;
  color: var(--practice-accent-strong);
  font-size: 1.45rem;
  font-weight: 900;
  letter-spacing: -0.04em;
}

.empty-state {
  display: grid;
  min-height: 230px;
  place-items: center;
  grid-column: 1 / -1;
  margin: 0;
  padding: 28px;
  border: 1px dashed #b7c9be;
  border-radius: 15px;
  background: #f6faf7;
  color: var(--practice-muted);
  text-align: center;
}

.pager {
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 18px;
  padding-top: 17px;
  border-top: 1px solid var(--practice-line);
}

.pager button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  border: 1px solid var(--practice-accent);
  border-radius: 10px;
  background: var(--practice-accent);
  color: #ffffff;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

.pager button:hover {
  border-color: var(--practice-accent-strong);
  background: var(--practice-accent-strong);
}

.pager button:disabled {
  border-color: #c7d2cc;
  background: #dfe7e2;
  color: #7a8780;
  cursor: not-allowed;
}

#page-info {
  min-width: 9ch;
  color: var(--practice-muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.86rem;
  font-weight: 900;
  text-align: center;
}

@media (max-width: 680px) {
  .practice-app {
    padding: 17px;
  }

  .search-controls,
  .product-grid {
    grid-template-columns: 1fr;
  }

  .product-grid {
    min-height: 0;
  }

  .product-card {
    min-height: 136px;
  }
}

@media (max-width: 400px) {
  .practice-results__header {
    align-items: start;
    flex-direction: column;
  }

  .pager {
    align-items: stretch;
    flex-wrap: wrap;
  }

  #page-info {
    order: -1;
    width: 100%;
  }
}
