/* Light only. Apple-style: system font, quiet greys, one accent, hairlines, generous space. */
:root {
  --bg: #f5f5f7; --card: #fff; --ink: #1d1d1f; --muted: #6e6e73; --line: #d2d2d7; --hair: rgba(0, 0, 0, .08);
  --tint: #0a7a62; --tint-hover: #086650; --on-tint: #fff; --soft: #e8f4f0;
  --warn: #8a4b00; --warn-bg: #fff4e0; --ok: #1f7a3a; --bad: #b3261e;
  --radius: 18px; --radius-s: 12px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 4px 16px rgba(0, 0, 0, .04);
  --shadow-up: 0 2px 4px rgba(0, 0, 0, .05), 0 12px 32px rgba(0, 0, 0, .08);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", "Segoe UI", Roboto, Arial, sans-serif;
  --display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", "Segoe UI", Roboto, Arial, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.47 var(--font); letter-spacing: -.022em; -webkit-font-smoothing: antialiased; }

/* ---------- Header: sticky, translucent ---------- */
header { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px max(16px, env(safe-area-inset-left)); min-height: 52px;
  background: rgba(255, 255, 255, .72); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); border-bottom: 1px solid var(--hair); }
.brand { display: flex; align-items: center; gap: 8px; color: inherit; text-decoration: none; font-size: 1.06rem; }
.brand b { font-weight: 600; letter-spacing: -.02em; }
nav { display: flex; gap: 2px; }
nav a { color: var(--muted); text-decoration: none; font-size: .88rem; padding: 7px 12px; border-radius: 999px; transition: color .2s, background .2s; }
nav a:hover { color: var(--ink); }
nav a[aria-current] { color: var(--ink); background: rgba(0, 0, 0, .05); font-weight: 500; }

/* ---------- Layout and type ---------- */
main { max-width: 680px; margin: 0 auto; padding: 32px 20px 72px; }
main:has(.grid, .compare) { max-width: 1080px; }
h1 { font-family: var(--display); font-size: clamp(2rem, 6vw, 3rem); font-weight: 700; line-height: 1.08; letter-spacing: -.035em; margin: 8px 0 16px; }
main > h1:first-child + p { font-size: clamp(1.1rem, 2.6vw, 1.3rem); color: var(--muted); line-height: 1.4; }
h2 { font-family: var(--display); font-size: 1.5rem; font-weight: 600; letter-spacing: -.025em; line-height: 1.2; margin: 44px 0 14px; }
h3 { font-size: 1.06rem; font-weight: 600; margin: 0 0 8px; }
p { margin: 0 0 14px; }
a { color: var(--tint); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 3px solid rgba(10, 122, 98, .45); outline-offset: 2px; }
.muted { color: var(--muted); }
.small { font-size: .82rem; letter-spacing: -.01em; }
.eyebrow { color: var(--tint); font-size: .82rem; font-weight: 600; letter-spacing: .02em; text-transform: uppercase; margin: 0 0 6px; }
.stack > * + * { margin-top: 12px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 24px 0; }

/* ---------- Buttons: pill shaped ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit; font-size: 1rem; font-weight: 500; text-decoration: none; cursor: pointer;
  border: 0; background: var(--tint); color: var(--on-tint); padding: 12px 22px; border-radius: 999px; min-height: 44px; transition: background .2s, transform .1s; }
.btn:hover { background: var(--tint-hover); text-decoration: none; }
.btn:active { transform: scale(.98); }
.btn.secondary { background: rgba(0, 0, 0, .05); color: var(--ink); }
.btn.secondary:hover { background: rgba(0, 0, 0, .09); }
.btn.link { background: none; color: var(--tint); padding: 12px 4px; }
.btn.small { min-height: 34px; padding: 6px 14px; font-size: .88rem; }
.btn[disabled] { opacity: .35; cursor: default; transform: none; }
.btn[disabled]:hover { background: var(--tint); }
.btn.secondary[disabled]:hover { background: rgba(0, 0, 0, .05); }

/* ---------- Cards and lists ---------- */
.card { background: var(--card); border-radius: var(--radius); padding: 20px 22px; margin-bottom: 14px; box-shadow: var(--shadow); }
.card > :last-child { margin-bottom: 0; }
.card ul { list-style: none; padding: 0; margin: 0; }
.card li + li { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--hair); }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 10px 24px; margin: 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: 600; text-align: right; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 0 0 12px; list-style: none; }
.chips li, .badge { display: inline-block; background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; font-size: .82rem; font-weight: 500; }
.warn { background: var(--warn-bg); color: var(--warn); border-radius: var(--radius-s); padding: 12px 16px; margin-bottom: 10px; font-size: .94rem; }
.note { color: var(--muted); font-size: .82rem; border-top: 1px solid var(--line); padding-top: 16px; margin: 40px 0 16px; }

/* ---------- Questionnaire ---------- */
progress { -webkit-appearance: none; appearance: none; display: block; width: 100%; height: 4px; border: 0; border-radius: 4px; background: var(--line); overflow: hidden; margin-bottom: 28px; }
progress::-webkit-progress-bar { background: var(--line); }
progress::-webkit-progress-value { background: var(--tint); border-radius: 4px; transition: width .3s; }
progress::-moz-progress-bar { background: var(--tint); border-radius: 4px; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
legend { font-family: var(--display); font-size: clamp(1.5rem, 4.5vw, 2rem); font-weight: 600; letter-spacing: -.03em; line-height: 1.15; padding: 0; margin-bottom: 22px; }
legend:focus { outline: none; }
.opt { display: flex; align-items: center; gap: 14px; background: var(--card); border: 1.5px solid transparent; border-radius: var(--radius-s); padding: 14px 18px; margin-bottom: 10px; min-height: 56px; cursor: pointer; box-shadow: var(--shadow); transition: border-color .15s, background .15s; }
.opt:hover { border-color: var(--line); }
.opt:has(input:checked) { border-color: var(--tint); background: var(--soft); }
.opt:has(input:focus-visible) { outline: 3px solid rgba(10, 122, 98, .45); outline-offset: 2px; }
.opt input { width: 20px; height: 20px; accent-color: var(--tint); flex: none; margin: 0; }

/* ---------- Forms ---------- */
select, input[type=search], input[type=text], input[type=number], input[type=file] { font: inherit; color: inherit; max-width: 100%; }
select, input[type=search], input[type=text], input[type=number] { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-s); padding: 10px 14px; min-height: 44px; }
select:focus, input:focus { outline: none; border-color: var(--tint); box-shadow: 0 0 0 4px rgba(10, 122, 98, .15); }
input.search { width: 100%; padding-left: 40px; background: var(--card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236e6e73' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") no-repeat 14px 50% / 18px; }
label.field { display: block; font-weight: 600; margin: 20px 0 8px; }

/* Segmented control: <div class="segmented"><button aria-pressed="true">A</button><button>B</button></div> */
.segmented { display: inline-flex; background: rgba(0, 0, 0, .06); border-radius: 10px; padding: 2px; gap: 2px; }
.segmented button { font: inherit; font-size: .88rem; font-weight: 500; border: 0; background: none; color: var(--ink); padding: 6px 14px; border-radius: 8px; cursor: pointer; min-height: 32px; }
.segmented [aria-pressed=true] { background: var(--card); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }

/* ---------- Products (reusable) ----------
  <ul class="grid">
    <li class="product"><img src="" alt=""><p class="brand">Brand</p><h3>Name</h3>
      <p class="actives">Niacinamide 10%</p><p class="price">€ 12,99 <small>€ 43,30 / 100 ml</small></p>
      <span class="badge budget">Budget</span></li>
  </ul> */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; list-style: none; padding: 0; margin: 0 0 24px; }
.product { position: relative; display: flex; flex-direction: column; background: var(--card); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); transition: box-shadow .25s, transform .25s; }
.product:hover { box-shadow: var(--shadow-up); transform: translateY(-2px); }
.product img { width: 100%; aspect-ratio: 1; object-fit: contain; border-radius: var(--radius-s); background: #fafafa; margin-bottom: 14px; }
.product .brand { color: var(--muted); font-size: .76rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; margin: 0 0 2px; }
.product h3 { font-size: 1rem; line-height: 1.3; margin: 0 0 8px; }
.product h3 a { color: inherit; }
.product h3 a::after { content: ""; position: absolute; inset: 0; } /* whole card clickable */
.product .actives { color: var(--tint); font-size: .82rem; font-weight: 500; margin: 0 0 12px; }
.product .price { margin-top: auto; }
.product .badge { position: absolute; top: 14px; left: 14px; }
.product:has(> .badge):not(:has(> img, > .ph)) { padding-top: 52px; } /* badge needs room when there is no photo */
.price { font-size: 1.06rem; font-weight: 600; margin: 0; }
.price small { display: block; color: var(--muted); font-size: .76rem; font-weight: 400; }
@media (max-width: 520px) {
  .grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .product { padding: 12px; }
  .product .badge { top: 8px; left: 8px; }
  .product .ph { gap: 2px; padding: 28px 8px 8px; }
  .product .ph::before { width: 18%; margin-bottom: 6px; }
  .product .ph-slot { font-size: .94rem; }
}
.badge.budget { background: var(--soft); border-color: transparent; color: var(--tint); }
.badge.premium { background: #1d1d1f; border-color: transparent; color: #fff; }
.badge.match { background: var(--tint); border-color: transparent; color: #fff; }

/* Placeholder when there is no photo: <div class="ph"><span class="ph-brand">Brand</span><span class="ph-slot">Cleanser</span></div> */
.ph { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; aspect-ratio: 1; padding: 16px; text-align: center;
  border-radius: var(--radius-s); background: linear-gradient(160deg, #fbfbfd 0%, var(--soft) 100%); box-shadow: inset 0 0 0 1px var(--hair); }
.ph::before { content: ""; width: 28%; aspect-ratio: 1 / 1.6; margin-bottom: 8px; border-radius: 10px 10px 6px 6px; background: linear-gradient(180deg, rgba(10, 122, 98, .22) 0 18%, #fff 18% 100%); box-shadow: 0 0 0 1px rgba(10, 122, 98, .18), 0 6px 14px rgba(0, 0, 0, .06); }
.ph-brand { color: var(--muted); font-size: .7rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.ph-slot { color: var(--tint); font-family: var(--display); font-size: 1.06rem; font-weight: 600; letter-spacing: -.02em; }
.product .ph { margin-bottom: 14px; }
.detail > .ph { border-radius: var(--radius); }
.detail > .ph::before { width: 22%; }
.detail .ph-brand { font-size: .82rem; }
.detail .ph-slot { font-size: 1.5rem; }

/* Product detail: <div class="detail"><img><div>...</div></div> */
.detail { display: grid; gap: 32px; align-items: start; }
@media (min-width: 760px) { .detail:has(> img, > .ph) { grid-template-columns: 1fr 1fr; } }
.detail > img { width: 100%; aspect-ratio: 1; object-fit: contain; background: var(--card); border-radius: var(--radius); padding: 24px; }

/* Buying advice */
.note.advice-disclaimer { font-size: .88rem; line-height: 1.45; border: 0; background: rgba(0, 0, 0, .035); border-radius: var(--radius-s); padding: 12px 16px; margin: 0 0 24px; }
.advice-total { margin-top: 32px; }
.advice-total dt { color: var(--ink); font-weight: 600; }
.advice-total dd { white-space: nowrap; font-family: var(--display); font-size: 1.5rem; letter-spacing: -.02em; color: var(--tint); }
.advice-total p { color: var(--muted); margin-top: 6px; }

/* Shop offers: <ul class="offers"><li><span>Shop</span><b class="price">€ 9,99</b><a class="btn small">Add</a></li></ul> */
.offers { list-style: none; padding: 0; margin: 0 0 16px; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.offers li { display: flex; align-items: center; gap: 12px; padding: 14px 18px; }
.offers li + li { border-top: 1px solid var(--hair); }
.offers li > :first-child { flex: 1; }
.offers br { display: none; }
.offer-date { display: block; font-size: .76rem; margin-top: 2px; }
.stale { opacity: .6; font-style: italic; }
.offers .best { display: block; color: var(--ok); font-size: .76rem; font-weight: 600; }

/* Comparison table: <div class="compare"><table>...</table></div> */
.compare { overflow-x: auto; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 24px; }
.compare table { border-collapse: collapse; width: 100%; min-width: 520px; font-size: .94rem; }
.compare th, .compare td { padding: 12px 16px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--hair); }
.compare thead th { font-weight: 600; vertical-align: bottom; }
.compare tbody th { color: var(--muted); font-weight: 400; white-space: nowrap; }
.compare tr:last-child > * { border-bottom: 0; }
.yes { color: var(--ok); font-weight: 600; }
.no { color: var(--bad); }

/* ---------- Banner and toast ---------- */
#banner { background: var(--soft); padding: 12px 20px; font-size: .94rem; text-align: center; }
#banner ul { display: inline-block; text-align: left; margin: 6px 0 10px; padding-left: 20px; }
#banner .btn { min-height: 34px; padding: 6px 16px; font-size: .88rem; }
#toast { position: fixed; left: 16px; right: 16px; bottom: max(16px, env(safe-area-inset-bottom)); max-width: 420px; margin: 0 auto; z-index: 20;
  background: rgba(29, 29, 31, .92); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); color: #fff; text-align: center; font-size: .94rem;
  border-radius: 999px; padding: 12px 20px; box-shadow: var(--shadow-up); display: none; }
#toast.show { display: block; animation: rise .25s ease-out; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }
