/* The overview layouts of the one-page flow that fit one screen (a trial for admins,
   templates/components/overview_layouts.html). A, poster: the image over half the screen, the ingredients beside it.
   C, compact: a small plate at the top and the ingredients in columns under it. Both take the whole screen, without
   the site's top bar and footer; the round button at the top right shows the top bar again. */
html:not(.site-menu) body:has(.make.has-ovl) > header, body:has(.make.has-ovl) > footer { display: none !important; }
html.site-menu body:has(.make.has-ovl) > header { position: fixed; left: 0; right: 0; top: 0; }
.rv2.make.has-ovl { max-width: none; margin: 0; padding: 0; }
html.cooking .ovl { display: none; }
/* The admin chip at the top, beside the back button, clear of the title and Start cooking */
html:not(.cooking) body:has(.make.has-ovl) .trialbar { top: calc(12px + env(safe-area-inset-top, 0px)); bottom: auto; left: 64px; }

.ovl { height: 100vh; height: 100dvh; }
.ovl .fab { position: fixed; z-index: 130; top: calc(12px + env(safe-area-inset-top, 0px)); }
.ovl-back { left: max(12px, env(safe-area-inset-left, 0px)); }
.ovl-menu { right: max(12px, env(safe-area-inset-right, 0px)); }
/* With the top bar shown, everything moves down under it */
html.site-menu .ovl { margin-top: 64px; height: calc(100vh - 64px); height: calc(100dvh - 64px); }
html.site-menu .ovl .fab { top: 76px; }
html.site-menu:not(.cooking) body:has(.make.has-ovl) .trialbar { top: 76px; }
.ovl-menu[aria-expanded="true"] { background: var(--color-ink); color: var(--color-paper); border-color: var(--color-ink); }

/* Shared parts */
.pp-times { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 8px 0 0; font: 400 14px var(--font-mono); }
.pp-times b { font-weight: 600; }
.ovl-serv { display: flex; align-items: center; gap: var(--space-3); }
.ovl-serv .stepper button { height: 36px; }
.ovl-serv .stepper input { height: 32px; width: 52px; }
.ovl-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.ovl-chips .chip { min-height: 36px; padding: 0 14px; border: 1px solid var(--color-line); border-radius: var(--radius-pill); background: var(--color-soft);
  color: var(--color-ink); font: 500 14px var(--font-sans); cursor: pointer; }
.ovl-chips .chip:hover { background: var(--color-paper); }
.ovl .ovl-go { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; white-space: nowrap; }
.rv2 .ovl-ings { min-height: 0; margin-top: 0; overflow: auto; overscroll-behavior: contain; }  /* not the margin of .rv2 section */
.ovl-ings .sec-head { margin-bottom: var(--space-2); }
.ovl-cols { columns: 230px; column-gap: var(--space-8); }
.ovl-cols .shop-group { break-after: avoid; margin-top: var(--space-3); }
.ovl-cols .shop-group:first-child { margin-top: 0; }
.ovl-cols .ilist li { break-inside: avoid; }
.chip:focus-visible, .cc-btn:focus-visible, .cc-more:focus-visible, .ovl-go:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }

/* A, the poster: the image to the left at full height, with the title on it */
.ovl-poster { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(380px, 1fr); }
.pp-img { position: relative; margin: 0; overflow: hidden; background: var(--color-soft); }
.pp-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.pp-img figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 96px var(--space-8) var(--space-6); color: #fff;
  background: linear-gradient(to bottom, transparent, rgb(0 0 0 / .68)); }
.pp-img h1 { margin: 0; color: inherit; font-size: clamp(28px, 3.4vw, 54px); line-height: 1.05; text-wrap: balance; }
.pp-img.no-img figcaption { color: var(--color-ink); background: none; }
.pp-side { display: flex; flex-direction: column; gap: var(--space-4); min-height: 0; padding: 12px var(--space-8) var(--space-6); }
/* The servings and the chips on a line with the menu button, so the ingredients get the height under it */
.pp-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2) var(--space-3);
  min-height: 40px; padding-right: 52px; }
.pp-top .ovl-chips { gap: 6px; }
.pp-top .chip { min-height: 34px; padding: 0 12px; font-size: 13px; }
.ovl-poster .ovl-ings { flex: 1; }
.pp-go .ovl-go { width: 100%; min-height: 56px; font-size: 18px; }
/* Standing up, or narrow: the image at the top */
@media (orientation: portrait), (max-width: 760px) {
  /* The ingredients take what they need, up to two thirds; the image gets the rest */
  .ovl-poster { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(32vh, 1fr) auto; grid-template-rows: minmax(32dvh, 1fr) auto; }
  .pp-side { max-height: 68vh; max-height: 68dvh; padding: var(--space-4) var(--space-6) var(--space-4); }
  .pp-top { padding-right: 0; }  /* the menu button is on the image */
  .pp-img figcaption { padding: 64px var(--space-6) var(--space-4); }
}
@media (max-width: 600px) {
  .pp-side { padding: var(--space-3) var(--space-4) calc(var(--space-3) + env(safe-area-inset-bottom, 0px)); gap: var(--space-3); }
  .pp-img figcaption { padding: 48px var(--space-4) var(--space-3); }
  .pp-times { font-size: 13px; }
}

/* C, compact: a plate at the top with the image and the title, the ingredients under it and what helps to plan
   beside them. The image follows the ingredients' size (static/js/overview_fit.js): large with a short list,
   small with a long one */
.ovl-compact { --img-h: 32vh; display: flex; flex-direction: column; gap: var(--space-4); max-width: 1440px; margin: 0 auto;
  padding: 60px var(--space-8) var(--space-4); }
.ovl-compact:has(.ovl-ings[data-density="large"]) { --img-h: 40vh; }
.ovl-compact:has(.ovl-ings[data-density="normal"]) { --img-h: 26vh; }
.ovl-compact:has(.ovl-ings[data-density="tight"]) { --img-h: 20vh; }
.cc-plate { flex: none; display: flex; align-items: center; gap: var(--space-8); }
.cc-img { flex: none; margin: 0; height: var(--img-h); min-height: 120px; aspect-ratio: 4 / 3; overflow: hidden; border-radius: var(--radius);
  max-width: 55%; background: var(--color-soft); display: grid; place-items: center; color: var(--color-muted); }
.cc-img img { display: block; width: 100%; height: 100%; object-fit: cover; }
.cc-img > .icon { width: 40%; height: 40%; opacity: .35; }
.cc-head { min-width: 0; display: flex; flex-direction: column; gap: var(--space-3); }
.cc-head h1 { margin: 0; font-size: clamp(26px, 3vw, 46px); line-height: 1.08; text-wrap: balance; }
.cc-head .pp-times { margin: 0; color: var(--color-muted); }
.cc-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: var(--space-1); }
.cc-actions .ovl-go { min-height: 48px; }
.cc-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 48px; padding: 0 18px; border: 1px solid var(--color-line); border-radius: var(--radius-pill);
  background: var(--color-paper); color: var(--color-ink); font: 600 15px var(--font-sans); cursor: pointer; }
.cc-btn:hover { background: var(--color-soft); }
.cc-btn .icon { width: 18px; height: 18px; }
.cc-body { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 300px; grid-template-rows: minmax(0, 1fr); gap: var(--space-8);
  border-top: 1px solid var(--color-line); padding-top: var(--space-3); }

/* At a glance: the time, the equipment, the parts and the chef's note */
.cc-glance { min-height: 0; overflow: auto; overscroll-behavior: contain; display: flex; flex-direction: column; gap: var(--space-6);
  padding-left: var(--space-6); border-left: 1px solid var(--color-line); }
.rv2 .cc-glance section { margin-top: 0; }
.cc-glance h2.eyebrow { margin: 0 0 var(--space-2); }
.cc-parts { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: var(--space-2); }
.cc-parts figure { margin: 0; text-align: center; font-size: 12px; }
.cc-parts img { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; border-radius: var(--radius-sm); background: var(--color-soft); }
.cc-note { margin: 0; font-size: 15px; line-height: 1.45; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden; }
.cc-more { margin-top: 4px; padding: 0; border: 0; background: none; color: var(--color-muted); font-size: 13px; text-decoration: underline; cursor: pointer; }
.cc-glance .parts span + span::before { content: " · "; }

/* The time as a strip, each part as long as it takes */
.tstrip { display: grid; gap: 6px; }
.ts-bar, .ts-keys { display: flex; gap: 3px; }
.ts-bar span { height: 10px; min-width: 6px; flex-basis: 0; border-radius: 5px; background: var(--color-prep); }
.ts-bar .ts-cook { background: var(--color-cook); }
.ts-bar .ts-serve { background: var(--color-serve); }
.ts-keys span { flex-basis: 0; min-width: 64px; font: 400 12px/1.3 var(--font-mono); color: var(--color-muted); }
.ts-keys b { display: block; font: 600 12px var(--font-sans); color: var(--color-ink); }

/* The equipment */
.eq-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: var(--space-3) var(--space-2); }
.eq-grid li { display: grid; justify-items: center; gap: 4px; text-align: center; font-size: 12px; line-height: 1.2; }
.eq-grid .sym { --s: 40px; }

/* Standing up, and on a phone: the image over the full width, the title under it */
@media (orientation: portrait), (max-width: 600px) {
  .cc-plate { flex-direction: column; align-items: stretch; gap: var(--space-3); }
  .cc-img { width: 100%; max-width: none; height: var(--img-h); min-height: 0; aspect-ratio: auto; }
}
/* Standing up: what helps to plan in a row under the plate */
@media (orientation: portrait) and (min-width: 601px) {
  .cc-body { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); gap: var(--space-4); }
  .cc-glance { order: -1; overflow: visible; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--space-4) var(--space-8);
    padding: 0 0 var(--space-3); border-left: 0; border-bottom: 1px solid var(--color-line); }
}
/* A phone: the image over the full width, the rest under More */
@media (max-width: 600px) {
  .ovl-compact { --img-h: 26vh; padding: 60px var(--space-4) calc(var(--space-3) + env(safe-area-inset-bottom, 0px)); gap: var(--space-3); }
  .ovl-compact:has(.ovl-ings[data-density="large"]) { --img-h: 30vh; }
  .ovl-compact:has(.ovl-ings[data-density="normal"]) { --img-h: 22vh; }
  .ovl-compact:has(.ovl-ings[data-density="tight"]) { --img-h: 18vh; }
  .cc-head { gap: var(--space-2); }
  .cc-actions .ovl-go { flex: 1 1 100%; }  /* a row of its own, Bowls and More share the next */
  .cc-btn { flex: 1; justify-content: center; padding: 0 14px; }
  .cc-body { grid-template-columns: minmax(0, 1fr); }
  .cc-glance { display: none; }
}

/* The rest: a drawer from the right, over the whole height */
.ovl-more .eq-grid { grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); }
.ovl-more { border: 0; margin: 0 0 0 auto; padding: var(--space-3) var(--space-6) var(--space-6); width: min(460px, 100vw); max-width: 100vw;
  height: 100%; max-height: 100%; overflow: auto; background: var(--color-paper); color: var(--color-ink); box-shadow: -12px 0 40px rgb(0 0 0 / .18); }
.ovl-more[open] { animation: drawer-in .2s ease-out; }
@keyframes drawer-in { from { transform: translateX(32px); opacity: .5; } }
@media (prefers-reduced-motion: reduce) { .ovl-more[open] { animation: none; } }
.ovl-more::backdrop { background: rgb(0 0 0 / .3); }
.ovl-more .sheet-h { position: sticky; top: calc(-1 * var(--space-3)); z-index: 1; background: var(--color-paper); padding-block: var(--space-2); }
.ovl-more section { margin-top: var(--space-6); scroll-margin-top: 64px; }
.ovl-more h3.eyebrow { margin: 0 0 var(--space-2); }
.ovl-more .note { margin: 0; }
.ovl-more .more-panel { position: static; width: auto; border: 0; border-radius: 0; padding: 0; box-shadow: none; }
.ovl-more .source { margin-top: var(--space-6); }

/* The ingredients as large as fits (static/js/overview_fit.js picks the first step that needs no scrolling, and
   the last when none does): large and roomy for a short list, normal, and tight for a long one */
.ovl-ings[data-density="large"] .ilist li { gap: var(--space-4); padding: 6px 0; font-size: 20px; }
.ovl-ings[data-density="large"] .sym { --s: 68px !important; }
.ovl-ings[data-density="large"] .ilist .amt { font-size: 18px; }
.ovl-ings[data-density="large"] .ilist small { font-size: 14px; }
.ovl-ings[data-density="large"] .shop-group { margin-top: var(--space-6); font-size: 13px; }
.ovl-ings[data-density="large"] .ovl-cols { columns: 250px; }
.ovl-ings[data-density="roomy"] .ilist li { gap: var(--space-3); padding: 4px 0; font-size: 18px; }
.ovl-ings[data-density="roomy"] .sym { --s: 52px !important; }
.ovl-ings[data-density="roomy"] .ilist .amt { font-size: 16px; }
.ovl-ings[data-density="roomy"] .ilist small { font-size: 13px; }
.ovl-ings[data-density="roomy"] .shop-group { margin-top: 20px; font-size: 13px; }
.ovl-ings[data-density="roomy"] .ovl-cols { columns: 240px; }
.ovl-ings[data-density="tight"] .ilist li { gap: 6px; padding: 0; font-size: 14px; line-height: 1.25; }
.ovl-ings[data-density="tight"] .sym { --s: 28px !important; }
.ovl-ings[data-density="tight"] .ilist .amt { font-size: 13px; }
.ovl-ings[data-density="tight"] .ilist small { font-size: 11px; }
.ovl-ings[data-density="tight"] .shop-group { margin-top: var(--space-2); }
.ovl-ings[data-density="tight"] .sec-head { margin-bottom: 4px; }
.ovl-ings[data-density="tight"] .ovl-cols { columns: 200px; column-gap: var(--space-6); }
.ovl-poster:has(.ovl-ings[data-density="tight"]) .pp-side { gap: var(--space-3); }
.ovl-poster:has(.ovl-ings[data-density="tight"]) .pp-go .ovl-go { min-height: 48px; font-size: 16px; }
