:root {
  --type: Arial, sans-serif;
  --display-size: clamp(2.2rem, 3.6vw, 3.35rem);
  --section-size: clamp(1.55rem, 2.3vw, 2.15rem);
  --card-size: clamp(1.15rem, 1.65vw, 1.4rem);
  --wrap-width: 1180px;
}

body { font: 1.0625rem/1.6 var(--type); hyphens: none; }
.wrap { width: min(calc(100% - 72px), var(--wrap-width)); }
h1, h2, h3, .feature-content h3, .ingredient-card h3 {
  font: 700 var(--card-size)/1.23 var(--type);
  letter-spacing: -.025em;
}
h1, .hero h1, .page-intro h1 { font-size: var(--display-size); line-height: 1.1; }
h1 em { color: var(--wine); font-style: normal; font-weight: inherit; }
h2, .section-heading h2, .author h2, .explore-card h2, .match-form h2,
.match-result h2, .routine-intro h2, .support-note h2 { font-size: var(--section-size); }
.full-review h2, .feature-content h3, .ingredient-card h3 { font-size: var(--card-size); }
.feature-content p:not(.eyebrow), .page-intro > p:not(.eyebrow) { font-size: inherit; }
.eyebrow, .brand small { font-size: .8125rem; letter-spacing: .11em; }
.brand strong { font: 700 1.16rem/1.18 var(--type); letter-spacing: -.025em; }
.brand-avatar { width: 43px; height: 43px; flex: none; object-fit: cover; border-radius: 50%; }
.header-row { min-height: 76px; }

.hero { display: block; min-height: 0; max-width: none; border-bottom: 1px solid var(--line); }
.welcome { --welcome-gap: clamp(18px, 3vw, 40px); position: relative; display: grid; grid-template-columns: minmax(0, 170px) minmax(0, 650px); gap: var(--welcome-gap); align-items: center; justify-content: center; padding-block: clamp(20px, 2.7vw, 34px); }
.welcome.without-portrait { grid-template-columns: minmax(0, 700px); justify-content: start; }
.welcome-photo { margin: 0; padding: 4px; background: var(--white); box-shadow: 0 0 0 1px #e4d7cd, 0 3px 6px rgb(58 37 29 / .14), 0 10px 20px rgb(58 37 29 / .17); }
.welcome-portrait { width: 100%; height: auto; }
.welcome-copy h1 { margin-bottom: 11px; }
.hero .welcome-copy h1 { font-size: clamp(1.55rem, 2.6vw, 2.25rem); }
.welcome-copy p { max-width: 66ch; color: var(--quiet); line-height: 1.5; text-wrap: pretty; }
.welcome-copy p + p { margin-top: .55em; }
.welcome-phrase { white-space: nowrap; }
.welcome-copy .actions { margin-top: 12px; align-items: flex-start; justify-content: space-between; }
.welcome-art { width: clamp(30px, 6vw, 42px); height: auto; max-height: 94px; object-fit: contain; pointer-events: none; }
.page-intro { padding-block: 48px 28px; }
.ingredient-intro h1 { font-size: clamp(1.875rem, 3vw, 2.375rem); }
.botanical-background { position: relative; isolation: isolate; }
.botanical-background::before,
.botanical-background::after {
  content: '';
  position: absolute;
  inset-block: 0;
  width: clamp(138px, 23vw, 340px);
  z-index: -1;
  pointer-events: none;
  background: url('welcome-vine.webp') center top / 100% auto repeat-y;
  opacity: .13;
}
.botanical-background::before { right: 0; }
.botanical-background::after { left: 0; transform: scaleX(-1); }
.reviews-intro-copy { text-wrap: pretty; }

.product-media { margin: 0; background: var(--cream); }
.product-media-row { display: grid; grid-template-columns: 1fr; min-width: 0; aspect-ratio: 1.85; border-bottom: 1px solid var(--line); }
.product-media-row.has-texture { grid-template-columns: 1fr .72fr; }
.product-photo, .product-texture { width: 100%; height: 100%; min-width: 0; min-height: 0; object-fit: contain; }
.product-photo { padding: 8px; background: var(--white); }
.reviews-grid .product-photo, .review-dialog .product-photo { background: #fff; }
.product-texture { object-fit: cover; border-left: 1px solid var(--line); }
.product-media figcaption { padding: 9px 15px; color: var(--quiet); font-size: .85rem; line-height: 1.4; }
.feature-link:hover .product-media figcaption { color: var(--ink); }
.review-controls { min-height: 69px; }
.result-count { min-height: 2.6rem; }
.review-origin { font-size: .875rem; }
.review-experience { margin-block: 18px 6px; font-size: 1rem; }
.review-ingredients h3 { margin-bottom: 6px; font-size: .9rem; }
.review-ingredients ul { margin: 0; padding-inline-start: 1.1em; color: var(--quiet); }
.review-ingredients li + li { margin-top: 5px; }
.review-post { display: inline-block; margin-top: 15px; }
.review-compact { display: flex; flex-direction: column; min-width: 0; }
.reviews-grid .product-media-row { aspect-ratio: 6 / 5; }
.review-compact .full-review-body { display: flex; flex: 1; flex-direction: column; padding: 15px; line-height: 1.5; }
.review-compact h2 { margin-block: 0 8px; }
.review-compact .tags { margin-top: 10px; }
.review-compact .review-experience { margin-top: 12px; }
.review-compact .ingredient-note { margin-top: 10px; padding-top: 9px; }
.review-compact .review-post { align-self: flex-start; margin-top: auto; padding-top: 10px; }
.review-products summary { width: fit-content; color: var(--wine); font-weight: 700; cursor: pointer; }
.review-product-table { width: 100%; margin-top: 8px; border-collapse: collapse; font-size: .875rem; line-height: 1.35; }
.review-product-table :is(th, td) { padding: 4px 8px 4px 0; vertical-align: top; text-align: start; }
.review-product-table th { color: var(--wine); }
.review-product-table tr > :last-child { padding-inline-end: 0; text-align: end; white-space: nowrap; }
.review-product-table tbody { border-top: 1px solid var(--line); }

.review-previews > .full-review { position: relative; }
.review-previews .product-media-row { aspect-ratio: 4 / 3; }
.review-previews .full-review-body > :not(h2, .review-read-more) { display: none; }
.review-read-more { align-self: flex-start; margin-top: auto; padding-top: 4px; }
.review-read-more::after { position: absolute; inset: 0; content: ''; }
.review-previews > .full-review:hover, .review-previews > .full-review:focus-within { border-color: var(--wine); }

@media (min-width: 1000px) {
  .welcome { --vine-width: clamp(108px, 10vw, 140px); width: min(calc(100% - 72px), 1100px); grid-template-columns: 176px minmax(0, 1fr); padding-inline-end: calc(var(--vine-width) + var(--welcome-gap)); }
  .welcome-copy .actions { margin-top: 16px; }
  .welcome-art { position: absolute; inset-block-start: 50%; inset-inline-end: 0; width: var(--vine-width); max-height: 345px; transform: translateY(-50%); }
}

@media (max-width: 735px) {
  .wrap { width: calc(100% - 36px); }
  .header-row { min-height: 0; }
  .welcome { grid-template-columns: minmax(110px, 25%) minmax(0, 1fr); }
  .page-intro { padding-block: 34px 24px; }
}

@media (max-width: 540px) {
  body { font-size: 1.125rem; }
  main :where(p:not([class]), .reviews-intro-copy, .directory-note, .ingredient-purpose, .pair-guidance dd, .pair-source-note) {
    text-wrap: pretty;
  }
  .welcome {
    --welcome-gap: 14px;
    width: calc(100% - 32px);
    grid-template-columns: minmax(0, 1fr) clamp(76px, calc(30vw - 19px), 102px);
    grid-template-areas: 'greeting greeting' 'lead portrait';
    align-items: start;
    row-gap: 0;
  }
  .welcome.without-portrait { grid-template-columns: 1fr; grid-template-areas: 'greeting' 'lead'; }
  .welcome-copy, .welcome-text { display: contents; }
  .welcome-photo { grid-area: portrait; }
  .hero .welcome-copy h1 { grid-area: greeting; margin: 0 0 12px; font-size: clamp(1.25rem, 6.2vw, 1.6rem); }
  .welcome-role { display: block; margin-top: .35em; color: var(--wine); font-size: clamp(.875rem, 4vw, 1.0625rem); font-weight: 400; line-height: 1.3; letter-spacing: normal; }
  .welcome-text > p { grid-column: 1 / -1; font-size: 1.0625rem; text-align: start; }
  .welcome-text > p:first-child { grid-area: lead; font-size: clamp(1.03125rem, 4.75vw, 1.0625rem); }
  .welcome-text > p:nth-child(2), .welcome-copy .actions { margin-top: 14px; }
  .welcome-copy .actions { grid-column: 1 / -1; }
  .welcome-phrase { white-space: normal; }
  .botanical-background::before, .botanical-background::after { opacity: .10; }
  .welcome-art { max-height: clamp(72px, 21vw, 93px); }
  .brand strong { font-size: 1.05rem; }
  .brand-avatar { width: 36px; height: 36px; }
}

@media (max-width: 350px) {
  .welcome { --welcome-gap: 10px; }
}

@media (375px <= width <= 540px) {
  .review-previews { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .review-previews .full-review-body { padding: 12px; }
}

.feedback-board {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(12px, 3vw, 24px);
  width: min(100%, 550px);
  padding: clamp(15px, 3vw, 27px);
  border: 1px solid #d9c8b7;
  border-radius: 8px;
  background: radial-gradient(rgb(104 53 73 / .14) .6px, transparent .85px) 0 0 / 7px 7px, #eee1d2;
  box-shadow: inset 0 1px 4px rgb(58 37 29 / .09);
}
.feedback-note {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 25px clamp(10px, 2vw, 17px) 13px;
  color: var(--ink);
  background: #fff7df;
  border: 1px solid #e7d8b7;
  box-shadow: 0 3px 7px rgb(58 37 29 / .16);
  text-decoration: none;
  transform: rotate(-1.4deg);
}
.feedback-note:nth-child(2) { background: #f9e7e9; border-color: #e8ccd3; transform: rotate(1.4deg); }
.feedback-note::before {
  position: absolute;
  top: 7px;
  left: calc(50% - 5px);
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 30%, #f3afd2, #a54566 52%, #642e46);
  box-shadow: 1px 2px 3px rgb(58 37 29 / .34);
  content: '';
}
.feedback-note:hover { color: var(--ink); transform: translateY(-2px); }
.feedback-note:hover .text-link { text-decoration-thickness: 2px; }
.feedback-note-name { display: inline-flex; align-items: center; gap: 7px; font-weight: 700; line-height: 1.15; }
.feedback-note-logo { flex: none; width: 28px; height: 28px; border-radius: 50%; }
.feedback-note q { margin: 3px 0 9px; color: var(--quiet); font-size: .95rem; line-height: 1.3; }
.feedback-note-footer { display: flex; align-items: center; justify-content: space-between; gap: 7px; width: 100%; margin-top: auto; }
.feedback-note .text-link { font-size: .825rem; line-height: 1.2; }
.feedback-note-preview { flex: none; width: clamp(28px, calc(20vw - 30px), 52px); height: auto; border: 1px solid var(--line); border-radius: 3px; box-shadow: 0 1px 3px rgb(58 37 29 / .14); }

.site-dialog {
  width: min(760px, calc(100% - 24px));
  max-width: none;
  max-height: calc(100vh - 24px);
  max-height: calc(100dvh - 24px);
  margin: auto;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  background: var(--white);
  overflow: hidden;
}
.site-dialog[open] { display: flex; flex-direction: column; }
.site-dialog::backdrop { background: rgb(45 36 38 / .65); }
.site-dialog-header, .feedback-dialog-actions { display: flex; align-items: center; gap: 8px; }
.site-dialog-header {
  flex-wrap: wrap;
  justify-content: space-between;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
}
.site-dialog-button {
  min-height: 44px;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--wine);
  background: var(--white);
  font-size: .875rem;
  font-weight: 700;
}
.site-dialog-button:hover { background: var(--cream); }
.site-dialog-content { min-height: 0; overflow: auto; overscroll-behavior: contain; }
.site-dialog-content:focus-visible { outline-offset: -3px; }
.feedback-view { background: var(--cream); }
.feedback-view img { width: 100%; height: auto; }
.feedback-view.is-zoomed img { width: 200%; max-width: none; }

.review-dialog { width: min(880px, calc(100% - 24px)); }
.review-dialog .site-dialog-header { flex-wrap: nowrap; }
.review-dialog h2 { font-size: clamp(1.05rem, 3vw, 1.45rem); }
.review-dialog .product-media-row { aspect-ratio: auto; }
.review-dialog .product-photo { height: auto; max-height: min(48vh, 28rem); }

/* Ingredient safety guidance, within the existing diary palette. */
.pair-effectiveness-note { grid-column: 1 / -1; border-top: 1px solid var(--line); padding-top: 12px; }
.pair-guidance.pair-standalone-advice { display: block; }
.pair-evidence-label { margin: 8px 0; font-weight: 600; }
.match-explained { margin-top: 22px; color: var(--quiet); font-size: 1rem; }
.match-explained summary { color: var(--wine); font-weight: 600; cursor: pointer; width: fit-content; }
.match-explained ul { padding-inline-start: 22px; }
.match-explained li { margin-block: 8px; }
.match-explained strong { color: var(--ink); }
