/*
  Al Dente: Midfi's screens, which the Cozy layout is built on
  Matches the "Midfi cleaned" page of the Al Dente Figma file. The palette is tokens
  at the top of styles.css, shared by all four layouts, in light and dark. Midfi
  screens use mf- classes; the shared screens (settings, sign-in, setup, link and
  scan imports, cook mode, the cookbook simulator, and all of Classic) are styled in
  styles.css and polished by the overrides near the end of this file. Bistro keeps
  its own look, so nothing here applies to it. Cozy uses Midfi's screens and restyles
  them in cozy.css.
  Phone first (the design is 402pt wide); from 768px the tab bar becomes a sidebar.
*/

:root:not([data-screens="midfi"]) .mf-nav { display: none; }
:root:not([data-layout="cozy"]) .mf-cozy-only,
:root[data-layout="cozy"] .mf-midfi-only { display: none; }

/* :where() adds nothing to specificity, so these rules weigh what a plain :root would. */
:root:not(:where([data-layout="bistro"])) {
  --photo-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 22 22' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2.75' y='4.125' width='16.5' height='13.75' rx='2.75'/%3E%3Ccircle cx='8.25' cy='9.17' r='1.65' fill='black' stroke='none'/%3E%3Cpath d='M3.67 16.04 8.25 11.92l3.21 2.75 2.75-2.29 4.12 3.66'/%3E%3C/svg%3E");
  & body { background: var(--mf-bg); color: var(--mf-ink); font: 15px/1.35 var(--mf-sans); }
  &[data-screens="midfi"] { --nav-h: 84px; }
  &[data-screens="midfi"] .nav { display: none; }
  & ::selection { background: var(--mf-tomato-tint-2); }
  & :focus-visible { outline: 2px solid var(--mf-tomato); outline-offset: 2px; }

  /* ---------- Type ---------- */

  & .mf-title { font: 400 32px/1.2 var(--mf-serif); letter-spacing: -0.01em; }
  & .mf-display { margin: 14px 0 0; font: 400 27px/1.22 var(--mf-serif); letter-spacing: -0.01em; }
  & .mf-h1 { font: 400 26px/1.23 var(--mf-serif); letter-spacing: -0.01em; }
  & .mf-h2 { font: 400 20px/1.25 var(--mf-serif); letter-spacing: -0.005em; }
  & .mf-h3 { display: block; font: 400 17px/1.24 var(--mf-serif); letter-spacing: -0.003em; }
  & .mf-h4 { display: block; font: 400 15px/1.3 var(--mf-sans); }
  & .mf-sub { margin-top: 6px; color: var(--mf-soft); font-size: 14px; line-height: 1.3; }
  & .mf-small { display: block; color: var(--mf-soft); font-size: 12.5px; line-height: 1.3; }
  & .mf-muted { color: var(--mf-soft); font-size: 13px; }
  & .mf-label { display: block; margin: 0 0 8px; color: var(--mf-soft); font-size: 10.5px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; }
  & .mf-eyebrow { color: var(--mf-mustard-ink); font-size: 10.5px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; }
  & .mf-tomato-text { color: var(--mf-tomato-ink); }
  & .mf-plum-text { color: var(--mf-plum-ink); }
  & .mf-mustard-text { color: var(--mf-mustard-ink); font-size: 12px; font-weight: 600; }
  & .mf-center { align-self: center; text-align: center; }
  & .mf-grow { flex: 1; min-width: 0; }
  & .mf-prose { font-size: 15px; line-height: 1.47; }
  & .mf-empty { padding: 18px 0; color: var(--mf-soft); font-size: 14px; }
  & .mf-link { padding: 0; border: 0; background: none; color: var(--mf-plum-ink); font: 600 14px var(--mf-sans); }
  & .mf-danger { color: var(--mf-tomato-ink); }
  & .mf-see { padding: 0; border: 0; background: none; color: var(--mf-plum-ink); font: 500 13px var(--mf-sans); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; white-space: nowrap; }
  & .ic { flex: none; }

  /* ---------- Screens ---------- */

  & .mf-screen { display: flex; flex-direction: column; min-height: 100dvh; padding: 12px var(--mf-gutter) 40px; }
  /* Flex children would otherwise grow to fit a shelf's full row of cards. */
  & .mf-screen > * { min-width: 0; }
  & .mf-screen:has(.mf-sticky) { padding-bottom: 120px; }
  & .mf-section { margin-top: 28px; }
  & .mf-section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 26px 0 12px; }
  & .mf-section > .mf-section-head:first-child { margin-top: 0; }
  & .mf-section > .mf-h2:first-child { margin-bottom: 12px; }
  & .mf-section-side { display: flex; align-items: center; gap: 14px; }

  /* The main tabs' header: logo or title, then the bell and your avatar. */
  & .mf-head { padding-top: 4px; }
  & .mf-head-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; }
  & .mf-head-actions { display: flex; gap: 10px; }
  /* With a back arrow first, the title sits right after it and the buttons stay right. */
  & .mf-head-row > .auto-back + * { margin-right: auto; }
  /* The logo image is used as a mask so it takes the ink color in light and dark. */
  & .mf-logo { display: block; width: 108px; height: 56px; background: var(--mf-ink); -webkit-mask: url(/midfi/logo.png) left center / contain no-repeat; mask: url(/midfi/logo.png) left center / contain no-repeat; }
  & .mf-round { position: relative; display: grid; place-items: center; width: 44px; height: 44px; flex: none; border: 0; border-radius: 50%; background: var(--mf-sand); color: var(--mf-ink); }
  & .mf-round.is-on { color: var(--mf-tomato); }
  & .mf-round.is-on .ic-bookmark path { fill: currentColor; }
  & .mf-round-sm { width: 32px; height: 32px; }
  & .mf-burger { cursor: pointer; }
  & .mf-burger .burger-bars { width: 18px; height: 18px; }
  & .mf-burger.is-open { background: var(--mf-tomato-tint); color: var(--mf-tomato-ink); }
  & .mf-dot { position: absolute; top: 10px; right: 11px; width: 9px; height: 9px; border: 2px solid var(--mf-sand); border-radius: 50%; background: var(--mf-tomato); box-sizing: content-box; }
  & .mf-me { display: block; border-radius: 50%; }

  /* Focused screens' top bar: round back button, centered title, an action. */
  & .mf-top { position: sticky; top: 0; z-index: 20; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; margin: -12px calc(-1 * var(--mf-gutter)) 14px; padding: 12px var(--mf-gutter) 10px; background: color-mix(in srgb, var(--mf-bg) 90%, transparent); backdrop-filter: blur(10px); }
  & .mf-top .mf-back { width: 40px; height: 40px; }
  & .mf-top-title { font-size: 16px; font-weight: 600; text-align: center; }
  & .mf-top-action { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
  & .mf-toggle2 { justify-self: end; display: flex; padding: 3px; border-radius: 999px; background: var(--mf-sand); }
  & .mf-toggle2 button { display: grid; place-items: center; width: 40px; height: 32px; border: 0; border-radius: 999px; background: none; color: var(--mf-soft-2); }
  & .mf-toggle2 button.is-on { background: var(--mf-card); color: var(--mf-plum-ink); box-shadow: var(--mf-soft-shadow); }

  /* ---------- Avatars ---------- */

  & .mf-av { display: inline-grid; place-items: center; width: var(--s); height: var(--s); flex: none; overflow: hidden; border-radius: 50%; background: var(--av, #6f6359); color: #fff; font: 600 calc(var(--s) * 0.34) / 1 var(--mf-sans); letter-spacing: 0.02em; }
  & .mf-av.is-you { color: #2a211e; }
  & .mf-av img { width: 100%; height: 100%; object-fit: cover; }
  & .mf-av-ring { box-shadow: 0 0 0 2px var(--mf-card); }
  & .mf-stack { display: inline-flex; flex: none; }
  & .mf-stack > * { box-shadow: 0 0 0 2px var(--mf-card); }
  & .mf-stack > * + * { margin-left: calc(var(--s) * -0.3); }
  & .mf-av-more { background: var(--mf-mustard); color: #2a211e; font-weight: 700; }

  /* ---------- Buttons, chips, fields ---------- */

  & .mf-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 0 20px; border: 1.5px solid transparent; border-radius: 14px; background: var(--mf-sand); color: var(--mf-ink); font: 600 15px/1 var(--mf-sans); text-align: center; white-space: nowrap; cursor: pointer; }
  & .mf-btn:disabled, & .mf-btn.is-disabled { opacity: 0.45; cursor: default; }
  & .mf-btn-sm { min-height: 38px; padding: 0 14px; border-radius: 12px; font-size: 13.5px; }
  & .mf-btn-block { width: 100%; }
  & .mf-btn-square { width: 52px; padding: 0; flex: none; }
  & .mf-btn-primary { background: var(--mf-tomato); color: #fff; box-shadow: 0 4px 10px rgb(194 68 42 / 0.28); }
  & .mf-btn-plum { background: var(--mf-plum); color: #fff; box-shadow: 0 6px 14px rgb(115 48 72 / 0.22); }
  & .mf-btn-plum.is-quiet { box-shadow: none; }
  & .mf-btn-ink { background: #1b1b1b; color: #fff; }
  & .mf-btn-outline { border-color: var(--mf-line-2); background: var(--mf-card); }
  & .mf-btn-outline.is-on { border-color: var(--mf-tomato); color: var(--mf-tomato-ink); }
  & .mf-btn-outline.is-on .ic-bookmark path { fill: currentColor; }
  & .mf-btn-light { background: var(--mf-card); box-shadow: var(--mf-soft-shadow); }
  & .mf-btn-pink { background: var(--mf-plum-tint); color: var(--mf-plum-ink); font-weight: 700; }
  & .mf-btn-sand { background: var(--mf-sand); color: var(--mf-soft-2); }
  & .mf-two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  & .mf-two-sm { display: flex; gap: 8px; margin-top: 10px; }

  & .mf-chips { display: flex; flex-wrap: wrap; gap: 8px; }
  & .mf-chips-scroll { flex-wrap: nowrap; overflow-x: auto; margin: 0 calc(-1 * var(--mf-gutter)); padding: 2px var(--mf-gutter); scrollbar-width: none; }
  & .mf-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 12px; border: 1px solid var(--mf-line-2); border-radius: 999px; background: var(--mf-card); color: var(--mf-ink); font: 500 13px var(--mf-sans); white-space: nowrap; cursor: pointer; }
  & .mf-chip.is-on { border-color: var(--mf-plum); background: var(--mf-plum); color: #fff; font-weight: 700; }
  & .mf-chip-ink.is-on { border-color: #1b1b1b; background: #1b1b1b; }
  & .mf-chip-av { padding-left: 4px; }
  & .mf-chip-tag { border: 0; background: var(--mf-sand); font-weight: 600; }
  & .mf-chip-tag button { display: grid; place-items: center; padding: 0; border: 0; background: none; color: var(--mf-soft); }
  & .mf-chip-add { border-style: dashed; color: var(--mf-soft-2); background: transparent; }
  & .mf-pill { display: inline-flex; align-items: center; gap: 6px; min-height: 26px; padding: 0 11px; border-radius: 999px; background: var(--mf-sand); color: var(--mf-ink); font-size: 11.5px; font-weight: 500; }
  & .mf-pill.is-plum { background: var(--mf-plum-tint); color: var(--mf-plum-ink); }
  & .mf-pill-source { background: var(--mf-tomato-tint); color: var(--mf-tomato-ink); font-weight: 600; }
  & .mf-tags { display: flex; flex-wrap: wrap; gap: 8px; }
  & .mf-status { flex: none; padding: 5px 10px; border-radius: 999px; background: var(--mf-sand); color: var(--mf-soft-2); font-size: 10.5px; font-weight: 600; white-space: nowrap; }
  & .mf-status.is-mustard { background: var(--mf-mustard-tint-2); color: var(--mf-mustard-ink); }
  & .mf-status.is-pink { background: var(--mf-plum-tint-2); color: var(--mf-plum-ink); }
  & .mf-status.is-green { background: var(--mf-green-tint); color: var(--mf-green); }
  & .mf-red-dot { display: inline-block; width: 8px; height: 8px; flex: none; margin-right: 6px; border-radius: 50%; background: var(--mf-tomato); }
  & .mf-green-dot { display: inline-block; width: 7px; height: 7px; margin-right: 4px; border-radius: 50%; background: var(--mf-green); }

  & .mf-seg { display: grid; grid-auto-columns: 1fr; grid-auto-flow: column; gap: 4px; margin-top: 18px; padding: 4px; border-radius: 14px; background: var(--mf-sand); }
  & .mf-seg button { min-height: 38px; border: 0; border-radius: 11px; background: none; color: var(--mf-soft-2); font: 500 13px var(--mf-sans); }
  & .mf-seg button.is-on { background: var(--mf-card); color: var(--mf-plum-ink); font-weight: 600; box-shadow: var(--mf-soft-shadow); }
  & .mf-seg-plum { margin-top: 0; }

  & .mf-search { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 16px; border: 1px solid var(--mf-field); border-radius: 14px; background: var(--mf-sand); margin-top: 18px; }
  & .mf-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; color: var(--mf-ink); font: 400 15px var(--mf-sans); }
  & .mf-search input::placeholder { color: var(--mf-soft); }
  & .mf-search-row { display: flex; gap: 10px; }
  & .mf-search-row .mf-search { flex: 1; }
  & .mf-filter { --knock: var(--mf-tomato); display: grid; place-items: center; width: 52px; height: 52px; margin-top: 18px; flex: none; border: 0; border-radius: 14px; background: var(--mf-tomato); color: #fff; box-shadow: 0 4px 10px rgb(194 68 42 / 0.25); }
  & .mf-filter.is-on { outline: 3px solid var(--mf-mustard); outline-offset: 2px; }

  & .mf-field { display: flex; flex-direction: column; margin-top: 18px; min-width: 0; }
  & .mf-field .mf-label { margin-bottom: 7px; }
  & .mf-field-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
  & .mf-field-row-2 { grid-template-columns: 1fr 1fr; }
  & .mf-input { width: 100%; min-height: 48px; padding: 12px 15px; border: 1px solid var(--mf-field); border-radius: 12px; background: var(--mf-card); color: var(--mf-ink); font: 400 15px/1.4 var(--mf-sans); }
  & .mf-input::placeholder { color: var(--mf-soft); }
  & .mf-input:focus { border-color: var(--mf-plum); outline: 0; box-shadow: 0 0 0 3px var(--mf-plum-tint); }
  & textarea.mf-input { resize: none; overflow: hidden; }
  & .mf-field.is-warn .mf-input { border: 1.5px solid var(--mf-mustard-ink); background: var(--mf-mustard-tint); }
  & .mf-warn-inline { display: flex; align-items: center; gap: 5px; margin-top: 6px; color: var(--mf-mustard-ink); font-size: 12px; font-weight: 500; }

  & .mf-toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 4px 0; cursor: pointer; }
  & .mf-toggle-row b { display: block; font-size: 14.5px; font-weight: 600; }
  & .mf-switch { appearance: none; position: relative; width: 48px; height: 28px; flex: none; margin: 0; border-radius: 999px; background: var(--mf-line-2); transition: background 0.15s; cursor: pointer; }
  & .mf-switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgb(0 0 0 / 0.2); transition: transform 0.15s; }
  & .mf-switch:checked { background: var(--mf-tomato); }
  & .mf-switch-plum:checked { background: var(--mf-plum); }
  & .mf-switch-ink:checked { background: #1b1b1b; }
  & .mf-switch:checked::after { transform: translateX(20px); }

  & .mf-card-box { padding: 14px 16px; border: 1px solid var(--mf-line); border-radius: 18px; background: var(--mf-card); }
  & .mf-dashed { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 50px; margin-top: 12px; border: 1.5px dashed var(--mf-line-2); border-radius: 14px; background: none; color: var(--mf-plum-ink); font: 600 14px var(--mf-sans); cursor: pointer; }
  & .mf-x { display: grid; place-items: center; width: 30px; height: 30px; flex: none; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--mf-soft); cursor: pointer; }
  & .mf-x:hover { background: var(--mf-sand); }

  /* Little icon squares: tinted backgrounds with a colored icon. */
  & .mf-tile { display: grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: 12px; background: var(--mf-sand); color: var(--mf-ink); }
  & .mf-tile-44 { width: 44px; height: 44px; border-radius: 50%; }
  & .tile-tomato { background: var(--mf-tomato-tint-2); color: var(--mf-tomato-ink); }
  & .tile-plum { background: var(--mf-plum-tint); color: var(--mf-plum-ink); }
  & .tile-pink { background: var(--mf-plum-tint); color: var(--mf-plum-ink); }
  & .tile-mustard { background: var(--mf-mustard-tint-2); color: var(--mf-mustard-ink); }
  & .tile-mustard-solid { background: var(--mf-mustard); color: #2a211e; border-radius: 50%; }
  & .tile-green { background: var(--mf-green-tint); color: var(--mf-green); }
  & .tile-sand { background: var(--mf-sand); color: var(--mf-soft-2); }
  & .tile-solid { width: 58px; height: 58px; border-radius: 16px; background: var(--mf-tomato); color: #fff; box-shadow: 0 5px 12px rgb(194 68 42 / 0.3); }
  & .tile-plum-solid { width: 48px; height: 48px; border-radius: 14px; background: var(--mf-plum); color: #fff; }
  & .tile-ink { background: #1b1b1b; color: #fff; }

  /* ---------- Photos, cards and shelves ---------- */

  & .mf-photo { position: relative; display: grid; place-items: center; overflow: hidden; background: var(--mf-photo); color: var(--mf-photo-icon); }
  & .mf-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

  & .mf-card { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 7px; width: 104px; flex: none; padding: 6px 6px 8px; border-radius: 14px; background: var(--mf-card); box-shadow: var(--mf-card-shadow); scroll-snap-align: start; transition: transform 0.15s; }
  & .mf-card:hover { transform: translateY(-2px); }
  & .mf-card-photo { position: relative; display: block; }
  & .mf-card-photo .mf-photo { height: 76px; border-radius: 10px; }
  & .mf-card-title { display: -webkit-box; min-height: 30px; padding: 0 2px; overflow: hidden; font: 600 12.5px/1.2 var(--mf-serif); -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  & .mf-card-meta { display: flex; align-items: center; gap: 4px; padding: 0 2px; overflow: hidden; color: var(--mf-soft); font-size: 10px; font-weight: 500; white-space: nowrap; text-overflow: ellipsis; }
  & .mf-badge { position: absolute; top: 5px; right: 5px; display: grid; place-items: center; min-width: 24px; height: 24px; border-radius: 50%; background: var(--mf-card); color: var(--mf-soft-2); box-shadow: 0 1px 3px rgb(0 0 0 / 0.12); }
  & .mf-badge:has(.mf-av) { min-width: 0; background: none; box-shadow: none; }
  & .mf-badge-saved { display: grid; color: var(--mf-tomato); }
  & .mf-badge-saved path { fill: currentColor; }
  & .mf-draft { position: absolute; left: 6px; bottom: 6px; padding: 3px 8px; border-radius: 999px; background: var(--mf-mustard); color: #2a211e; font-size: 9px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }

  & .mf-shelf { margin-top: 4px; }
  & .mf-shelf-gap { height: 14px; }
  & .mf-shelf .mf-section-head { margin: 22px 0 10px; }
  & .mf-shelf .mf-h2 { font-size: 18px; }
  & .mf-shelf-row { position: relative; margin: 0 calc(-1 * var(--mf-gutter)); padding-bottom: 8px; }
  & .mf-shelf-cards { display: flex; gap: 12px; overflow-x: auto; padding: 4px var(--mf-gutter) 0; scroll-snap-type: x mandatory; scroll-padding: 0 var(--mf-gutter); scrollbar-width: none; }
  & .mf-shelf-cards::-webkit-scrollbar { display: none; }
  & .mf-grid .mf-shelf-cards { overflow: visible; }
  & .mf-grid .mf-card { width: calc((100% - 24px) / 3); max-width: 150px; }
  & .mf-grid .mf-card-photo .mf-photo { height: auto; aspect-ratio: 92 / 76; }
  & .mf-grid-row + .mf-grid-row { margin-top: 18px; }

  /* Each shelf's name sits above its row of cards as a small caption. (It was a
     wooden plank under the cards until Nov 16.) */
  & .mf-shelf-row { display: flex; flex-direction: column; }
  & .mf-plank { order: -1; margin: 0 var(--mf-gutter) 6px; }
  & .mf-plank span { display: block; color: var(--mf-soft); font: 600 10.5px/1.2 var(--mf-sans); letter-spacing: 0.12em; text-transform: uppercase; }

  & .mf-list { display: flex; flex-direction: column; gap: 10px; }
  & .mf-row { display: flex; align-items: center; gap: 12px; padding: 8px 12px 8px 8px; border-radius: 14px; background: var(--mf-card); box-shadow: var(--mf-soft-shadow); color: var(--mf-chev); }
  & .mf-row-photo .mf-photo { width: 56px; height: 56px; border-radius: 10px; }
  & .mf-row-text { flex: 1; min-width: 0; color: var(--mf-ink); }
  & .mf-row .mf-h4 { font-family: var(--mf-serif); font-weight: 600; }
  & .mf-end { margin-top: 26px; color: var(--mf-soft); font-size: 14px; text-align: center; }
  & .mf-more { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 10px; color: var(--mf-plum-ink); font-weight: 700; font-size: 14px; }

  /* ---------- Discover ---------- */

  & .mf-event-strip { display: flex; align-items: center; gap: 14px; min-height: 100px; padding: 0 16px; border-radius: 18px; background: var(--mf-plum); color: #fff; box-shadow: 0 6px 14px rgb(115 48 72 / 0.25); }
  & .mf-date-badge { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 62px; height: 68px; flex: none; border-radius: 14px; background: var(--mf-bg); color: #733048; font-size: 11px; font-weight: 600; letter-spacing: 0.08em; }
  & .mf-date-badge b { color: #2a211e; font: 600 26px/1.15 var(--mf-serif); letter-spacing: 0; }
  & .mf-event-strip-info { display: flex; flex: 1; min-width: 0; flex-direction: column; gap: 5px; }
  & .mf-event-strip-title { font: 400 20px/1.25 var(--mf-serif); }
  & .mf-event-strip-when { color: rgb(255 255 255 / 0.8); font-size: 12px; }
  & .mf-seats { display: flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 500; }
  & .mf-bar { display: inline-block; position: relative; width: 64px; height: 5px; flex: none; overflow: hidden; border-radius: 3px; background: var(--mf-line-2); }
  & .mf-bar > span { position: absolute; inset: 0 auto 0 0; border-radius: 3px; background: var(--mf-mustard); transition: width 0.3s; }
  & .mf-bar.on-dark { background: rgb(255 255 255 / 0.22); }
  & .mf-bar-ink { display: block; width: 100%; margin-top: 8px; }
  & .mf-bar-ink > span { background: #1b1b1b; }
  & .mf-rsvp { flex: none; min-height: 35px; padding: 0 14px; border: 0; border-radius: 12px; background: var(--mf-mustard); color: #2a211e; font: 600 13px/35px var(--mf-sans); letter-spacing: 0.04em; cursor: pointer; }
  & .mf-rsvp.is-in { background: rgb(255 255 255 / 0.18); color: #fff; }

  /* ---------- Saved, See all, My Kitchen ---------- */

  & .mf-promo { display: flex; align-items: center; gap: 14px; margin-top: 18px; padding: 12px; border-radius: 18px; background: var(--mf-plum); color: #fff; }
  & .mf-promo-photo .mf-photo { width: 72px; height: 72px; border-radius: 12px; background: rgb(255 255 255 / 0.16); color: rgb(255 255 255 / 0.7); }
  & .mf-promo-text { display: flex; flex: 1; min-width: 0; flex-direction: column; gap: 3px; }
  & .mf-promo-text .mf-eyebrow { color: var(--mf-mustard-on-plum); letter-spacing: 0.04em; font-size: 10px; }
  & .mf-promo-title { font: 400 17px/1.2 var(--mf-serif); }
  & .mf-promo-sub { color: rgb(255 255 255 / 0.75); font-size: 12px; }
  & .mf-promo-go { flex: none; padding: 9px 12px; border-radius: 12px; background: var(--mf-mustard); color: #2a211e; font-size: 13px; font-weight: 700; }
  & .mf-sortrow { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 18px; }
  & .mf-sortrow .mf-muted { margin-right: 2px; }
  & .mf-sortrow .mf-chip svg path { stroke: currentColor; }
  & .mf-stats3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 18px; }
  & .mf-stats3 > div { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 12px 6px; border: 1px solid var(--mf-line); border-radius: 16px; background: var(--mf-card); }
  & .mf-stats3 b { font: 400 22px/1.2 var(--mf-serif); }
  & .mf-stats3 span { color: var(--mf-soft); font-size: 11px; }
  & .mf-decide { display: flex; align-items: center; gap: 12px; width: 100%; margin-top: 18px; padding: 12px 14px; border: 0; border-radius: 16px; background: var(--mf-mustard-tint); color: var(--mf-ink); text-align: left; cursor: pointer; }
  & .mf-decide-text { flex: 1; display: flex; flex-direction: column; }
  & .mf-decide-text b { font-size: 14px; }
  & .mf-decide-text span { color: var(--mf-soft-2); font-size: 12.5px; }
  & .mf-decide-go { display: flex; align-items: center; gap: 2px; color: var(--mf-plum-ink); font-size: 13px; font-weight: 700; }
  & .mf-decide .tile-mustard { background: var(--mf-mustard); color: #2a211e; border-radius: 12px; }
  & #shelf-body { margin-top: 18px; }

  /* ---------- Events ---------- */

  & .mf-days { display: flex; gap: 8px; margin: 16px calc(-1 * var(--mf-gutter)) 0; padding: 2px var(--mf-gutter) 4px; overflow-x: auto; scrollbar-width: none; }
  & .mf-day { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 52px; flex: 1; padding: 9px 4px 8px; border: 1px solid var(--mf-line); border-radius: 14px; background: var(--mf-card); color: var(--mf-soft); font: 600 10px var(--mf-sans); letter-spacing: 0.06em; cursor: pointer; }
  & .mf-day b { color: var(--mf-ink); font: 400 22px/1.15 var(--mf-serif); letter-spacing: 0; }
  & .mf-day i { width: 5px; height: 5px; border-radius: 50%; background: var(--mf-plum); }
  & .mf-day i[hidden] { display: block; visibility: hidden; }
  & .mf-day.is-on { border-color: var(--mf-plum); background: var(--mf-plum); color: rgb(255 255 255 / 0.8); box-shadow: 0 6px 14px rgb(115 48 72 / 0.25); }
  & .mf-day.is-on b { color: #fff; }
  & .mf-day.is-on i { background: #fff; }

  & .mf-feature { position: relative; margin-top: 18px; overflow: hidden; border-radius: 22px; background: var(--mf-card); box-shadow: var(--mf-card-shadow); }
  & .mf-feature-photo { display: block; }
  & .mf-feature-photo .mf-photo { height: 118px; }
  & .mf-feature-chip { position: absolute; top: 14px; left: 14px; padding: 5px 10px; border-radius: 999px; background: var(--mf-card); color: var(--mf-plum-ink); font-size: 10.5px; font-weight: 700; letter-spacing: 0.06em; }
  & .mf-feature-save { position: absolute; top: 12px; right: 12px; width: 36px; height: 36px; background: var(--mf-card); }
  & .mf-feature-body { display: flex; flex-direction: column; gap: 12px; padding: 18px 16px 16px; }
  & .mf-feature-title { font: 400 23px/1.2 var(--mf-serif); }
  & .mf-host-line { display: flex; align-items: center; gap: 7px; color: var(--mf-soft); font-size: 12.5px; }
  & .mf-host-line > .mf-av + span { color: var(--mf-ink); font-weight: 500; }
  & .mf-dotsep { color: var(--mf-line-2); }
  & .mf-feature-foot { display: flex; align-items: center; gap: 12px; }
  & .mf-seats-block { display: flex; flex: 1; flex-direction: column; gap: 6px; font-size: 12px; }
  & .mf-seats-block b { font-weight: 600; }
  & .mf-seats-block .mf-bar { width: 76px; }
  & .mf-empty-card { display: flex; flex-direction: column; align-items: center; gap: 14px; margin-top: 18px; padding: 28px 18px; border: 1.5px dashed var(--mf-line-2); border-radius: 22px; color: var(--mf-soft); text-align: center; }

  & .mf-event-list { display: flex; flex-direction: column; gap: 10px; }
  & .mf-event-row { display: flex; align-items: center; gap: 14px; padding: 12px; border: 1px solid var(--mf-line); border-radius: 18px; background: var(--mf-card); }
  & .mf-date-tile { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 50px; height: 56px; flex: none; border-radius: 12px; background: var(--mf-sand); color: var(--mf-plum-ink); font-size: 9.5px; font-weight: 700; letter-spacing: 0.08em; }
  & .mf-date-tile b { color: var(--mf-ink); font: 400 22px/1.15 var(--mf-serif); letter-spacing: 0; }
  & .mf-event-row-text { flex: 1; min-width: 0; }
  & .mf-event-row-text .mf-small { margin-top: 3px; }

  /* An event's page shares the recipe page's hero and body. */
  & .mf-hero-plum .mf-photo { background: var(--mf-plum-tint-2); }
  & .mf-host { display: flex; align-items: center; gap: 12px; margin-top: 14px; }
  & .mf-host b { display: block; font-size: 15px; font-weight: 600; }
  & .mf-info { margin-top: 18px; padding: 4px 16px; border: 1px solid var(--mf-line); border-radius: 20px; background: var(--mf-card); }
  & .mf-info-row { display: flex; align-items: center; gap: 14px; padding: 14px 0; }
  & .mf-info-row + .mf-info-row { border-top: 1px solid var(--mf-line); }
  & .mf-info-row b { display: block; font-size: 14.5px; font-weight: 600; }
  & .mf-info-row .mf-small { margin-top: 3px; display: flex; align-items: center; gap: 4px; }
  & .mf-info-row .mf-seats { margin-top: 6px; }
  & .mf-info-row .mf-bar { width: 80px; }
  & .mf-map { position: relative; height: 120px; margin-top: 14px; overflow: hidden; border-radius: 20px; background:
      linear-gradient(175deg, transparent 42%, var(--mf-card) 42% 47%, transparent 47%),
      linear-gradient(90deg, transparent 31%, var(--mf-card) 31% 33%, transparent 33%),
      linear-gradient(90deg, transparent 67%, var(--mf-card) 67% 68.5%, transparent 68.5%),
      radial-gradient(ellipse at 18% 88%, #d5dfc4 0 14%, transparent 15%),
      radial-gradient(ellipse at 86% 92%, #d5dfc4 0 12%, transparent 13%),
      var(--mf-photo); opacity: 0.9; }
  & .mf-map-pin { position: absolute; left: 50%; top: 50%; display: grid; place-items: center; width: 88px; height: 88px; margin: -44px; border: 1.5px dashed var(--mf-plum); border-radius: 50%; background: rgb(115 48 72 / 0.14); color: #fff; }
  & .mf-map-pin::before { content: ""; position: absolute; width: 28px; height: 28px; border-radius: 50%; background: var(--mf-plum); }
  & .mf-map-pin .ic { position: relative; }
  & .mf-going { display: flex; align-items: center; gap: 12px; }
  & .mf-going b { display: block; font-size: 14px; font-weight: 600; }
  & .mf-menu { display: flex; flex-direction: column; padding: 4px 14px; }
  & .mf-menu-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; color: var(--mf-chev); }
  & .mf-menu-row + .mf-menu-row { border-top: 1px solid var(--mf-line); }
  & .mf-menu-row .mf-grow { color: var(--mf-ink); }
  & .mf-menu-photo { width: 52px; height: 52px; flex: none; border-radius: 12px; }
  & .mf-course { display: block; padding: 0; border: 0; background: none; color: var(--mf-tomato-ink); font: 700 9.5px var(--mf-sans); letter-spacing: 0.1em; text-transform: uppercase; }
  & .mf-course-btn { cursor: pointer; text-decoration: underline dotted; text-underline-offset: 3px; }
  & .mf-menu .mf-h4 { font: 400 17px/1.25 var(--mf-serif); }
  & .mf-bring { padding: 4px 16px; }
  & .mf-bring-row { display: flex; align-items: center; gap: 10px; min-height: 52px; font-size: 14.5px; }
  & .mf-bring-row + .mf-bring-row { border-top: 1px solid var(--mf-line); }
  & .mf-who { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; }
  & .mf-claim { padding: 7px 12px; border: 1.5px solid var(--mf-plum); border-radius: 10px; background: none; color: var(--mf-plum-ink); font: 600 12.5px var(--mf-sans); cursor: pointer; }
  & .mf-claim.is-mine { border-color: var(--mf-green); background: var(--mf-green-tint); color: var(--mf-green); }

  /* Hosting form */
  & .mf-cover { display: flex; align-items: center; gap: 14px; position: relative; min-height: 130px; margin-top: 22px; padding: 18px 48px; overflow: hidden; border: 1.5px dashed var(--mf-plum); border-radius: 20px; background: var(--mf-plum-tint); cursor: pointer; }
  & .mf-cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0.35; }
  & .mf-cover > span { position: relative; }
  & .mf-cover-title { display: block; color: var(--mf-plum-ink); font-size: 14px; font-weight: 600; }
  & .mf-host-form .mf-h2 { margin-top: 28px; font-size: 23px; }
  & .mf-host-form .mf-section-head .mf-h2 { margin-top: 0; }
  & .mf-host-form .mf-label { margin-top: 18px; }
  & .mf-chip-plum.is-on { border-color: var(--mf-plum); background: var(--mf-plum); }
  & .mf-guests { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px 12px; }
  & .mf-guest-names { grid-column: 1 / -1; color: var(--mf-ink); font-size: 14px; font-weight: 600; }
  & .mf-seat-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; }
  & .mf-seat-row b { display: block; font-size: 14.5px; font-weight: 600; }
  & .mf-host-form .mf-toggle-row.mf-card-box { margin-top: 12px; }

  /* ---------- The recipe page (and an event's page) ---------- */

  & .mf-detail { padding-top: 0; }
  & .mf-hero { position: relative; margin: 0 calc(-1 * var(--mf-gutter)); }
  & .mf-hero-photo { height: 300px; }
  & .mf-hero-photo .ic { width: 32px; height: 32px; margin-bottom: 120px; }
  & .mf-hero-bar { position: absolute; inset: 12px var(--mf-gutter) auto; display: flex; gap: 12px; }
  & .mf-hero-bar .mf-round { width: 40px; height: 40px; background: var(--mf-bg); box-shadow: var(--mf-soft-shadow); }
  /* The back arrow stays in the corner while you scroll a recipe or a dinner, since
     those pages hide the tab bar. */
  & .mf-detail .mf-hero-bar .mf-back { position: fixed; z-index: 26; top: calc(12px + env(safe-area-inset-top, 0px)); left: max(var(--mf-gutter), calc((100vw - 720px) / 2 + 24px)); }
  & .mf-body { position: relative; margin: -50px calc(-1 * var(--mf-gutter)) 0; padding: 26px var(--mf-gutter) 0; border-radius: 28px 28px 0 0; background: var(--mf-bg); }
  & .mf-recipe-title { margin-top: 14px; font: 400 30px/1.2 var(--mf-serif); letter-spacing: -0.01em; }
  & .mf-byline { display: flex; align-items: center; gap: 8px; margin-top: 12px; color: var(--mf-soft); font-size: 13px; }
  & .mf-byline b { color: var(--mf-ink); font-weight: 600; }
  & .mf-desc { margin-top: 12px; color: var(--mf-soft); font-size: 14.5px; line-height: 1.45; }
  & .mf-stats4 { display: grid; grid-auto-columns: 1fr; grid-auto-flow: column; gap: 8px; margin-top: 18px; }
  & .mf-stats4 > div { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 4px; border: 1px solid var(--mf-line); border-radius: 16px; background: var(--mf-card); }
  & .mf-stats4 span { color: var(--mf-soft); font-size: 9.5px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; }
  & .mf-stats4 b { font: 400 17px/1.2 var(--mf-serif); text-align: center; }
  & .mf-callout { display: flex; gap: 10px; margin-top: 14px; padding: 12px 14px; border-radius: 14px; background: var(--mf-mustard-tint); color: var(--mf-mustard-ink); font-size: 13px; }
  & .mf-detail .mf-section .mf-h2 { font-size: 23px; }
  & .mf-stepper { display: inline-flex; align-items: center; gap: 4px; padding: 3px; border-radius: 999px; background: var(--mf-card); border: 1px solid var(--mf-line); font-size: 13px; font-weight: 600; }
  & .mf-stepper > span, & .mf-stepper > b { min-width: 74px; text-align: center; }
  & .mf-stepper > b { min-width: 36px; font: 400 20px var(--mf-serif); }
  & .mf-stepper button { display: grid; place-items: center; width: 30px; height: 30px; padding: 0; border: 0; border-radius: 50%; background: var(--mf-sand); color: var(--mf-ink); cursor: pointer; }
  & .mf-stepper button.is-accent { background: var(--mf-tomato); color: #fff; }
  & .mf-stepper-plum button.is-accent { background: var(--mf-plum); }
  & .mf-group { margin: 14px 0 2px; color: var(--mf-tomato-ink); font-size: 10.5px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; }
  & .mf-ings li + li { border-top: 1px solid var(--mf-line); }
  & .mf-ing { display: grid; grid-template-columns: 20px minmax(70px, min(30%, 140px)) 1fr; align-items: center; gap: 12px; min-height: 45px; padding: 8px 0; cursor: pointer; font-size: 15px; }
  & .mf-ing input { position: absolute; opacity: 0; pointer-events: none; }
  & .mf-check { display: grid; place-items: center; width: 20px; height: 20px; border: 1.5px solid var(--mf-chev); border-radius: 50%; color: transparent; }
  & .mf-ing input:checked + .mf-check, & .mf-pick input:checked + .mf-check { border-color: var(--mf-green); background: var(--mf-green); color: var(--mf-on-green); }
  & .mf-ing input:checked ~ .mf-amt, & .mf-ing input:checked ~ .mf-ing-name { color: var(--mf-soft); text-decoration: line-through; }
  & .mf-ing input:focus-visible + .mf-check { outline: 2px solid var(--mf-tomato); outline-offset: 2px; }
  & .mf-amt { font-weight: 600; }
  & .mf-steps { display: flex; flex-direction: column; gap: 18px; }
  & .mf-steps li { display: grid; grid-template-columns: 30px 1fr; gap: 14px; font-size: 15px; line-height: 1.47; }
  & .mf-num { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--mf-tomato); color: #fff; font-size: 13px; font-weight: 700; }
  & .mf-steps .amt { padding: 0; border: 0; border-radius: 0; background: none; color: var(--mf-tomato-ink); font-weight: 600; }
  & .mf-timer { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; padding: 5px 11px; border: 0; border-radius: 999px; background: var(--mf-sand); color: var(--mf-ink); font: 600 12px var(--mf-sans); cursor: pointer; }
  & .mf-timer.is-running { background: var(--mf-tomato); color: #fff; font-variant-numeric: tabular-nums; }
  & .mf-timer.is-done { background: var(--mf-green); color: var(--mf-on-green); }
  & .mf-timer.is-static { cursor: default; }
  & .mf-note { margin-top: 26px; padding: 16px; border-radius: 4px; background: var(--mf-mustard-tint-2); }
  & .mf-note p + p { margin-top: 6px; font-size: 14.5px; line-height: 1.45; }
  & .mf-party { display: flex; align-items: center; gap: 14px; margin-top: 22px; padding: 18px; border-radius: 4px; background: var(--mf-plum); color: #fff; }
  & .mf-party > span:first-child { flex: 1; }
  & .mf-party-title { display: block; font: 400 19px/1.2 var(--mf-serif); }
  & .mf-party-sub { display: block; margin-top: 4px; color: rgb(255 255 255 / 0.78); font-size: 12.5px; }
  & .mf-party-go { padding: 9px 14px; border-radius: 10px; background: var(--mf-mustard); color: #2a211e; font-size: 13px; font-weight: 600; }

  /* The bar that stays at the bottom of a focused screen. */
  & .mf-sticky { position: fixed; z-index: 25; left: 0; right: 0; bottom: 0; display: flex; gap: 10px; padding: 14px var(--mf-gutter) calc(14px + var(--safe-b)); border-top: 1px solid var(--mf-line); background: var(--mf-card); box-shadow: var(--mf-sheet-shadow); }
  & .mf-sticky > .mf-btn:first-child:not(:only-child) { flex: 0 0 auto; min-width: 116px; }
  & .mf-sticky > .mf-btn:last-child { flex: 1; }
  & .mf-sticky-stack { flex-direction: column; align-items: stretch; }

  /* ---------- Adding a recipe ---------- */

  & .mf-upload { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-top: 22px; padding: 26px 20px 22px; border: 1.5px dashed #e3988a; border-radius: 22px; background: var(--mf-tomato-tint); text-align: center; }
  & .mf-upload .mf-h2 { margin-top: 8px; font-size: 21px; }
  & .mf-upload .mf-small { max-width: 290px; }
  & .mf-upload-btns { display: flex; gap: 10px; margin-top: 10px; }
  & .mf-upload-btns .mf-btn { min-height: 40px; cursor: pointer; }
  & .mf-divider { display: flex; align-items: center; gap: 12px; margin: 26px 0 14px; color: var(--mf-soft); font-size: 10.5px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; }
  & .mf-divider::before, & .mf-divider::after { content: ""; flex: 1; height: 1px; background: var(--mf-line-2); }
  & .mf-options { display: flex; flex-direction: column; gap: 10px; }
  & .mf-option { display: flex; align-items: center; gap: 14px; padding: 14px; border: 1px solid var(--mf-line); border-radius: 18px; background: var(--mf-card); color: var(--mf-chev); cursor: pointer; }
  & .mf-option > span:nth-child(2) { flex: 1; color: var(--mf-ink); }
  & .mf-option .mf-tile { width: 46px; height: 46px; }
  & .mf-footnote { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: auto; padding-top: 28px; color: var(--mf-soft); font-size: 12px; }

  /* Review form */
  & .mf-found { display: flex; gap: 12px; margin-top: 18px; padding: 14px; border-radius: 16px; background: var(--mf-mustard-tint); }
  & .mf-found > span:last-child { display: flex; flex-direction: column; gap: 3px; font-size: 12.5px; color: var(--mf-mustard-ink); }
  & .mf-found b { color: var(--mf-ink); font-size: 14px; }
  & .mf-found-item { color: var(--mf-soft-2); }
  & .mf-photo-row { display: flex; gap: 12px; margin-top: 18px; }
  & .mf-add-photo { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 150px; padding: 16px; overflow: hidden; border: 1.5px dashed #e3988a; border-radius: 18px; background: var(--mf-tomato-tint); text-align: center; cursor: pointer; }
  & .mf-add-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
  & .mf-add-photo.has-photo > :not(img) { position: relative; padding: 2px 8px; border-radius: 8px; background: rgb(255 253 248 / 0.88); }
  & .mf-add-photo.has-photo .tile-solid { display: none; }
  & .mf-add-photo .tile-solid { width: 46px; height: 46px; border-radius: 13px; }
  & .mf-add-photo-title { color: var(--mf-tomato-ink); font-size: 13px; font-weight: 600; }
  & .mf-original { position: relative; width: 108px; flex: none; margin: 0; overflow: hidden; border-radius: 18px; background: #2a211e; }
  & .mf-original img { width: 100%; height: 100%; object-fit: cover; opacity: 0.9; }
  & .mf-original figcaption { position: absolute; left: 8px; bottom: 8px; padding: 3px 9px; border-radius: 999px; background: rgb(0 0 0 / 0.55); color: #fff; font-size: 11px; font-weight: 600; }
  & .mf-ing-rows { display: flex; flex-direction: column; gap: 10px; }
  & .mf-igroup + .mf-igroup, & .mf-sgroup + .mf-sgroup { margin-top: 18px; }
  & .mf-group-name { margin-bottom: 10px; color: var(--mf-tomato-ink); font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
  & .mf-ing-edit { display: grid; grid-template-columns: 30% 1fr 30px; align-items: center; gap: 8px; }
  & .mf-ing-edit .mf-amt-in { font-weight: 600; }
  & .mf-warn { display: none; grid-column: 1 / -1; align-items: center; gap: 6px; color: var(--mf-mustard-ink); font-size: 12px; font-weight: 500; }
  & .mf-ing-edit.is-warn .mf-warn { display: flex; }
  & .mf-ing-edit.is-warn .mf-amt-in { border: 1.5px solid var(--mf-mustard); background: var(--mf-mustard-tint); }
  & .mf-step-edits { display: flex; flex-direction: column; gap: 12px; counter-reset: step; }
  & .mf-step-edit { display: grid; grid-template-columns: 30px 1fr 30px; align-items: start; gap: 10px; counter-increment: step; }
  & .mf-step-edit .mf-num { margin-top: 9px; width: 26px; height: 26px; font-size: 12px; }
  & .mf-step-edit .mf-num::before { content: counter(step); }
  & .mf-step-box { display: flex; flex-direction: column; align-items: flex-start; padding: 0; border: 1px solid var(--mf-field); border-radius: 14px; background: var(--mf-card); }
  & .mf-step-box .mf-input { border: 0; background: none; box-shadow: none; font-size: 14.5px; line-height: 1.45; }
  & .mf-step-box .mf-timer { margin: -4px 0 12px 14px; }
  & .mf-step-box .mf-timer[hidden] { display: none; }
  & .mf-step-edit .mf-x { margin-top: 9px; }
  & .mf-form > .mf-toggle-row.mf-card-box { margin-top: 18px; }
  & .mf-form .mf-danger { margin-top: 22px; }

  /* ---------- People ---------- */

  & .mf-account-head { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; }
  & .mf-account-photo { position: relative; margin-bottom: 8px; }
  & .mf-account-head .mf-title { font-size: 26px; }
  & .mf-cam { position: absolute; right: -2px; bottom: 2px; display: grid; place-items: center; width: 32px; height: 32px; border: 2px solid var(--mf-bg); border-radius: 50%; background: var(--mf-card); color: var(--mf-ink); }
  & .mf-friends-card { margin-top: 14px; padding: 16px; }
  & .mf-friends-card .mf-section-head { margin: 0 0 14px; }
  & .mf-friends-card .mf-going { margin-bottom: 16px; }
  & .mf-friends-card .mf-btn { min-height: 46px; }
  & .mf-account .mf-label { margin: 26px 0 8px; }
  & .mf-list-box { padding: 4px 14px; }
  & .mf-list-row { display: flex; align-items: center; gap: 14px; min-height: 58px; color: var(--mf-chev); }
  & .mf-list-row + .mf-list-row { border-top: 1px solid var(--mf-line); }
  & .mf-list-row .mf-grow { color: var(--mf-ink); }
  & .mf-account > .mf-link { margin-top: 26px; font-size: 15px; }

  & .mf-notifs { display: flex; flex-direction: column; margin: 0 -12px; }
  & .mf-notif { position: relative; display: flex; align-items: flex-start; gap: 12px; padding: 14px 12px; border-radius: 18px; font-size: 14px; line-height: 1.4; }
  & .mf-notif + .mf-notif:not(.is-new) { border-top: 1px solid var(--mf-line); border-radius: 0; }
  & .mf-notif.is-new { margin-bottom: 8px; background: var(--mf-plum-tint); }
  & .mf-notif b { font-weight: 700; }
  & .mf-notif .mf-small { margin-top: 4px; display: flex; align-items: center; gap: 4px; }
  & .mf-notif .mf-red-dot { margin: 6px 0 0; }
  & .mf-note-thumb .mf-photo { width: 48px; height: 48px; border-radius: 10px; }
  & .mf-quote { display: inline-block; margin-top: 8px; padding: 8px 12px; border-radius: 10px; background: var(--mf-sand); font-style: italic; font-size: 13px; }
  & .mf-screen > .mf-eyebrow { margin: 22px 0 8px; }
  & .mf-screen > .mf-chips { margin-top: 16px; }
  & .mf-caught { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-top: 28px; color: var(--mf-soft); font-size: 13px; }
  & .mf-caught span { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--mf-sand); color: var(--mf-soft-2); }

  & .mf-invite-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
  & .mf-invite { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 14px; border: 1px solid var(--mf-line); border-radius: 18px; background: var(--mf-card); color: var(--mf-ink); text-align: left; font: inherit; cursor: pointer; }
  & .mf-invite .mf-tile { margin-bottom: 8px; }
  & .mf-invite b { font-size: 14px; }
  & #friends-body > .mf-h2 { margin-top: 28px; font-size: 21px; }
  & #friends-body > .mf-sub { margin: 2px 0 12px; }
  & .mf-people { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
  & .mf-person { display: flex; align-items: center; gap: 14px; padding: 12px 14px; }
  & .mf-person b { display: block; font-size: 15px; font-weight: 700; }
  & .mf-person .mf-small { display: flex; align-items: center; gap: 4px; margin-top: 2px; }
  & .mf-row-actions { display: flex; align-items: center; gap: 8px; }
  & .mf-friends-foot { display: flex; align-items: center; gap: 14px; margin-top: 26px; padding: 14px 16px; border-radius: 18px; background: var(--mf-sand); }
  & .mf-friends-foot b { display: block; font-size: 14px; }
  & .mf-friends-foot .mf-see { text-decoration: none; font-weight: 700; }

  /* ---------- Sheets, splash, done ---------- */

  & .mf-add-overlay { position: fixed; z-index: 60; inset: 0; display: flex; align-items: flex-end; justify-content: center; }
  & .mf-scrim { position: absolute; inset: 0; border: 0; background: rgb(42 33 30 / 0.28); backdrop-filter: blur(8px); }
  & .mf-sheet { position: relative; display: flex; flex-direction: column; gap: 6px; width: 100%; max-width: 560px; max-height: 88dvh; overflow-y: auto; padding: 12px var(--mf-gutter) calc(28px + var(--safe-b)); border-radius: 28px 28px 0 0; background: var(--mf-bg); box-shadow: var(--mf-sheet-shadow); animation: mf-up 0.25s cubic-bezier(0.2, 0.8, 0.2, 1); }
  & .mf-handle { align-self: center; width: 40px; height: 5px; margin-bottom: 14px; border-radius: 3px; background: var(--mf-line-2); }
  & .mf-sheet > .mf-sub { margin-bottom: 14px; }
  & .mf-sheet .mf-label { margin-top: 10px; }
  & .mf-sheet .mf-toggle-row { margin: 18px 0; }
  & .mf-add-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 10px; }
  & .mf-add-card { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 16px; border: 1px solid var(--mf-line); border-radius: 22px; background: var(--mf-card); box-shadow: var(--mf-soft-shadow); }
  & .mf-add-card .mf-tile { width: 52px; height: 52px; margin-bottom: 14px; border-radius: 14px; }
  & .mf-add-card .mf-h3 { font-size: 20px; }
  & .mf-add-go { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; color: var(--mf-tomato-ink); font-size: 13px; font-weight: 700; }
  & .mf-add-card.is-plum .mf-add-go { color: var(--mf-plum-ink); }
  & .mf-close { align-self: center; display: grid; place-items: center; width: 58px; height: 58px; margin-top: 26px; border: 0; border-radius: 18px; background: #2a211e; color: #fff; cursor: pointer; }
  & .mf-pick-list { display: flex; flex-direction: column; margin: 6px 0 14px; }
  & .mf-pick { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 60px; padding: 8px 0; border: 0; border-bottom: 1px solid var(--mf-line); background: none; color: var(--mf-ink); font: inherit; text-align: left; cursor: pointer; }
  & .mf-pick b { display: block; font-weight: 600; }
  & .mf-pick input { position: absolute; opacity: 0; }

  & .mf-splash { position: fixed; z-index: 80; inset: 0; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 12px; padding: 0 30px; background: var(--mf-bg); }
  & .mf-splash-line { color: var(--mf-plum-ink); font: 400 36px/1.23 var(--mf-serif); }
  & .mf-splash-line.in { animation: mf-fade 0.5s ease both; }
  & .mf-splash-note { color: var(--mf-soft); font-size: 14px; }

  & .mf-done-body { display: flex; flex: 1; flex-direction: column; align-items: center; justify-content: center; gap: 12px; text-align: center; }
  & .mf-big-check { display: grid; place-items: center; width: 84px; height: 84px; border-radius: 50%; background: var(--mf-green); color: var(--mf-on-green); }
  & .mf-done-body .mf-btn { margin-top: 18px; }

  /* ---------- Welcome ---------- */

  & .mf-welcome { justify-content: center; gap: 0; padding-top: 32px; }
  & .mf-welcome-art { position: relative; height: 380px; margin: 0 -10px; }
  & .mf-logo-big { position: absolute; top: 0; left: 6px; width: 220px; height: 110px; }
  & .mf-welcome-event { position: absolute; top: 112px; right: 14px; display: flex; flex-direction: column; justify-content: space-between; width: 150px; height: 154px; padding: 14px 16px; border-radius: 18px; background: var(--mf-plum); color: #fff; transform: rotate(6deg); }
  & .mf-welcome-event .mf-small { color: rgb(255 255 255 / 0.85); font-size: 11px; }
  & .mf-welcome-event-title { margin-bottom: auto; padding-top: 4px; font: 400 17px/1.2 var(--mf-serif); }
  & .mf-welcome-event .mf-small:last-child { align-self: flex-end; }
  & .mf-welcome-recipe { position: absolute; top: 178px; left: 30px; display: flex; flex-direction: column; width: 168px; height: 170px; padding: 14px; border-radius: 18px; background: #f2e8da; color: #2a211e; box-shadow: var(--mf-card-shadow); transform: rotate(-5deg); }
  & .mf-welcome-noodles { flex: 1; margin-bottom: 8px; border: 6px solid #dbb88f; border-radius: 14px; background: #fffdf8 url(/midfi/noodle.png) center / 190% no-repeat; }
  & .mf-welcome-recipe-title { color: #a83a22; font: 400 15px/1.2 var(--mf-serif); }
  & .mf-welcome-recipe .mf-small { color: #2a211e; font-size: 10px; }
  & .mf-welcome-title { font: 400 34px/1.2 var(--mf-serif); letter-spacing: -0.01em; }
  & .mf-welcome-title em { display: block; color: var(--mf-plum-ink); font-style: normal; font-weight: 600; }
  & .mf-welcome-sub { margin-top: 12px; font-size: 15px; line-height: 1.4; }
  & .mf-welcome-actions { display: flex; flex-direction: column; gap: 14px; margin: 46px 0 20px; padding: 0 12px; }
  & .mf-welcome-actions .mf-btn { min-height: 48px; border-radius: 10px; font-weight: 400; font-size: 18px; }
  & .mf-welcome-actions .mf-btn-outline { border-color: var(--mf-ink); background: none; }

  /* ---------- Send to Cookbook ---------- */

  & .mf-send .mf-device-row { display: flex; align-items: center; gap: 12px; margin-top: 18px; }
  & .mf-send .mf-device-row b { display: block; font-size: 14.5px; }
  & .mf-send .mf-label { margin-top: 22px; }
  & .mf-toggles { display: flex; flex-direction: column; gap: 4px; margin-top: 16px; padding: 8px 16px; }
  & .mf-toggles .mf-toggle-row { padding: 8px 0; }
  & .mf-toggles .mf-toggle-row + .mf-toggle-row { border-top: 1px solid var(--mf-line); }
  & .mf-paper-wrap { display: flex; justify-content: center; margin-top: 18px; }
  & .mf-paper { display: flex; flex-direction: column; width: 100%; max-width: 300px; aspect-ratio: 3 / 4; padding: 14px 14px 10px; border: 1px solid #d7d5d0; border-radius: 4px; background: #f1efea; color: #1b1b1b; font-size: 8.5px; box-shadow: 0 6px 18px rgb(0 0 0 / 0.08); }
  & .mf-paper-head { display: flex; justify-content: space-between; padding-bottom: 6px; border-bottom: 1px solid #1b1b1b; font-size: 7.5px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }
  & .mf-paper-title { margin-top: 10px; font: 400 18px/1.15 var(--mf-serif); }
  & .mf-paper-meta { margin-top: 3px; color: #5e5e5e; }
  & .mf-paper-photo { display: grid; place-items: center; height: 70px; margin-top: 8px; overflow: hidden; position: relative; background: #d7d5d0; color: #8a8a8a; }
  & .mf-paper-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: grayscale(1) contrast(0.9); }
  & .mf-paper-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 8px; flex: 1; overflow: hidden; line-height: 1.35; }
  & .mf-paper-label { margin-bottom: 4px; font-size: 7px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
  & .mf-paper-cols li { display: flex; gap: 4px; margin-bottom: 2px; }
  & .mf-paper-cols li i { width: 6px; height: 6px; flex: none; margin-top: 2px; border: 1px solid #1b1b1b; }
  & .mf-paper-cols ol { list-style: decimal; padding-left: 12px; }
  & .mf-paper-cols ol li { display: list-item; }
  & .mf-paper-foot { display: flex; align-items: center; justify-content: space-between; padding-top: 6px; color: #5e5e5e; font-size: 7.5px; }
  & .mf-paper-key { padding: 2px 8px; border: 1px solid #1b1b1b; border-radius: 999px; color: #1b1b1b; }
  & .mf-paper-progress { display: flex; gap: 4px; margin-top: 8px; }
  & .mf-paper-progress i { flex: 1; height: 3px; background: #d7d5d0; }
  & .mf-paper-progress i.is-on { background: #1b1b1b; }
  & .mf-paper-num { margin-top: 12px; font: 400 44px/1 var(--mf-serif); }
  & .mf-paper-step { margin-top: 10px; flex: 1; font: 400 15px/1.35 var(--mf-serif); }
  & .mf-paper.is-large .mf-paper-step { font-size: 18px; }
  & .mf-paper.is-large .mf-paper-cols { font-size: 9.5px; }
  & .mf-paper-timer { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; padding: 8px 10px; border: 1.5px solid #1b1b1b; border-radius: 6px; }
  & .mf-paper-timer b { font: 600 20px var(--mf-sans); }
  & .mf-paper-timer span { margin-left: auto; max-width: 70px; color: #5e5e5e; font-size: 7px; text-align: right; }
  & .mf-page-dots { display: flex; justify-content: center; gap: 6px; margin-top: 16px; }
  & .mf-page-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--mf-line-2); }
  & .mf-page-dots i.is-on { width: 18px; border-radius: 4px; background: var(--mf-ink); }
  & .mf-page-label { margin-top: 8px; font-size: 12.5px; font-weight: 600; text-align: center; }
  & .mf-send-check .mf-see { margin-top: 8px; display: inline-flex; gap: 4px; align-items: center; }
  & .mf-seen { display: flex; align-items: center; gap: 6px; align-self: center; margin-top: 14px; padding: 6px 12px; border-radius: 999px; background: var(--mf-sand); font-size: 12px; font-weight: 500; }
  & .mf-device { position: relative; width: 140px; height: 180px; margin: 10px auto 22px; padding: 14px 12px 26px; border: 1px solid #d3cbbe; border-radius: 16px; background: #e7e2d8; box-shadow: var(--mf-soft-shadow); }
  & .mf-device-screen { display: flex; flex-direction: column; gap: 6px; height: 100%; padding: 12px 10px; border-radius: 4px; background: #f1efea; }
  & .mf-device-screen i { display: block; height: 3px; background: #5e5e5e; }
  & .mf-device-screen i.w60 { width: 60%; height: 5px; background: #1b1b1b; }
  & .mf-device-screen i.w40 { width: 40%; height: 5px; background: #1b1b1b; }
  & .mf-device-screen i.w80 { width: 80%; }
  & .mf-device-screen span { flex: 1; background: #d7d5d0; }
  & .mf-device-brand { position: absolute; left: 0; right: 0; bottom: 8px; color: #8a8a8a; font-size: 8px; text-align: center; }
  & .mf-device-check { position: absolute; top: -10px; right: -10px; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: #1b1b1b; color: #fff; }
  & .mf-device-wifi { position: absolute; top: -4px; right: -26px; width: 18px; height: 18px; border: 3px solid transparent; border-top-color: var(--mf-soft); border-radius: 50%; animation: mf-pulse 1.2s ease-in-out infinite; }
  & .mf-sending .mf-title, & .mf-sending .mf-sub { text-align: center; }
  & .mf-stages { display: flex; flex-direction: column; margin-top: 18px; padding: 4px 16px; }
  & .mf-stage { display: flex; align-items: center; gap: 12px; min-height: 44px; color: var(--mf-soft); font-size: 13.5px; }
  & .mf-stage + .mf-stage { border-top: 1px solid var(--mf-line); }
  & .mf-stage-dot { width: 18px; height: 18px; flex: none; border: 1.5px dashed var(--mf-line-2); border-radius: 50%; }
  & .mf-stage.is-active { color: var(--mf-ink); }
  & .mf-stage.is-active .mf-stage-dot { border: 2px solid var(--mf-ink); border-right-color: transparent; animation: mf-spin 0.8s linear infinite; }
  & .mf-stage.is-done { color: var(--mf-ink); }
  & .mf-stage.is-done .mf-stage-dot { border: 0; background: #1b1b1b url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18'%3E%3Cpath d='M5 9.4l2.6 2.6L13 6.5' fill='none' stroke='white' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 14px no-repeat; }
  & .mf-progress { display: flex; justify-content: space-between; margin-top: 18px; font-size: 12px; font-weight: 600; }
  & .mf-sending > div > .mf-link { display: block; margin-top: 24px; }
  & .mf-landed { margin-top: 18px; padding: 4px 16px; }
  & .mf-landed-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; }
  & .mf-landed-row + .mf-landed-row { border-top: 1px solid var(--mf-line); }
  & .mf-landed-row b { display: block; font-size: 14px; }
  & .mf-sticky-stack .mf-link { padding: 8px; text-align: center; }

  /* ---------- The tab bar ---------- */

  & .mf-nav { position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(2, 1fr) 72px repeat(2, 1fr); align-items: center; height: calc(var(--nav-h) + var(--safe-b)); padding: 0 14px var(--safe-b); border-top: 1px solid var(--mf-line); background: var(--mf-card); box-shadow: var(--mf-sheet-shadow); }
  & body.is-focus .mf-nav { display: none; }
  & .mf-nav-brand { display: none; }
  & .mf-tab { display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--mf-soft-2); font-size: 11px; font-weight: 500; }
  & .mf-tab.is-active { color: var(--mf-tomato-ink); font-weight: 600; }
  & .mf-tab.is-active .ic-bookmark path, & .mf-tab.is-active .ic-chef path { fill: currentColor; }
  & .mf-create { justify-self: center; display: grid; place-items: center; width: 58px; height: 58px; margin-top: -10px; border: 0; border-radius: 18px; background: var(--mf-tomato); color: #fff; box-shadow: 0 5px 12px rgb(194 68 42 / 0.35); cursor: pointer; transition: transform 0.15s; }
  & .mf-create:active { transform: scale(0.94); }
  & .mf-create-label { display: none; }

  @media (prefers-reduced-motion: reduce) {
    & .mf-sheet, & .mf-splash-line.in { animation: none; }
    & .mf-card, & .mf-create { transition: none; }
  }

  /* The Ingredients button on phones, once the list has scrolled away (recipe.js). */
  & .mf-ing-pin { position: fixed; z-index: 26; top: calc(12px + env(safe-area-inset-top, 0px)); right: var(--mf-gutter); display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 16px; border: 0; border-radius: 999px; background: var(--mf-card); color: var(--mf-ink); box-shadow: var(--mf-card-shadow); font: 600 14px var(--mf-sans); cursor: pointer; }
  & .mf-ing-pin[hidden] { display: none; }
  & .mf-ing-sheet { max-height: 60vh; overflow-y: auto; margin-top: 10px; }

  /* Wide screens: the recipe in two columns, the ingredients staying put beside the steps. */
  @media (min-width: 1024px) {
    & .mf-screen.mf-detail { max-width: 1080px; }
    & .mf-detail .mf-hero-bar .mf-back { left: max(24px, calc((100vw - 1080px) / 2 + 24px)); }
    & .mf-detail .mf-body { display: grid; grid-template-columns: minmax(280px, 360px) minmax(0, 1fr); column-gap: 56px; align-items: start; }
    & .mf-detail .mf-body > * { grid-column: 1 / -1; }
    & .mf-detail .mf-body > .mf-section:has(#ingredients) { grid-column: 1; position: sticky; top: 72px; max-height: calc(100dvh - 180px); overflow-y: auto; }
    & .mf-detail .mf-body > .mf-section:has(#steps) { grid-column: 2; margin-top: 0; }
    & .mf-ing-pin { display: none !important; }
    & .mf-detail .mf-sticky { width: min(1032px, 100%); }
  }

  /* ---------- Wide screens: a sidebar and a centered column ---------- */

  @media (min-width: 768px) {
    &[data-screens="midfi"] body:not(.is-focus) { padding-left: 232px; }
    & .mf-nav { top: 0; right: auto; bottom: 0; grid-template-columns: 1fr; grid-auto-rows: max-content; align-content: start; gap: 4px; width: 232px; height: auto; padding: 22px 14px; border-top: 0; border-right: 1px solid var(--mf-line); box-shadow: none; }
    & .mf-nav-brand { display: block; padding: 0 10px 18px; }
    & .mf-nav-brand .mf-logo { width: 120px; height: 54px; }
    & .mf-tab { flex-direction: row; gap: 12px; padding: 11px 12px; border-radius: 12px; font-size: 15px; }
    & .mf-tab:hover { background: var(--mf-sand); }
    & .mf-tab.is-active { background: var(--mf-tomato-tint); }
    & .mf-create { order: 10; justify-self: stretch; display: flex; justify-content: center; gap: 8px; width: auto; height: 50px; margin: 18px 0 0; border-radius: 14px; font: 600 15px var(--mf-sans); }
    & .mf-create .ic { width: 22px; height: 22px; }
    & .mf-create-label { display: inline; }
    & .mf-screen { width: 100%; max-width: 760px; margin: 0 auto; padding: 28px 40px 60px; --mf-gutter: 40px; }
    & .mf-focus, & .mf-detail { max-width: 720px; }
    & .mf-detail { padding-top: 0; }
    & .mf-head .mf-logo { display: none; }
    & .mf-screen:has(.mf-sticky) { padding-bottom: 130px; }
    & .mf-shelf-row, & .mf-days, & .mf-chips-scroll { margin-left: -40px; margin-right: -40px; }
    & .mf-card { width: 124px; }
    & .mf-card-photo .mf-photo { height: 92px; }
    & .mf-hero-photo { height: 360px; border-radius: 0 0 28px 28px; }
    & .mf-hero { margin-top: 0; }
    & .mf-sticky { left: 50%; right: auto; width: min(720px, 100%); transform: translateX(-50%); border: 1px solid var(--mf-line); border-bottom: 0; border-radius: 22px 22px 0 0; }
    & body:not(.is-focus) .mf-sticky { left: calc(50% + 116px); }
    & .mf-top { margin-left: -40px; margin-right: -40px; padding-left: 40px; padding-right: 40px; }
    & .mf-sheet { margin-bottom: 6vh; border-radius: 28px; }
    & .mf-add-overlay { align-items: center; }
  }
}

@keyframes mf-up { from { transform: translateY(40px); opacity: 0; } }
@keyframes mf-fade { from { opacity: 0; transform: translateY(8px); } }
@keyframes mf-spin { to { transform: rotate(360deg); } }
@keyframes mf-pulse { 50% { opacity: 0.3; } }
