/* nevarbunda — the visual language is the back of the packet.
 *
 * A snack's front-of-pack design exists to sell it; the besin değerleri panel
 * on the back exists to be legible. This site is an argument for the back of
 * the packet, so it is built from that panel's materials: printed-paper
 * ground, hairline rules, and tabular figures that let two products' numbers
 * line up down the column.
 *
 * The only saturated colour on the page is the Nutri-Score scale itself,
 * whose five values are set by Santé publique France. Everything interactive
 * is ink blue precisely so it can never be mistaken for a grade. */

:root {
  --paper:      #fcfcfa;
  --paper-sunk: #f2f2ed;
  --ink:        #1a1917;
  --ink-soft:   #56554e;
  --ink-faint:  #8a897f;
  --rule:       #dcdbd4;
  --rule-hard:  #b4b3aa;
  --link:       #1f3a5f;

  /* nevarbunda's own rating palette; deliberately distinct from Nutri-Score. */
  --rating-excellent: #176b57;
  --rating-good:      #4f6f35;
  --rating-mediocre:  #9a6818;
  --rating-bad:       #9a3f35;

  /* Official Nutri-Score scale (Santé publique France). Not ours to alter. */
  --ns-a: #038141;
  --ns-b: #85bb2f;
  --ns-c: #fecb02;
  --ns-d: #ee8100;
  --ns-e: #e63e11;

  --shell: 72rem;
  --step:  0.75rem;

  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
          "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper:      #15161a;
    --paper-sunk: #1d1f24;
    --ink:        #ecebe6;
    --ink-soft:   #a9a89f;
    --ink-faint:  #78776f;
    --rule:       #2e3037;
    --rule-hard:  #454852;
    --link:       #9ec1ec;
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  /* Every figure on this site sits in a column beside another figure. */
  font-variant-numeric: tabular-nums;
}

a { color: var(--link); }

:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 2px;
}

main {
  max-width: var(--shell);
  margin: 0 auto;
  padding: 0 1.25rem 4rem;
}

/* ---------- masthead ---------- */

.masthead {
  max-width: var(--shell);
  margin: 0 auto;
  padding: 1.5rem 1.25rem 1.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  align-items: baseline;
  justify-content: space-between;
  border-bottom: 1px solid var(--rule);
}

.wordmark {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--ink);
  text-decoration: none;
}

/* The name is a question — "ne var bunda?" — so the mark carries the mark. */
.wordmark-q { color: var(--ns-d); }

.nav {
  display: flex;
  gap: 1.25rem;
  font-size: 0.875rem;
}

.nav a {
  color: var(--ink-soft);
  text-decoration: none;
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
}

.nav a:hover { color: var(--ink); border-bottom-color: var(--rule-hard); }

/* ---------- intro ---------- */

.intro { padding: 3rem 0 2rem; max-width: 42rem; }

.intro h1 {
  margin: 0;
  font-size: clamp(1.75rem, 4.5vw, 2.75rem);
  line-height: 1.12;
  letter-spacing: -0.035em;
  font-weight: 700;
}

.intro-note {
  margin: 1rem 0 0;
  color: var(--ink-soft);
  font-size: 0.9375rem;
  max-width: 38rem;
}

/* ---------- filters ---------- */

/* Three stacked rows, not one seven-control line. Each row is its own flex
 * context, so the checkbox no longer has to be nudged onto the selects'
 * baseline to look aligned. */
.filters {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
  padding: 1.25rem 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--step);
  align-items: flex-end;
}

/* The selects share the row evenly and wrap as whole controls rather than
 * letting one collapse to its text width. */
.filter-row-selects .filter { flex: 1 1 11rem; }
.filter-row-actions { align-items: center; gap: 1rem; }

.filter { display: flex; flex-direction: column; gap: 0.3rem; }
.filter-search { flex: 1 1 100%; }

/* Label beside the box, not above it like the selects — and now on its own
 * row, so it needs no baseline compensation. The box is grown well past the
 * browser default and tinted, because a 13px unchecked default box is the
 * single easiest control on this page to miss. */
.filter-check {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.55rem;
}
.filter-check input {
  width: 1.05rem;
  height: 1.05rem;
  accent-color: var(--link);
  cursor: pointer;
  flex: none;
}
.filter-check label {
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.9375rem;
  color: var(--ink);
  cursor: pointer;
}

/* Sentence case at a readable size. These were 11px uppercase with 0.09em
 * tracking, which is the hardest text on the page to read and sat directly
 * against the goal of a page an older reader can scan. */
.filter label {
  font-size: 0.8125rem;
  letter-spacing: 0;
  color: var(--ink-soft);
}

.filter input, .filter select {
  font: inherit;
  font-size: 0.9375rem;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--rule-hard);
  border-radius: 2px;
  padding: 0.5rem 0.6rem;
  min-width: 0;
  width: 100%;
}

.filters button {
  font: inherit;
  font-size: 0.9375rem;
  padding: 0.45rem 1.1rem;
  border: 1px solid var(--link);
  border-radius: 2px;
  background: var(--link);
  color: var(--paper);
  cursor: pointer;
}

.filters button:hover { filter: brightness(1.15); }

.filter-clear { font-size: 0.875rem; }

.resultcount {
  margin: 1.25rem 0 1.5rem;
  font-size: 0.8125rem;
  letter-spacing: 0.02em;
  color: var(--ink-faint);
}

/* ---------- grid ---------- */

.grid {
  display: grid;
  /* auto-fit collapses the empty tracks of a short row, so a search returning
   * 1–3 products does not leave hairline background bleeding across the row.
   * The grid itself sits on the normal page background rather than on the
   * rule colour, so a sparse result set looks the same as the rest of the
   * site; the cards separate from one another with a real gap instead. */
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 0.75rem;
}

/* Cards butt against one another on hairlines, the way cells do in a
 * nutrition table, rather than floating as separate cards. */
.card { background: var(--paper); }

.card-link {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 1rem;
  color: inherit;
  text-decoration: none;
}

.card-link:hover { background: var(--paper-sunk); }

.card-shot {
  aspect-ratio: 1;
  overflow: hidden;
  margin-bottom: 0.875rem;
  background: var(--paper-sunk);
}

.card-shot img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  mix-blend-mode: multiply;
}

@media (prefers-color-scheme: dark) {
  .card-shot img { mix-blend-mode: normal; }
}

.card-body { display: flex; flex-direction: column; flex: 1; }

.card-brand {
  margin: 0 0 0.25rem;
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  color: var(--ink-faint);
}

/* Two lines' worth of room whether the name needs it or not, so the verdict
 * rows line up across a grid row and two products can be read side by side. */
.card-name {
  margin: 0;
  min-height: 2.6em;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.card-verdict {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.875rem;
}

.card-verdict[data-verdict="excellent"] .puan,
.p-score[data-verdict="excellent"] .puan { color: var(--rating-excellent); }
.card-verdict[data-verdict="good"] .puan,
.p-score[data-verdict="good"] .puan { color: var(--rating-good); }
.card-verdict[data-verdict="mediocre"] .puan,
.p-score[data-verdict="mediocre"] .puan { color: var(--rating-mediocre); }
.card-verdict[data-verdict="bad"] .puan,
.p-score[data-verdict="bad"] .puan { color: var(--rating-bad); }

.rating-provisional,
.rating-cap {
  margin: 0.5rem 0 0;
  font-size: 0.75rem;
  line-height: 1.35;
  color: var(--ink-soft);
}

.rating-cap {
  padding-left: 0.625rem;
  border-left: 3px solid var(--rating-bad);
}

/* The composite carries the weight. It is nevarbunda's own number, so it is
 * always labelled — a bare 46 beside a rank of 154 would be unreadable. */
.puan {
  font-family: var(--mono);
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.03em;
}

.puan-max {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--ink-faint);
  letter-spacing: 0;
}

.card-puanlabel {
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--ink-faint);
}

/* The official figure sits below ours, visibly secondary and always named,
 * so the two scales are never read as one. */
.card-official {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  margin-top: 0.375rem;
}

.card-gradelabel {
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--ink-faint);
}

.card-pos {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

/* ---------- the Nutri-Score chip ---------- */

.grade {
  display: inline-grid;
  place-items: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 2px;
  font-family: var(--mono);
  font-size: 0.875rem;
  font-weight: 700;
  color: #fff;
  background: var(--rule-hard);
}

.grade[data-grade="A"] { background: var(--ns-a); }
.grade[data-grade="B"] { background: var(--ns-b); color: #14210a; }
.grade[data-grade="C"] { background: var(--ns-c); color: #2a2200; }
.grade[data-grade="D"] { background: var(--ns-d); }
.grade[data-grade="E"] { background: var(--ns-e); }

/* ---------- the peer strip ---------- *
 *
 * The signature of the site. The track is the product's whole peer group,
 * best on the left; the mark is where this product sits in it. It exists so
 * "%100" is never read alone: you see the size of the field it won, and on an
 * all-D/E category the caveat underneath explains what winning it is worth. */

.peers {
  position: relative;
  height: 6px;
  margin: 0.75rem 0 0.5rem;
  /* Left is the top of the category. The track fades out toward the bottom so
   * the strip reads as a field with a good end, not as a progress bar. */
  background: linear-gradient(
    to right,
    var(--rule-hard) 0%,
    var(--rule) 100%
  );
  border-radius: 1px;
}

.peers-mark {
  position: absolute;
  top: -2px;
  /* Inset by the mark's own width so rank 1 and last rank both stay on the
   * track instead of hanging off the ends. */
  left: 0;
  width: 3px;
  height: 10px;
  border-radius: 1px;
  background: var(--ink);
  transform: translateX(-1.5px);
}

.card-group {
  margin: 0.125rem 0 0;
  font-size: 0.8125rem;
  color: var(--ink-soft);
}

.card-rank {
  margin: 0.125rem 0 0;
  font-size: 0.8125rem;
  color: var(--ink-faint);
}

.card-caveat {
  margin: 0.5rem 0 0;
  padding-left: 0.5rem;
  border-left: 2px solid var(--ns-d);
  font-size: 0.75rem;
  line-height: 1.35;
  color: var(--ink-soft);
}

/* The additive count sits at the bottom of every card. The .risk chip does
 * the visible work (including the green data-risk="clean" badge); only the
 * spacing belongs here. */
.card-add { margin: 0.375rem 0 0; }

/* ---------- no data ---------- */

.card-nodata {
  margin: 0.875rem 0 0;
  font-family: var(--mono);
  font-size: 0.9375rem;
  letter-spacing: 0.01em;
  color: var(--ink-soft);
}

.card-why {
  margin: 0.375rem 0 0;
  font-size: 0.75rem;
  line-height: 1.35;
  color: var(--ink-faint);
}

/* ---------- empty state and infinite scroll ---------- */

.empty {
  padding: 4rem 0;
  font-size: 1rem;
  color: var(--ink-soft);
}

/* The sentinel is an invisible target the scroll observer watches; once the
 * last page has loaded it is a plain empty div. */
.scroll-sentinel {
  height: 0;
}

.scroll-sentinel.is-loading {
  height: 2px;
  margin-top: 1rem;
  background:
    linear-gradient(90deg, transparent, var(--ink-faint), transparent);
  background-size: 50% 100%;
  background-repeat: no-repeat;
  animation: scroll-load 1s linear infinite;
}

@keyframes scroll-load {
  from { background-position: -50% 0; }
  to   { background-position: 150% 0; }
}

/* ---------- product page ---------- */

.product { padding-top: 2.5rem; max-width: 54rem; }

.p-head {
  display: grid;
  grid-template-columns: minmax(0, 18rem) minmax(0, 1fr);
  gap: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--rule);
}

@media (max-width: 44rem) {
  .p-head { grid-template-columns: 1fr; gap: 1.25rem; }
}

.p-shot {
  aspect-ratio: 1;
  overflow: hidden;
  background: var(--paper-sunk);
}

.p-shot img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  mix-blend-mode: multiply;
}

@media (prefers-color-scheme: dark) {
  .p-shot img { mix-blend-mode: normal; }
}

.p-brand {
  margin: 0 0 0.375rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  color: var(--ink-faint);
}

.p-name {
  margin: 0;
  font-size: clamp(1.375rem, 3vw, 1.875rem);
  line-height: 1.18;
  letter-spacing: -0.03em;
  font-weight: 700;
}

.p-verdict {
  display: flex;
  /* flex-start, not center: the block is three lines tall now, and centring
   * the chip against it lines the letter up with the raw score instead of
   * with the sentence that names it. */
  align-items: flex-start;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.p-score {
  display: flex;
  align-items: flex-start;
  gap: 0.875rem;
  margin-top: 1.5rem;
}

.p-score-name {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 700;
}

.p-official {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  margin-top: 1rem;
}

.p-official .grade {
  flex: 0 0 auto;
}

.p-verdict .grade {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 4px;
  font-size: 2rem;
}

/* The verdict block is the letter and the sentence that says whose algorithm
 * produced it. The attribution is not fine print: it is the difference
 * between "Santé publique France graded this product" and "this site ran
 * their published algorithm over a retail label", and only the second is
 * true. It is sized to be read, not skimmed past. */
.p-verdict-text {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.p-gradename {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
}

/* The penalty balance, set as the arithmetic it is: the two column totals,
 * the subtraction, and the letter it lands on. Mono, because the claim of the
 * whole block is that a reader holding the packet can redo the sum. Presented
 * here rather than beside the letter in the header: a bare negative number
 * next to a grade reads as a rating, and no caption undoes that. */
.p-balance {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
}

.p-balance-sum {
  font-family: var(--mono);
  font-size: 0.9375rem;
  color: var(--ink);
}

/* ---------- the raw-score scale ----------
 *
 * The one place on the site that uses the Nutri-Score palette for something
 * other than a letter chip, because the segments ARE the letter bands: the
 * meter exists to show that the grade is a threshold on the number above it,
 * not a second opinion about the product. Segment widths and the marker come
 * from nutriscore.Bands and nutriscore.Position, never from CSS arithmetic.
 */
.scale {
  margin: 0.875rem 0 0;
}

.scale-track {
  position: relative;
  display: flex;
  height: 1.375rem;
  border-radius: 3px;
  overflow: hidden;
}

.scale-band {
  display: grid;
  place-items: center;
  min-width: 0;
  overflow: hidden;
  font-family: var(--mono);
  font-size: 0.6875rem;
  font-weight: 700;
  color: #fff;
  opacity: 0.42;
}

/* The band this product falls in carries full strength; the rest recede, so
 * the eye lands on the answer before it reads the scale. */
.scale-band.is-current {
  opacity: 1;
}

.scale-band[data-grade="A"] { background: var(--ns-a); }
.scale-band[data-grade="B"] { background: var(--ns-b); color: #14210a; }
.scale-band[data-grade="C"] { background: var(--ns-c); color: #2a2200; }
.scale-band[data-grade="D"] { background: var(--ns-d); }
.scale-band[data-grade="E"] { background: var(--ns-e); }

/* A dark bar inside a light halo, so it stays visible on the yellow C band
 * and on the dark-red E band alike, in either theme. */
.scale-mark {
  position: absolute;
  top: -3px;
  bottom: -3px;
  width: 3px;
  margin-left: -1.5px;
  border-radius: 2px;
  background: var(--ink);
  box-shadow: 0 0 0 2px var(--paper);
}

.scale-ends {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 0.5rem;
  font-size: 0.75rem;
  color: var(--ink-soft);
}

.scale-here {
  font-family: var(--mono);
  font-weight: 700;
  color: var(--ink);
}

.p-gradesrc {
  max-width: 46ch;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--ink-soft);
}

/* .src is the same attribution one level quieter, for the card, where it sits
 * under the letter in a space that cannot hold a sentence. text-transform is
 * reset: .card-gradelabel upper-cases its label, and a caps attribution on
 * every card in a grid of sixty reads as shouting rather than as a footnote. */
.src {
  display: block;
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.6875rem;
  font-weight: 400;
  line-height: 1.3;
  color: var(--ink-soft);
}

.p-gradenote {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
}

/* The catalogue position: the headline number, always printed with the pool
 * it is drawn from so it cannot be read as a score out of 100. */
.p-pos {
  margin: 0.5rem 0 0;
  font-size: 1.125rem;
  color: var(--ink);
}

.p-pos b { font-size: 1.5rem; letter-spacing: -0.03em; }

.p-group {
  margin: 1rem 0 0;
  font-size: 0.9375rem;
  color: var(--ink-soft);
}

.peers-lg { height: 8px; margin: 0.625rem 0 0.25rem; }
.peers-lg .peers-mark { height: 14px; top: -3px; width: 3px; }

.peers-ends {
  display: flex;
  justify-content: space-between;
  margin: 0;
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
}

.p-rank {
  margin: 0.5rem 0 0;
  font-size: 0.9375rem;
  color: var(--ink-soft);
}

.p-caveat {
  margin: 1.25rem 0 0;
  padding: 0.75rem 0.875rem;
  border-left: 3px solid var(--ns-d);
  background: var(--paper-sunk);
  font-size: 0.875rem;
  line-height: 1.45;
  color: var(--ink-soft);
}

.p-nodata {
  margin: 1.5rem 0 0;
  font-family: var(--mono);
  font-size: 1.375rem;
  color: var(--ink-soft);
}

.p-why { margin: 0.625rem 0 0; font-size: 0.9375rem; }

.p-why-more {
  margin: 0.875rem 0 0;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--ink-faint);
  max-width: 34rem;
}

/* ---------- sections ---------- */

.p-section {
  padding: 2rem 0;
  border-bottom: 1px solid var(--rule);
}

.p-section h2 {
  margin: 0 0 1rem;
  font-size: 1.125rem;
  letter-spacing: -0.02em;
}

/* Anything this project authored itself is badged, so it can never be read as
 * part of the official algorithm. */
.ours {
  display: inline-block;
  margin-left: 0.5rem;
  padding: 0.125rem 0.5rem;
  border: 1px solid var(--rule-hard);
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  color: var(--ink-faint);
  vertical-align: 0.15em;
}

.p-explain {
  margin: 0 0 1.5rem;
  font-size: 1.0625rem;
  line-height: 1.45;
  max-width: 40rem;
}

.drivers {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 2rem;
}

.drivers h3 {
  margin: 0 0 0.75rem;
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--ink-soft);
}

/* Component points run the opposite way from every other number here, so the
 * direction is printed rather than left to be inferred. */
.dir {
  margin-left: 0.5rem;
  font-family: var(--mono);
  font-size: 0.6875rem;
  text-transform: none;
  letter-spacing: 0;
  color: var(--ink-faint);
}

.driver-list { list-style: none; margin: 0; padding: 0; }

.driver-list li {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: baseline;
  gap: 0.5rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--rule);
  font-size: 0.9375rem;
}

.d-value { color: var(--ink-soft); font-size: 0.875rem; }
.d-pts { font-weight: 700; min-width: 3ch; text-align: right; }
.d-max { font-weight: 400; color: var(--ink-faint); }

.d-flag {
  grid-column: 1 / -1;
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
}

.d-uncounted .d-name,
.d-uncounted .d-value,
.d-uncounted .d-pts { opacity: 0.55; }
.d-uncounted .d-pts { text-decoration: line-through; }

/* ---------- tables ---------- */

/* A table has no scroll box of its own, so a table wider than the viewport
 * widens <main> and scrolls the entire document sideways. The additive table
 * is 447px at its narrowest — five columns, three of which refuse to wrap —
 * which cut the photo, the masthead and the right edge of every section off
 * on any phone. It scrolls inside its own box instead, the same way .cmp
 * does on the comparison page.
 *
 * Applies to any block with an intrinsic minimum wider than a phone: the
 * additive table, the penalty tables, and the MathML formulas. A <math>
 * element is no more a scroll container than a <table> is, so setting
 * overflow on it directly does nothing. */
.scroll-x {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.nutri, .additives {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
}

.nutri th, .nutri td,
.additives th, .additives td {
  text-align: left;
  padding: 0.5rem 0.75rem 0.5rem 0;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
}

.nutri th { font-weight: 400; color: var(--ink-soft); }
.nutri td { text-align: right; font-weight: 600; }

.additives thead th {
  font-size: 0.6875rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--ink-faint);
  border-bottom: 1px solid var(--rule-hard);
}

.a-code { font-family: var(--mono); font-size: 0.875rem; white-space: nowrap; }
.a-src { font-size: 0.75rem; line-height: 1.4; color: var(--ink-faint); }
.a-nosrc { color: var(--ink-faint); }

.risk {
  display: inline-block;
  padding: 0.125rem 0.5rem;
  border-radius: 2px;
  font-size: 0.75rem;
  white-space: nowrap;
  background: var(--paper-sunk);
  color: var(--ink-soft);
  border: 1px solid var(--rule);
}

/* Risk badges are deliberately not the Nutri-Score palette: this is our
 * assessment, and it must not borrow the official scale's authority. */
.risk[data-risk="limited"]  { border-color: #b9a25a; }
.risk[data-risk="moderate"] { border-color: #b97a3a; color: var(--ink); }
.risk[data-risk="high"]     { border-color: #b34a3a; color: var(--ink); font-weight: 600; }

/* "clean" is the no-additive-found badge. Green, but deliberately not
 * --ns-a: a green that matches the Nutri-Score scale would read as an
 * official grade rather than as our own count. */
.risk[data-risk="clean"] {
  border-color: #4a8b5a;
  color: #2f6b40;
  font-weight: 600;
}

@media (prefers-color-scheme: dark) {
  .risk[data-risk="clean"] { color: #7fc192; }
}

/* ---------- additive summary (product header) ---------- */

.risk-summary {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.375rem 0.5rem;
  margin-top: 1rem;
  padding-top: 0.875rem;
  border-top: 1px solid var(--rule);
}

.risk-summary-label {
  font-size: 0.6875rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-soft);
  text-decoration: none;
}

.risk-summary-label:hover { text-decoration: underline; }

.risk-summary-total {
  font-size: 1.125rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.risk-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  flex-basis: 100%;
}

/* Lowercased here rather than in the template so the markup keeps the same
 * label the table below prints. The page is lang="tr", so the browser applies
 * Turkish casing rules to it. */
.risk-chips .risk { text-transform: lowercase; }


.notes { margin: 0; padding-left: 1.125rem; font-size: 0.9375rem; color: var(--ink-soft); }
.notes li { margin-bottom: 0.375rem; }

.p-foot {
  margin: 1rem 0 0;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--ink-faint);
  max-width: 40rem;
}

.p-foot-lead { margin-top: 0; margin-bottom: 1.25rem; }

/* ---------- calculation details ---------- */

.calc { margin: 2rem 0 0; }

.calc summary {
  cursor: pointer;
  padding: 0.75rem 0;
  font-size: 0.875rem;
  color: var(--link);
}

.calc-body { padding: 0.5rem 0 1rem; max-width: 32rem; }

.calc-raw {
  margin: 0;
  font-size: 1.0625rem;
}

.calc-raw b { font-size: 1.5rem; letter-spacing: -0.03em; }

.calc-sum th, .calc-sum td {
  border-bottom: 1px solid var(--rule-hard);
  font-weight: 700;
}

.calc-sum th { color: var(--ink); }

.calc-meta {
  margin: 1rem 0 0;
  font-size: 0.75rem;
  color: var(--ink-faint);
}

.calc-meta code {
  font-family: var(--mono);
  font-size: 0.75rem;
}

.p-back { margin: 2.5rem 0 0; font-size: 0.875rem; }

/* ---------- shared ---------- */

.intro-tight { padding-bottom: 1rem; }

.grade-sm { width: 1.25rem; height: 1.25rem; font-size: 0.75rem; }

.rank-puan {
  font-family: var(--mono);
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* ---------- rankings ---------- */

.rank-group {
  padding: 2rem 0;
  border-top: 1px solid var(--rule);
}

.rank-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 1rem;
  margin-bottom: 1.25rem;
}

.rank-head h2 {
  margin: 0;
  font-size: 1.25rem;
  letter-spacing: -0.025em;
}

.rank-meta {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--ink-faint);
}

.rank-allde {
  padding-left: 0.5rem;
  border-left: 2px solid var(--ns-d);
  color: var(--ink-soft);
}

.rank-cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
  gap: 1.5rem 2.5rem;
}

.rank-col h3 {
  margin: 0 0 0.5rem;
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--ink-faint);
}

.rank-list { list-style: none; margin: 0; padding: 0; }

.rank-row {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.4375rem 0;
  border-bottom: 1px solid var(--rule);
  font-size: 0.875rem;
}

.rank-pos {
  min-width: 2.25rem;
  color: var(--ink-faint);
  font-size: 0.8125rem;
}

.rank-name {
  flex: 1;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.rank-name:hover { text-decoration: underline; }

/* ---------- documents ---------- */

.doc { max-width: 44rem; }

.doc-section {
  padding: 2rem 0;
  border-top: 1px solid var(--rule);
}

.doc-section h2 {
  margin: 0 0 1rem;
  font-size: 1.1875rem;
  letter-spacing: -0.025em;
}

.doc-section p {
  margin: 0 0 1rem;
  font-size: 0.9375rem;
  line-height: 1.65;
}

.doc-list {
  margin: 0 0 1rem;
  padding-left: 1.125rem;
  font-size: 0.9375rem;
  line-height: 1.65;
}

.doc-list li { margin-bottom: 0.625rem; }

/* Anything that qualifies rather than states sits in a quieter register, so
 * the caveats are legible without competing with the claims. */
.doc-note {
  padding: 0.875rem 1rem;
  background: var(--paper-sunk);
  border-left: 3px solid var(--rule-hard);
  font-size: 0.875rem !important;
  color: var(--ink-soft);
}

.census {
  padding: 1rem;
  border: 1px solid var(--rule-hard);
  font-size: 0.9375rem;
}

/* ---------- footer ---------- */

.footer {
  max-width: var(--shell);
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
  border-top: 1px solid var(--rule);
  font-size: 0.8125rem;
  line-height: 1.55;
  color: var(--ink-faint);
}

.footer p { margin: 0 0 0.625rem; max-width: 44rem; }
.footer-lead { color: var(--ink-soft); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}


/* ---------- the composite on the product page ---------- */

.puan-lg { font-size: 3.25rem; }

.p-puanlabel {
  font-size: 0.8125rem;
  line-height: 1.4;
  color: var(--ink-faint);
}

/* The two halves, side by side, each naming its source. Which half is Santé
 * publique France's and which is ours is the whole justification for showing
 * a number of our own, so it is stated here and not only on /yontem. */
.p-halves {
  display: flex;
  gap: 1.5rem;
  margin: 1rem 0 0;
  padding: 0.875rem 0 0;
  border-top: 1px solid var(--rule);
}

.rating-breakdown {
  flex-wrap: wrap;
}

.p-half dt {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
}

.p-half dd {
  margin: 0.25rem 0 0;
  font-family: var(--mono);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.p-half-src {
  display: block;
  margin-top: 0.125rem;
  font-size: 0.625rem;
  text-transform: none;
  letter-spacing: 0.02em;
  opacity: 0.75;
}

.p-official {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.875rem;
}

/* ---------- the içerik penalty breakdown ---------- */

.penalties { margin: 0; }

.penalties > div {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--rule);
}

.penalties dt { margin: 0; }

.penalties dd {
  margin: 0;
  font-family: var(--mono);
  font-weight: 700;
  white-space: nowrap;
}

.penalties-sum { border-bottom: none; font-weight: 700; }
.penalties-sum dt { font-weight: 700; }

.p-nopenalty {
  margin: 0;
  font-weight: 600;
}

/* The label the score was read from. Shown verbatim: the penalties above are
 * only checkable against it. */
.ingredients {
  margin: 0;
  padding: 0.875rem 1rem;
  background: var(--paper-alt, rgba(0, 0, 0, 0.03));
  border-radius: 4px;
  font-size: 0.875rem;
  line-height: 1.65;
}

.data-quality-callout {
  margin: 0 0 1rem;
  padding: 0.875rem 1rem;
  border: 1px solid rgba(176, 106, 0, 0.38);
  border-radius: 4px;
  background: rgba(176, 106, 0, 0.07);
  color: var(--ink);
  font-size: 0.875rem;
  line-height: 1.5;
}

.data-quality-callout p { margin: 0; }
.data-quality-callout ul { margin: 0.4rem 0; padding-left: 1.25rem; }
.data-quality-head { font-weight: 700; color: var(--ns-d, #9a5b00); }

.dedupe-label {
  display: inline-block;
  margin: 0.5rem 0 0;
  padding: 0.18rem 0.55rem;
  border: 1px solid var(--rule-hard);
  border-radius: 999px;
  color: var(--ink-faint);
  font-size: 0.75rem;
}

.dedupe-label[data-status="possible_duplicate"] {
  border-color: rgba(176, 106, 0, 0.38);
  color: var(--ns-d, #9a5b00);
}


/* ---------- the published rules on /yontem ---------- */

.halves-doc { margin: 0 0 1.25rem; }

.halves-doc > div { margin-bottom: 1rem; }

.halves-doc dt {
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.halves-doc dd { margin: 0; }

.halves-doc .p-half-src,
.halves-doc .ours { display: inline; margin-left: 0.375rem; }

/* The penalty table is the score's contract with the reader: every rule that
 * moves the number is printed here. */
.penalty-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 1.25rem;
  font-size: 0.9375rem;
}

.penalty-table th,
.penalty-table td {
  text-align: left;
  padding: 0.5rem 0.75rem 0.5rem 0;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
}

.penalty-table th {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
}

.penalty-table td:nth-child(2) {
  font-family: var(--mono);
  font-weight: 700;
  white-space: nowrap;
}


/* ---------- EU regulatory divergence ----------
 * A fact about another jurisdiction's law, not our risk judgement. Styled
 * distinctly from the risk chips so the two are never read as the same claim.
 */

.eu-flag {
  margin: 0.375rem 0 0;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.eu-flag-banned { color: var(--ns-e, #c0392b); }
.eu-flag-warning { color: var(--ns-d, #b06a00); }

.eu-callout {
  margin: 1rem 0 0;
  padding: 0.875rem 1rem;
  border-left: 3px solid currentColor;
  border-radius: 0 4px 4px 0;
}

.eu-callout-banned { color: var(--ns-e, #c0392b); background: rgba(192, 57, 43, 0.07); }
.eu-callout-warning { color: var(--ns-d, #b06a00); background: rgba(176, 106, 0, 0.07); }

.eu-callout-head { margin: 0; font-size: 0.9375rem; font-weight: 700; }

.eu-callout-body {
  margin: 0.375rem 0 0;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--ink, inherit);
  opacity: 0.85;
}

.eu-tag {
  display: inline-block;
  padding: 0.125rem 0.375rem;
  border-radius: 3px;
  font-size: 0.6875rem;
  font-weight: 700;
  white-space: nowrap;
}

.eu-tag[data-eu="banned"] { background: rgba(192, 57, 43, 0.14); color: var(--ns-e, #c0392b); }
.eu-tag[data-eu="warning"] { background: rgba(176, 106, 0, 0.14); color: var(--ns-d, #b06a00); }

.eu-src {
  display: block;
  margin-top: 0.1875rem;
  font-size: 0.625rem;
  line-height: 1.35;
  opacity: 0.8;
}


/* ---------- category alternatives ----------
 * The product page names the peer group in its ranking line and used to stop
 * there. This block is that group, made visible: the top of the category,
 * best first, each entry carrying the same puan + letter pair the grid cards
 * carry so a position never appears here without the letter beside it.
 */

.alts {
  padding: 2rem 0;
  border-bottom: 1px solid var(--rule);
}

.alts h2 {
  margin: 0 0 0.375rem;
  font-size: 1.125rem;
  letter-spacing: -0.02em;
}

.alts-note {
  margin: 0 0 1rem;
  max-width: 40rem;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--ink-soft);
}

/* The honesty lines — a rolled-up pool, or a heterogeneous group where
 * "alternative" is a weak claim. Set apart from the note so they read as a
 * qualification of the heading rather than as more of the same sentence. */
.alts-caveat {
  margin: 0 0 1rem;
  max-width: 40rem;
  padding-left: 0.75rem;
  border-left: 2px solid var(--rule-hard);
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--ink-faint);
}

.alt-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr));
  gap: var(--step);
  margin: 0;
  padding: 0;
  list-style: none;
}

.alt-item {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 0.75rem;
  border: 1px solid var(--rule);
  border-radius: 4px;
  color: inherit;
  text-decoration: none;
}

.alt-item:hover { background: var(--paper-sunk); }

.alt-shot {
  display: block;
  aspect-ratio: 1;
  margin-bottom: 0.5rem;
  background: var(--paper-sunk);
  border-radius: 3px;
  overflow: hidden;
}

.alt-shot img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  mix-blend-mode: multiply;
}

@media (prefers-color-scheme: dark) {
  .alt-shot img { mix-blend-mode: normal; }
}

.alt-brand {
  font-size: 0.6875rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.alt-name {
  flex: 1;
  margin: 0.125rem 0 0.5rem;
  font-size: 0.8125rem;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

/* The composite and the official letter sit on one line, in that order,
 * matching the card. The letter is what keeps the number honest. */
.alt-verdict {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.alt-verdict .puan { font-size: 1.375rem; }

.alt-pos {
  margin-top: 0.25rem;
  font-size: 0.6875rem;
  color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
}

/* .eu-flag is a <p> on a card and a <span> here, so it needs the block. */
.alt-item .eu-flag {
  display: block;
  font-size: 0.6875rem;
  line-height: 1.3;
}

.alts-more {
  margin: 1rem 0 0;
  font-size: 0.8125rem;
}

/* Narrow screens: a swipeable strip rather than a two-column grid that would
 * push the score breakdown a full screen further down. */
@media (max-width: 44rem) {
  .alt-list {
    display: flex;
    gap: 0.625rem;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.25rem;
  }

  .alt-list > li {
    flex: 0 0 9rem;
    scroll-snap-align: start;
  }
}


/* ---------- the formula block (/yontem) ----------
 * MathML, rendered natively by the browser. No library and no script: the
 * site has never shipped a byte of JavaScript and this does not change that.
 *
 * Only spacing and colour are set here. Fraction bars, the summation sign and
 * the italic variables are the browser's own maths layout, which is the whole
 * reason for using MathML over a stack of styled <span>s.
 */

.formula {
  padding: 1.75rem 0 2rem;
  border-top: 1px solid var(--rule);
}

.formula-head {
  margin: 0 0 1.25rem;
  font-size: 1.1875rem;
  letter-spacing: -0.025em;
}

.formula-row + .formula-row { margin-top: 1.5rem; }

.formula-row math {
  display: block;
  /* Large enough that a fraction's numerator and denominator stay readable;
   * the browser scales the nested parts down from here. */
  font-size: 1.375rem;
  padding: 0.875rem 1rem;
  background: var(--paper-sunk);
  border-radius: 4px;
}

/* The wrapper scrolls, not the <math>: overflow does not apply to MathML
 * layout, so a formula wider than the viewport would otherwise widen the
 * page. Verified at 320px, where the besin formula lays out at 355px. */
.formula-row .scroll-x { border-radius: 4px; }

/* Function names read as words, not as a product of variables. */
.formula-row math mo { color: var(--ink); }

.formula-note {
  margin: 0.625rem 0 0;
  font-size: 0.875rem;
  line-height: 1.55;
  color: var(--ink-soft);
}

.formula-worked {
  margin: 1.75rem 0 0;
  padding: 0.875rem 1rem;
  border-left: 2px solid var(--rule-hard);
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--ink-soft);
}

@media (max-width: 44rem) {
  .formula-row math { font-size: 1.125rem; }
}

/* The "low" risk tier. Formerly "none", which scored zero; it now costs
   points under the katkı cezası, so it is no longer styled as an absence. It
   stays visually quieter than the three graded tiers because the label it
   carries — "Bilinen risk yok" — is still a statement that no hazard is
   claimed. */
.risk[data-risk="low"] { border-color: #8a8a8a; }

/* The clean-label bonus: the only additive line that adds rather than
   subtracts, so it reads in the same green as the clean chip rather than in
   the penalty table's colour. */
.p-bonus {
  margin: 0.6rem 0 0;
  font-size: 0.95rem;
  color: #2f7d46;
}
@media (prefers-color-scheme: dark) {
  .p-bonus { color: #7fc192; }
}
