.reviews-header,
.reviews-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 18px;
}

.reviews-header nav {
  display: flex;
  gap: 16px;
}

.reviews-header nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

.reviews-header nav a:hover,
.reviews-header [aria-current] { color: #805412; }
.reviews-header [aria-current] { text-decoration: underline; text-underline-offset: 5px; }
.reviews-header :focus-visible { outline-color: var(--blue); }

.reviews-intro {
  padding: 36px 0;
  background: var(--mist);
  border-bottom: 1px solid var(--line);
}

.reviews-intro h1 {
  margin: 0;
  font-size: 2.25rem;
  letter-spacing: 0;
}

.reviews-intro p:last-child { margin-bottom: 0; }

.reviews-layout {
  display: grid;
  gap: 32px;
  padding-block: 32px 48px;
}

.reviews-layout > section { min-width: 0; }
.reviews-layout h2 { margin: 0 0 12px; font-size: 1.4rem; letter-spacing: 0; }
.reviews-layout p { margin-block: 0 12px; }
.review-note { color: var(--text); font-size: 0.9rem; }

#review-form fieldset {
  margin: 18px 0;
  padding: 0;
  border: 0;
}

#review-form legend,
#review-form > label { font-weight: 700; color: var(--ink); }

.rating-input {
  display: flex;
  gap: 4px;
  margin-top: 4px;
}

.rating-input label { cursor: pointer; }

.rating-input label > span:first-of-type {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--mist);
  color: #637185;
  font-size: 1.55rem;
  line-height: 1;
}

.rating-input label:is(:has(input:checked), :has(~ label input:checked)) > span:first-of-type {
  color: #805412;
  border-color: var(--gold);
  background: #fff8e3;
}

.rating-input input:focus-visible + span,
.reviews-layout :is(button, textarea):focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 2px;
}

#review-body {
  display: block;
  width: 100%;
  margin-block: 6px;
  padding: 12px;
  border: 1px solid #8799ae;
  border-radius: var(--radius);
  color: var(--ink);
  background: var(--paper);
  font: inherit;
  resize: vertical;
}

#review-challenge:empty { display: none; }
#review-challenge { margin-bottom: 14px; }
.review-submit { background: var(--navy); color: var(--paper); }
.review-submit:hover:not(:disabled) { background: var(--blue); color: var(--paper); }
.review-submit:disabled { opacity: 0.65; cursor: not-allowed; }
#review-feedback { margin: 12px 0 0; }
#review-feedback[data-state="error"] { color: #9a291c; }
#review-feedback[data-state="success"] { color: #14613b; }

#review-list > article {
  padding-block: 14px;
  border-bottom: 1px solid var(--line);
}

#review-list > article:first-child { border-top: 1px solid var(--line); }
#review-list > article > p { white-space: pre-wrap; overflow-wrap: anywhere; margin-bottom: 0; }
.review-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: baseline; margin-bottom: 6px; }
.review-meta time { font-size: 0.85rem; color: var(--muted); }
.review-stars { color: #805412; letter-spacing: 0; }
.review-more { margin-top: 16px; color: var(--navy); border: 1px solid var(--line); background: var(--mist); }
.review-more[hidden] { display: none; }

.recent-reviews {
  background: var(--mist);
  border-block: 1px solid var(--line);
}

.recent-reviews-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 12px 24px;
  margin-bottom: 20px;
}

.recent-reviews-heading h2 { margin: 0; font-size: 1.75rem; letter-spacing: 0; }
.recent-reviews-heading .eyebrow { margin: 0 0 6px; }
.recent-reviews-heading .button { margin: 0; white-space: normal; }
#recent-review-status:empty { display: none; }

#recent-review-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 195px), 1fr));
  gap: 12px;
}

#recent-review-list article {
  padding: 16px;
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--shadow-sm);
}

#recent-review-list .review-meta { flex-direction: column; gap: 2px; }
#recent-review-list article p { margin: 8px 0 0; overflow-wrap: anywhere; font-size: 0.92rem; }

@media (min-width: 760px) {
  .reviews-layout { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 48px; }
  .reviews-layout > section + section { border-left: 1px solid var(--line); padding-left: 36px; }
}
