/* HitMeals. The nutrition label is the system: three rule weights (10px, 5px, 1px),
   condensed black numbers, and colour only for the three macros. */

@font-face {
  font-family: "Archivo";
  src: url("fonts/archivo.woff2?v=2f7ea45b") format("woff2"); /* ?v = first 8 of the file's md5; tests/check.php keeps it current */
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
}

:root {
  --ink: #000;
  --paper: #fff;
  --gray: #6b6b6b;
  --hair: #cfcfcf;
  --tint: #f2f2f2;
  --protein: #d92b1c;
  --carbs: #e9a400;
  --fat: #4e7d2a;
  --rule-xl: 10px;
  --rule-l: 5px;
  --wrap: 74rem;
  --gutter: clamp(1rem, 4vw, 2.5rem);
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #fff;
    --paper: #000;
    --gray: #a6a6a6;
    --hair: #3d3d3d;
    --tint: #1c1c1c;
    --protein: #ff6b5e;
    --carbs: #f4bd2f;
    --fat: #93c35a;
  }
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Archivo", "Helvetica Neue", Arial, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.55;
}

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: .18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--protein); outline-offset: 2px; }

h1, h2, h3 { font-stretch: 72%; font-weight: 850; line-height: .95; margin: 0 0 .5em; }
h1 { font-size: clamp(2.6rem, 1.4rem + 4.5vw, 4.75rem); line-height: .9; }
h2 { font-size: clamp(1.75rem, 1.3rem + 1.6vw, 2.4rem); }
h3 { font-size: 1.3rem; font-stretch: 85%; font-weight: 750; line-height: 1.15; }
p { margin: 0 0 1em; }

.lede { font-size: 1.2rem; line-height: 1.45; max-width: 36rem; }

.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }

.skip { position: absolute; left: -999px; top: .5rem; background: var(--paper); padding: .5rem 1rem; z-index: 10; }
.skip:focus { left: .5rem; }

/* Header and footer */

.site-header { border-bottom: 1px solid var(--ink); }
.site-header .wrap {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between;
  gap: .25rem 1.5rem; padding-block: .8rem;
}
.logo { font-size: 2.1rem; font-stretch: 62%; font-weight: 900; line-height: 1; text-decoration: none; }
/* Each label stays on one line ("Plan a day"); on narrow screens the items wrap between labels. */
.site-header nav { display: flex; flex-wrap: wrap; gap: 0 1.25rem; }
.site-header nav a { font-weight: 650; text-decoration: none; padding-block: .2rem; border-bottom: 3px solid transparent; white-space: nowrap; }
.site-header nav a:hover { border-bottom-color: var(--hair); }
.site-header nav a[aria-current] { border-bottom-color: var(--ink); }

.site-footer { border-top: var(--rule-xl) solid var(--ink); margin-top: 4.5rem; }
.site-footer .wrap {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 2rem;
  padding-block: 1.1rem 2.5rem; font-size: .9rem; color: var(--gray);
}
.site-footer p { margin: 0; }
.site-footer a { color: var(--ink); }
.analytics-switch { margin: 0; color: var(--gray); }
.analytics-switch .link-button { min-height: 0; margin-right: .5rem; color: var(--ink); }

/* The analytics question: a bar across the bottom until the visitor chooses. Pages get room for it below. */
.consent {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1rem;
  padding: .9rem var(--gutter); background: var(--paper); border-top: var(--rule-l) solid var(--ink);
}
.consent p { flex: 1 1 22rem; margin: 0; font-size: .95rem; }
/* Accept and Decline look the same and share the width equally: refusing must be as easy as accepting. */
.consent button { flex: 1 1 0; max-width: 10rem; min-height: 44px; padding: 0 1.1rem; font-size: 1.05rem; }
body.asking { padding-bottom: 12rem; }

/* The label: forms, cards and nutrition panels are all built from it */

.label { border: 2px solid var(--ink); padding: .35rem .8rem .8rem; background: var(--paper); }
.label h2 {
  font-size: 2.6rem; font-stretch: 62%; font-weight: 900; line-height: 1;
  margin: 0; padding-bottom: .2rem; border-bottom: 1px solid var(--ink);
}
.label-sub { margin: 0; padding: .3rem 0 .4rem; font-size: .95rem; border-bottom: var(--rule-xl) solid var(--ink); }
.label-note { font-size: .8125rem; color: var(--gray); margin: .6rem 0 0; }
.label-note a { color: var(--ink); }
.label button { width: 100%; margin-top: 1rem; }

.line {
  display: flex; justify-content: space-between; align-items: baseline; gap: 1rem;
  margin: 0; padding: .2rem 0; border-bottom: 1px solid var(--ink);
}
.line span { font-weight: 700; }
.line b { font-weight: 850; font-stretch: 72%; font-variant-numeric: tabular-nums; }
.line.big { border-bottom: var(--rule-l) solid var(--ink); }
.line.big span { font-size: 1.2rem; font-weight: 900; font-stretch: 72%; }
.line.big b { font-size: 2.1rem; line-height: 1; }

.bar { display: flex; gap: 2px; height: .55rem; margin: .6rem 0 .55rem; }
.bar i { display: block; min-width: 2px; }
.bar .p, .legend .p { background: var(--protein); }
.bar .c, .legend .c { background: var(--carbs); }
.bar .f, .legend .f { background: var(--fat); }

.legend { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem 1rem; margin: 0 0 1rem; font-size: .9rem; color: var(--gray); }
.legend span { display: inline-flex; align-items: center; gap: .35rem; color: var(--ink); }
.legend i { display: inline-block; width: .75rem; height: .75rem; }

/* Form fields as label rows */

.field { display: flex; align-items: baseline; gap: .5rem; margin: 0; padding: .45rem 0; border: 0; border-top: 1px solid var(--ink); }
.field > span:first-child { font-weight: 800; font-stretch: 85%; margin-right: auto; }
.field.big { border-top: 0; padding-top: .35rem; border-bottom: var(--rule-l) solid var(--ink); }
.field.big + .field { border-top: 0; }
.field.big > span:first-child { font-size: 1.9rem; font-stretch: 62%; font-weight: 900; }
.unit { font-weight: 700; min-width: 2.4em; }

input[type="number"] {
  width: 5.5ch; padding: .05rem .3rem; border: 0; border-bottom: 2px solid var(--ink); border-radius: 0;
  background: var(--tint); color: inherit; text-align: right;
  font: inherit; font-size: 1.6rem; font-weight: 850; font-stretch: 72%;
  appearance: textfield; -moz-appearance: textfield;
}
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.field.big input { font-size: 2.6rem; width: 5ch; }
.field.text { flex-wrap: wrap; }
.field.text input {
  flex: 1 1 10rem; min-width: 0; padding: .3rem .4rem; border: 0; border-bottom: 2px solid var(--ink); border-radius: 0;
  background: var(--tint); color: inherit; font: inherit; font-weight: 600;
}
.leave-out .check { padding-bottom: .3rem; }
.limits label { display: inline-flex; align-items: center; gap: .35rem; margin: 0 1.25rem .3rem 0; font-weight: 600; white-space: nowrap; }
.limits input { width: 5ch; font-size: 1.15rem; }

select {
  font: inherit; font-weight: 700; color: inherit; background: var(--tint);
  border: 0; border-bottom: 2px solid var(--ink); border-radius: 0; padding: .2rem .3rem; max-width: 60%;
}

fieldset.field { display: flow-root; min-width: 0; }
fieldset.field legend { float: left; width: 100%; padding: 0 0 .35rem; font-weight: 800; font-stretch: 85%; }
.check { display: flex; align-items: center; gap: .5rem; padding: .45rem 0; border-top: 1px solid var(--ink); font-weight: 600; }
fieldset .check { display: inline-flex; padding: 0 1.25rem 0 0; border: 0; }
input[type="checkbox"], input[type="radio"] { width: 1.1rem; height: 1.1rem; margin: 0; accent-color: var(--ink); }

button, .button {
  display: inline-block; padding: .8rem 1.2rem; border: 0; border-radius: 0; cursor: pointer;
  background: var(--ink); color: var(--paper); text-decoration: none; text-align: center;
  font: inherit; font-size: 1.25rem; font-weight: 800; font-stretch: 80%; line-height: 1.1;
}
button:hover, .button:hover { background: var(--protein); color: var(--paper); }

/* Home */

.hero { display: grid; gap: 2.5rem; align-items: start; padding-block: clamp(2rem, 6vw, 4.5rem) clamp(2.5rem, 6vw, 4.5rem); }
.hero h1 { font-size: clamp(3.2rem, 1.4rem + 7vw, 7rem); line-height: .86; margin-bottom: 1.5rem; }
.hero .lede { font-size: 1.3rem; }
.examples { color: var(--gray); max-width: 36rem; }
.examples a { color: var(--ink); font-weight: 600; }

.band { background: var(--ink); color: var(--paper); }
.band-inner { display: grid; gap: 1.25rem 3rem; align-items: center; padding-block: 2rem 2.25rem; }
.band h2 { margin-bottom: .3rem; }
.band p { margin: 0; max-width: 36rem; }
.inline-form { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1.25rem; }
.inline-form label { display: flex; align-items: baseline; gap: .4rem; font-weight: 700; }
.band input[type="number"] { background: transparent; border-bottom-color: var(--paper); }
.band button { background: var(--paper); color: var(--ink); }
.band button:hover { background: var(--protein); color: var(--paper); }

.section { padding-top: clamp(2.75rem, 6vw, 4.5rem); }
.section-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .25rem 1.5rem; }
.section-head a { font-weight: 700; }

.toc { list-style: none; margin: 0; padding: 0; border-top: var(--rule-xl) solid var(--ink); }
.toc li { display: flex; justify-content: space-between; align-items: baseline; padding: .5rem 0; border-bottom: 1px solid var(--ink); }
.toc a { font-size: 1.35rem; font-weight: 800; font-stretch: 80%; text-decoration: none; }
.toc a:hover { text-decoration: underline; }
.toc span { font-size: 1.35rem; font-weight: 850; font-stretch: 72%; font-variant-numeric: tabular-nums; }

/* Recipe cards */

.grid { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 15.5rem), 1fr)); }
.card { position: relative; display: flex; flex-direction: column; padding: .5rem .75rem .7rem; border: 2px solid var(--ink); }
.card:hover { background: var(--tint); }
.card h3 { flex: 1; margin: 0 0 .1rem; padding-bottom: .5rem; border-bottom: var(--rule-xl) solid var(--ink); font-size: 1.3rem; }
.card h3 a { text-decoration: none; }
.card h3 a::after { content: ""; position: absolute; inset: -2px; }
.card h3 a:focus-visible { outline: none; }
.card h3 a:focus-visible::after { outline: 3px solid var(--protein); outline-offset: 2px; }
.card .meta { margin: 0; font-size: .875rem; color: var(--gray); }

/* Lists. Tappable controls are at least 44 CSS px tall, the comfortable touch size. */

.crumbs { margin-bottom: .9rem; font-size: .95rem; font-weight: 700; }
.crumbs a { text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.crumbs span { margin-inline: .3rem; color: var(--gray); }

.page-head { padding-block: clamp(2rem, 5vw, 3.5rem) 1.25rem; }
.page-head h1 { max-width: 16ch; }

.search { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .75rem; margin-bottom: 1.25rem; }
.search label { font-weight: 800; font-stretch: 85%; }
.search input {
  flex: 1 1 14rem; min-width: 0; padding: .55rem .6rem; border: 2px solid var(--ink); border-radius: 0;
  background: var(--paper); color: inherit; font: inherit; font-size: 1.05rem;
}
.search button { padding: .6rem 1.1rem; font-size: 1.1rem; }
.search-limit { display: inline-flex; align-items: center; gap: .4rem; font-weight: 700; white-space: nowrap; }
.search-limit input { width: 5.5ch; font-size: 1.15rem; }
.no-results { padding: 1rem 0; font-size: 1.1rem; }

.chips { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.75rem; }
.chips a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 .75rem; border: 2px solid var(--ink); font-size: .95rem; font-weight: 700; text-decoration: none; }
.chips a:hover { background: var(--tint); }
.chips a[aria-current] { background: var(--ink); color: var(--paper); }

.list-tools {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: .25rem 1.5rem;
  padding-top: .45rem; margin-bottom: .75rem; border-top: var(--rule-xl) solid var(--ink);
}
.count { margin: 0; font-size: 1.0625rem; font-stretch: 100%; font-weight: 800; line-height: 1.55; }
.sort { display: flex; flex-wrap: wrap; align-items: center; gap: 0 .4rem; margin: 0; color: var(--gray); }
.sort a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 .35rem; color: var(--ink); font-weight: 600; text-decoration: none; }
.sort a:hover, .sort a[aria-current] { text-decoration: underline; text-decoration-thickness: 3px; }

/* Recipe page */

.recipe-head { max-width: 54rem; padding-block: clamp(2rem, 5vw, 3.5rem) 2rem; }
.facts { display: flex; flex-wrap: wrap; gap: 1rem 2.75rem; margin: 1.5rem 0 0; padding: 0; list-style: none; color: var(--gray); font-size: .95rem; }
.facts b { display: block; color: var(--ink); font-size: 1.5rem; font-weight: 850; font-stretch: 72%; line-height: 1.15; }

/* Jump links: on a phone the nutrition label comes first, so ingredients and method are a tap away. */
.jump { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.25rem; }
.jump a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 1rem; border: 2px solid var(--ink); font-weight: 700; text-decoration: none; }
.jump a:hover { background: var(--tint); }
#ingredients, #method, #nutrition, .week [id^="day-"] { scroll-margin-top: 1rem; }
.save { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; margin-top: 1.5rem; color: var(--gray); font-size: .95rem; }
.save button, .share button { padding: .55rem 1rem; border: 2px solid var(--ink); background: var(--paper); color: var(--ink); font-size: 1.1rem; }
.save button span { color: var(--protein); }
.save button.on { background: var(--ink); color: var(--paper); }
.save button:hover { background: var(--tint); color: var(--ink); }
.save a { color: var(--ink); }
.share { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; margin: 2rem 0 0; color: var(--gray); }
.share[hidden] { display: none; }
.share button:hover { background: var(--tint); }
.saved-item { display: flex; flex-direction: column; gap: .35rem; }
.saved-item .card { flex: 1; }
.link-button { align-self: flex-start; min-height: 44px; padding: 0 .25rem 0 0; background: none; color: var(--ink); font-size: .95rem; font-weight: 700; text-decoration: underline; }
.link-button:hover { background: none; color: var(--protein); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.recipe-photo { display: block; width: 100%; height: auto; max-height: 32rem; object-fit: cover; margin-bottom: 2.5rem; border: 2px solid var(--ink); }
/* minmax(0, 1fr): one column that may shrink below its content, so a phone never scrolls sideways. */
.recipe-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2.5rem; }
.recipe-main { max-width: 40rem; }
.recipe-main h2 { margin: 2.75rem 0 .75rem; padding-top: .45rem; border-top: var(--rule-xl) solid var(--ink); }
.recipe-main section:first-child h2 { margin-top: 0; }

.ingredients-head {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: .5rem 1rem;
  margin-bottom: .75rem; padding-top: .45rem; border-top: var(--rule-xl) solid var(--ink);
}
.recipe-main .ingredients-head h2 { margin: 0; padding: 0; border: 0; }
.units { display: flex; flex-wrap: wrap; align-items: center; row-gap: .4rem; margin: 0; font-size: .9rem; color: var(--gray); }
.units span { margin-right: .6rem; }
.units a { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; padding: 0 .75rem; border: 2px solid var(--ink); color: var(--ink); font-weight: 700; text-decoration: none; }
.units a + a { border-left: 0; }
.scaled { margin: 0 0 .75rem; padding: .5rem .75rem; border-left: var(--rule-l) solid var(--ink); background: var(--tint); font-size: .95rem; }
.units a:hover { background: var(--tint); }
.units a[aria-current] { background: var(--ink); color: var(--paper); }

.ingredients { list-style: none; margin: 0; padding: 0; }
.ingredients li { padding: .45rem 0; border-bottom: 1px solid var(--hair); }

.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.steps li { display: grid; grid-template-columns: 2.25rem 1fr; gap: .75rem; padding: .75rem 0; border-bottom: 1px solid var(--hair); counter-increment: step; }
.steps li::before { content: counter(step); font-size: 2rem; font-weight: 900; font-stretch: 62%; line-height: 1; }

.swaps span { display: block; font-size: .95rem; color: var(--gray); font-variant-numeric: tabular-nums; }
.storage { display: grid; grid-template-columns: max-content minmax(0, 1fr); margin: 0; }
.storage dt, .storage dd { margin: 0; padding: .45rem 0; border-bottom: 1px solid var(--hair); }
.storage dt { padding-right: 1rem; font-weight: 800; }
.storage p { margin: 0; }

.notes h3 { margin: 1.75rem 0 .4rem; }
.notes ul, .prose ul { padding-left: 1.2rem; }
.notes li, .prose li { margin-bottom: .45rem; }

.nutrition h2 { font-size: 3.2rem; }
.nutrition .line span { font-weight: 400; }
.nutrition .line span b { font-weight: 800; font-stretch: 85%; }
.nutrition .kcal { border-bottom: var(--rule-l) solid var(--ink); }
.nutrition .kcal span { font-size: 2rem; font-weight: 900; font-stretch: 62%; }
.nutrition .kcal b { font-size: 3.4rem; line-height: 1; }
.nutrition .head span { font-size: .8rem; font-weight: 700; }
.nutrition .sub span { padding-left: 1.25rem; }

.portions { width: 100%; margin-top: .4rem; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.portions caption {
  caption-side: top; text-align: left; padding: .35rem 0 .1rem; border-top: var(--rule-xl) solid var(--ink);
  font-size: 1.35rem; font-weight: 900; font-stretch: 72%;
}
.portions th, .portions td { padding: .3rem 0; text-align: right; border-bottom: 1px solid var(--ink); }
.portions th:first-child { text-align: left; font-weight: 400; }
.portions thead th { font-size: .8rem; font-weight: 700; }
.portions .one th, .portions .one td { font-weight: 800; }

/* Finder and planner */

.tool { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2.25rem; align-items: start; } /* the column may shrink on phones */
.tool-out { min-width: 0; }
.tool-out > .count { margin-bottom: .6rem; }
.targets .line.big b { font-size: 2.1rem; line-height: 1; }
.working { margin: .9rem 0 0; padding-left: 1.2rem; font-size: .95rem; }
.working li { margin-bottom: .35rem; }
.tool-out .prose { margin-top: 2rem; }
.tool-out .prose h2:first-child { margin-top: 0; }
/* Finder and planner results are linked as #matches and #day: leave a little room above them. */
#matches, #day, #targets { scroll-margin-top: 1rem; }

.results { list-style: none; margin: 0; padding: 0; border-top: var(--rule-xl) solid var(--ink); }
.result { padding: .9rem 0 1.1rem; border-bottom: 1px solid var(--ink); }
.result h3 { font-size: 1.6rem; margin: .1rem 0 .35rem; }
.result h3 a { text-decoration: none; }
.result h3 a:hover { text-decoration: underline; }
.portion { margin: 0 0 .6rem; }

.score { display: flex; align-items: center; gap: .45rem; margin: 0; font-weight: 700; }
.score b { font-size: 2.25rem; font-weight: 900; font-stretch: 62%; line-height: 1; font-variant-numeric: tabular-nums; }
.hit { padding: .15rem .45rem; background: var(--ink); color: var(--paper); font-size: .85rem; font-weight: 800; }

.meter { display: grid; grid-template-columns: 4.5rem minmax(3rem, 1fr) 10.5rem; align-items: center; gap: .2rem .75rem; margin: .3rem 0; font-size: .9rem; }
.meter span:first-child { font-weight: 700; }
.meter span:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.track { height: .5rem; background: var(--tint); }
.track i { display: block; height: 100%; background: var(--ink); }
.meter.over .track i { background: repeating-linear-gradient(-45deg, var(--ink) 0 3px, transparent 3px 6px); }
.meter.over span:last-child { font-weight: 800; }

.warn { margin: 1rem 0 0; padding: .6rem .8rem; border-left: var(--rule-xl) solid var(--ink); background: var(--tint); }

.empty { padding-top: .6rem; border-top: var(--rule-xl) solid var(--ink); }
.empty h2 { font-size: 1.9rem; }

.day-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: .5rem 1rem; padding-bottom: .35rem; border-bottom: var(--rule-xl) solid var(--ink); }
.day .day-head h2 { padding: 0; border: 0; }
.day-meals { list-style: none; margin: 0; padding: 0; }
.day-meals li {
  display: grid; grid-template-columns: 6rem minmax(0, 1fr) auto auto; align-items: baseline; gap: .2rem 1.25rem;
  padding: .65rem 0; border-bottom: 1px solid var(--ink);
}
.slot { font-weight: 800; font-stretch: 85%; }
.what a { font-weight: 700; }
.serv { display: block; color: var(--gray); font-size: .9rem; }
.swap { display: inline-flex; align-items: center; min-height: 44px; margin-left: .2rem; padding: 0 .6rem; color: var(--ink); font-weight: 700; }
.n { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.day-total { margin-top: -1px; padding-top: .6rem; border-top: var(--rule-l) solid var(--ink); }
.week { display: grid; gap: 1.5rem; }
.day-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1.25rem; margin-top: 1.25rem; color: var(--gray); }
.day-actions span { max-width: 30rem; font-size: .95rem; }

/* About */

.prose { max-width: 42rem; }
.prose h2 { margin: 2.5rem 0 .75rem; padding-top: .45rem; border-top: var(--rule-xl) solid var(--ink); font-size: 2rem; }
.prose h2:first-child { margin-top: .5rem; }


/* Wider screens */

@media (min-width: 52rem) {
  .hero { grid-template-columns: minmax(0, 1fr) minmax(19rem, 24rem); gap: 4rem; }
  .band-inner { grid-template-columns: minmax(0, 1fr) auto; }
  .toc { display: grid; grid-template-columns: 1fr 1fr; column-gap: 3rem; }
}

@media (min-width: 58rem) {
  .tool { grid-template-columns: 20rem minmax(0, 1fr); gap: 3.5rem; }
  /* Sticky panels never outgrow the window: a long form (the planner's limits and leave-outs) scrolls inside
     itself, so its button is always reachable without scrolling through the results first. */
  .refine { position: sticky; top: 1rem; max-height: calc(100vh - 2rem); overflow-y: auto; }
  .recipe-body { grid-template-columns: minmax(0, 1fr) 21rem; gap: 4rem; align-items: start; }
  .nutrition { grid-column: 2; grid-row: 1; position: sticky; top: 1rem; max-height: calc(100vh - 2rem); overflow-y: auto; }
  .week { grid-template-columns: 1fr 1fr; gap: 2rem 2.5rem; }
  .recipe-main { grid-column: 1; grid-row: 1; }
}

/* Narrow screens */

@media (max-width: 40rem) {
  .site-header nav { column-gap: .8rem; }
  /* One swipeable row of collections instead of a wall of wrapped chips. */
  .chips { flex-wrap: nowrap; overflow-x: auto; margin-inline: calc(-1 * var(--gutter)); padding-inline: var(--gutter); scrollbar-width: none; }
  .chips a { flex: none; }
  .meter { grid-template-columns: 1fr auto; }
  .meter .track { grid-column: 1 / -1; grid-row: 2; }
  .day-meals li { grid-template-columns: 1fr auto; }
  .day-meals .slot, .day-meals .what { grid-column: 1 / -1; }
  .day-meals .n { text-align: left; }
}

@media print {
  .site-header nav, .site-footer, .skip, .section, .portions, .label-note, .units, .crumbs, .more, .save, .share, .swap, .jump, .consent, .analytics-switch { display: none; }
  .nutrition { position: static; }
  body { font-size: 11pt; }
}
