/* generoitu: scripts/chainpages.mjs (ketju- ja tuotesivut) */
  * { box-sizing: border-box; }
  html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font-ui); font-size: var(--fs-md); line-height: var(--lh-md); -webkit-font-smoothing: antialiased; }
  a { color: var(--accent-text); text-decoration: none; } a:hover { text-decoration: underline; }
  button, select { font: inherit; color: inherit; }
  .caps { font-size: var(--fs-xs); line-height: var(--lh-xs); letter-spacing: var(--tracking-caps); text-transform: uppercase; color: var(--ink-3); font-weight: 600; }
  .page { max-width: 1040px; margin: 0 auto; padding: var(--sp-4) var(--sp-4) 0; }
  .hd { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4); }
  .mark { display: inline-flex; align-items: center; gap: .4em; color: var(--ink); font-family: var(--font-display); font-weight: 700; letter-spacing: -0.03em; line-height: 1; font-size: 22px; }
  .mark:hover { text-decoration: none; } .mark img { width: 1.8em; height: 1.8em; object-fit: contain; display: block; }
  .hd a.back { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-sm); color: var(--ink-2); } .hd a.back:hover { color: var(--accent-text); text-decoration: none; }
  .ico { display: block; }
  .crumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: var(--sp-6); font-size: var(--fs-sm); line-height: var(--lh-sm); color: var(--ink-3); }
  .crumbs a { color: var(--ink-2); text-decoration: none; } .crumbs a:hover { color: var(--ink); text-decoration: underline; } .crumbs [aria-current] { color: var(--ink); }
  h1, h2 { font-family: var(--font-display); font-weight: 600; letter-spacing: var(--tracking-tight); margin: 0; text-wrap: pretty; overflow-wrap: break-word; }
  @media (max-width: 480px) { h1, h2 { hyphens: auto; -webkit-hyphens: auto; } } /* tavutus vain kapealla, jottei työpöydällä tule "kalo-rit" */
  h1 { font-size: var(--fs-2xl); line-height: var(--lh-2xl); }
  h2 { font-size: var(--fs-xl); line-height: var(--lh-xl); }
  section { margin-top: var(--sp-8); display: flex; flex-direction: column; gap: var(--sp-3); }
  .hero { margin-top: var(--sp-4); display: flex; flex-direction: column; gap: var(--sp-3); align-items: flex-start; }
  .hero-t { display: flex; flex-direction: column; gap: var(--sp-3); min-width: 0; }
  .brand { width: 72px; height: 56px; flex: none; background: #fff; border: 1.5px solid var(--line); border-radius: var(--r-lg); display: flex; align-items: center; justify-content: center; padding: 8px; }
  .brand img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
  .brand.tacobell { background: #702082; } .brand.txt { width: auto; min-width: 72px; padding: 0 14px; font-weight: 600; font-size: var(--fs-sm); color: #1a1a1a; white-space: nowrap; }
  .lead { margin: 0; max-width: 680px; color: var(--ink-2); }
  .pills { display: flex; flex-wrap: wrap; gap: 8px; }
  .pills span { display: inline-flex; align-items: center; height: var(--chip-h); padding: 0 12px; border-radius: var(--r-full); background: var(--surface-2); font-size: var(--fs-sm); font-weight: 500; }
  .card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
  .tabs { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
  .chip { display: inline-flex; align-items: center; height: 36px; padding: 0 12px; border-radius: var(--r-full); border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-size: var(--fs-sm); font-weight: 500; white-space: nowrap; cursor: pointer; }
  .chip:hover { border-color: var(--line-strong); text-decoration: none; }
  .chip.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
  .picks { display: grid; gap: var(--sp-4); }
  .pick { padding: var(--sp-5); display: flex; flex-direction: column; gap: var(--sp-3); }
  .pick:not(.on) { display: none; }
  .pick ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
  .pick li { display: flex; justify-content: space-between; gap: 12px; align-items: center; } .pick li img.th { width: 36px; height: 36px; }
  .pick li span { font-weight: 500; min-width: 0; overflow-wrap: break-word; hyphens: auto; -webkit-hyphens: auto; }
  .pick li b, td.num.hi { font-family: var(--font-display); font-size: var(--fs-lg); font-weight: 600; color: var(--accent-text); white-space: nowrap; font-variant-numeric: tabular-nums; }
  .pick li b.plain { color: var(--ink); }
  .pick small, .note { font-size: var(--fs-sm); line-height: var(--lh-sm); color: var(--ink-3); }
  .note { margin: 0; }
  .bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: var(--sp-3); }
  .bar label { display: flex; align-items: center; gap: 8px; font-size: var(--fs-sm); color: var(--ink-2); }
  .bar select, .cat-sel select { height: var(--control-h); padding: 0 10px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); color: var(--ink); font-size: var(--fs-md); max-width: 100%; }
  .cats { display: none; flex-wrap: wrap; gap: 8px; }
  .cat-sel { display: flex; } .cat-sel select { width: 100%; }
  .tbl { overflow: hidden; }
  table { width: 100%; border-collapse: collapse; }
  th, td { padding: 12px; text-align: left; vertical-align: top; }
  tbody tr { border-top: 1px solid var(--line); }
  th { font-size: var(--fs-xs); line-height: var(--lh-xs); letter-spacing: var(--tracking-caps); text-transform: uppercase; color: var(--ink-3); font-weight: 600; background: var(--surface-2); }
  th.num, td.num { text-align: right; } td.num { white-space: nowrap; color: var(--ink-2); font-variant-numeric: tabular-nums; }
  td.rank { color: var(--ink-3); width: 28px; font-variant-numeric: tabular-nums; }
  /* linkki tuotesivulle: aksenttiväri ja pieni nuoli, jotta sen erottaa tekstistä (myös tummassa tilassa, currentColor) */
  a.pl, .pl { color: var(--accent-text); font-weight: 500; } a.pl:hover { text-decoration: underline; }
  /* nuoli kiinni viimeisessä sanassa (plName), ettei se rivity yksinään */
  .pl .plw { white-space: nowrap; }
  .pl .plw::after { content: ""; display: inline-block; width: .4em; height: .4em; margin: 0 .15em 0 .3em; border-top: 1.5px solid currentColor; border-right: 1.5px solid currentColor; transform: rotate(45deg); vertical-align: .1em; }
  /* ketjun/merkin pieni logo valkoisessa laatikossa (kuten top-listan logosirut) */
  img.lg { flex: none; object-fit: contain; background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 2px; vertical-align: middle; } img.lg.tacobell { background: #702082; }
  .lgn { display: inline-flex; align-items: center; gap: 6px; }
  /* ketjun/merkin nimi linkkinä ketjusivulle: sama väri kuin tuotelinkit, ilman nuolta */
  a.cn { color: var(--accent-text); font-weight: 500; padding-block: 4px; } a.cn:hover { text-decoration: underline; }
  /* puuttuva arvo: "–" + ?-painike (24 px kosketusalue), selitys vihjeenä hiirellä, fokuksella tai napautuksella */
  .mi { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; margin: -4px -2px -4px 2px; padding: 0; border: 0; background: none; color: var(--ink-3); cursor: help; vertical-align: middle; font: 600 12px/1 var(--font-ui); letter-spacing: 0; text-transform: none; }
  .mi-c { display: flex; align-items: center; justify-content: center; width: 17px; height: 17px; border: 1.5px solid currentColor; border-radius: 50%; }
  .mi:hover, .mi:focus-visible, .mi.open { color: var(--ink); }
  .mi-tip { display: none; position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(calc(-50% + var(--dx, 0px))); z-index: 20; width: max-content; max-width: min(240px, calc(100vw - 16px));
    padding: 8px 10px; border-radius: 8px; background: var(--ink); color: var(--bg); font: 400 13px/18px var(--font-ui); text-align: left; white-space: normal; box-shadow: var(--shadow); }
  .mi:hover .mi-tip, .mi:focus-visible .mi-tip, .mi.open .mi-tip { display: block; }
  .row { display: flex; align-items: center; gap: 10px; min-width: 0; } .row > span, .row > div { min-width: 0; }
  img.th { width: 40px; height: 40px; flex: none; border-radius: 8px; object-fit: contain; background: #fff; border: 1px solid var(--line); }
  img.th.ph { opacity: .7; }
  td.item .n { font-weight: 500; overflow-wrap: anywhere; hyphens: auto; -webkit-hyphens: auto; }
  td.item .s, td.item .m { font-size: var(--fs-sm); line-height: var(--lh-sm); color: var(--ink-2); }
  td.item .s { color: var(--ink-3); }
  .hide-m { display: none; }
  tr.cut, tr.out { display: none; }
  .more { height: var(--control-h); padding: 0 20px; border-radius: var(--r-full); border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); font-size: var(--fs-md); font-weight: 500; cursor: pointer; align-self: stretch; }
  .more[hidden] { display: none; }
  .near { padding: var(--sp-5); display: flex; flex-direction: column; gap: var(--sp-3); }
  .near .pin { display: none; }
  .near p { margin: 0; color: var(--ink-2); }
  .near-t { display: flex; flex-direction: column; gap: 4px; flex: 1; }
  a.ext .ico { display: inline-block; vertical-align: -2px; margin-left: 3px; } /* ulkoinen linkki: pieni nuoli-ikoni tekstin perään */
  .btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: var(--control-h); padding: 0 20px; border-radius: var(--r-full); background: var(--accent-text); color: var(--bg); font-weight: 600; white-space: nowrap; }
  .btn:hover { text-decoration: none; opacity: .92; }
  .faq > div { padding: var(--sp-4); display: flex; flex-direction: column; gap: 6px; }
  .faq > div + div { border-top: 1px solid var(--line); }
  .faq h3 { margin: 0; font-size: var(--fs-md); line-height: var(--lh-md); font-weight: 600; }
  .faq p { margin: 0; color: var(--ink-2); }
  .others { display: flex; flex-wrap: wrap; gap: 8px; }
  .others .chip { height: var(--control-h); padding: 0 14px; gap: 8px; } .others .chip img.lg { border-radius: 5px; }
  .page > .site-foot { margin-top: var(--sp-10); }
  /* kosketusalueet vähintään 24 px (mobiilin QA): tekstin sisäiset linkit saavat näkymättömän pystypehmusteen, murupolku ja
     yläpalkin linkki korkeammat laatikot; pienin fonttikoko 12 px */
  a.pl, a.ext { padding-block: 4px; }
  .crumbs a, .crumbs span { display: inline-flex; align-items: center; min-height: 24px; }
  .hd a.back { min-height: 44px; }
  .caps, th, .tile small { font-size: 12px; }
  @media (min-width: 760px) {
    .page { padding: var(--sp-4) var(--sp-8) 0; }
    h1 { font-size: var(--fs-3xl); line-height: var(--lh-3xl); }
    .lead { font-size: var(--fs-lg); line-height: var(--lh-lg); }
    section { margin-top: 48px; gap: var(--sp-4); }
    .hero { flex-direction: row; gap: var(--sp-8); margin-top: var(--sp-5); }
    .brand { width: 96px; height: 72px; padding: 10px; } .brand.txt { min-width: 96px; }
    .tabs { display: none; }
    .picks { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .pick:not(.on) { display: flex; }
    .cats { display: flex; } .cat-sel { display: none; }
    .bar select { height: var(--control-h-desktop); font-size: var(--fs-sm); }
    th, td { padding: 12px 16px; vertical-align: middle; }
    td.rank { width: 48px; }
    .hide-m { display: table-cell; } td.item .m { display: none; }
    .more { align-self: center; }
    .near { flex-direction: row; align-items: center; gap: var(--sp-6); padding: var(--sp-6); }
    .near .pin { display: flex; width: 56px; height: 56px; flex: none; border-radius: var(--r-full); background: var(--accent-soft); color: var(--accent-text); align-items: center; justify-content: center; }
    .faq > div { padding: var(--sp-5) var(--sp-6); }
    .faq h3 { font-size: var(--fs-lg); line-height: var(--lh-lg); }
    .others .chip { height: 36px; }
  }

  [data-sivu="tuotesivu"] .crumbs { margin-top: var(--sp-4); }
  .phero { margin-top: var(--sp-4); display: flex; flex-direction: column; gap: var(--sp-4); }
  .pimg { position: relative; width: 100%; height: 200px; flex: none; background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); display: flex; align-items: center; justify-content: center; }
  .pimg img.p { width: 160px; height: 160px; object-fit: contain; } .pimg img.p.ph { width: 96px; height: 96px; opacity: .7; }
  .pimg .cl { position: absolute; top: 12px; left: 12px; width: 32px; height: 32px; object-fit: contain; }
  .phero-t { display: flex; flex-direction: column; gap: var(--sp-4); min-width: 0; flex: 1; }
  .phero-t .ht { display: flex; flex-direction: column; gap: 10px; }
  /* rivi otsikon yläpuolella: logo, ketju, erotin, kategoria samalla keskilinjalla */
  .kicker { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: var(--fs-sm); line-height: var(--lh-sm); font-weight: 600; color: var(--ink-2); }
  .kicker .sep { color: var(--ink-3); font-weight: 400; }
  .tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  /* laatan arvo mitoitetaan laatan leveyden mukaan (container query) ja yksikkö rivittyy luvun alle, jos tila ei riitä (esim. "1 098 kcal") */
  /* laatat jakavat rivit (subgrid): otsikot samalla rivillä ylhäällä, arvot yhteisellä rivillä, vaikka jokin otsikko rivittyy kahdelle riville */
  .tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 12px 14px; display: grid; grid-row: span 3; grid-template-rows: subgrid; row-gap: 4px; align-content: start; min-width: 0; }
  .tile > .caps { align-self: start; } .tile > b { align-self: start; }
  /* arvon koko laatan leveyden mukaan: kontti on <b> (laatta itse ei voi olla kontti, koska subgrid ei toimi kontin kanssa) */
  .tile b { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: .25em; container-type: inline-size; font-family: var(--font-display); font-size: 24px; line-height: 1.15; font-weight: 600; font-variant-numeric: tabular-nums; }
  .tile b em { font-style: normal; font-size: clamp(20px, 26cqi, 24px); }
  .tile.dark b { container-type: normal; } .tile.dark b em { font-size: 24px; } /* mobiilissa tumma laatta on rivi: arvo sisällön levyinen */
  .tile b span { font-size: var(--fs-md); font-weight: 500; color: var(--ink-2); }
  .tile small { font-size: var(--fs-xs); line-height: var(--lh-xs); color: var(--ink-3); }
  .tile.pr b { color: var(--accent-text); } .tile.pr b span { color: inherit; }
  .tile.dark { grid-column: 1 / -1; grid-row: auto; display: flex; background: var(--ink); border-color: var(--ink); color: var(--bg); flex-direction: row; justify-content: space-between; align-items: center; }
  .tile.dark .caps, .tile.dark b span { color: inherit; opacity: .8; } .tile.dark .caps { opacity: .75; }
  .two { margin-top: var(--sp-8); display: grid; gap: var(--sp-4); }
  .two > section { margin: 0; padding: var(--sp-5); gap: var(--sp-4); }
  .bars { display: flex; flex-direction: column; gap: 14px; }
  .bars > div { display: flex; flex-direction: column; gap: 6px; }
  .bars .h { display: flex; justify-content: space-between; } .bars .h span:first-child { font-weight: 500; } .bars .pct { color: var(--ink-2); font-variant-numeric: tabular-nums; }
  .bars .t { height: 8px; border-radius: var(--r-full); background: var(--surface-2); overflow: hidden; } .bars .t i { display: block; height: 8px; border-radius: var(--r-full); background: var(--ink); }
  .bars .pr .pct { color: var(--accent-text); font-weight: 600; } .bars .pr .t i { background: var(--accent); }
  .cmp table { font-size: var(--fs-md); } .cmp th, .cmp td { padding: 10px 0 10px 8px; background: none; } .cmp th:first-child { padding-left: 0; }
  .cmp tbody th { text-transform: none; letter-spacing: 0; font-size: var(--fs-md); line-height: var(--lh-md); color: var(--ink); font-weight: 500; }
  .cmp thead th { padding-top: 0; } .cmp td { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; } .cmp td.avg, .cmp td.diff { color: var(--ink-2); } .cmp td.up { color: var(--accent-text); font-weight: 600; }
  /* vertailu: poikkeamapalkki keskiviivasta (vasemmalle vähemmän, oikealle enemmän); luvut tekstinä, palkki koriste */
  .dv { display: flex; flex-direction: column; gap: 14px; }
  .dv-h { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; } .dv-h span:first-child { font-weight: 500; } .dv-h span:last-child { color: var(--ink-2); font-variant-numeric: tabular-nums; }
  .dv-h b { font-weight: 600; color: var(--ink); } .dv-h b.good { color: var(--accent-text); }
  .dv-t { position: relative; height: 8px; margin-top: 6px; border-radius: var(--r-full); background: var(--surface-2); }
  .dv-t::before { content: ""; position: absolute; left: calc(50% - 1px); top: -4px; bottom: -4px; width: 2px; border-radius: 1px; background: var(--line-strong); }
  .dv-t i { position: absolute; top: 0; height: 8px; background: var(--ink-3); }
  .dv-t i.pos { left: 50%; border-radius: 0 var(--r-full) var(--r-full) 0; } .dv-t i.neg { right: 50%; border-radius: var(--r-full) 0 0 var(--r-full); }
  .dv-t i.good { background: var(--accent); }
  .alt .sz, .pick .sz { display: block; font-size: var(--fs-sm); line-height: var(--lh-sm); font-weight: 400; color: var(--ink-3); }
  .alts { display: grid; gap: var(--sp-3); }
  a.alt { padding: var(--sp-4) var(--sp-5); display: flex; align-items: flex-start; gap: 14px; color: var(--ink); }
  a.alt img.th { width: 56px; height: 56px; border-radius: 10px; } .alt-t { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
  a.alt:hover { text-decoration: none; border-color: var(--line-strong); }
  a.alt:hover .t { text-decoration: underline; } .alt .t { font-size: var(--fs-lg); line-height: var(--lh-lg); font-weight: 600; overflow-wrap: anywhere; } .alt .s { color: var(--ink-2); }
  .alt .r { font-family: var(--font-display); font-size: var(--fs-lg); font-weight: 600; color: var(--accent-text); }
  .vers td.item .n { font-weight: 500; } .vers tr.main td.item .n::after { content: ' · arvot yllä'; font-weight: 400; color: var(--ink-3); font-size: var(--fs-sm); }
  .src { margin-top: var(--sp-8); padding: var(--sp-5); border: 1px solid var(--line); border-radius: var(--r-lg); flex-direction: column; align-items: flex-start; gap: var(--sp-3); }
  .src p { margin: 0; font-size: var(--fs-sm); line-height: var(--lh-sm); color: var(--ink-2); }
  .btnline { display: inline-flex; align-items: center; height: var(--control-h); padding: 0 20px; border-radius: var(--r-full); border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); font-weight: 500; white-space: nowrap; }
  .btnline:hover { text-decoration: none; border-color: var(--ink); }
  @media (min-width: 760px) {
    .phero { flex-direction: row; gap: 40px; align-items: flex-start; margin-top: var(--sp-5); }
    .pimg { width: 240px; height: 240px; } .pimg img.p { width: 176px; height: 176px; }
    .tiles { grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 12px; } /* 5 rinnakkain leveällä, kapeammalla useampi rivi */
    .tile { padding: 16px; } .tile b { font-size: 28px; } .tile b em { font-size: clamp(22px, 30cqi, 28px); }
    .tile.dark { grid-column: auto; grid-row: span 3; display: grid; } .tile.dark b { container-type: inline-size; } .tile.dark b em { font-size: clamp(22px, 30cqi, 28px); }
    .two { margin-top: 48px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .two > section { padding: var(--sp-6); }
    .alts { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-4); }
    a.alt { padding: var(--sp-5); }
    .src { flex-direction: row; justify-content: space-between; align-items: center; padding: var(--sp-5) var(--sp-6); gap: var(--sp-6); }
  }
