/* iwant2eat — the new look ("evening kitchen": dark, led by the photo).
 * The owner's choice of 2026-11-18, shipped beside the old look, which stays
 * the default. The avatar menu's "New look" switch sets <body data-ui="new">
 * (js/theme.js, cookie `iwe-ui`); every rule here sits under that attribute,
 * so with the switch off this file changes nothing.
 *
 * Three things to keep in mind when editing:
 *
 * 1. It restyles the SAME markup. Nothing a page can do moved or went away:
 *    the scripts' hooks (.ing-num, [data-recipe-id], .tag-chip[data-tag-id],
 *    a#add-recipe-btn, .cook-start-btn…) are the old ones. What the new look
 *    adds to the markup carries .ui2-only, and the first rule below hides it
 *    under the old look.
 * 2. app.css and redesign.css are layered with !important, so an override here
 *    often needs one too. That is why they are everywhere.
 * 3. Screen only. Printing, and the PDF export (iwe-print.js clones the recipe
 *    outside <main>), keep the old paper styles: recipe rules are scoped to
 *    #main for that.
 *
 * The palette rides on midnight's rules (the body says data-theme="midnight"
 * while the new look is on) and replaces its tokens. Red is the danger mark's
 * alone, so the accent is amber.
 */
body:not([data-ui="new"]) .ui2-only { display: none !important; }

@media screen {

body[data-ui="new"] {
  --bg:          #181613;
  --surface:     #25221c;
  --surface-2:   #2f2b24;
  --text:        #f3ecdf;
  --text-2:      #b9b1a1;
  --muted:       #9c9484;
  --border:      #443f36;
  --primary:     #f0a93a;
  --primary-2:   #e39a2a;
  --primary-ink: #1d1305;
  --accent:      #f0a93a;
  --accent-2:    #f6c56b;
  --success:     #7bc47f;
  --danger:      #ff6b61;
  --chip-bg:     #2f2b24;
  --chip-text:   #e9dfcb;
  --chip-border: #4a453b;
  --shadow-sm:   0 1px 2px rgba(0,0,0,.45);
  --shadow-md:   0 14px 34px rgba(0,0,0,.55);
  --font-display: 'Prata', Georgia, 'Times New Roman', serif;
  --display-weight: 400;
  --display-tracking: 0;
  --radius: 14px;
  /* Height of the phone's bottom tab bar; 0 where there is none. */
  --ui2-tab-h: 0px;
  /* The glass every floating control is made of. */
  --ui2-glass: rgba(28, 25, 21, .66);
  /* What floats over the page itself follows the tone (below); --ui2-glass,
     which sits on photos, is dark in both. */
  --ui2-bar: rgba(28, 25, 21, .66);
  --ui2-bar-edge: rgba(255, 255, 255, .13);
  --ui2-lift: 0 18px 28px -20px rgba(0, 0, 0, .9);
  --ui2-book-lift: 20px 24px 30px -16px rgba(0, 0, 0, .8);
  background: var(--bg);
  color: var(--text);
}

/* The light tone of the new look (owner, 2026-11-18): the same layout on a
   warm paper ground, picked with Dark / Light under the New look switch
   (cookie `iwe-ui-tone`; the body then says data-theme="market", the light
   base). Amber cannot carry text on white, so here the accent is the deep
   green of the brand. What sits on a photo (titles, round controls, scrims)
   and cook mode are dark in both tones. */
body[data-ui="new"][data-ui-tone="light"] {
  --bg:          #f6f2e9;
  --surface:     #ffffff;
  --surface-2:   #efe8d9;
  --text:        #1f2420;
  --text-2:      #525a50;
  --muted:       #697066;
  --border:      #e2dbca;
  --primary:     #0b6b43;
  --primary-2:   #095a38;
  --primary-ink: #ffffff;
  --accent:      #b8730a;
  --accent-2:    #d59324;
  --success:     #0b6b43;
  --danger:      #c43a2a;
  --chip-bg:     #efe8d9;
  --chip-text:   #4b4034;
  --chip-border: #ddd3bd;
  --shadow-sm:   0 1px 2px rgba(60, 45, 20, .1);
  --shadow-md:   0 14px 30px rgba(60, 45, 20, .18);
  --ui2-bar: rgba(255, 255, 255, .8);
  --ui2-bar-edge: rgba(40, 30, 10, .14);
  --ui2-lift: 0 16px 24px -18px rgba(60, 45, 20, .55);
  --ui2-book-lift: 18px 22px 26px -16px rgba(60, 45, 20, .5);
}

/* ---------- top bar ---------- */
body[data-ui="new"] header.topbar {
  background: color-mix(in srgb, var(--bg) 84%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

/* ---------- phone: the tabs become a bar at the bottom, Add in its middle ----------
   The tabs stay where they are in the markup (inside header.topbar > nav, so the
   offline click handlers and the paid lock still find them); each is pinned to
   its fifth of the bottom edge, over a strip the header paints. */
@media (max-width: 640px) {
  body[data-ui="new"] {
    --ui2-tab-h: calc(58px + env(safe-area-inset-bottom, 0px));
    padding-bottom: var(--ui2-tab-h);
  }
  /* A filter on the header would make it the containing block of the pinned tabs. */
  body[data-ui="new"] header.topbar {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    background: var(--bg);
  }
  body[data-ui="new"] header.topbar::after {
    content: "";
    position: fixed; left: 0; right: 0; bottom: 0;
    height: var(--ui2-tab-h);
    background: color-mix(in srgb, var(--bg) 92%, transparent);
    border-top: 1px solid var(--border);
    z-index: 70;
  }
  body[data-ui="new"] header.topbar nav > a.nav-tab {
    position: fixed !important;
    bottom: 0; z-index: 71;
    width: 20% !important; min-width: 0 !important; max-width: none !important;
    height: var(--ui2-tab-h);
    margin: 0 !important;
    padding: 6px 2px calc(6px + env(safe-area-inset-bottom, 0px)) !important;
    display: flex !important; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    background: none !important; border: 0 !important; border-radius: 0 !important; box-shadow: none !important;
    color: var(--text-2) !important;
    font-size: 10.5px !important; font-weight: 500 !important; line-height: 1.1;
    transform: none !important;
  }
  body[data-ui="new"] header.topbar nav > a.nav-tab:nth-of-type(1) { inset-inline-start: 0; }
  body[data-ui="new"] header.topbar nav > a.nav-tab:nth-of-type(2) { inset-inline-start: 20%; }
  body[data-ui="new"] header.topbar nav > a.nav-tab:nth-of-type(3) { inset-inline-start: 40%; }
  body[data-ui="new"] header.topbar nav > a.nav-tab:nth-of-type(4) { inset-inline-start: 60%; }
  body[data-ui="new"] header.topbar nav > a.nav-tab:nth-of-type(5) { inset-inline-start: 80%; }
  body[data-ui="new"] header.topbar nav > a.nav-tab .nav-ic { width: 22px !important; height: 22px !important; }
  body[data-ui="new"] header.topbar nav > a.nav-tab .nav-label {
    max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  body[data-ui="new"] header.topbar nav > a.nav-tab.active { color: var(--primary) !important; }
  body[data-ui="new"] header.topbar nav > a.nav-tab.nav-add .nav-ic {
    width: 46px !important; height: 46px !important; padding: 12px;
    border-radius: 50%; background: var(--primary); color: var(--primary-ink);
    box-shadow: 0 6px 16px -6px color-mix(in srgb, var(--primary) 70%, transparent);
  }
  /* With the tabs gone from it, the top row has room for the logo again. */
  body[data-ui="new"] header.topbar a.brand.hide-on-phone { display: inline-flex !important; }
  /* What is pinned to the bottom of the screen sits above the bar. */
  body[data-ui="new"] .scroll-nav { bottom: calc(var(--ui2-tab-h) + 12px) !important; }
  body[data-ui="new"] .paid-lock-toast { bottom: calc(var(--ui2-tab-h) + 1rem) !important; }
  body[data-ui="new"] .tag-pick-hint { bottom: calc(var(--ui2-tab-h) + 1rem) !important; }
  body[data-ui="new"] .install-prompt { bottom: var(--ui2-tab-h) !important; }
  /* The news card stands on the tab bar, not under it. */
  body[data-ui="new"] .news-card { bottom: calc(var(--ui2-tab-h) + 0.6rem) !important; }
  body[data-ui="new"]:has(.install-prompt) .news-card { bottom: calc(var(--ui2-tab-h) + 4.6rem) !important; }
}
/* On a wider screen Add is the banner on the recipes page, as before. */
@media (min-width: 641px) {
  body[data-ui="new"] header.topbar nav > a.nav-add { display: none !important; }
}

/* ---------- recipes list: posters ---------- */
body[data-ui="new"] .card-grid {
  grid-template-columns: repeat(auto-fill, minmax(196px, 1fr)) !important;
  grid-auto-rows: auto !important;
  gap: 18px !important;
}
@media (max-width: 640px) {
  body[data-ui="new"] .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 12px !important; }
}
body[data-ui="new"] .card-grid > .card,
body[data-ui="new"] .card-grid > a.card {
  position: relative !important;
  aspect-ratio: 3 / 4;
  min-height: 0 !important;
  padding: 0 0 12px !important;
  display: flex !important; flex-direction: column !important; justify-content: flex-end; gap: 2px;
  background: #2c2822 !important;
  border: 0 !important;
  border-radius: 14px !important;
  overflow: hidden;
  isolation: isolate;
  box-shadow: var(--ui2-lift) !important;
  transition: transform .2s, box-shadow .2s;
}
@media (hover: hover) {
  body[data-ui="new"] .card-grid > .card:hover,
  body[data-ui="new"] .card-grid > a.card:hover {
    transform: translateY(-4px) !important;
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--primary) 60%, transparent), 0 24px 34px -18px rgba(0, 0, 0, .95) !important;
  }
}
/* The photo is the card. */
body[data-ui="new"] .card-grid > .card .card-thumb-wrap,
body[data-ui="new"] .card-grid > a.card .card-thumb-wrap {
  position: absolute !important; inset: 0 !important;
  width: 100% !important; height: 100% !important;
  aspect-ratio: auto !important;
  margin: 0 !important; padding: 0 !important;
  border: 0 !important; border-radius: 0 !important;
  background: none !important; box-shadow: none !important;
  z-index: 0;
}
body[data-ui="new"] .card-grid .card .card-thumb {
  position: absolute !important; inset: 0;
  width: 100% !important; height: 100% !important;
  object-fit: cover !important;
  border-radius: 0 !important;
}
body[data-ui="new"] .card-grid .card .card-thumb-bg { display: none !important; }
/* Text reads over any photo: a scrim under it, never the photo's own colours. */
body[data-ui="new"] .card-grid > .card::after,
body[data-ui="new"] .card-grid > a.card::after {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(to top, rgba(10, 8, 6, .96) 0%, rgba(10, 8, 6, .62) 30%, rgba(10, 8, 6, 0) 60%);
}
body[data-ui="new"] .card-grid .card > .title,
body[data-ui="new"] .card-grid .card > .subtitle,
body[data-ui="new"] .card-grid .card > .meta,
body[data-ui="new"] .card-grid .card > .card-tags,
body[data-ui="new"] .card-grid .card > .card-added,
body[data-ui="new"] .card-grid .card > .card-example,
body[data-ui="new"] .card-grid .card > .card-import-failed-note,
body[data-ui="new"] .card-grid .card > .card-variants {
  position: relative; z-index: 2;
  margin: 0 !important;
  padding: 0 12px !important;
  border: 0 !important;
}
body[data-ui="new"] .card-grid .card > .title {
  font: 400 1.12rem/1.16 var(--font-display) !important;
  letter-spacing: 0 !important;
  color: #fff !important;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  text-wrap: balance;
}
body[data-ui="new"] .card-grid .card > .subtitle {
  font-size: .78rem !important; font-style: normal !important; line-height: 1.25 !important;
  color: rgba(255, 255, 255, .82) !important;
  display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden;
}
body[data-ui="new"] .card-grid .card > .meta { color: rgba(255, 255, 255, .8) !important; font-size: .78rem; }
/* Tags and collections: one quiet line over the title. Each is still a press
   that filters or opens; taking one off is in the card's menu. */
body[data-ui="new"] .card-grid .card > .card-tags {
  order: -1;
  display: flex !important; flex-wrap: nowrap !important; gap: 0 !important;
  overflow: hidden; white-space: nowrap;
  margin-bottom: 2px !important;
}
body[data-ui="new"] .card-grid .card .card-tag-chip,
body[data-ui="new"] .card-grid .card .card-collection-chip {
  flex: none;
  background: none !important; border: 0 !important; border-radius: 0 !important; box-shadow: none !important;
  padding: 0 !important; margin: 0 !important;
  color: rgba(255, 255, 255, .84) !important;
  font-size: .62rem !important; font-weight: 600 !important; line-height: 1.5 !important;
  letter-spacing: .09em; text-transform: uppercase;
}
body[data-ui="new"] .card-grid .card .card-tags > * + *::before { content: "·"; margin: 0 .4em; }
body[data-ui="new"] .card-grid .card .card-tag-chip-icon,
body[data-ui="new"] .card-grid .card .card-collection-chip-icon,
body[data-ui="new"] .card-grid .card .card-tags .tag-chip-x { display: none !important; }
body[data-ui="new"] .card-grid .card > .card-added {
  margin-top: 4px !important;
  color: rgba(255, 255, 255, .78) !important;
  font-size: .75rem !important;
}
body[data-ui="new"] .card-grid .card .card-added:has(.ui2-card-meta) .card-times { display: none !important; }
body[data-ui="new"] .ui2-card-meta { display: inline-flex; align-items: center; gap: 4px; }
body[data-ui="new"] .ui2-card-meta span + svg { margin-left: 8px; }
/* The round controls on the photo. */
body[data-ui="new"] .card-grid .card .card-fav-btn,
body[data-ui="new"] .card-grid .card .card-share-btn,
body[data-ui="new"] .card-grid .card .ui2-card-more {
  position: absolute !important; z-index: 3;
  width: 32px !important; height: 32px !important; padding: 0 !important;
  display: inline-flex; align-items: center; justify-content: center;
  border: 0 !important; border-radius: 50% !important;
  background: var(--ui2-glass) !important;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  color: #fff !important;
  box-shadow: none !important;
  cursor: pointer;
}
body[data-ui="new"] .card-grid .card .card-fav-btn { top: 8px !important; right: 8px !important; left: auto !important; }
body[data-ui="new"] .card-grid .card .card-fav-btn.on { color: #ff7a8c !important; }
body[data-ui="new"] .card-grid .card .ui2-card-more { top: 46px; right: 8px; }
body[data-ui="new"] .card-grid .card .card-share-btn { top: 8px !important; left: 8px !important; right: auto !important; }
body[data-ui="new"] .card-grid .card .card-share-btn svg { width: 17px; height: 17px; }
body[data-ui="new"] .card-grid .card .card-share-btn.card-shared-btn { background: #1f9d57 !important; }
body[data-ui="new"] .card-grid .card .card-video-badge { top: 46px !important; left: 8px !important; right: auto !important; z-index: 3; }
/* No photo: a cover made of the recipe's own first letter, in one of six
   quiet colours by the card's place in the grid. */
body[data-ui="new"] .card-grid > .card:not(:has(.card-thumb-wrap)) {
  background: linear-gradient(145deg, hsl(var(--ui2-h, 28) 36% 32%), hsl(var(--ui2-h, 28) 44% 13%)) !important;
}
body[data-ui="new"] .card-grid > .card:not(:has(.card-thumb-wrap))::before {
  content: attr(data-l);
  position: absolute; right: -.03em; top: -.16em; z-index: 0;
  font: 400 9.5rem/1 var(--font-display);
  color: rgba(255, 255, 255, .15);
  pointer-events: none;
}
body[data-ui="new"] .card-grid > .card:nth-child(6n+1) { --ui2-h: 352; }
body[data-ui="new"] .card-grid > .card:nth-child(6n+2) { --ui2-h: 34; }
body[data-ui="new"] .card-grid > .card:nth-child(6n+3) { --ui2-h: 108; }
body[data-ui="new"] .card-grid > .card:nth-child(6n+4) { --ui2-h: 282; }
body[data-ui="new"] .card-grid > .card:nth-child(6n+5) { --ui2-h: 18; }
body[data-ui="new"] .card-grid > .card:nth-child(6n)   { --ui2-h: 190; }


/* ---------- top bar chips, desktop ---------- */
body[data-ui="new"] header.topbar nav > a.nav-tab {
  background: none !important;
  border: 1px solid transparent !important;
  box-shadow: none !important;
  color: var(--text-2) !important;
}
body[data-ui="new"] header.topbar nav > a.nav-tab:hover { color: var(--text) !important; background: color-mix(in srgb, var(--text) 8%, transparent) !important; }
body[data-ui="new"] header.topbar nav > a.nav-tab.active {
  background: color-mix(in srgb, var(--text) 10%, transparent) !important;
  color: var(--text) !important;
}
body[data-ui="new"] header.topbar .gplay-link,
body[data-ui="new"] header.topbar .appstore-link {
  background: none; border: 1px solid var(--border); color: var(--text-2);
}
@media (max-width: 640px) {
  body[data-ui="new"] header.topbar::after { display: block !important; }
  body[data-ui="new"] header.topbar nav > a.nav-tab,
  body[data-ui="new"] header.topbar nav > a.nav-tab.active,
  body[data-ui="new"] header.topbar nav > a.nav-tab:hover { background: none !important; border: 0 !important; }
  body[data-ui="new"] header.topbar nav > a.nav-tab .nav-ic,
  body[data-ui="new"] header.topbar nav > a.nav-tab .nav-ic-wrap {
    background: none !important; border: 0 !important; box-shadow: none !important; padding: 0 !important;
  }
  body[data-ui="new"] header.topbar nav > a.nav-tab.nav-add .nav-ic {
    padding: 12px !important; background: var(--primary) !important;
  }
}

/* ---------- recipes list: header, banners, toolbar ---------- */
body[data-ui="new"] .recipes-header { background: var(--bg) !important; }
/* Add: a quiet bar, not a billboard. Still the whole drop target it was. */
body[data-ui="new"] .add-drop-banner {
  flex-direction: row !important;
  padding: .7rem 1rem !important;
  background: color-mix(in srgb, var(--primary) 13%, var(--surface)) !important;
  border: 1px solid color-mix(in srgb, var(--primary) 45%, transparent) !important;
  border-radius: 999px !important;
  color: var(--text) !important;
  box-shadow: none !important;
}
body[data-ui="new"] .add-drop-banner.drag-over {
  background: color-mix(in srgb, var(--primary) 30%, var(--surface)) !important;
  border-style: dashed !important;
}
body[data-ui="new"] .add-drop-banner .add-recipe-title,
body[data-ui="new"] .add-drop-banner .add-recipe-title * { color: var(--text) !important; }
body[data-ui="new"] .add-drop-banner .add-recipe-title { font: 400 1.15rem/1.2 var(--font-display) !important; }
body[data-ui="new"] .add-recipe-mic.is-ready,
body[data-ui="new"] .add-recipe-camera {
  background: var(--primary) !important; color: var(--primary-ink) !important;
  border: 0 !important; box-shadow: none !important;
  width: 38px !important; height: 38px !important;
}
body[data-ui="new"] .add-recipe-mic.is-ready svg,
body[data-ui="new"] .add-recipe-camera svg { width: 20px; height: 20px; }
/* The trial and quota notes carry light colours inline. */
body[data-ui="new"] .recipes-header > .alert,
body[data-ui="new"] main > .alert {
  background: color-mix(in srgb, var(--primary) 9%, var(--surface)) !important;
  border-color: var(--border) !important;
  color: var(--text-2) !important;
  border-radius: 14px;
}
body[data-ui="new"] .alert.alert-danger { color: var(--danger) !important; border-color: color-mix(in srgb, var(--danger) 45%, transparent) !important; }
body[data-ui="new"] .recipes-toolbar .search-input { border-radius: 999px !important; }
body[data-ui="new"] .recipes-toolbar .fav-toggle,
body[data-ui="new"] .recipes-toolbar .shared-toggle,
body[data-ui="new"] .recipes-toolbar .collections-toggle,
body[data-ui="new"] .recipes-toolbar .grid-xlate,
body[data-ui="new"] .recipes-toolbar .sort-switch {
  background: var(--surface) !important;
  border-color: var(--border) !important;
  color: var(--text-2) !important;
  box-shadow: none !important;
}
body[data-ui="new"] .recipes-toolbar .fav-toggle.on,
body[data-ui="new"] .recipes-toolbar .shared-toggle.on,
body[data-ui="new"] .recipes-toolbar .collections-toggle.on,
body[data-ui="new"] .recipes-toolbar .collections-toggle.active,
body[data-ui="new"] .recipes-toolbar .grid-xlate.active {
  border-color: var(--primary) !important; color: var(--primary) !important;
}
body[data-ui="new"] .sort-switch button.active { background: var(--text) !important; color: var(--bg) !important; }
body[data-ui="new"] .tag-bar .tag-chip {
  background: none !important; border: 1px solid var(--border) !important; color: var(--text-2) !important; box-shadow: none !important;
}
body[data-ui="new"] .tag-bar .tag-chip.active,
body[data-ui="new"] .tag-bar .tag-chip.selected {
  background: var(--text) !important; color: var(--bg) !important; border-color: var(--text) !important;
}
body[data-ui="new"] .tag-bar .tag-add-input { background: none !important; border: 1px dashed var(--border) !important; color: var(--text) !important; border-radius: 999px !important; }
body[data-ui="new"] .ext-promo-banner { background: var(--surface) !important; color: var(--text-2) !important; border-color: var(--border) !important; }


/* ================= recipe page =================
   Scoped to #main: the PDF export renders a clone of .printable-recipe that
   sits outside it, on white, and must keep the paper styles. */
body[data-ui="new"] #main:has(> .printable-recipe) { padding-bottom: calc(4rem + 84px); }
body[data-ui="new"] #main .recipe-toolbar .recipe-back { color: var(--text-2); }
body[data-ui="new"] #main .recipe-toolbar .btn-print,
body[data-ui="new"] #main .recipe-toolbar .fav-btn {
  background: var(--surface) !important; border: 1px solid var(--border) !important; color: var(--text) !important;
  border-radius: 999px !important; box-shadow: none !important;
}
body[data-ui="new"] #main .recipe-toolbar .fav-btn.on,
body[data-ui="new"] #main .recipe-toolbar .fav-btn.active { color: #ff7a8c !important; }

/* No notebook: the lines, the margin and the punched hole go; the photo leads. */
body[data-ui="new"] #main .printable-recipe {
  display: grid; grid-template-columns: minmax(0, 1fr);
  max-width: 900px; margin-inline: auto;
  padding: 0 0 1.5rem !important;
  background: none !important; border: 0 !important; border-radius: 0 !important; box-shadow: none !important;
  color: var(--text);
}
body[data-ui="new"] #main .printable-recipe::before,
body[data-ui="new"] #main .printable-recipe::after { display: none !important; }

/* The photo across the top, the title on it. Both sit in the first cell of
   the grid, so the title rides the bottom edge of the photo whatever its
   length. A press on the photo still opens it full screen; a press on the
   title edits it, as before. */
body[data-ui="new"] #main .printable-recipe > .recipe-hero-frame {
  grid-area: 1 / 1;
  float: none !important; position: relative !important;
  width: auto !important; height: auto !important; aspect-ratio: 21 / 9;
  margin: 0 !important; padding: 0 !important;
  border: 0 !important; border-radius: 22px !important;
  background: #2c2822 !important; box-shadow: none !important; transform: none !important;
  overflow: hidden; display: block;
}
body[data-ui="new"] #main .recipe-hero-frame .recipe-hero-thumb { display: none !important; }
body[data-ui="new"] #main .recipe-hero-frame .ui2-hero-img {
  position: absolute; inset: 0; width: 100%; height: 100%; max-width: none;
  object-fit: cover; display: block; border: 0; border-radius: 0; box-shadow: none; padding: 0;
}
body[data-ui="new"] #main .printable-recipe > .recipe-hero-frame::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(to top, rgba(24, 22, 19, .96) 0%, rgba(24, 22, 19, .6) 30%, rgba(24, 22, 19, 0) 62%);
}
body[data-ui="new"] #main .printable-recipe:has(> .recipe-hero-frame) > .recipe-header {
  grid-area: 1 / 1; align-self: end;
  position: relative; z-index: 2;
  margin: 0 !important; padding: 0 1.4rem 1.1rem !important;
  pointer-events: none;
}
body[data-ui="new"] #main .printable-recipe:has(> .recipe-hero-frame) > .recipe-header :is(textarea, button, a, span) { pointer-events: auto; }
body[data-ui="new"] #main .printable-recipe > .recipe-photo-credit { text-align: right; margin: .3rem .4rem 0 !important; }
body[data-ui="new"] #main .recipe-header .recipe-title { gap: 0 .5rem; padding-right: 0 !important; margin: 0 !important; }
body[data-ui="new"] #main .recipe-title-input,
body[data-ui="new"] #main .recipe-header .recipe-title-text {
  font: 400 2.6rem/1.08 var(--font-display) !important;
  color: var(--text) !important;
  background: transparent !important;
  flex: 1 1 100% !important;
}
body[data-ui="new"] #main .recipe-subtitle-input,
body[data-ui="new"] #main .recipe-header .recipe-subtitle {
  font-size: 1.05rem !important; font-style: normal !important;
  color: var(--text-2) !important;
  background: transparent !important;
  flex: 1 1 100% !important;
}
body[data-ui="new"] #main .recipe-title-input:focus,
body[data-ui="new"] #main .recipe-subtitle-input:focus {
  background: var(--surface) !important; border-color: var(--primary) !important; outline: 0;
}
/* On the photo the title is white in either tone; with no photo it is the
   ink of the page (the rules above). */
body[data-ui="new"] #main .printable-recipe:has(> .recipe-hero-frame) .recipe-title-input,
body[data-ui="new"] #main .printable-recipe:has(> .recipe-hero-frame) .recipe-header .recipe-title-text {
  color: #fff !important; text-shadow: 0 1px 14px rgba(0, 0, 0, .55);
}
body[data-ui="new"] #main .printable-recipe:has(> .recipe-hero-frame) .recipe-subtitle-input,
body[data-ui="new"] #main .printable-recipe:has(> .recipe-hero-frame) .recipe-header .recipe-subtitle {
  color: rgba(255, 255, 255, .86) !important;
}
body[data-ui="new"] #main .printable-recipe:has(> .recipe-hero-frame) .recipe-title-input:focus,
body[data-ui="new"] #main .printable-recipe:has(> .recipe-hero-frame) .recipe-subtitle-input:focus {
  background: rgba(24, 22, 19, .75) !important;
}
body[data-ui="new"] #main .recipe-collapse-toggle:hover,
body[data-ui="new"] #main .photos-toggle:hover,
body[data-ui="new"] #main .original-text-toggle:hover { background: none !important; }
body[data-ui="new"] #main .recipe-description { color: var(--text-2) !important; margin: 1rem 0 .2rem !important; padding: 0 !important; max-width: 68ch; }

/* Facts under the title. */
body[data-ui="new"] #main .recipe-head-strip { display: flex; flex-direction: column; align-items: stretch; gap: .7rem; margin: .9rem 0 0 !important; }
body[data-ui="new"] #main .recipe-nutrition {
  background: none !important; border: 0 !important; padding: 0 !important;
  color: var(--text-2) !important; font-size: .88rem !important;
}
body[data-ui="new"] #main .recipe-nutrition-cell > *:first-child,
body[data-ui="new"] #main .recipe-nutrition strong,
body[data-ui="new"] #main .recipe-nutrition b { color: var(--text) !important; }
body[data-ui="new"] #main .recipe-allergen-chip {
  background: none !important; border: 1px solid var(--border) !important; color: var(--text-2) !important;
}
body[data-ui="new"] #main .recipe-metastrip-note { color: var(--muted) !important; }
body[data-ui="new"] #main .recipe-meta-row { color: var(--text-2) !important; font-size: .92rem !important; gap: .45rem .9rem !important; }
body[data-ui="new"] #main .serves-btn,
body[data-ui="new"] #main .serves-reset {
  width: 2.1rem !important; height: 2.1rem !important;
  background: color-mix(in srgb, var(--text) 11%, transparent) !important;
  border: 0 !important; color: var(--text) !important; font-size: 1.15rem !important;
}
body[data-ui="new"] #main .serves-reset { background: none !important; color: var(--primary) !important; }
body[data-ui="new"] #main .serves-value { color: var(--text) !important; font-weight: 700; min-width: 1.6em; text-align: center; display: inline-block; }
body[data-ui="new"] #main .cook-btn {
  background: var(--primary) !important; color: var(--primary-ink) !important; border: 0 !important;
  font-weight: 700 !important; font-size: .92rem !important; padding: .6rem 1.05rem !important; line-height: 1.1 !important;
}
body[data-ui="new"] #main .cook-btn svg { fill: currentColor; stroke: none; width: 14px; height: 14px; }

/* The glass bar: servings and "Start cooking" stay in reach while the page
   scrolls. They are the meta row's own two controls, pinned; Prep stays in
   the row. Only where the row has a Start button (and the browser knows
   :has), else everything stays in the row as it was. A recipe of several
   dishes keeps each dish's own row. */
body[data-ui="new"] #main .printable-recipe > .recipe-head-strip > .recipe-meta-row:has(> .cook-start-btn)::after {
  content: ""; position: fixed; z-index: 40;
  left: calc(50% - 240px); width: 480px; height: 60px;
  bottom: calc(var(--ui2-tab-h) + 12px);
  border-radius: 999px;
  background: var(--ui2-bar);
  -webkit-backdrop-filter: blur(18px) saturate(1.4); backdrop-filter: blur(18px) saturate(1.4);
  border: 1px solid var(--ui2-bar-edge);
  box-shadow: 0 16px 36px -12px rgba(0, 0, 0, .85);
}
body[data-ui="new"] #main .printable-recipe > .recipe-head-strip > .recipe-meta-row:has(> .cook-start-btn) > .serves-stepper {
  position: fixed !important; z-index: 41;
  left: calc(50% - 224px);
  bottom: calc(var(--ui2-tab-h) + 12px + 13px);
  display: flex; align-items: center; gap: .45rem;
  color: var(--text-2); font-size: .85rem;
}
body[data-ui="new"] #main .printable-recipe > .recipe-head-strip > .recipe-meta-row:has(> .cook-start-btn) > .cook-start-btn {
  position: fixed !important; z-index: 41;
  right: calc(50% - 231px);
  bottom: calc(var(--ui2-tab-h) + 12px + 9px);
  height: 42px; margin: 0 !important;
  max-width: 300px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
@media (max-width: 640px) {
  /* No glass bar on a phone (owner, 2026-11-20): there the screen is the
     recipe, and a bar always over it costs more than cook mode, rarely used
     yet, is worth. Servings and Start stay in the meta row and scroll away. */
  body[data-ui="new"] #main .printable-recipe > .recipe-head-strip > .recipe-meta-row:has(> .cook-start-btn)::after { display: none !important; }
  body[data-ui="new"] #main .printable-recipe > .recipe-head-strip > .recipe-meta-row:has(> .cook-start-btn) > .serves-stepper,
  body[data-ui="new"] #main .printable-recipe > .recipe-head-strip > .recipe-meta-row:has(> .cook-start-btn) > .cook-start-btn {
    position: static !important; left: auto; right: auto; bottom: auto;
  }
  body[data-ui="new"] #main .printable-recipe > .recipe-head-strip > .recipe-meta-row:has(> .cook-start-btn) > .cook-start-btn {
    height: auto; max-width: 100%;
  }
  /* On a phone the photo runs edge to edge. */
  body[data-ui="new"] #main .printable-recipe > .recipe-hero-frame {
    aspect-ratio: 4 / 3; margin-inline: -1.5rem !important; border-radius: 0 !important;
  }
  body[data-ui="new"] #main .printable-recipe:has(> .recipe-hero-frame) > .recipe-header { padding: 0 0 .9rem !important; }
  body[data-ui="new"] #main .recipe-title-input,
  body[data-ui="new"] #main .recipe-header .recipe-title-text { font-size: 2rem !important; }
}

/* ---------- phone: the ingredients nearer the top (owner, 2026-11-20) ----------
   On a 390 x 844 phone the list started at 894 px with a photo: below the
   first screen. What gave way: */
@media (max-width: 640px) {
  /* 1. Back, the heart and export ride on the photo, as in a phone's own
     apps, when the photo comes straight after them (not under a sample's
     note or any banner). The photo then starts under the top bar. */
  body[data-ui="new"] #main:has(> .recipe-toolbar + .printable-recipe > .recipe-hero-frame:first-child) { position: relative; }
  body[data-ui="new"] #main:has(> .recipe-toolbar + .printable-recipe > .recipe-hero-frame:first-child) > .recipe-toolbar {
    position: absolute; z-index: 6; top: .7rem; left: 16px; right: 16px;
    margin: 0 !important;
  }
  body[data-ui="new"] #main > .recipe-toolbar + .printable-recipe > .recipe-hero-frame:first-child { margin-top: -2rem !important; }
  body[data-ui="new"] #main:has(> .recipe-toolbar + .printable-recipe > .recipe-hero-frame:first-child) > .recipe-toolbar .recipe-back {
    padding: .45rem .85rem; border-radius: 999px;
    background: var(--ui2-glass); color: #fff !important;
    -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
    text-decoration: none;
  }
  body[data-ui="new"] #main:has(> .recipe-toolbar + .printable-recipe > .recipe-hero-frame:first-child) > .recipe-toolbar .fav-btn,
  body[data-ui="new"] #main:has(> .recipe-toolbar + .printable-recipe > .recipe-hero-frame:first-child) > .recipe-toolbar .btn-print,
  body[data-ui="new"] #main:has(> .recipe-toolbar + .printable-recipe > .recipe-hero-frame:first-child) > .recipe-toolbar .translate-btn {
    background: var(--ui2-glass) !important; border-color: rgba(255, 255, 255, .16) !important; color: #fff !important;
    -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  }
  body[data-ui="new"] #main:has(> .recipe-toolbar + .printable-recipe > .recipe-hero-frame:first-child) > .recipe-toolbar .fav-btn.on,
  body[data-ui="new"] #main:has(> .recipe-toolbar + .printable-recipe > .recipe-hero-frame:first-child) > .recipe-toolbar .fav-btn.active { color: #ff7a8c !important; }
  /* 2. The note on the estimates is one line; a tap shows it whole
     (js/phone-grid.js; not :focus, which a tap doesn't give everywhere). It stays on screen: audit N10 asked for it where a phone shows
     it, not in a hover title, and the allergen half of it is about safety. */
  body[data-ui="new"] #main .recipe-metastrip-note {
    display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 1;
    overflow: hidden; cursor: pointer; margin: 0 !important; font-size: .78rem !important;
  }
  body[data-ui="new"] #main .recipe-metastrip-note:focus-visible,
  body[data-ui="new"] #main .recipe-metastrip-note.is-open { -webkit-line-clamp: unset; }
  /* The ingredients from the steps (js/phone-grid.js): a pill over the tab
     bar while the steps are on screen and the list has scrolled away, and the
     sheet it opens with copies of the lists. */
  body[data-ui="new"] .ing-fab {
    position: fixed; z-index: 45; left: 16px; /* the scroll arrows hold the right corner */
    bottom: calc(var(--ui2-tab-h, 0px) + 14px + env(safe-area-inset-bottom, 0px));
    padding: .65rem 1.1rem; border-radius: 999px;
    background: var(--primary); color: var(--primary-ink);
    border: 0; font: 600 .92rem/1 inherit; cursor: pointer;
    box-shadow: 0 10px 24px -10px rgba(0, 0, 0, .8);
    opacity: 0; transform: translateY(12px); pointer-events: none;
    transition: opacity .16s ease-out, transform .16s ease-out;
    -webkit-tap-highlight-color: transparent;
  }
  body[data-ui="new"] .ing-fab.is-on { opacity: 1; transform: none; pointer-events: auto; }
  /* Above the install banner while a phone's browser shows it. */
  body[data-ui="new"]:has(> .install-prompt) .ing-fab {
    bottom: calc(var(--ui2-tab-h, 0px) + 96px + env(safe-area-inset-bottom, 0px));
  }
  body[data-ui="new"] .ing-sheet { position: fixed; inset: 0; z-index: 3500; }
  body[data-ui="new"] .ing-sheet-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, .5); animation: ui2-fade .16s ease-out; }
  body[data-ui="new"] .ing-sheet-panel {
    position: absolute; left: 0; right: 0; bottom: 0; max-height: 75vh; max-height: 75dvh;
    display: flex; flex-direction: column;
    background: var(--surface); border-top: 1px solid var(--border);
    border-radius: 22px 22px 0 0; box-shadow: 0 -18px 40px -20px rgba(0, 0, 0, .6);
    animation: ui2-sheet-up .2s cubic-bezier(.2, .8, .2, 1);
  }
  body[data-ui="new"] .ing-sheet-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: .8rem 1rem .4rem; border-bottom: 1px solid var(--border);
  }
  body[data-ui="new"] .ing-sheet-title { margin: 0; font: 400 1.3rem/1.2 var(--font-display); color: var(--text); }
  body[data-ui="new"] .ing-sheet-close {
    width: 2.4rem; height: 2.4rem; border-radius: 50%; border: 0;
    background: color-mix(in srgb, var(--text) 11%, transparent); color: var(--text);
    font-size: 1.5rem; line-height: 1; cursor: pointer;
  }
  body[data-ui="new"] .ing-sheet-body {
    overflow-y: auto; overscroll-behavior: contain;
    padding: .3rem 1rem calc(1rem + env(safe-area-inset-bottom, 0px));
  }
  body[data-ui="new"] #main .ing-sheet-body > .printable-recipe { padding: 0 !important; max-width: none; }
  body[data-ui="new"] .ing-sheet-dish { margin: .9rem 0 .3rem; font: 600 .95rem/1.2 inherit; color: var(--text-2); }
  /* 3. Tighter spacing above the facts and the section headings. */
  body[data-ui="new"] #main .recipe-description { margin: .7rem 0 0 !important; }
  body[data-ui="new"] #main .recipe-head-strip { gap: .5rem; margin: .6rem 0 0 !important; }
  body[data-ui="new"] #main .recipe-collapse-bar { margin: 1.3rem 0 .5rem !important; }
}

/* Section bars become headings. */
body[data-ui="new"] #main .recipe-collapse-bar,
body[data-ui="new"] #main .recipe-photos-header,
body[data-ui="new"] #main .original-text-header {
  margin: 1.9rem 0 .7rem !important;
  border-bottom: 1px solid var(--border);
}
body[data-ui="new"] #main .recipe-collapse-toggle,
body[data-ui="new"] #main .photos-toggle,
body[data-ui="new"] #main .original-text-toggle {
  width: 100%;
  background: none !important; border: 0 !important; border-radius: 0 !important; box-shadow: none !important;
  color: var(--text) !important;
  font: 400 1.45rem/1.2 var(--font-display) !important;
  text-align: start !important;
  padding: .2rem 6.5rem .55rem 0 !important;
}
body[data-ui="new"] #main .recipe-collapse-toggle .toggle-caret,
body[data-ui="new"] #main .photos-toggle .toggle-caret,
body[data-ui="new"] #main .original-text-toggle .toggle-caret { color: var(--muted) !important; }
body[data-ui="new"] #main .recipe-collapse-actions { inset-inline-start: auto !important; inset-inline-end: 0 !important; }
body[data-ui="new"] #main .section-icon-btn,
body[data-ui="new"] #main .section-reset-btn {
  background: none !important; border: 0 !important; box-shadow: none !important; color: var(--text-2) !important;
}
body[data-ui="new"] #main .section-icon-btn:hover { color: var(--primary) !important; }
body[data-ui="new"] #main .format-switch { background: var(--surface) !important; border-color: var(--border) !important; }
body[data-ui="new"] #main .format-switch button { color: var(--text-2) !important; background: none !important; }
body[data-ui="new"] #main .format-switch button.active { background: var(--text) !important; color: var(--bg) !important; }

/* Ingredients: the amount is still the thing you press to change it. */
body[data-ui="new"] #main .printable-recipe .recipe-ingredients { list-style: none !important; padding: 0 !important; margin: 0 !important; }
body[data-ui="new"] #main .printable-recipe .recipe-ingredients > li {
  padding: .5rem 0 !important; margin: 0 !important;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 65%, transparent);
  color: var(--rf-body-fg, var(--text));
}
body[data-ui="new"] #main .printable-recipe .recipe-ingredients > li.ing-group {
  border-bottom: 0; padding-top: 1rem !important;
  color: var(--primary); font-size: .8rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase;
}
body[data-ui="new"] #main .printable-recipe .ing-num {
  font-size: var(--rf-qty-size, 1.05rem) !important;
  font-weight: var(--rf-qty-weight, 700) !important;
  color: var(--rf-qty-fg, var(--text)) !important;
  background: color-mix(in srgb, var(--primary) 17%, transparent) !important;
  border: 1px solid color-mix(in srgb, var(--primary) 55%, transparent) !important;
  border-radius: 999px !important;
  padding: .08em .6em !important; min-width: 2.1em; text-align: center;
  line-height: 1.5 !important;
}
body[data-ui="new"] #main .printable-recipe .ing-qty-input {
  background: var(--bg) !important; color: var(--text) !important;
  border: 1.5px solid var(--primary) !important; border-radius: 10px !important;
}
body[data-ui="new"] #main .printable-recipe .ing-qty-step {
  background: color-mix(in srgb, var(--text) 11%, transparent) !important; color: var(--text) !important; border: 0 !important;
}
/* Steps: a card each, the number in amber beside it. */
body[data-ui="new"] #main .printable-recipe ol.recipe-step-list { padding-inline-start: 2.3rem !important; margin: 0 !important; }
body[data-ui="new"] #main .printable-recipe ol.recipe-step-list > li {
  margin: 0 0 .6rem !important; padding: .85rem 1rem !important;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  color: var(--rf-body-fg, var(--text));
}
body[data-ui="new"] #main .printable-recipe ol.recipe-step-list > li::marker {
  color: var(--primary); font-family: var(--font-display); font-size: 1.35rem; font-weight: 400;
}
body[data-ui="new"] #main .recipe-notes,
body[data-ui="new"] #main .recipe-notes-empty { color: var(--text-2); }
body[data-ui="new"] #main .recipe-ai-pane,
body[data-ui="new"] #main .recipe-photos-pane { background: none !important; border: 0 !important; box-shadow: none !important; padding-inline: 0 !important; }
body[data-ui="new"] #main .photo-card { background: var(--surface) !important; border-color: var(--border) !important; }
body[data-ui="new"] #main .photo-add-tile { background: none !important; border: 1.5px dashed var(--border) !important; color: var(--text-2) !important; }


/* The strip is a column here; its old phone rule (flex: 1 0 100% on a wrapping
   row) would otherwise send the meta row into a second column, off screen. */
body[data-ui="new"] #main .recipe-head-strip { flex-wrap: nowrap !important; }
body[data-ui="new"] #main .recipe-head-strip > .recipe-metastrip,
body[data-ui="new"] #main .recipe-head-strip > .recipe-meta-row { flex: 0 0 auto !important; margin: 0 !important; }
/* The title is a field that looks like a heading until it has the focus. */
body[data-ui="new"] #main .recipe-title-input:not(:focus),
body[data-ui="new"] #main .recipe-subtitle-input:not(:focus) { border-color: transparent !important; }
/* The pinned controls carry none of the row's "·" separators. */
body[data-ui="new"] #main .printable-recipe > .recipe-head-strip > .recipe-meta-row:has(> .cook-start-btn) > .serves-stepper::before,
body[data-ui="new"] #main .printable-recipe > .recipe-head-strip > .recipe-meta-row:has(> .cook-start-btn) > .serves-stepper::after,
body[data-ui="new"] #main .printable-recipe > .recipe-head-strip > .recipe-meta-row:has(> .cook-start-btn) > .cook-start-btn::before { content: none !important; }


/* The up/down arrows clear the glass bar on a recipe. */
body[data-ui="new"] #main .printable-recipe .scroll-nav { bottom: calc(var(--ui2-tab-h) + 84px) !important; }

/* ================= cooking =================
   The same overlay and the same controls (a press anywhere on the step goes on,
   the dots jump, mic and speaker, End); the step now lies on a card, the first
   of a stack. Opaque: the page must not show through. */
body[data-ui="new"] .cook-overlay {
  --primary: #f0a93a; --primary-ink: #1d1305; --border: #443f36;
  background: radial-gradient(90% 50% at 50% 0, rgba(240, 169, 58, .2), rgba(240, 169, 58, 0) 70%), #14120f !important;
  color: #f3ecdf !important;
  padding: 1rem 1rem 1.1rem !important;
}
body[data-ui="new"] .cook-overlay .cook-counter { color: rgba(243, 236, 223, .8); font-weight: 600; }
body[data-ui="new"] .cook-overlay .cook-end {
  background: rgba(255, 255, 255, .1) !important; border: 0 !important; border-radius: 999px !important; color: #f3ecdf !important;
}
body[data-ui="new"] .cook-overlay .cook-body {
  margin: .9rem 0 2.2rem !important;
  padding: 4.2rem 1.4rem 1.4rem !important;
  background: #2d2a24 !important;
  border: 1px solid #4a453b;
  border-radius: 24px;
  box-shadow: 0 13px 0 -6px #25221d, 0 14px 0 -6px #4a453b, 0 26px 0 -13px #1e1c18, 0 27px 0 -13px #3a362e, 0 40px 50px -24px rgba(0, 0, 0, .8);
}
body[data-ui="new"] .cook-overlay .cook-listen,
body[data-ui="new"] .cook-overlay .cook-speak {
  background: rgba(255, 255, 255, .1) !important; border: 0 !important; border-radius: 50% !important; color: #f3ecdf !important;
}
body[data-ui="new"] .cook-overlay .cook-listen.listening,
body[data-ui="new"] .cook-overlay .cook-speak.speaking { background: var(--primary) !important; color: var(--primary-ink) !important; }
body[data-ui="new"] .cook-overlay .cook-voice-lang { border-color: rgba(243, 236, 223, .4) !important; color: #f3ecdf !important; background: none !important; }
body[data-ui="new"] .cook-overlay .cook-arrow {
  width: 56px !important; height: 56px !important; border-radius: 50% !important;
  background: rgba(255, 255, 255, .12) !important; border: 0 !important; color: #f3ecdf !important;
}
body[data-ui="new"] .cook-overlay .cook-nav .cook-arrow:last-child { background: var(--primary) !important; color: var(--primary-ink) !important; }
body[data-ui="new"] .cook-overlay .cook-arrow:disabled { opacity: .35; }
body[data-ui="new"] .cook-overlay .cook-dot.current,
body[data-ui="new"] .cook-overlay .cook-dot.done { background: var(--primary) !important; border-color: var(--primary) !important; }

/* ================= collections: books =================
   Each collection stands like a book turned a little to show its spine;
   pointing at one turns its cover to you. Everything on the card is where it
   was: the icon, the share chain, the book export, the pencil, the name, the
   count. A card being edited lies flat and wide so its form has room.

   Colour: a collection's own (--coll-color), deepened so white type reads on
   it; one without a colour takes one of six by its place on the shelf. The
   first cut mixed every cover two-thirds toward black, and on the dark page
   neither covers nor spines could be told apart (owner, 2026-11-18): covers
   are now mid-tones lit from the top left, and the spine is the lit side. */
body[data-ui="new"] .collection-grid {
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)) !important;
  gap: 46px 42px !important;
  padding: 14px 10px 28px 46px;
}
body[data-ui="new"] .collection-grid > .collection-card:nth-child(6n+1) { --ui2-book: #9a3f4c; }
body[data-ui="new"] .collection-grid > .collection-card:nth-child(6n+2) { --ui2-book: #2f7460; }
body[data-ui="new"] .collection-grid > .collection-card:nth-child(6n+3) { --ui2-book: #b9822c; }
body[data-ui="new"] .collection-grid > .collection-card:nth-child(6n+4) { --ui2-book: #40659a; }
body[data-ui="new"] .collection-grid > .collection-card:nth-child(6n+5) { --ui2-book: #81508e; }
body[data-ui="new"] .collection-grid > .collection-card:nth-child(6n)   { --ui2-book: #b05a33; }
body[data-ui="new"] .collection-grid > .collection-card { --book: var(--ui2-book, #9a3f4c); }
body[data-ui="new"] .collection-grid > .collection-card.collection-card-tinted { --book: color-mix(in oklab, var(--coll-color, #9a7a45) 68%, #21170f); }
body[data-ui="new"] .collection-grid > .collection-card.collection-card-unassigned:not(.collection-card-tinted) { --book: #7f766b; }

body[data-ui="new"] .collection-grid > .collection-card:not(.collection-card-editing) {
  aspect-ratio: 3 / 4;
  padding: 50px 14px 14px 20px !important;
  justify-content: flex-end;
  overflow: visible !important;
  border: 0 !important;
  border-radius: 2px 10px 10px 2px !important;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, .3) 0, rgba(0, 0, 0, 0) 9px, rgba(255, 255, 255, .16) 10px, rgba(255, 255, 255, 0) 14px),
    linear-gradient(150deg, color-mix(in oklab, var(--book) 84%, #fff) 0%, var(--book) 42%, color-mix(in oklab, var(--book) 66%, #000) 100%) !important;
  color: #fff !important;
  box-shadow: var(--ui2-book-lift), inset 0 0 0 1px rgba(255, 255, 255, .1) !important;
  transform-style: preserve-3d;
  transform: perspective(900px) rotateY(24deg);
  transition: transform .5s cubic-bezier(.2, .8, .2, 1);
  cursor: pointer;
}
/* The spine: the book's lit side, with two gilt bands. */
body[data-ui="new"] .collection-grid > .collection-card:not(.collection-card-editing)::before {
  content: "";
  position: absolute; left: -40px; top: 0; bottom: 0; width: 40px;
  transform-origin: right center; transform: rotateY(-90deg);
  background:
    linear-gradient(180deg, rgba(255, 224, 160, 0) 0 11%, rgba(255, 224, 160, .7) 11% 12.6%, rgba(255, 224, 160, 0) 12.6% 87.4%, rgba(255, 224, 160, .7) 87.4% 89%, rgba(255, 224, 160, 0) 89%),
    linear-gradient(90deg, color-mix(in oklab, var(--book) 70%, #000) 0%, color-mix(in oklab, var(--book) 80%, #fff) 45%, color-mix(in oklab, var(--book) 92%, #000) 100%);
  border-radius: 3px 0 0 3px;
}
/* A thin gilt frame on the cover. */
body[data-ui="new"] .collection-grid > .collection-card:not(.collection-card-editing)::after {
  content: "";
  position: absolute; inset: 8px 8px 8px 17px;
  border: 1px solid rgba(255, 232, 180, .3);
  border-radius: 2px 6px 6px 2px;
  pointer-events: none;
}
@media (hover: hover) {
  body[data-ui="new"] .collection-grid > .collection-card:not(.collection-card-editing):hover { transform: perspective(900px) rotateY(0deg); }
}
body[data-ui="new"] .collection-grid > .collection-card:not(.collection-card-editing):focus-within,
body[data-ui="new"] .collection-grid > .collection-card.tag-drop-hover { transform: perspective(900px) rotateY(0deg); }
/* The row of controls keeps the top of the cover; the name can never climb into it. */
body[data-ui="new"] .collection-grid > .collection-card:not(.collection-card-editing) .collection-card-icons {
  position: absolute; top: 14px; left: 24px; right: 14px; margin: 0;
  z-index: 1;
}
body[data-ui="new"] .collection-grid > .collection-card:not(.collection-card-editing) .collection-card-name {
  font: 400 1.02rem/1.18 var(--font-display) !important; color: #fff !important;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .45);
  overflow-wrap: break-word; hyphens: auto;
  max-height: 4.9em; overflow: hidden;
}
body[data-ui="new"] .collection-grid > .collection-card:not(.collection-card-editing) .collection-card-count {
  display: block; margin-top: 4px;
  font: 500 .76rem/1.2 system-ui, sans-serif; color: rgba(255, 255, 255, .86) !important;
  text-shadow: none;
}
body[data-ui="new"] .collection-grid > .collection-card:not(.collection-card-editing) .collection-card-description {
  color: rgba(255, 255, 255, .86) !important; font-size: .72rem !important; line-height: 1.3;
  overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
body[data-ui="new"] .collection-grid > .collection-card:not(.collection-card-editing) .collection-card-edit-btn,
body[data-ui="new"] .collection-grid > .collection-card:not(.collection-card-editing) .collection-card-share-btn {
  width: 26px !important; height: 26px !important;
  background: rgba(20, 16, 12, .42) !important; border: 0 !important; color: #fff !important; box-shadow: none !important;
}
body[data-ui="new"] .collection-grid > .collection-card:not(.collection-card-editing) .collection-card-icon {
  border: 1.5px solid rgba(255, 232, 180, .7) !important; box-shadow: 0 2px 6px rgba(0, 0, 0, .35) !important;
}
body[data-ui="new"] .collection-grid > .collection-card:not(.collection-card-editing) .collection-card-icon:not(.has-img) {
  background: rgba(20, 16, 12, .42) !important; color: #fff !important;
}
body[data-ui="new"] .collection-grid > .collection-card:not(.collection-card-editing) .collection-card-share-btn.card-shared-btn { background: #1f9d57 !important; }
body[data-ui="new"] .collection-grid > .collection-card.collection-card-editing {
  grid-column: 1 / -1;
  background: var(--surface) !important; border: 1px solid var(--border) !important; color: var(--text) !important;
}
@media (max-width: 640px) {
  body[data-ui="new"] .collection-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 34px 30px !important; padding: 12px 6px 24px 34px; }
  /* A narrow cover: the row of controls shrinks to stay on it. */
  body[data-ui="new"] .collection-grid > .collection-card:not(.collection-card-editing) .collection-card-icons { left: 20px; right: 8px; gap: 2px; }
  body[data-ui="new"] .collection-grid > .collection-card:not(.collection-card-editing) .collection-card-icons-right { gap: 2px !important; }
  body[data-ui="new"] .collection-grid > .collection-card:not(.collection-card-editing) .collection-card-icon { width: 28px !important; height: 28px !important; }
  body[data-ui="new"] .collection-grid > .collection-card:not(.collection-card-editing) .collection-card-edit-btn,
  body[data-ui="new"] .collection-grid > .collection-card:not(.collection-card-editing) .collection-card-share-btn { width: 22px !important; height: 22px !important; font-size: .7rem !important; }
}
@media (prefers-reduced-motion: reduce) {
  body[data-ui="new"] .collection-grid > .collection-card { transition: none !important; }
}

/* On a wide screen the step card keeps a reading width. */
body[data-ui="new"] .cook-overlay .cook-top,
body[data-ui="new"] .cook-overlay .cook-body,
body[data-ui="new"] .cook-overlay .cook-nav,
body[data-ui="new"] .cook-overlay .cook-progress { width: min(100%, 820px); margin-inline: auto !important; }


/* No servings on the recipe, so no stepper: Start floats alone, without the
   empty length of glass beside it. */
body[data-ui="new"] #main .printable-recipe > .recipe-head-strip > .recipe-meta-row:has(> .cook-start-btn):not(:has(> .serves-stepper))::after { display: none; }
body[data-ui="new"] #main .printable-recipe > .recipe-head-strip > .recipe-meta-row:has(> .cook-start-btn):not(:has(> .serves-stepper)) > .cook-start-btn {
  box-shadow: 0 14px 30px -10px rgba(0, 0, 0, .85);
}
/* The ingredients beside or over each step ("Stacked", "Side-by-side"):
   quieter than the step, still easy to read on the dark ground. */
body[data-ui="new"] #main .printable-recipe .mep-ingredients > li { color: var(--text-2) !important; opacity: 1 !important; }


/* Found on the light tone, true of both. */
/* The mic and camera sit inside the Add title, whose "everything takes the
   text colour" rule would otherwise paint their icons in it. */
body[data-ui="new"] .add-drop-banner .add-recipe-title .add-recipe-mic.is-ready,
body[data-ui="new"] .add-drop-banner .add-recipe-title .add-recipe-mic.is-ready *,
body[data-ui="new"] .add-recipe-wrap .add-recipe-camera,
body[data-ui="new"] .add-recipe-wrap .add-recipe-camera * { color: var(--primary-ink) !important; }
body[data-ui="new"] .add-recipe-mic.is-ready:hover { background: var(--primary-2) !important; }
@media (max-width: 640px) {
  /* Solid: a see-through strip let the cards' titles show between the tabs. */
  body[data-ui="new"] header.topbar::after { background: var(--bg); }
  /* An icon takes its tab's colour (the old active chip made it white). */
  body[data-ui="new"] header.topbar nav > a.nav-tab:not(.nav-add) .nav-ic { color: inherit !important; }
  body[data-ui="new"] header.topbar nav > a.nav-tab.active { color: var(--primary) !important; }
}

/* A phone has no glass bar (see the bar above): the arrows go back down to
   the tab bar, and a lone Start in the row casts no floating shadow. Here at
   the end so it comes after the rules it undoes. */
@media (max-width: 640px) {
  body[data-ui="new"] #main .printable-recipe .scroll-nav { bottom: calc(var(--ui2-tab-h) + 12px) !important; }
  body[data-ui="new"] #main .printable-recipe > .recipe-head-strip > .recipe-meta-row:has(> .cook-start-btn) > .cook-start-btn { box-shadow: none !important; }
}

/* ---------- phone: the Add banner becomes the +'s sheet (js/phone-grid.js) ----------
   The tab bar's + already says "add", so on a phone the banner was a second,
   bigger way to the same page above every grid (owner, 2026-11-20). Its
   camera and mic move into the sheet the + opens on this page. The input and
   the mic stay in the DOM, hidden: the sheet's rows use them. */
@media (max-width: 640px) {
  body[data-ui="new"] .add-recipe-wrap:has(#add-recipe-btn) { margin: 0 !important; height: 0; overflow: hidden; }
}
body[data-ui="new"] .add-sheet[hidden] { display: none !important; }
body[data-ui="new"] .add-sheet {
  position: fixed; inset: 0; z-index: 3500;
}
body[data-ui="new"] .add-sheet-backdrop {
  position: absolute; inset: 0; background: rgba(0, 0, 0, .5);
  animation: ui2-fade .16s ease-out;
}
body[data-ui="new"] .add-sheet-panel {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: .5rem 1rem calc(1rem + env(safe-area-inset-bottom, 0px));
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-radius: 22px 22px 0 0;
  box-shadow: 0 -18px 40px -20px rgba(0, 0, 0, .6);
  animation: ui2-sheet-up .2s cubic-bezier(.2, .8, .2, 1);
}
body[data-ui="new"] .add-sheet-grip {
  width: 38px; height: 4px; border-radius: 2px; margin: .2rem auto .7rem;
  background: var(--border);
}
body[data-ui="new"] .add-sheet-title {
  font: 400 1.25rem/1.2 var(--font-display); color: var(--text);
  margin: 0 .25rem .2rem;
}
body[data-ui="new"] .add-sheet-sub { margin: 0 .25rem .5rem; color: var(--text-2); font-size: .85rem; }
body[data-ui="new"] .add-sheet-row {
  display: flex; align-items: center; gap: .9rem; width: 100%;
  margin: .45rem 0 0; padding: .75rem .8rem;
  background: var(--surface-2); color: var(--text);
  border: 1px solid var(--border); border-radius: 16px;
  text-align: start; text-decoration: none; font: inherit; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
body[data-ui="new"] .add-sheet-row:active { transform: scale(.98); opacity: .85; }
body[data-ui="new"] .add-sheet-ico {
  flex: 0 0 auto; width: 42px; height: 42px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--primary); color: var(--primary-ink);
}
body[data-ui="new"] .add-sheet-ico svg { width: 21px; height: 21px; }
body[data-ui="new"] .add-sheet-text { display: flex; flex-direction: column; gap: .1rem; min-width: 0; }
body[data-ui="new"] .add-sheet-text strong { font-weight: 600; font-size: 1rem; }
body[data-ui="new"] .add-sheet-text span { color: var(--text-2); font-size: .82rem; line-height: 1.3; }
/* Voice only where the banner's mic found it can record (voice-recipe.js). */
body[data-ui="new"] .add-sheet-voice { display: none; }
body[data-ui="new"]:has(#add-recipe-mic.is-ready) .add-sheet-voice { display: flex; }

/* ---------- phone: the search row comes back on a scroll up (js/phone-grid.js) ----------
   Down a long grid the search was a full scroll away. A finger moving up
   brings the search row back pinned to the top; moving down puts it away,
   unless someone is typing in it. Only once the whole header is off screen,
   and the header keeps the room the row took (an ::after of that height) so
   nothing below moves. */
@media (max-width: 640px) {
  body[data-ui="new"].ui2-tb-peek .recipes-header::after { content: ""; display: block; height: var(--ui2-tb-h, 0px); }
  body[data-ui="new"].ui2-tb-peek .recipes-toolbar {
    position: fixed !important; top: 0; left: 0; right: 0; z-index: 60;
    margin: 0 !important;
    padding: calc(env(safe-area-inset-top, 0px) + .55rem) 16px .55rem !important;
    background: var(--ui2-bar) !important;
    -webkit-backdrop-filter: blur(14px) saturate(1.2);
    backdrop-filter: blur(14px) saturate(1.2);
    border-bottom: 1px solid var(--ui2-bar-edge);
    animation: ui2-drop-in .18s ease-out;
  }
  /* Search, its clear button and the two toggles beside it; sorting and
     views wait at the top of the page. */
  body[data-ui="new"].ui2-tb-peek .recipes-toolbar .sort-view-group,
  body[data-ui="new"].ui2-tb-peek .recipes-toolbar .toolbar-line-break { display: none !important; }
}
@media (prefers-reduced-motion: reduce) {
  body[data-ui="new"] .add-sheet-panel,
  body[data-ui="new"] .add-sheet-backdrop,
  body[data-ui="new"].ui2-tb-peek .recipes-toolbar { animation: none; }
}

/* Endless scrolling's "Show more" (PagerPlacement.Endless): a quiet pill, not
   a call to action. It is mostly pressed by the script before anyone sees it. */
body[data-ui="new"] .grid-more { margin: 1.25rem 0 1rem; }
body[data-ui="new"] .grid-more-btn {
  background: var(--surface-2) !important;
  color: var(--text) !important;
  border: 1px solid var(--border) !important;
  border-radius: 999px !important;
  box-shadow: none !important;
  padding: .55rem 1.4rem !important;
  font-weight: 500;
}
body[data-ui="new"] .grid-more-count { color: var(--muted); font-size: .8rem; }

} /* @media screen */

@media (prefers-reduced-motion: reduce) {
  body[data-ui="new"] .card-grid > .card { transition: none !important; }
  body[data-ui="new"] .card-grid > .card:hover { transform: none !important; }
}

