:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #21352e;
  background: #f7f5ef;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

.page {
  width: min(100% - 2rem, 760px);
  margin: 0 auto;
  padding: 3.5rem 0 5rem;
}

.page-header {
  margin-bottom: 2rem;
}

.eyebrow {
  margin: 0 0 0.75rem;
  color: #557563;
  font-size: 0.78rem;
  font-weight: 750;
  letter-spacing: 0.14em;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0.5rem;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.4rem, 8vw, 4rem);
  font-weight: 500;
  letter-spacing: -0.045em;
  line-height: 1.05;
}

h2 {
  margin-bottom: 1.2rem;
  font-size: 1.15rem;
}

.intro {
  margin-bottom: 0;
  color: #5f6c65;
}

.search-panel,
.details-panel {
  padding: clamp(1.15rem, 4vw, 2rem);
  border: 1px solid #e4e2d8;
  border-radius: 1rem;
  background: #fffefa;
  box-shadow: 0 12px 35px rgb(36 52 43 / 5%);
}

.details-panel {
  margin-top: 1.25rem;
}

label {
  display: block;
  margin: 1rem 0 0.45rem;
  font-size: 0.9rem;
  font-weight: 650;
}

select,
input:not([type="checkbox"]),
textarea {
  width: 100%;
  border: 1px solid #c9d1ca;
  border-radius: 0.55rem;
  background: #fff;
  color: #21352e;
  font: inherit;
}

.search-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 9rem;
  gap: 0.75rem;
  align-items: end;
}

.search-controls label {
  margin-top: 0;
}

input:not([type="checkbox"]),
select {
  min-height: 3rem;
  padding: 0.7rem 0.85rem;
}

input {
  font-size: 1rem;
}

select {
  cursor: pointer;
}

textarea {
  min-height: 7rem;
  padding: 0.75rem;
  line-height: 1.55;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus,
.result-button:focus-visible {
  outline: 3px solid #a9c9b2;
  outline-offset: 2px;
}

.help {
  margin: 0.5rem 0 0;
  color: #68756d;
  font-size: 0.85rem;
}

.status {
  min-height: 1.35rem;
  margin: 0.9rem 0 0;
  color: #56675e;
  font-size: 0.9rem;
}

.status.error {
  color: #a33326;
}

.results {
  display: grid;
  gap: 0.5rem;
  margin: 0.75rem 0 0;
  padding: 0;
  list-style: none;
}

.result-button {
  width: 100%;
  padding: 0.85rem 1rem;
  border: 1px solid #e2e5dc;
  border-radius: 0.55rem;
  background: #f9faf5;
  color: #29483a;
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.result-button:hover {
  border-color: #9ab5a1;
  background: #f0f5ed;
}

.result-button[aria-current="true"] {
  border-color: #557563;
  background: #eaf2e9;
  font-weight: 650;
}

.selected-title {
  margin-bottom: 0.25rem;
  color: #557563;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.25rem;
}

.ingredients-fieldset {
  min-width: 0;
  margin: 1rem 0 1.25rem;
  padding: 0;
  border: 0;
}

.ingredients-fieldset legend {
  margin-bottom: 0.45rem;
  font-size: 0.9rem;
  font-weight: 650;
}

.ingredient-list {
  display: grid;
  gap: 0.45rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ingredient-list li label {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  margin: 0;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.5;
}

.ingredient-list input[type="checkbox"] {
  flex: 0 0 auto;
  width: 1.1rem;
  height: 1.1rem;
  margin: 0.2rem 0 0;
  accent-color: #557563;
}

.ingredient-list input[type="checkbox"]:focus-visible {
  outline: 3px solid #a9c9b2;
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

@media (max-width: 480px) {
  .page {
    padding-top: 2.25rem;
  }

  .search-panel,
  .details-panel {
    border-radius: 0.75rem;
  }
}
