/* recipe.plantry.app — the app's recipe view, as a page.
   Colours: the page wears the accent the app samples from the photo (--accent, --bg-light,
   --bg-dark come from the server per recipe). Type: the system sans for UI, the system serif
   for the intro and the steps, as in the app. */

:root {
  color-scheme: light dark;
  --bg: var(--bg-light, #fff);
  --text: #000;
  --secondary: rgba(60, 60, 67, 0.62);
  --tertiary: rgba(60, 60, 67, 0.32);
  --fill: rgba(255, 255, 255, 0.62);
  --fill-strong: rgba(255, 255, 255, 0.82);
  --hairline: rgba(60, 60, 67, 0.16);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(0, 0, 0, 0.06);
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --rounded: ui-rounded, "SF Pro Rounded", -apple-system, system-ui, sans-serif;
  --serif: ui-serif, "New York", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --gutter: 20px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: var(--bg-dark, #000);
    --text: #fff;
    --secondary: rgba(235, 235, 245, 0.62);
    --tertiary: rgba(235, 235, 245, 0.3);
    --fill: rgba(255, 255, 255, 0.08);
    --fill-strong: rgba(255, 255, 255, 0.14);
    --timer-progress: rgba(255, 255, 255, 0.26);
    --timer-progress-opacity: 1;
    --hairline: rgba(255, 255, 255, 0.12);
    --shadow: none;
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.4 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}

.intro a, .step-body a { overflow-wrap: anywhere; }

a { color: inherit; }

svg { width: 1em; height: 1em; flex: none; }

button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }

.recipe { max-width: 1180px; margin: 0 auto; padding-bottom: calc(40px + env(safe-area-inset-bottom)); }

/* MARK: Language menu — the plantry.app homepage's: a <details>, so it opens, closes and takes
   focus without JavaScript (lang-menu.js adds click-away, Escape and the remembering cookie).
   On a recipe it is a chip in the toolbar under the title; a plan has it in a row above. */

.page-bar {
  display: flex;
  justify-content: flex-end;
  padding: max(12px, env(safe-area-inset-top)) max(var(--gutter), env(safe-area-inset-right)) 0 max(var(--gutter), env(safe-area-inset-left));
}
.page-bar + .title-block { padding-top: 12px; }

.lang-menu { position: relative; }

.lang-menu > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  font: 500 15px/1 var(--sans);
  white-space: nowrap;
  user-select: none;
  -webkit-user-select: none;
  background: var(--fill);
  color: var(--text);
  box-shadow: var(--shadow);
}
.lang-menu > summary::-webkit-details-marker { display: none; }
.lang-menu > summary::marker { content: ""; }

/* In the recipe's toolbar it is one of the chips, and its list opens from the chip's left. */
.chips .lang-menu > summary { gap: 8px; padding: 0 16px; font: 600 15px/1 var(--sans); box-shadow: none; }
.chips .lang-list { left: 0; right: auto; z-index: 10; }

.lang-chevron { width: 10px; height: 10px; opacity: 0.7; transition: transform 0.2s ease; }
.lang-menu[open] .lang-chevron { transform: rotate(180deg); }

/* `display: flex` would otherwise override the browser's own hiding of a closed <details>. */
.lang-menu:not([open]) > .lang-list { display: none; }

.lang-list {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 180px;
  padding: 6px;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: rgba(28, 28, 36, 0.86);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  backdrop-filter: blur(24px) saturate(180%);
  border: 0.5px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
}

.lang-list a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 10px;
  color: #fff;
  text-decoration: none;
  font: 500 15px/1.2 var(--sans);
  white-space: nowrap;
}

/* Every row keeps the tick's width, so the list does not shift as you switch. */
.lang-list a::before { content: ""; width: 12px; height: 12px; flex: none; }
.lang-list a:hover, .lang-list a:focus-visible { background-color: rgba(255, 255, 255, 0.12); outline: none; }
.lang-list a[aria-current="true"]::before {
  background-color: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M1.8 6.3l2.9 2.9 5.5-6.1' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat center / 12px 12px;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M1.8 6.3l2.9 2.9 5.5-6.1' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat center / 12px 12px;
}

/* Japanese in its own faces, as on the homepage, rather than whichever CJK font comes first. */
[lang="ja"] {
  --sans: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Yu Gothic", YuGothic, Meiryo, "Noto Sans JP", sans-serif;
  line-break: strict;
}
/* Japanese has no italics to set the intro in, and breaks headings between phrases. */
.intro:lang(ja) { font-style: normal; }
h1:lang(ja) { word-break: auto-phrase; }

/* In light mode the menu turns light, like the homepage's past its hero. */
@media (prefers-color-scheme: light) {
  .lang-list {
    background: rgba(255, 255, 255, 0.92);
    border-color: rgba(0, 0, 0, 0.08);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  }
  .lang-list a { color: #1c1c1e; }
  .lang-list a:hover,
  .lang-list a:focus-visible { background-color: rgba(0, 0, 0, 0.06); }
}

/* MARK: Hero */

/* Edge to edge at every width: the page column is centred, the photo spans the window. Clipped
   on three sides only, so a pull past the top can stretch the photo up into the gap. */
.hero {
  width: 100vw;
  margin: 0 calc(50% - 50vw);
  clip-path: inset(-100vh 0 0 0);
  background: var(--fill);
}

.hero img {
  display: block;
  width: 100%;
  /* Tall on a phone, the way the app's hero fills the screen before the title scrolls up: a
     portrait crop that zooms into the dish around the recipe's point of interest. */
  aspect-ratio: 3 / 4;
  max-height: 80vh;
  object-fit: cover;
  /* The stretch grows the photo up from its bottom edge (recipe.js). */
  transform-origin: 50% 100%;
}

/* The app's ParallaxHeaderView: the photo stays pinned under the top of the window while the
   page scrolls over it, so it leaves at half the speed of the text. A scroll-driven animation
   runs on the compositor, smooth on iPhone; recipe.js covers older browsers and the pull. */
@keyframes hero-parallax { to { translate: 0 50%; } }
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .hero { view-timeline: --hero block; }
    .hero img {
      animation: hero-parallax linear both;
      animation-timeline: --hero;
      animation-range: exit 0% exit 100%;
    }
  }
}

/* MARK: Title */

.title-block { padding: 24px max(var(--gutter), env(safe-area-inset-left)) 8px max(var(--gutter), env(safe-area-inset-right)); }

h1 {
  margin: 0;
  font: 800 34px/1.12 var(--sans);
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  background: var(--fill);
  font: 600 15px/1 var(--sans);
}

.chip svg { font-size: 18px; color: var(--secondary); }

/* The app's ingredient card header: the small uppercase label with the scale badge across from it,
   then the servings title ("6 bitar") with round − / + buttons. */
.ingredients-heading { margin-bottom: 8px; }
.ingredients-label { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 30px; }
.ingredients-label h2 {
  margin: 0;
  font: 600 15px/1.2 var(--sans);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--secondary);
}
.scale-badge {
  padding: 5px 11px;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  font: 600 15px/1 var(--sans);
  font-variant-numeric: tabular-nums;
  color: var(--secondary);
  white-space: nowrap;
}
.scale-badge[data-idle] { visibility: hidden; }
.servings { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 6px; }
.servings-title { min-width: 0; font: 700 22px/1.2 var(--sans); letter-spacing: -0.01em; }
.servings-buttons { display: flex; gap: 12px; flex: none; margin-left: auto; }

.step-servings {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--fill-strong);
}

.step-servings svg { color: var(--text); font-size: 18px; }

.step-servings:disabled { opacity: 0.35; cursor: default; }

/* Keep the screen on while cooking: a toggle in the chip row, filled with the accent when on. */
.chip.awake { cursor: pointer; }
.chip.awake[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }
.chip.awake[aria-pressed="true"] svg { color: inherit; }

/* The app's source capsule: a full pill, its icon and button concentric with it (the same
   10 px inset all round, so their radii are the capsule's minus the inset). */
.source {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  padding: 10px 10px 10px 22px;
  min-height: 68px;
  border-radius: 999px;
  background: var(--fill);
  text-decoration: none;
}

.source:has(.avatar) { padding-left: 10px; }

.source-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }

.source-caption { font-size: 13px; color: var(--secondary); }

.source-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 48px;
  padding: 0 20px;
  border-radius: 999px;
  background: var(--fill-strong);
  font: 600 15px/1 var(--sans);
  white-space: nowrap;
}

.intro-wrap.long .intro {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 5;
  overflow: hidden;
}

.intro-wrap.long.open .intro { display: block; -webkit-line-clamp: unset; }

.more {
  margin-top: 6px;
  font: 600 16px/1 var(--sans);
  color: var(--secondary);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.intro {
  margin: 20px 0 0;
  font: italic 18px/1.5 var(--serif);
  color: var(--text);
}

/* MARK: Columns */

/* The page's bottom room lives in the steps column (the CTA sits at its end), so on wide
   screens the grid — and with it the pinned ingredient column — reaches the very bottom. */
.recipe:not(.plan):not(.not-found) { padding-bottom: 0; }
.steps-section { padding-bottom: calc(56px + env(safe-area-inset-bottom)); }
.steps-section .cta { margin-left: 0; margin-right: 0; }

.columns { padding: 8px max(var(--gutter), env(safe-area-inset-left)) 0 max(var(--gutter), env(safe-area-inset-right)); }

h2 { margin: 0 0 12px; font: 700 22px/1.2 var(--sans); letter-spacing: -0.01em; }

.card {
  margin-top: 24px;
  padding: 20px 20px 24px;
  border-radius: 24px;
  background: var(--fill);
  box-shadow: var(--shadow);
}

/* A group's name as the app sets it: plain, in the text colour, ruled off across the card. */
h3.group {
  margin: 20px 0 0;
  padding-bottom: 8px;
  font: 700 15px/1.3 var(--sans);
  color: var(--text);
  border-bottom: 1px solid var(--hairline);
}

.ingredients { list-style: none; margin: 0; padding: 0; }

.ingredient {
  display: grid;
  grid-template-columns: minmax(64px, 30%) 1fr;
  gap: 14px;
}

/* The rule between rows runs under the ingredient's text only — not the amount, not the icon. */
.ingredients { font-size: 18px; }
.ingredient .amount, .ingredient .what { padding: 9px 0; }
.ingredient .what { position: relative; }
.ingredient .what::after {
  content: "";
  position: absolute;
  left: 38px; /* the 28px icon and its 10px gap */
  right: 0;
  bottom: 0;
  border-bottom: 1px solid var(--hairline);
}
.ingredient .what:not(:has(.ingredient-icon))::after { left: 0; }

.ingredients .ingredient:last-child .what::after { display: none; }

.amount { text-align: right; font-weight: 400; font-variant-numeric: tabular-nums; }

.unit { font-weight: inherit; color: inherit; }

.what {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 10px;
  align-items: start;
  min-width: 0;
}

.what .name, .what .note { grid-column: 2; }
/* Long compound names ("grönsaksbuljongtärning") break at a syllable instead of running out of
   the card on a phone; the page's lang picks the hyphenation rules. */
.what .name { hyphens: auto; overflow-wrap: anywhere; }

.what:not(:has(.ingredient-icon)) { display: flex; flex-direction: column; }

/* The shopping list's illustrated icon for the item, as the app shows it. */
/* The generic carton's <picture> steps aside so its image sits in the grid like any icon. */
.generic-icon { display: contents; }
.ingredient-icon { grid-row: 1 / span 2; width: 28px; height: 28px; margin-top: -3px; object-fit: contain; }

.note { font-size: 15px; color: var(--secondary); }

/* A tap strikes an ingredient through, the way a step is ticked off; remembered per recipe. */
.ingredient { cursor: pointer; -webkit-tap-highlight-color: transparent; }
/* The row's contents dim, not the rule under them (it is `.what::after`, so not a child). */
.ingredient.done .amount, .ingredient.done .what > *, .ingredient.done .ingredient-icon { opacity: 0.4; }
.ingredient.done .name { text-decoration: line-through; }


/* MARK: Steps */

.steps-section { margin-top: 32px; }


.steps { list-style: none; margin: 0; padding: 0; }

.step {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  align-items: start;
  gap: 14px;
  padding: 16px 0;
}

.check {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  /* Centred on the first line of the step: 21px × 1.5 = 31.5px tall, so (31.5 − 30) / 2. */
  margin-top: 0.75px;
  border-radius: 50%;
  border: 2px solid var(--tertiary);
  color: transparent;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.check svg { width: 15px; height: 15px; }

/* A ticked step: the text colour filled in, the check cut out in the page's background. */
.step.done .check { background: var(--text); border-color: var(--text); color: var(--bg); }

.step-body p {
  margin: 0;
  font: 19px/1.5 var(--serif);
  transition: opacity 0.25s;
}

.step.done .step-body p { opacity: 0.4; }

/* Only timers are underlined: they are the links. */
.duration {
  font: inherit;
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  cursor: pointer;
}

.duration.running { color: var(--accent); text-decoration-thickness: 2px; }

.step-header h3 { margin: 24px 0 0; font: 700 20px/1.25 var(--sans); }

.timers { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }

/* The app's timer chip: a wide capsule under the step. */
.timer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 48px;
  padding: 0 20px;
  border-radius: 999px;
  background: var(--fill-strong);
  font: 600 17px/1 var(--sans);
}

/* The app's timer dial (timerStepRound), tinted like text the way the app tints it. */
.timer-icon {
  width: 22px;
  height: 22px;
  flex: none;
  background: currentColor;
  -webkit-mask: url(/assets/timer.png) center / contain no-repeat;
  mask: url(/assets/timer.png) center / contain no-repeat;
}

/* Running, the chip is its own progress bar: the accent fills it from the leading edge. */
.timer { position: relative; overflow: hidden; isolation: isolate; max-width: 100%; min-width: 0; }
.timer-label { flex: none; }

.timer::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--progress, 0%);
  /* Light mode fills with the accent, translucent; dark mode with a stronger cut of the
     chip's own fill, where a tinted bar read as a colour of its own. */
  background: var(--timer-progress, var(--accent));
  opacity: var(--timer-progress-opacity, 0.35);
  z-index: -1;
  transition: width 1s linear;
}

.timer:not(.running)::before { transition: none; }

.timer.ringing { background: var(--accent); color: var(--on-accent); }

.timer.ringing::before { opacity: 0; }

.timer-left { font-variant-numeric: tabular-nums; }

/* "Pressa tofu · 30 minuter": the app's timer name, then its time — the countdown while it runs. */
.timer-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.timer-dot { opacity: 0.5; }
.timer-label { white-space: nowrap; }
.timer.running .timer-label { display: none; }

.timer.ringing { animation: ring 0.9s ease-in-out infinite; }

@keyframes ring { 50% { transform: scale(1.03); } }

.avatar { width: 48px; height: 48px; border-radius: 50%; background: #000; object-fit: cover; flex: none; }


/* MARK: Phones */


/* MARK: Tablet — one column, centred, the photo rounded inside the margins */

@media (min-width: 700px) {
  :root { --gutter: 32px; }
  .recipe { max-width: 760px; }
  .hero img { aspect-ratio: 16 / 9; max-height: 70vh; }
  .title-block { padding-top: 28px; }
  h1 { font-size: 40px; }
  .intro { font-size: 21px; }
  /* A phone's sizes bring the steps down and the ingredients up beside each other; on a wider
     page the steps read at full size again and the ingredients at the page's own. */
  .step-body p { font-size: 21px; }
  .ingredients { font-size: 17px; }
  .servings-title { font-size: 28px; line-height: 1.15; }
}

/* MARK: Desktop — the iPad layout: ingredients in a sticky column beside the steps */

@media (min-width: 1000px) {
  :root { --gutter: 40px; }
  .recipe { max-width: 1180px; }
  /* Most of the window, the way the app's hero fills the screen before the title. */
  .hero img { aspect-ratio: 16 / 9; max-height: 82vh; }
  .title-block { padding-top: 32px; max-width: 860px; }
  h1 { font-size: 46px; }
  .columns {
    display: grid;
    grid-template-columns: 1fr minmax(320px, 400px);
    grid-template-rows: auto 1fr;
    gap: 0 56px;
    align-items: start;
  }
  /* Steps on the left, ingredients in a sticky column on the right; the markup keeps the
     ingredients first so phones read them before the steps. */
  /* The tilde heads the steps column, centred over it; the card spans both rows on the right. */
  .columns > .divider { grid-column: 1; grid-row: 1; margin-top: 0; }
  .steps-section { grid-column: 1; grid-row: 2; }
  /* The card carries the same bottom room as the steps column, for when it is the taller one. */
  .ingredients-card { grid-column: 2; grid-row: 1 / span 2; margin-bottom: calc(56px + env(safe-area-inset-bottom)); }
  /* Pinned beside the steps: under the floating nav when the card fits the window; a taller
     card gets a negative top from recipe.js so it holds by its bottom edge once scrolled to. */
  .ingredients-card.pinned { position: sticky; top: calc(76px + env(safe-area-inset-top)); }
  .steps-section { margin-top: 24px; }
  .step-body p { max-width: 38em; }
}

/* MARK: Dividers — the app's tilde before the steps, the diamond that closes them */

/* The tilde sits between the intro and the ingredients, the full page width. */
.divider { display: flex; justify-content: center; align-items: center; height: 30px; margin: 8px 0 -2px; color: rgba(0, 0, 0, 0.1); }
.divider svg { width: 70px; height: 25px; }
/* The last step keeps its own 16px below, so the diamond's bottom margin makes up the difference. */
.divider.closing { margin: 44px 0 60px; color: rgba(120, 120, 128, 0.2); }
.divider.closing svg { width: 14px; height: 14px; }
@media (prefers-color-scheme: dark) {
  .divider { color: rgba(255, 255, 255, 0.3); }
  .divider.closing { color: rgba(120, 120, 128, 0.36); }
}
.steps-section .cta { margin-top: 0; }

/* MARK: Buttons */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 22px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  font: 700 17px/1 var(--sans);
  text-decoration: none;
  white-space: nowrap;
}

/* 56px with iOS's 22.5% corners (≈12.6px radius), inset 12px beyond the card's padding so the
   corner arcs share a centre with the card's 48px corners. */
.cta .app-icon { width: 56px; height: 56px; margin: 12px 0 12px 12px; }
.app-icon { flex: none; border-radius: 22.5%; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12); }

/* MARK: Call to action — the card at the end of the recipe */

.cta {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 48px max(var(--gutter), env(safe-area-inset-left)) 8px max(var(--gutter), env(safe-area-inset-right));
  padding: 24px;
  /* Concentric with the 48px capsule inside: its 24px radius plus the 24px padding. */
  border-radius: 48px;
  background: var(--fill);
  box-shadow: var(--shadow);
}

.cta-text { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 0; }

.cta-text span { font-size: 15px; color: var(--secondary); }

@media (max-width: 520px) {
  .cta { flex-wrap: wrap; }
  .cta .button { width: 100%; }
}

@media (min-width: 1000px) {
  .cta { max-width: 760px; margin-left: auto; margin-right: auto; padding: 24px; }
}

/* MARK: Plan — a shared meal plan as the app's plan detail shows it: the recipes as the app's
   small recipe cards (photo on top, title and time in a footer), in columns from a ~200px target
   width and never fewer than two, 16px gaps on a phone and 32px on wider screens. */

.plan-meta { margin: 8px 0 0; font: 600 15px/1.3 var(--sans); color: var(--secondary); }

/* A plan has no sampled accent: the page's default colours, and the app's yellow on the button. */
.plan .button { background: #ffc800; color: #000; }

.plan .intro { margin-top: 16px; }

.plan-recipes { padding: 16px max(var(--gutter), env(safe-area-inset-left)) 0 max(var(--gutter), env(safe-area-inset-right)); }

.plan-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }

.plan-card {
  display: flex;
  flex-direction: column;
  aspect-ratio: 1 / 1.55;
  border-radius: 24px;
  overflow: hidden;
  background: var(--fill-strong);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.12);
  text-decoration: none;
  color: inherit;
}

/* A recipe without a photo shows its own accent, as its page would; a missing one, the fill. */
.plan-photo {
  display: block;
  flex: 1 1 auto;
  min-height: 0;
  background: var(--fill);
}

.plan-photo img { display: block; width: 100%; height: 100%; object-fit: cover; }

.plan-card-text { display: flex; align-items: flex-start; gap: 8px; flex: none; min-height: 59px; padding: 6px 8px 6px 12px; }

.plan-card-title {
  flex: 1 1 auto;
  min-width: 0;
  font: 500 13px/1.3 var(--sans);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.plan-card-time { flex: none; display: inline-flex; align-items: center; gap: 3px; font: 400 13px/1.3 var(--sans); }

.plan-card-time svg { width: 11px; height: 11px; }

.plan-card.missing { cursor: default; }

/* /weekly: "Earlier plans", a menu left of the language one. Its list is anchored to the bar's
   right edge (not the chip's) so it stays on screen beside the language chip on a phone. */
.page-bar { position: relative; gap: 8px; }
.plans-menu { position: static; }
.plans-icon { width: 16px; height: 16px; flex: none; }
.plans-list {
  right: max(var(--gutter), env(safe-area-inset-right));
  z-index: 10;
  width: min(320px, calc(100vw - 2 * var(--gutter)));
  max-height: min(70vh, 560px);
  overflow-y: auto;
}
.plans-list a.plans-row { align-items: center; gap: 12px; padding: 8px; white-space: normal; }
.plans-list a.plans-row::before { content: none; }
.plans-thumb { flex: none; width: 40px; height: 71px; border-radius: 8px; overflow: hidden; background: rgba(255, 255, 255, 0.12); }
.plans-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.plans-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.plans-title { font: 600 15px/1.25 var(--sans); }
.plans-date { font: 400 13px/1.2 var(--sans); color: rgba(255, 255, 255, 0.6); }
/* Narrow screens: the language chip folds to its flag first, then the plans chip to its icon. */
@media (max-width: 480px) {
  .page-bar .plans-menu ~ .lang-menu .lang-name { display: none; }
}
@media (max-width: 340px) {
  .plans-menu .lang-name { display: none; }
}


.plan-card.missing .plan-photo { position: relative; }
.plan-card.missing .plan-photo img { filter: grayscale(1); opacity: 0.5; }
.plan-card.missing .plan-card-text { opacity: 0.5; }

/* The app's glass caption pill over the photo's bottom-leading corner. */
.plan-missing-label {
  position: absolute;
  left: 8px;
  bottom: 10px;
  padding: 4px 8px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.72);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  color: #000;
  font: 500 12px/1.3 var(--sans);
}
@media (prefers-color-scheme: dark) {
  .plan-missing-label { background: rgba(40, 40, 40, 0.72); color: #fff; }
}

@media (min-width: 700px) {
  .plan-recipes { padding-left: max(32px, env(safe-area-inset-left)); padding-right: max(32px, env(safe-area-inset-right)); }
  .plan-list { grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 32px; }
}

/* MARK: Not found */

.not-found { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 18vh var(--gutter) 40px; gap: 12px; }



.not-found p { max-width: 420px; color: var(--secondary); margin: 0 0 12px; }

/* No recipe means no sampled accent, so the button wears the app's yellow, like a plan's. */
.not-found .button { background: #ffc800; color: #000; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
