/* css/tokens.css */
/* Design tokens. "Warm precision": the cookbook's warmth, the kitchen scale's
   exactness. Components use these properties only, never raw values. */
@layer tokens {
  @font-face {
    font-family: "Fraunces";
    src: url("../fonts/fraunces.woff2") format("woff2");
    font-weight: 400 700;
    font-style: normal;
    font-display: swap;
  }
  @font-face {
    font-family: "Fraunces";
    src: url("../fonts/fraunces-italic.woff2") format("woff2");
    font-weight: 400 600;
    font-style: italic;
    font-display: swap;
  }
  @font-face {
    font-family: "Inter";
    src: url("../fonts/inter.woff2") format("woff2");
    font-weight: 400 700;
    font-style: normal;
    font-display: swap;
  }
  @font-face {
    font-family: "JetBrains Mono";
    src: url("../fonts/jetbrains-mono.woff2") format("woff2");
    font-weight: 400 600;
    font-style: normal;
    font-display: swap;
  }
  /* Metric compatible fallbacks, so the swap does not shift layout. */
  @font-face {
    font-family: "Fraunces Fallback";
    src: local("Times New Roman"), local("Liberation Serif"), local("Tinos");
    size-adjust: 123.37%;
    ascent-override: 79.28%;
    descent-override: 20.67%;
    line-gap-override: 0%;
  }
  @font-face {
    font-family: "Inter Fallback";
    src: local("Arial"), local("Liberation Sans"), local("Arimo"), local("Helvetica");
    size-adjust: 108.15%;
    ascent-override: 89.57%;
    descent-override: 22.3%;
    line-gap-override: 0%;
  }

  :root {
    color-scheme: light;

    /* Kitchen palette, light */
    --flour: #FAF6EF;        /* page background */
    --parchment: #F2EBDF;    /* secondary surfaces */
    --crust: #E4D6C1;        /* borders, dividers */
    --card: #FFFFFF;         /* cards, sheets */
    --ink: #1E1A16;          /* primary text */
    --smoke: #6B6158;        /* secondary text */
    --ash: #786D62;          /* tertiary text, AA on flour (4.68) and card; never on parchment, use smoke there */
    --accent: #1E1E1E;       /* actions: one near black accent, color is for meaning */
    --on-accent: #FAF6EF;
    --accent-hover: #3A3632;

    --basil: #2F6B45;        /* verified, success */
    --basil-tint: #E8F0EA;
    --basil-line: #C3D8C9;
    --saffron: #8A5A0B;      /* claimed labels, warnings */
    --saffron-fill: #F0B93F;
    --saffron-tint: #F8EFDC;
    --saffron-line: #E8D3A6;
    --beet: #A61E3A;         /* danger, conflict */
    --beet-tint: #F7E7EA;
    --beet-line: #E6BCC5;
    --beet-soft: #D8B3BB;
    --blueberry: #34558B;    /* info */
    --blueberry-tint: #EEF1F6;
    --blueberry-line: #C9D3E4;

    --overlay: rgb(30 26 22 / .45);
    --shade: 30 26 22;       /* shadow tint channels (ink, never pure black) */
    --photo-inset: none;

    /* Type */
    --font-display: "Fraunces", "Fraunces Fallback", Georgia, serif;
    --font-ui: "Inter", "Inter Fallback", system-ui, -apple-system, "Segoe UI", sans-serif;
    --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

    --text-hero: clamp(2.5rem, 1.6rem + 3.9vw, 4.5rem);     /* 40 -> 72 */
    --text-h1: clamp(2rem, 1.55rem + 1.9vw, 3.25rem);       /* 32 -> 52 */
    --text-h2: clamp(1.5rem, 1.28rem + .95vw, 2.125rem);    /* 24 -> 34 */
    --text-h3: clamp(1.1875rem, 1.1rem + .38vw, 1.4375rem); /* 19 -> 23 */
    --text-body: 1.0625rem;  /* 17 */
    --text-ui: .9375rem;     /* 15 */
    --text-small: .8125rem;  /* 13 */
    --text-input: 1rem;      /* 16, so iOS never zooms on focus */
    --leading-body: 1.55;
    --leading-tight: 1.05;

    /* Space (4 px base) */
    --s-1: 4px;
    --s-2: 8px;
    --s-3: 12px;
    --s-4: 16px;
    --s-5: 20px;
    --s-6: 24px;
    --s-7: 28px;
    --s-8: 32px;
    --s-10: 48px;
    --s-12: 64px;
    --s-14: 80px;
    --s-16: 96px;
    --gutter: clamp(16px, 4vw, 40px);
    --content-max: 1320px;
    --reading-max: 720px;

    /* Shape */
    --r-xs: 4px;
    --r-sm: 8px;
    --r-md: 14px;
    --r-lg: 22px;
    --r-xl: 32px;
    --r-pill: 999px;

    /* Depth: warm, layered */
    --shadow-1: 0 1px 2px rgb(var(--shade) / .04), 0 6px 18px -10px rgb(var(--shade) / .18);
    --shadow-2: 0 2px 4px rgb(var(--shade) / .05), 0 14px 28px -14px rgb(var(--shade) / .28);
    --shadow-3: 0 18px 40px -18px rgb(var(--shade) / .35);
    --shadow-4: 0 30px 60px -20px rgb(var(--shade) / .5);

    /* Layers */
    --z-base: 0;
    --z-sticky: 20;
    --z-dropdown: 30;
    --z-overlay: 40;
    --z-modal: 60;
    --z-toast: 80;
    --z-tooltip: 90;

    /* Touch */
    --hit: 48px;
    --hit-cook: 64px;

    /* Motion */
    --dur-instant: 90ms;
    --dur-quick: 160ms;
    --dur-base: 240ms;
    --dur-smooth: 380ms;
    --dur-slow: 600ms;
    --ease-standard: cubic-bezier(.2, .8, .2, 1);
    --ease-exit: cubic-bezier(.4, 0, 1, 1);
    /* Spring with about 4% overshoot. */
    --ease-spring: linear(0, .009, .035 2.1%, .141 4.4%, .281 6.7%, .723 12.9%, .938 16.7%, 1.017 19.4%, 1.041 21.6%, 1.047 23.5%, 1.043 25.8%, 1.018 31.3%, 1.004 36.4%, .998 45.8%, 1);
    /* Firm settle for toggles and check offs. */
    --ease-snap: linear(0, .144 4.5%, .472 11.1%, .792 19%, .946 26.1%, 1.011 34.2%, 1.018 41.3%, 1.003 58.6%, 1);
    --stagger: 14ms;
  }

  /* Dark, "after service" */
  :root[data-theme="dark"] {
    color-scheme: dark;
    --flour: #15120F;
    --parchment: #1D1915;
    --crust: #2E2822;
    --card: #221D18;
    --ink: #F3ECE2;
    --smoke: #B8ADA1;
    --ash: #968B80;
    --accent: #F3ECE2;
    --on-accent: #15120F;
    --accent-hover: #D9D0C4;
    --basil: #7FC49A;
    --basil-tint: #1C2A21;
    --basil-line: #2F4A38;
    --saffron: #E9B75A;
    --saffron-fill: #F0B93F;
    --saffron-tint: #2C2414;
    --saffron-line: #4F3F1F;
    --beet: #EE7F95;
    --beet-tint: #2F1A1F;
    --beet-line: #57303A;
    --beet-soft: #6E3B47;
    --blueberry: #9DB7E3;
    --blueberry-tint: #1A2130;
    --blueberry-line: #2E3A52;
    --overlay: rgb(0 0 0 / .6);
    --shade: 0 0 0;
    --photo-inset: inset 0 0 0 1px rgb(255 255 255 / .04), inset 0 -40px 80px -40px rgb(0 0 0 / .35);
  }

  @media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
      color-scheme: dark;
      --flour: #15120F;
      --parchment: #1D1915;
      --crust: #2E2822;
      --card: #221D18;
      --ink: #F3ECE2;
      --smoke: #B8ADA1;
      --ash: #968B80;
      --accent: #F3ECE2;
      --on-accent: #15120F;
      --accent-hover: #D9D0C4;
      --basil: #7FC49A;
      --basil-tint: #1C2A21;
      --basil-line: #2F4A38;
      --saffron: #E9B75A;
      --saffron-fill: #F0B93F;
      --saffron-tint: #2C2414;
      --saffron-line: #4F3F1F;
      --beet: #EE7F95;
      --beet-tint: #2F1A1F;
      --beet-line: #57303A;
      --beet-soft: #6E3B47;
      --blueberry: #9DB7E3;
      --blueberry-tint: #1A2130;
      --blueberry-line: #2E3A52;
      --overlay: rgb(0 0 0 / .6);
      --shade: 0 0 0;
      --photo-inset: inset 0 0 0 1px rgb(255 255 255 / .04), inset 0 -40px 80px -40px rgb(0 0 0 / .35);
    }
  }

  @media (prefers-reduced-motion: reduce) {
    :root {
      --dur-quick: 1ms;
      --dur-base: 120ms;
      --dur-smooth: 160ms;
      --dur-slow: 160ms;
      --ease-spring: ease-out;
      --ease-snap: ease-out;
      --stagger: 0ms;
    }
  }
}

/* css/base.css */
@layer reset, base;

@layer reset {
  *, *::before, *::after { box-sizing: border-box; }
  html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; hanging-punctuation: first last; }
  body, h1, h2, h3, h4, h5, h6, p, figure, blockquote, dl, dd, ol, ul { margin: 0; }
  ol[role="list"], ul[role="list"], .list-reset { list-style: none; padding: 0; }
  img, picture, svg, video, canvas { display: block; max-width: 100%; }
  img, video { height: auto; }
  input, button, textarea, select { font: inherit; color: inherit; letter-spacing: inherit; }
  button { cursor: pointer; background: none; border: 0; padding: 0; }
  button:disabled { cursor: not-allowed; }
  textarea { resize: vertical; }
  table { border-collapse: collapse; }
  [hidden] { display: none !important; }
  :where(a) { color: inherit; }
}

@layer base {
  @view-transition { navigation: auto; }

  html {
    background: var(--flour);
    scroll-padding-top: 88px;
    interpolate-size: allow-keywords;
  }

  body {
    min-height: 100dvh;
    background-color: var(--flour);
    /* Paper grain: fractal noise, extremely faint, never on photos or cards. */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .12 0 0 0 0 .1 0 0 0 0 .08 0 0 0 .022 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
    color: var(--ink);
    font-family: var(--font-ui);
    font-size: var(--text-body);
    line-height: var(--leading-body);
    font-feature-settings: "cv11";
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-tap-highlight-color: transparent;
    text-rendering: optimizeLegibility;
    overflow-wrap: break-word;
  }

  h1, h2, h3, .display {
    font-family: var(--font-display);
    font-weight: 500;
    letter-spacing: -0.02em;
    line-height: 1.1;
    text-wrap: balance;
    font-optical-sizing: auto;
  }
  h1 { font-size: var(--text-h1); line-height: var(--leading-tight); }
  h2 { font-size: var(--text-h2); }
  h3 { font-size: var(--text-h3); }
  p { text-wrap: pretty; }

  a {
    color: var(--accent);
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
    transition: color var(--dur-quick) var(--ease-standard);
  }
  @media (hover: hover) and (pointer: fine) {
    a:hover { color: var(--smoke); }
  }

  :focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: 4px;
  }
  :focus:not(:focus-visible) { outline: none; }

  ::selection { background: color-mix(in srgb, var(--saffron-fill) 45%, transparent); color: var(--ink); }

  input::placeholder, textarea::placeholder { color: var(--ash); opacity: 1; }

  code, kbd, samp, pre { font-family: var(--font-mono); font-size: .9em; }

  .num, .tnum { font-variant-numeric: tabular-nums; font-feature-settings: "tnum", "cv11"; }

  .visually-hidden:not(:focus):not(:active) {
    clip-path: inset(50%);
    height: 1px;
    width: 1px;
    overflow: hidden;
    position: absolute;
    white-space: nowrap;
  }

  .skip-link {
    position: absolute;
    inset-inline-start: var(--s-4);
    inset-block-start: calc(env(safe-area-inset-top) + var(--s-2));
    z-index: var(--z-tooltip);
    padding: var(--s-3) var(--s-4);
    border-radius: var(--r-md);
    background: var(--accent);
    color: var(--on-accent);
    font-weight: 600;
    transform: translateY(-200%);
    transition: transform var(--dur-quick) var(--ease-standard);
  }
  .skip-link:focus { transform: none; color: var(--on-accent); }

  @media (prefers-reduced-motion: reduce) {
    @view-transition { navigation: none; }
    *, *::before, *::after { scroll-behavior: auto !important; }
  }
}

/* css/layout.css */
@layer layout {
  .page {
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
  }
  .page > main { flex: 1; }

  .container {
    width: 100%;
    max-width: calc(var(--content-max) + 2 * var(--gutter));
    margin-inline: auto;
    padding-inline: max(var(--gutter), env(safe-area-inset-left)) max(var(--gutter), env(safe-area-inset-right));
  }
  .container--reading { max-width: calc(var(--reading-max) + 2 * var(--gutter)); }

  .stack { display: grid; gap: var(--stack-gap, var(--s-4)); align-content: start; }
  .cluster { display: flex; flex-wrap: wrap; gap: var(--cluster-gap, var(--s-2)); align-items: center; }

  /* Top bar */
  .topbar {
    position: sticky;
    top: 0;
    z-index: var(--z-sticky);
    padding-top: env(safe-area-inset-top);
    background: color-mix(in srgb, var(--flour) 88%, transparent);
    backdrop-filter: saturate(1.2) blur(10px);
    -webkit-backdrop-filter: saturate(1.2) blur(10px);
  }
  .topbar__inner {
    display: flex;
    align-items: center;
    gap: var(--s-4);
    min-height: 64px;
    transition: min-height var(--dur-smooth, 200ms) var(--ease-standard, ease);
  }
  /* Condensing top bar: shorter with a hairline once the page has scrolled. */
  .topbar { transition: box-shadow var(--dur-smooth, 200ms); }
  .is-scrolled .topbar { box-shadow: 0 1px 0 var(--crust); }
  .is-scrolled .topbar__inner { min-height: 52px; }
  @media (prefers-reduced-motion: reduce) { .topbar, .topbar__inner { transition: none; } }

  /* Back to top: after a screen and a half of scrolling */
  .totop { position: fixed; right: 16px; bottom: calc(var(--tabbar-h, 0px) + 16px + env(safe-area-inset-bottom)); z-index: var(--z-sticky); width: 48px; height: 48px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--crust); background: var(--card); color: var(--ink); box-shadow: 0 6px 18px rgb(0 0 0 / .12); cursor: pointer; }
  .totop[hidden] { display: none; }
  @media print { .totop { display: none !important; } }
  .brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: var(--hit);
    color: var(--ink);
    text-decoration: none;
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.02em;
  }
  .brand svg { flex: none; width: 30px; height: 30px; }
  .brand:hover { color: var(--ink); }

  /* Footer */
  .site-footer {
    margin-top: var(--s-12);
    border-top: 1px solid var(--crust);
    padding-block: var(--s-8) calc(var(--s-8) + env(safe-area-inset-bottom));
    font-size: var(--text-small);
    color: var(--smoke);
  }
  .site-footer__inner { display: flex; flex-wrap: wrap; gap: var(--s-4) var(--s-6); align-items: center; justify-content: space-between; }
  .site-footer nav ul { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-4); }
  .site-footer a { color: var(--smoke); display: inline-flex; min-height: 32px; align-items: center; }
}

@layer layout {
  .site-footer__nav { display: flex; flex-wrap: wrap; gap: 8px 16px; }
  .site-footer__nav a { color: var(--smoke); text-underline-offset: 3px; }
}

@layer layout {
  .offline-bar { position: sticky; top: 0; z-index: calc(var(--z-sticky) + 1); margin: 0; padding: 8px 16px; text-align: center; font-size: var(--text-small); font-weight: 600; background: var(--ink); color: var(--flour); }
  .site-footer__install, .site-footer__theme { color: var(--smoke); font-size: inherit; }
  @media print { .offline-bar { display: none !important; } }
}

/* css/components/button.css */
@layer components {
  .btn {
    --btn-bg: var(--card);
    --btn-fg: var(--ink);
    --btn-bd: var(--crust);
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: var(--hit);
    padding: 0 20px;
    border-radius: var(--r-md);
    border: 1px solid var(--btn-bd);
    background: var(--btn-bg);
    color: var(--btn-fg);
    font-size: var(--text-ui);
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    overflow: hidden;
    isolation: isolate;
    user-select: none;
    -webkit-user-select: none;
    transition: transform var(--dur-instant) var(--ease-standard),
                background-color var(--dur-quick) var(--ease-standard),
                border-color var(--dur-quick) var(--ease-standard),
                color var(--dur-quick) var(--ease-standard);
  }
  .btn:active:not(:disabled):not([aria-disabled="true"]) { transform: scale(.97); }
  .btn:hover { color: var(--btn-fg); }
  .btn .icon { width: 20px; height: 20px; flex: none; }

  .btn--primary { --btn-bg: var(--accent); --btn-fg: var(--on-accent); --btn-bd: var(--accent); }
  .btn--secondary { --btn-bg: var(--card); --btn-fg: var(--ink); --btn-bd: var(--crust); }
  .btn--outline { --btn-bg: var(--card); --btn-fg: var(--ink); --btn-bd: var(--accent); }
  .btn--ghost {
    --btn-bg: transparent; --btn-bd: transparent;
    padding-inline: 12px;
    text-decoration: underline;
    text-underline-offset: 4px;
    text-decoration-thickness: 1px;
  }
  .btn--danger { --btn-bg: var(--beet); --btn-fg: #FFFFFF; --btn-bd: var(--beet); }
  :root[data-theme="dark"] .btn--danger { --btn-fg: #15120F; }
  @media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn--danger { --btn-fg: #15120F; } }

  .btn--lg { min-height: 56px; padding-inline: 24px; font-size: 1rem; }
  .btn--sm { min-height: 40px; padding-inline: 14px; font-size: var(--text-small); border-radius: 12px; }
  .btn--block { display: flex; width: 100%; }
  .btn--round { width: var(--hit); padding: 0; border-radius: 50%; }

  @media (hover: hover) and (pointer: fine) {
    .btn--primary:hover { --btn-bg: var(--accent-hover); --btn-bd: var(--accent-hover); }
    .btn--secondary:hover, .btn--outline:hover { --btn-bd: var(--accent); }
    .btn--ghost:hover { color: var(--smoke); }
    .btn--danger:hover { filter: brightness(1.08); }
  }

  .btn:disabled, .btn[aria-disabled="true"] {
    --btn-bg: var(--crust); --btn-fg: var(--ash); --btn-bd: var(--crust);
    cursor: not-allowed;
  }
  .btn--ghost:disabled { --btn-bg: transparent; --btn-bd: transparent; }

  /* Pointer ripple, positioned by js/core/ripple.js through --rx/--ry. */
  .btn::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: radial-gradient(circle at var(--rx, 50%) var(--ry, 50%), color-mix(in srgb, currentColor 22%, transparent) 0, transparent 60%);
    opacity: 0;
    transform: scale(.4);
    transition: opacity var(--dur-base) var(--ease-standard), transform var(--dur-smooth) var(--ease-standard);
  }
  .btn.is-rippling::after { opacity: 1; transform: scale(2.2); transition-duration: 0ms, var(--dur-smooth); }

  /* Loading: the label is kept for width and screen readers, the fork loader shows. */
  .btn[aria-busy="true"] { pointer-events: none; }
  .btn[aria-busy="true"] > :not(.loader) { visibility: hidden; }
  .btn > .loader { position: absolute; inset: 0; margin: auto; display: none; }
  .btn[aria-busy="true"] > .loader { display: inline-flex; }
  .btn__label { display: inline-flex; align-items: center; gap: 10px; }

  /* Text button styled like a link (for actions inside sentences). */
  .link-btn {
    display: inline;
    padding: 0;
    border: 0;
    background: none;
    color: var(--accent);
    font: inherit;
    font-weight: inherit;
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-thickness: 1px;
    cursor: pointer;
  }
  .link-btn--strong { font-weight: 600; }
  /* A link on its own line with a trailing arrow ("All", "Ingredient Page"). */
  .link-standalone { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; color: var(--ink); text-underline-offset: 3px; white-space: nowrap; }
  /* Split button: the main action and a menu of the related ones */
  .splitbtn { position: relative; display: inline-flex; }
  .splitbtn__main { border-top-right-radius: 0; border-bottom-right-radius: 0; }
  .splitbtn__more > summary { list-style: none; }
  .splitbtn__more > summary::-webkit-details-marker { display: none; }
  .splitbtn__toggle { height: 100%; padding-inline: 10px; border-top-left-radius: 0; border-bottom-left-radius: 0; border-left: 1px solid color-mix(in srgb, var(--on-accent) 30%, transparent); }
  .splitbtn__menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; display: grid; min-width: 220px; padding: 6px; border: 1px solid var(--crust); border-radius: var(--r-md); background: var(--card); box-shadow: 0 10px 28px rgb(0 0 0 / .14); }
  .splitbtn__menu a { padding: 10px 12px; border-radius: 8px; color: var(--ink); text-decoration: none; font-weight: 500; }
  .splitbtn__menu a:hover { background: var(--parchment); color: var(--ink); }
  @media (prefers-reduced-motion: no-preference) { .splitbtn__more[open] .splitbtn__menu { animation: menu-in 140ms ease-out; } }
  @keyframes menu-in { from { opacity: 0; transform: translateY(-4px) scale(.98); } }
}

/* css/components/cards.css */
@layer components {
  .rgrid {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px 12px;
  }
  /* Wider screens fit as many cards of about 160 px as they can (design Browse: 7 across at 1920). */
  @media (min-width: 700px) { .rgrid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); } }
  .rcard { display: grid; gap: 6px; color: var(--ink); text-decoration: none; }
  .rcard:hover { color: var(--ink); }
  .rcard__media {
    position: relative;
    aspect-ratio: 4 / 5;
    border-radius: var(--r-lg);
    overflow: hidden;
    background: var(--parchment);
    box-shadow: var(--photo-inset);
    transition: box-shadow var(--dur-quick) var(--ease-standard), transform var(--dur-quick) var(--ease-standard);
  }
  .rcard__media > svg { position: absolute; inset: 0; width: 100%; height: 100%; transition: transform var(--dur-smooth) var(--ease-standard); }
  @media (hover: hover) and (pointer: fine) {
    .rcard:hover .rcard__media { box-shadow: var(--shadow-2); transform: translateY(-2px); }
    .rcard:hover .rcard__media > svg { transform: scale(1.03); }
  }
  .rcard:active .rcard__media { transform: scale(.98); }
  .rcard__badge, .rcard__time {
    position: absolute;
    left: 10px;
    bottom: 10px;
    padding: 3px 8px;
    border-radius: 8px;
    background: color-mix(in srgb, var(--flour) 88%, transparent);
    color: var(--ink);
    font-size: 12px;
    font-weight: 700;
  }
  .rcard__time { left: auto; right: 10px; }
  .rcard__title { font-family: var(--font-display); font-size: 1.125rem; font-weight: 500; line-height: 1.2; letter-spacing: -0.01em; }
  .rcard__meta { font-size: var(--text-small); color: var(--smoke); }

  .filterbar { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin-inline: calc(-1 * var(--gutter)); padding-inline: var(--gutter); }
  .fchip {
    flex: none;
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 0 14px;
    border-radius: var(--r-pill);
    background: var(--parchment);
    color: var(--ink);
    font-size: var(--text-ui);
    font-weight: 600;
    text-decoration: none;
  }
  .fchip[aria-current="true"], .fchip[aria-current="page"] { background: var(--accent); color: var(--on-accent); }
  /* A count after the label ("Vegan 4"): flex drops the space between them. */
  .fchip > .tnum { margin-left: 6px; font-weight: 500; opacity: .7; }
  .fchip:hover { color: var(--ink); }
  .fchip[aria-current="true"]:hover { color: var(--on-accent); }
  .seg__link { min-height: 36px; padding: 0 14px; border-radius: var(--r-pill); display: inline-flex; align-items: center; font-size: var(--text-small); font-weight: 600; color: var(--ink); text-decoration: none; }
  .seg__link[aria-current="true"] { background: var(--card); box-shadow: 0 1px 3px rgb(var(--shade) / .14); }

  .tablewrap { overflow-x: auto; border: 1px solid var(--crust); border-radius: var(--r-lg); background: var(--card); }
  .table { width: 100%; font-size: var(--text-ui); }
  .table th, .table td { text-align: start; padding: 12px 14px; border-bottom: 1px solid var(--parchment); }
  .table thead th { font-size: var(--text-small); color: var(--smoke); font-weight: 600; position: sticky; top: 0; background: var(--card); }
  .table .num { text-align: end; font-variant-numeric: tabular-nums; }
  .table tbody tr:last-child > * { border-bottom: 0; }
  @media (max-width: 700px) {
    .table thead { display: none; }
    .table, .table tbody, .table tr, .table th, .table td { display: block; }
    .table tr { padding: 12px 14px; border-bottom: 1px solid var(--parchment); }
    .table th, .table td { padding: 2px 0; border: 0; text-align: start !important; }
    .table td::before { content: attr(data-label) ": "; color: var(--smoke); }
  }
  .empty { display: grid; gap: 14px; justify-items: start; padding: var(--s-8) 0; color: var(--smoke); }
  .empty__art { width: 120px; height: auto; margin-bottom: 2px; }
  /* Context menu (right click, long press, menu key) */
  .rcard[data-ctx] { -webkit-touch-callout: none; }
  .ctxmenu { position: absolute; z-index: var(--z-toast, 70); display: grid; min-width: 200px; padding: 6px; border: 1px solid var(--crust); border-radius: var(--r-md); background: var(--card); box-shadow: 0 12px 32px rgb(0 0 0 / .18); }
  .ctxmenu a { padding: 10px 12px; border-radius: 8px; color: var(--ink); text-decoration: none; font-weight: 500; }
  .ctxmenu a:hover, .ctxmenu a:focus-visible { background: var(--parchment); color: var(--ink); outline: none; }
  @media (prefers-reduced-motion: no-preference) { .ctxmenu { animation: ctx-in 120ms ease-out; transform-origin: top left; } }
  @keyframes ctx-in { from { opacity: 0; transform: scale(.96); } }
}

/* css/components/feedback.css */
@layer components {
  /* Alerts and banners: info, success, warning, danger, safety. */
  .alert {
    --al-bg: var(--blueberry-tint); --al-bd: var(--blueberry-line); --al-fg: var(--blueberry);
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr) auto;
    gap: 12px;
    align-items: start;
    padding: 14px 16px;
    border-radius: var(--r-md);
    background: var(--al-bg);
    border: 1px solid var(--al-bd);
    font-size: var(--text-ui);
    line-height: 1.45;
    color: var(--ink);
  }
  .alert--success { --al-bg: var(--basil-tint); --al-bd: var(--basil-line); --al-fg: var(--basil); }
  .alert--warning { --al-bg: var(--saffron-tint); --al-bd: var(--saffron-line); --al-fg: var(--saffron); }
  .alert--danger { --al-bg: var(--beet-tint); --al-bd: var(--beet-line); --al-fg: var(--beet); }
  .alert--safety { --al-bg: var(--parchment); --al-bd: var(--crust); --al-fg: var(--accent); }
  .alert__icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--al-fg);
    color: var(--flour);
    display: grid;
    place-items: center;
    font-size: 13px;
    font-weight: 700;
  }
  .alert__icon .icon { width: 16px; height: 16px; }
  .alert__body { display: grid; gap: 2px; min-width: 0; }
  .alert__title { font-weight: 600; }
  .alert__body a { color: inherit; }
  .alert__dismiss { width: 40px; height: 40px; margin: -8px -8px -8px 0; border-radius: 50%; display: grid; place-items: center; color: var(--smoke); }
  .alert:not(:has(.alert__dismiss)) { grid-template-columns: 24px minmax(0, 1fr); }

  /* Note: a plainer box for short guidance ("All other sessions will be signed out.") */
  .note {
    padding: 12px 14px;
    border-radius: var(--r-md);
    background: var(--blueberry-tint);
    border: 1px solid var(--blueberry-line);
    font-size: 14px;
    line-height: 1.45;
  }
  .note--warm { background: var(--saffron-tint); border-color: var(--saffron-line); }

  /* Fork loader: tines filling like a gauge, never spinning. */
  .loader {
    display: inline-flex;
    align-items: flex-end;
    gap: calc(var(--loader-size, 20px) * .12);
    height: var(--loader-size, 20px);
    color: currentColor;
  }
  .loader span {
    width: max(2px, calc(var(--loader-size, 20px) * .11));
    border-radius: 2px;
    background: currentColor;
    transform-origin: bottom;
    animation: fk-tine 900ms var(--ease-standard) infinite;
  }
  .loader span:nth-child(1) { height: 100%; }
  .loader span:nth-child(2) { height: 72%; animation-delay: 110ms; }
  .loader span:nth-child(3) { height: 86%; animation-delay: 220ms; }
  .loader span:nth-child(4) { height: 60%; animation-delay: 330ms; }
  .loader--md { --loader-size: 36px; }
  @keyframes fk-tine { 0%, 100% { transform: scaleY(.35); } 50% { transform: scaleY(1); } }
  @media (prefers-reduced-motion: reduce) { .loader span { animation-duration: 2400ms; } }

  /* Flash messages at the top of a page */
  .flashes { display: grid; gap: var(--s-2); }

  /* Upload progress (editor photos, profile photo). */
  .eprogress { height: 6px; border-radius: 3px; background: var(--parchment); overflow: hidden; }
  .eprogress span { display: block; height: 100%; width: 0; background: var(--accent); transition: width var(--dur-base) var(--ease-standard); }
  .eprogress__label { margin: 0; font-size: var(--text-small); color: var(--smoke); }

  /* Toasts (public/js/components/toast.js): a small stack of plates. */
  .toasts { position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 16px); transform: translateX(-50%); z-index: var(--z-toast, 70); display: grid; gap: 8px; width: min(92vw, 460px); pointer-events: none; }
  .toast {
    pointer-events: auto; display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 16px; border-radius: 16px;
    background: var(--ink); color: var(--flour); box-shadow: var(--shadow-3); font-size: var(--text-ui);
    animation: fk-toast-in var(--dur-smooth, 280ms) var(--ease-spring, cubic-bezier(.2,.8,.2,1)); touch-action: pan-y;
  }
  .toast__text { flex: 1; min-width: 0; }
  .toast__action { min-height: 40px; padding: 0 14px; border-radius: 12px; border: 0; background: color-mix(in srgb, var(--flour) 16%, transparent); color: var(--flour); font-weight: 700; cursor: pointer; font: inherit; font-weight: 700; }
  .toast__action:hover { background: color-mix(in srgb, var(--flour) 26%, transparent); }
  .toast__close { width: 40px; height: 40px; border: 0; border-radius: 12px; background: none; color: var(--flour); font-size: 20px; cursor: pointer; }
  .toast.is-leaving { animation: fk-toast-out 200ms var(--ease-exit, ease-in) forwards; }
  @keyframes fk-toast-in { from { transform: translateY(16px) scale(.96); opacity: 0; } }
  @keyframes fk-toast-out { to { transform: translateY(10px) scale(.96); opacity: 0; } }
  @media (prefers-reduced-motion: reduce) { .toast, .toast.is-leaving { animation: none; } }
}

@layer components {
  /* Above bottom bars (editor, recipe dock) on phones. */
  @media (max-width: 1099px) { body:has([data-bar]) .toasts, body:has([data-dock]) .toasts { bottom: calc(env(safe-area-inset-bottom) + 88px); } }
}

/* Celebration burst (motion.js burst): decorative pieces around an anchor. */
@layer components {
  .burst { position: absolute; inset: 0; pointer-events: none; overflow: visible; }
  .burst__piece { position: absolute; left: 50%; top: 50%; width: 9px; height: 9px; border-radius: 2px; will-change: transform, opacity; }
  /* Unsaved changes bar (settings forms) */
  .unsaved {
    position: fixed; z-index: 60; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom));
    transform: translateX(-50%); width: min(720px, calc(100% - 32px));
    display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 16px;
    border-radius: 16px; background: var(--ink); color: var(--flour); box-shadow: 0 8px 24px rgb(0 0 0 / .18);
  }
  .unsaved[hidden] { display: none; }
  .unsaved__text { flex: 1; font-size: 15px; }
  .unsaved button { min-height: 44px; padding: 0 16px; border-radius: 12px; border: 0; font: inherit; font-weight: 600; cursor: pointer; }
  .unsaved__discard { background: color-mix(in srgb, var(--flour) 14%, transparent); color: var(--flour); }
  .unsaved__save { background: var(--flour); color: var(--ink); }
  .unsaved button:focus-visible { outline: 2px solid var(--flour); outline-offset: 2px; }
  @media (prefers-reduced-motion: no-preference) { .unsaved { animation: unsaved-in 180ms ease-out; } }
  @keyframes unsaved-in { from { opacity: 0; transform: translate(-50%, 12px); } }
}

@layer components {
  /* Confirm dialog */
  .confirm { width: min(440px, calc(100% - 32px)); padding: 0; border: 1px solid var(--crust); border-radius: 20px; background: var(--card); color: var(--ink); box-shadow: 0 24px 64px rgb(0 0 0 / .22); }
  .confirm::backdrop { background: rgb(20 16 12 / .38); }
  .confirm__body { display: grid; gap: 12px; padding: 22px; }
  .confirm__body h2 { margin: 0; font-size: 1.375rem; }
  .confirm__body p { margin: 0; color: var(--smoke); }
  .confirm__type[hidden] { display: none; }
  .confirm__acts { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }
}

@layer components {
  /* Skeleton rows: where content is on its way */
  .skel { display: grid; gap: 10px; padding: 4px 0; }
  .skel > span { display: block; height: 14px; border-radius: 7px; background: linear-gradient(90deg, var(--parchment) 0%, color-mix(in srgb, var(--parchment) 55%, var(--card)) 50%, var(--parchment) 100%) 0 0 / 200% 100%; }
  .skel > span:nth-child(3n+2) { width: 82%; }
  .skel > span:nth-child(3n) { width: 64%; }
  @media (prefers-reduced-motion: no-preference) { .skel > span { animation: skel 1.4s ease-in-out infinite; } }
  @keyframes skel { from { background-position: 100% 0; } to { background-position: -100% 0; } }
}

@layer components {
  /* Tooltips for icon-only buttons: the accessible name, shown on hover and
     keyboard focus. data-tip="end" anchors it to the right edge near the
     window's edge, "start" to the left. */
  [data-tip] { position: relative; }
  [data-tip]::after {
    content: attr(aria-label); position: absolute; top: calc(100% + 6px); left: 50%; transform: translateX(-50%);
    z-index: var(--z-toast, 70); padding: 5px 9px; border-radius: 8px; background: var(--ink); color: var(--flour);
    font: 600 12px/1.2 var(--font-ui); white-space: nowrap; pointer-events: none; opacity: 0; visibility: hidden;
    transition: opacity 120ms ease 300ms, visibility 0s linear 420ms;
  }
  [data-tip="end"]::after { left: auto; right: 0; transform: none; }
  [data-tip="start"]::after { left: 0; transform: none; }
  @media (hover: hover) { [data-tip]:hover::after { opacity: 1; visibility: visible; transition-delay: 300ms, 300ms; } }
  [data-tip]:focus-visible::after { opacity: 1; visibility: visible; transition-delay: 0s, 0s; }
  @media (prefers-reduced-motion: reduce) { [data-tip]::after { transition: none; } }
}

/* css/components/field.css */
@layer components {
  .field { display: grid; gap: 6px; min-width: 0; }
  .field__label {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: var(--s-3);
    font-size: var(--text-ui);
    font-weight: 600;
  }
  .field__label a, .field__label .link-btn { font-weight: 400; font-size: var(--text-ui); }
  .field__optional { font-weight: 400; color: var(--smoke); }

  .field :where(input[type="range"]) { width: 100%; min-height: 32px; accent-color: var(--accent); }
  .field :where(input[type="file"]) { font: inherit; color: var(--smoke); width: 100%; min-width: 0; }
  .field :where(input[type="file"])::file-selector-button {
    font: inherit; font-weight: 600; color: var(--ink); background: var(--card); border: 1.5px solid var(--crust);
    border-radius: 999px; padding: 10px 18px; margin-inline-end: 12px; cursor: pointer;
  }
  .field :where(input[type="file"]):hover::file-selector-button { border-color: var(--accent); }
  .input, .field :where(input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="range"]):not([type="file"]), select, textarea) {
    width: 100%;
    min-height: 52px;
    padding: 0 14px;
    border-radius: var(--r-sm);
    border: 1px solid var(--crust);
    background: var(--card);
    color: var(--ink);
    font-size: var(--text-input);
    transition: border-color var(--dur-quick) var(--ease-standard), box-shadow var(--dur-quick) var(--ease-standard);
    -webkit-appearance: none;
    appearance: none;
  }
  .field :where(textarea) { padding-block: 12px; min-height: 104px; line-height: 1.5; field-sizing: content; }
  .field :where(select) {
    padding-inline-end: 40px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%236B6158' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
  }
  .input:focus-visible, .field :where(input, select, textarea):focus-visible {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 14%, transparent);
  }
  .field [aria-invalid="true"] { border: 1.5px solid var(--beet); }
  .field--mono input { font-family: var(--font-mono); font-size: 1.125rem; letter-spacing: .08em; }

  .field__hint { font-size: var(--text-small); color: var(--smoke); line-height: 1.45; }
  .field__error {
    font-size: var(--text-small);
    color: var(--beet);
    line-height: 1.45;
    animation: field-error-in var(--dur-base) var(--ease-standard);
  }
  .field__error:empty { display: none; }
  @keyframes field-error-in { from { opacity: 0; transform: translateY(-4px); } }
  .field.is-shaking input { animation: field-shake 280ms var(--ease-standard); }
  @keyframes field-shake { 20%, 60% { transform: translateX(-2px); } 40%, 80% { transform: translateX(2px); } }
  @media (prefers-reduced-motion: reduce) { .field.is-shaking input { animation: none; } }

  /* Input with a fixed prefix: forklet.co/@ */
  .affix {
    display: flex;
    align-items: center;
    min-height: 52px;
    border-radius: var(--r-sm);
    border: 1px solid var(--crust);
    background: var(--card);
    transition: border-color var(--dur-quick) var(--ease-standard), box-shadow var(--dur-quick) var(--ease-standard);
  }
  .affix:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 14%, transparent); }
  .affix__text { padding-inline-start: 14px; color: var(--smoke); font-size: var(--text-input); white-space: nowrap; }
  .field .affix input { border: 0; border-radius: 0; min-height: 50px; padding-inline-start: 2px; background: transparent; box-shadow: none; flex: 1; min-width: 0; }
  .field .affix input:focus-visible { box-shadow: none; }
  .affix:has([aria-invalid="true"]) { border: 1.5px solid var(--beet); }

  /* Password with show/hide */
  .password { position: relative; }
  .field .password input { padding-inline-end: 56px; }
  .password__toggle {
    position: absolute;
    inset-block: 2px;
    inset-inline-end: 2px;
    width: var(--hit);
    display: grid;
    place-items: center;
    border-radius: var(--r-sm);
    color: var(--smoke);
  }
  .password__toggle .icon { width: 22px; height: 22px; }

  /* Strength meter: 12 ticks */
  .meter { display: grid; grid-template-columns: repeat(12, 1fr); gap: 3px; margin-top: 4px; }
  .meter span { height: 6px; border-radius: 2px; background: var(--crust); transition: background-color var(--dur-quick) var(--ease-standard); }
  .meter[data-level="weak"] span.on { background: var(--beet); }
  .meter[data-level="fair"] span.on { background: var(--saffron); }
  .meter[data-level="good"] span.on { background: var(--basil); }

  /* Checkbox, radio, switch: native inputs, custom visuals, 48px hit area. */
  .check {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: var(--hit);
    font-size: var(--text-ui);
    cursor: pointer;
  }
  .check input {
    appearance: none;
    -webkit-appearance: none;
    flex: none;
    width: 24px;
    height: 24px;
    margin: 0;
    border-radius: 6px;
    border: 1.5px solid var(--accent);
    background: var(--card);
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: background-color var(--dur-instant) var(--ease-standard);
  }
  .check input::after {
    content: "";
    width: 14px;
    height: 14px;
    background: var(--on-accent);
    clip-path: polygon(14% 52%, 0 66%, 38% 100%, 100% 22%, 86% 8%, 38% 72%);
    transform: scale(0);
    transition: transform var(--dur-quick) var(--ease-snap);
  }
  .check input:checked { background: var(--accent); }
  .check input:checked::after { transform: scale(1); }
  .check input[type="radio"] { border-radius: 50%; width: 22px; height: 22px; }
  .check input[type="radio"]::after { clip-path: none; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
  .check input[type="radio"]:checked { background: var(--card); }
  .check input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

  .switch { justify-content: space-between; font-weight: 600; }
  .switch input {
    width: 52px;
    height: 32px;
    border-radius: var(--r-pill);
    border: 0;
    background: var(--crust);
    position: relative;
    display: block;
    transition: background-color var(--dur-quick) var(--ease-standard);
  }
  .switch input::after {
    clip-path: none;
    position: absolute;
    top: 3px;
    left: 3px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #FFFFFF;
    box-shadow: 0 1px 3px rgb(30 26 22 / .3);
    transform: none;
    transition: transform var(--dur-base) var(--ease-spring);
  }
  .switch input:checked { background: var(--accent); }
  .switch input:checked::after { transform: translateX(20px); }
  :root[data-theme="dark"] .switch input:checked::after { background: #15120F; }
  @media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .switch input:checked::after { background: #15120F; } }

  .fieldset { border: 0; padding: 0; margin: 0; min-width: 0; display: grid; gap: 2px; }
  .fieldset > legend { padding: 0; margin-bottom: 4px; }

  /* Divider with a word: "or" */
  .or {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: var(--text-small);
    color: var(--smoke);
  }
  .or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--crust); }
  .field__count { justify-self: end; font-size: 12px; color: var(--smoke); font-variant-numeric: tabular-nums; }
  .field__count.is-near { color: var(--ink); font-weight: 600; }
  /* Tag input */
  .tagin { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-height: 52px; padding: 6px 8px; border: 1px solid var(--crust); border-radius: var(--r-md); background: var(--card); }
  .tagin:focus-within { outline: 2px solid var(--ink); outline-offset: 1px; }
  .tagin__chips { display: contents; list-style: none; }
  .tagin__chip { display: inline-flex; align-items: center; gap: 2px; padding: 2px 2px 2px 10px; border-radius: var(--r-pill); background: var(--parchment); font-size: 14px; }
  .tagin__x { width: 28px; height: 28px; border: 0; border-radius: 50%; background: none; color: var(--smoke); cursor: pointer; font-size: 16px; }
  .tagin__x:hover { background: var(--crust); color: var(--ink); }
  .tagin__field { flex: 1 1 120px; min-width: 120px; min-height: 36px; border: 0; background: none; font: inherit; color: var(--ink); }
  .tagin__field:focus { outline: none; }
  .tagin__menu { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 30; list-style: none; margin: 0; padding: 4px; border: 1px solid var(--crust); border-radius: var(--r-md); background: var(--card); box-shadow: 0 8px 24px rgb(0 0 0 / .12); }
  .tagin__menu [role="option"] { padding: 8px 10px; border-radius: 8px; cursor: pointer; }
  .tagin__menu [aria-selected="true"], .tagin__menu [role="option"]:hover { background: var(--parchment); }
}

/* css/components/nav.css */
@layer components {
  .avatar {
    --size: 40px;
    flex: none;
    width: var(--size);
    height: var(--size);
    border-radius: 50%;
    display: inline-grid;
    place-items: center;
    background: var(--av, var(--parchment));
    color: #1E1A16;
    font-size: calc(var(--size) * .36);
    font-weight: 700;
    letter-spacing: .01em;
    object-fit: cover;
    user-select: none;
  }
  .avatar--ring { box-shadow: 0 0 0 2px var(--flour), 0 0 0 4px var(--accent); }

  .topbar__spacer { flex: 1; }
  .topbar__nav { display: none; gap: var(--s-1); align-items: center; }
  .topbar__nav a {
    display: inline-flex;
    align-items: center;
    min-height: var(--hit);
    padding: 0 12px;
    border-radius: var(--r-md);
    color: var(--ink);
    text-decoration: none;
    font-size: var(--text-ui);
    font-weight: 500;
  }
  .topbar__nav a[aria-current="page"] { font-weight: 700; }
  @media (min-width: 768px) { .topbar__nav { display: flex; } }
  /* Phones: the guest's one button is Sign In, which links on to Create Account. */
  .topbar__signup { display: none; }
  /* New Recipe lives in the bar on wider screens; phones have it on Me and My Kitchen. */
  .topbar__new { display: none; }
  @media (min-width: 900px) { .topbar__new { display: inline-flex; } }
  @media (min-width: 768px) { .topbar__signup { display: inline-flex; } .topbar__signin { display: none; } }

  /* Account menu: a native <details> so it works without JavaScript. */
  .menu { position: relative; }
  .menu > summary {
    list-style: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: var(--hit);
    min-width: var(--hit);
    justify-content: center;
    border-radius: var(--r-pill);
    cursor: pointer;
  }
  .menu > summary::-webkit-details-marker { display: none; }
  .menu__panel {
    position: absolute;
    inset-inline-end: 0;
    top: calc(100% + 6px);
    z-index: var(--z-dropdown);
    min-width: 240px;
    padding: 8px;
    border-radius: var(--r-md);
    background: var(--card);
    border: 1px solid var(--crust);
    box-shadow: var(--shadow-3);
    transform-origin: top right;
    animation: menu-in var(--dur-base) var(--ease-spring);
  }
  @keyframes menu-in { from { opacity: 0; transform: scaleY(.92); } }
  @media (prefers-reduced-motion: reduce) { .menu__panel { animation: none; } }
  .menu__who { padding: 8px 12px 10px; border-bottom: 1px solid var(--crust); margin-bottom: 6px; display: grid; }
  .menu__who span { font-size: var(--text-small); color: var(--smoke); }
  .menu__panel a, .menu__panel button {
    display: flex;
    width: 100%;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    padding: 0 12px;
    border-radius: 10px;
    color: var(--ink);
    text-decoration: none;
    font-size: var(--text-ui);
    text-align: start;
  }
  .menu__panel .icon { width: 20px; height: 20px; color: var(--smoke); }
  @media (hover: hover) and (pointer: fine) {
    .menu__panel a:hover, .menu__panel button:hover { background: var(--parchment); color: var(--ink); }
  }

  /* Banner under the top bar (unverified email and similar). */
  .site-banner {
    background: var(--saffron-tint);
    border-bottom: 1px solid var(--saffron-line);
    font-size: var(--text-ui);
  }
  .site-banner .container { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; min-height: 48px; padding-block: 8px; }
}

@layer components {
  /* Site links in the top bar: an icon on phones, icon and label from 768px. */
  .topbar__link { display: inline-flex; align-items: center; gap: 6px; min-height: var(--hit); min-width: var(--hit); justify-content: center; padding: 0 10px; border-radius: var(--r-md); color: var(--ink); text-decoration: none; font-size: var(--text-ui); font-weight: 500; }
  .topbar__link > span:not(.topbar__count) { display: none; }
  .topbar__link[aria-current="page"] { font-weight: 700; }
  @media (min-width: 768px) { .topbar__link > span:not(.topbar__count) { display: inline; } }
}

@layer components {
  .topbar .btn { white-space: nowrap; }
  @media (max-width: 420px) { .topbar__inner { gap: 4px; } .topbar__link { padding: 0 6px; min-width: 40px; } }
}

@layer components {
  /* Bottom tab bar on phones (spec 18.2; design Landing) */
  :root { --tabbar-h: 0px; }
  .tabbar { display: none; }
  @media (max-width: 767px) {
    .has-tabbar { --tabbar-h: calc(61px + env(safe-area-inset-bottom)); }
    .has-tabbar .page { padding-bottom: var(--tabbar-h); }
    /* Search and Explore are in the bar; the top keeps the brand, bell and menu. */
    .has-tabbar .topbar__link:not(.topbar__bell) { display: none; }
    .tabbar {
      position: fixed; left: 0; right: 0; bottom: 0; z-index: var(--z-sticky, 30);
      display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
      padding: 4px 4px calc(env(safe-area-inset-bottom) + 4px);
      background: color-mix(in srgb, var(--flour) 96%, transparent);
      border-top: 1px solid var(--crust);
      backdrop-filter: saturate(1.2) blur(8px);
    }
    .tabbar__tab { min-height: 52px; display: grid; justify-items: center; align-content: center; gap: 3px; border-radius: 12px; color: var(--smoke); text-decoration: none; font-size: 11px; font-weight: 600; }
    .tabbar__tab:hover { color: var(--ink); }
    .tabbar__tab[aria-current="page"] { color: var(--ink); }
    .tabbar__tab[aria-current="page"] .icon { stroke-width: 2.4; }
    /* Things pinned to the bottom sit above the bar. */
    .has-tabbar .toasts, .has-tabbar .unsaved { bottom: calc(var(--tabbar-h) + 12px); }
  }
  @media print { .tabbar { display: none !important; } }
}

@layer components {
  /* Command palette (Ctrl or Cmd K) */
  .palette { width: min(640px, calc(100% - 24px)); max-height: min(560px, calc(100dvh - 48px)); margin: 10vh auto auto; padding: 0; border: 1px solid var(--crust); border-radius: 20px; background: var(--card); color: var(--ink); box-shadow: 0 24px 64px rgb(0 0 0 / .22); overflow: hidden; }
  .palette[open] { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
  .palette::backdrop { background: rgb(20 16 12 / .38); }
  .palette__form { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--parchment); }
  .palette__input { flex: 1; min-width: 0; min-height: 48px; border: 0; background: none; color: var(--ink); font: inherit; font-size: 18px; }
  .palette__input:focus { outline: none; }
  .palette__input::-webkit-search-cancel-button { display: none; }
  .palette__esc { font: 600 12px var(--font-ui); color: var(--smoke); border: 1px solid var(--crust); border-radius: 6px; padding: 2px 6px; }
  .palette__list { list-style: none; margin: 0; padding: 6px; overflow-y: auto; overscroll-behavior: contain; }
  .palette__group { padding: 10px 10px 4px; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--smoke); }
  .palette__opt { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 44px; padding: 0 10px; border-radius: 10px; cursor: pointer; }
  .palette__opt span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .palette__opt small { flex: none; color: var(--smoke); font-size: 12px; }
  .palette__opt[aria-selected="true"] { background: var(--parchment); }
  .palette__status { margin: 0; padding: 8px 16px; font-size: 12px; color: var(--smoke); border-top: 1px solid var(--parchment); min-height: 34px; }
  @media (prefers-reduced-motion: no-preference) { .palette[open] { animation: palette-in 140ms ease-out; } }
  @keyframes palette-in { from { opacity: 0; transform: translateY(-6px) scale(.99); } }
}

@layer components {
  /* Floating action button (phones): New Recipe; hides while scrolling down */
  .fab { position: fixed; right: 16px; bottom: calc(var(--tabbar-h, 0px) + 16px + env(safe-area-inset-bottom)); z-index: var(--z-sticky); display: inline-flex; align-items: center; gap: 8px; min-height: 56px; padding: 0 20px 0 16px; border-radius: 28px; background: var(--accent); color: var(--on-accent); font-weight: 700; text-decoration: none; box-shadow: 0 10px 28px rgb(0 0 0 / .22); transition: transform 220ms var(--ease-spring, ease), opacity 160ms; }
  .fab:hover { color: var(--on-accent); }
  .fab.is-hidden { transform: translateY(calc(100% + 32px)); opacity: 0; pointer-events: none; }
  @media (min-width: 768px) { .fab { display: none; } }
  @media (prefers-reduced-motion: reduce) { .fab { transition: none; } }
  @media print { .fab { display: none !important; } }
}

/* css/components/otp.css */
@layer components {
  /* One real input (so autofill, paste and screen readers just work) laid over
     six visual boxes. Without JavaScript the input itself is visible and usable. */
  .otp { position: relative; }
  .otp__input {
    width: 100%;
    min-height: 60px;
    padding: 0 14px;
    border-radius: var(--r-md);
    border: 1.5px solid var(--crust);
    background: var(--card);
    color: var(--ink);
    font-size: 1.625rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    letter-spacing: .5em;
    text-align: center;
  }
  .otp__boxes { display: none; }

  .otp.is-enhanced .otp__boxes {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 8px;
    pointer-events: none;
  }
  .otp.is-enhanced .otp__input {
    position: absolute;
    inset: 0;
    z-index: 1;
    border: 0;
    background: transparent;
    color: transparent;
    caret-color: transparent;
    letter-spacing: 0;
    text-align: left;
    font-size: 16px;
  }
  .otp.is-enhanced .otp__input::selection { background: transparent; }
  .otp__box {
    height: 60px;
    min-width: 0;
    border-radius: var(--r-md);
    border: 1.5px solid var(--crust);
    background: var(--flour);
    display: grid;
    place-items: center;
    font-size: 1.625rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: var(--ink);
    transition: border-color var(--dur-quick) var(--ease-standard), background-color var(--dur-base) var(--ease-standard), transform var(--dur-quick) var(--ease-spring);
    transition-delay: 0ms, var(--delay, 0ms), 0ms;
  }
  .otp__box.is-filled { border-color: var(--accent); }
  .otp.is-focused .otp__box.is-current { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 14%, transparent); }
  .otp.is-focused .otp__box.is-current::after {
    content: "";
    width: 2px;
    height: 28px;
    background: var(--accent);
    animation: otp-caret 1s steps(1) infinite;
  }
  @keyframes otp-caret { 50% { opacity: 0; } }
  .otp.is-pasted .otp__box { animation: otp-pulse var(--dur-smooth) var(--ease-spring); animation-delay: var(--delay, 0ms); }
  @keyframes otp-pulse { 40% { transform: scale(1.06); } }
  .otp.is-ok .otp__box { border-color: var(--basil); background: var(--basil-tint); color: var(--basil); }
  .otp.is-error .otp__box { border-color: var(--beet); }
  .otp[aria-invalid="true"] .otp__input:not(.is-enhanced *) { border-color: var(--beet); }
  @media (prefers-reduced-motion: reduce) {
    .otp.is-pasted .otp__box { animation: none; }
  }
}

/* css/pages/admin.css */
/* Admin area (spec 18.18): plain tables, a coverage bar and the category tree. */
@layer pages {
  .admin .settings__page { display: grid; gap: 16px; align-content: start; }
  .admin__table { width: 100%; border-collapse: collapse; font-size: var(--text-ui); background: var(--card); border: 1px solid var(--crust); border-radius: var(--r-md); overflow: hidden; }
  .admin__table th, .admin__table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--parchment); vertical-align: top; }
  .admin__table thead th { font-size: var(--text-small); color: var(--smoke); font-weight: 600; background: var(--flour); }
  .admin__table tbody th { font-weight: 600; }
  .admin__table .tnum { text-align: right; }
  .admin__table select { min-height: 36px; }
  .admin__bar { display: flex; height: 14px; border-radius: 7px; overflow: hidden; background: var(--parchment); }
  .admin__bar-own { background: var(--basil); }
  .admin__bar-inh { background: var(--basil-line); }
  .admin__tree { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
  .admin__tree > li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 6px; align-items: start; padding: 6px 8px 6px calc(8px + var(--depth, 0) * 22px); background: var(--card); border: 1px solid var(--parchment); border-radius: 10px; }
  .admin__tree summary { cursor: pointer; display: flex; gap: 10px; align-items: baseline; min-height: 36px; flex-wrap: wrap; }
  .admin__tree-name { font-weight: 600; }
  .admin__acts { display: flex; }
  .admin__add { max-width: 760px; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) auto; }
  @media (max-width: 640px) {
    .admin__table { display: block; overflow-x: auto; }
    .admin__add { grid-template-columns: minmax(0, 1fr); }
  }
}

/* Suggest a correction on an ingredient page. */
@layer pages {
  .ingpage__suggest { border-top: 1px solid var(--crust); padding-top: 12px; margin-top: 8px; }
  .ingpage__suggest > summary { cursor: pointer; font-weight: 600; min-height: 44px; display: flex; align-items: center; }
}

/* css/pages/auth.css */
@layer pages {
  /* Auth pages: a calm split screen. Photo half on desktop, photo band on
     mobile, one short form (spec 18.17, design Auth). */
  .auth {
    min-height: 100dvh;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
  }
  .auth__photo {
    position: relative;
    min-height: clamp(150px, 24dvh, 100dvh);
    overflow: hidden;
    background: var(--parchment);
  }
  .auth__photo svg, .auth__photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
  .auth__brand {
    position: absolute;
    top: calc(env(safe-area-inset-top) + 12px);
    inset-inline-start: 16px;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: var(--hit);
    padding: 0 14px;
    border-radius: var(--r-pill);
    background: color-mix(in srgb, var(--flour) 90%, transparent);
    color: var(--ink);
    text-decoration: none;
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 600;
  }
  .auth__brand:hover { color: var(--ink); }
  .auth__brand svg { position: static; width: 24px; height: 24px; }

  .auth__main {
    width: 100%;
    max-width: 520px;
    justify-self: center;
    display: grid;
    align-content: center;
    gap: 20px;
    padding: clamp(24px, 5vw, 64px) clamp(20px, 5vw, 64px) calc(env(safe-area-inset-bottom) + 32px);
  }
  .auth__head { display: grid; gap: 8px; }
  .auth__head h1 { font-size: clamp(1.875rem, 1.5rem + 1.6vw, 2.625rem); }
  .auth__sub { font-size: 1rem; line-height: 1.5; color: var(--smoke); }
  .auth__form { display: grid; gap: 16px; }
  .auth__links { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; }
  .auth__links .link-btn, .auth__links a { min-height: 44px; display: inline-flex; align-items: center; font-size: var(--text-ui); }
  .auth__center { text-align: center; font-size: var(--text-ui); }
  .auth__center a, .auth__center .link-btn { display: inline-flex; min-height: 44px; align-items: center; }
  .auth__fine { font-size: var(--text-small); color: var(--smoke); line-height: 1.5; }
  .auth__card {
    display: grid;
    gap: 14px;
    padding: 20px;
    border-radius: var(--r-lg);
    background: var(--card);
    border: 1px solid var(--crust);
  }
  .auth__card strong { font-family: var(--font-display); font-size: 1.25rem; font-weight: 600; }
  .auth__card p { font-size: var(--text-ui); line-height: 1.5; color: var(--smoke); }
  .auth__codes {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 16px;
    padding: 16px;
    border-radius: var(--r-md);
    background: var(--parchment);
    font-family: var(--font-mono);
    font-size: 1rem;
    letter-spacing: .04em;
    list-style: none;
    margin: 0;
  }
  @media (min-width: 900px) {
    .auth__photo { min-height: 100dvh; position: sticky; top: 0; max-height: 100dvh; }
  }
}

/* css/pages/batches.css */
@layer pages {
  /* Test batches, weigh log and batch sheets (spec 17.2) */
  .batches, .batch { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; padding-block: var(--s-4) var(--s-12); }
  .batch__form, .batch__form > section { display: grid; grid-template-columns: minmax(0, 1fr); min-width: 0; }
  .batches__head h1, .batch__head h1 { margin: 0; font-size: clamp(30px, 4vw, 44px); }
  .batches__head { display: grid; gap: 8px; }
  .batches__new { max-width: 720px; }
  .batches__new h2, .batches__list h2 { margin: 0; font-size: var(--text-h3); }
  .batches__scale { margin: 0; }
  .batches__newrow { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
  .batches__newrow .field { flex: 1 1 240px; }
  .batches__list { display: grid; gap: 10px; max-width: 900px; }
  .batches__listhead { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
  .blist { list-style: none; margin: 0; padding: 0; border: 1px solid var(--crust); border-radius: var(--r-lg); background: var(--card); overflow: hidden; }
  .blist li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 14px; }
  .blist li + li { border-top: 1px solid var(--parchment); }
  .blist__pick { display: grid; place-items: center; width: 32px; height: 44px; }
  .blist__main { display: grid; gap: 2px; color: var(--ink); text-decoration: none; min-width: 0; }
  .blist__main:hover strong { text-decoration: underline; }
  .blist__state { font-size: var(--text-small); color: var(--smoke); text-align: end; }
  .batch__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 12px; }
  .batch__kind { margin: 0 0 4px; font-size: 13px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--smoke); }
  .batch__meta { margin: 4px 0 0; color: var(--smoke); }
  .batch__acts { display: flex; gap: 8px; align-items: center; }
  .batch__form { display: grid; gap: 24px; }
  .batch__form h2 { margin: 0 0 6px; font-size: var(--text-h3); }
  .batch__fields { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); max-width: 960px; }
  .batch__scroll { position: relative; overflow-x: auto; }
  .btable { width: 100%; border-collapse: collapse; font-size: var(--text-ui); background: var(--card); border: 1px solid var(--crust); border-radius: var(--r-md); }
  .btable th, .btable td { padding: 6px 10px; text-align: start; border-bottom: 1px solid var(--parchment); vertical-align: middle; }
  .btable thead th { font-size: 12px; font-weight: 700; color: var(--smoke); text-transform: uppercase; letter-spacing: .03em; white-space: nowrap; }
  .btable .num { text-align: end; white-space: nowrap; }
  .btable tbody th { font-weight: 600; }
  .btable th .field__hint, .btable td .field__hint { display: block; font-weight: 400; }
  .btable__group th { background: var(--parchment); font-size: 13px; font-weight: 700; }
  .btable__in { width: 100%; min-width: 90px; min-height: 40px; padding: 0 8px; border: 1px solid var(--crust); border-radius: 8px; background: var(--flour); color: var(--ink); font: inherit; }
  td.num .btable__in { text-align: end; max-width: 130px; }
  .btable__lot { min-width: 120px; }
  .btable__step { max-width: 360px; font-size: 13px; color: var(--smoke); }
  .btable__text { white-space: pre-line; min-width: 180px; }
  .btable tr.is-out th[scope="row"] { color: var(--beet); }
  .bdev { color: var(--smoke); }
  .bdev.is-out { color: var(--beet); font-weight: 700; }
  .bdev.is-ok { color: var(--basil); }
  .btable--compare td.is-out { background: var(--beet-tint); }
  .btable--compare thead th { text-transform: none; letter-spacing: 0; font-size: 14px; color: var(--ink); white-space: normal; }
  .btable--compare thead th .field__hint { font-size: 12px; color: var(--smoke); }
  .bparams { display: grid; gap: 8px; max-width: 560px; }
  .bparams__row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .batch__notes { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
  .print-only { display: none; }

  /* The batch sheet: fields become lines to write on. */
  @media print {
    .batch { padding: 0; gap: 10px; font-size: 10pt; }
    .batch .flashes { display: none; }
    .batch ::placeholder { color: transparent; }
    .batch__head h1 { font-size: 18pt; }
    .btable { border: 0; font-size: 9pt; }
    .btable th, .btable td { padding: 3px 6px; border-bottom: 1px solid #999; }
    .btable__in, .batch__fields input, .batch__notes textarea, .bparams input { border: 0; border-bottom: 1px solid #555; border-radius: 0; background: none; min-height: 22px; appearance: none; }
    .batch__notes textarea { min-height: 60px; }
    select.btable__in:has(option[value=""]:checked) { color: transparent; }
    .batch__scroll { overflow: visible; }
    .print-only { display: flex; gap: 40px; }
    .batch__sign span { flex: 1; border-top: 1px solid #555; padding-top: 4px; font-size: 9pt; margin-top: 30px; }
    tr { break-inside: avoid; }
  }

  /* Team workspaces */
  .team, .teams, .coauthors { display: grid; gap: 20px; padding-block: var(--s-4) var(--s-12); }
  .team__head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
  .team__head h1 { margin: 0; }
  .team__sec { display: grid; gap: 12px; max-width: 900px; }
  .team__sec h2 { margin: 0; font-size: var(--text-h3); }
  .team__log { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: var(--text-small); }
  .team__log li { display: flex; flex-wrap: wrap; gap: 4px 12px; padding: 6px 0; border-bottom: 1px solid var(--parchment); }
  .team__log time { color: var(--smoke); font-variant-numeric: tabular-nums; min-width: 150px; }
  .pricelist__name strong { color: var(--ink); }
}

/* css/pages/book.css */
@layer pages {
  /* A catalog as a printed cookbook */
  .book { max-width: 900px; margin: 0 auto; padding: 16px var(--gutter) 64px; display: grid; gap: 40px; }
  .book__bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; }
  .book__bar .field__hint { flex-basis: 100%; margin: 0; }
  .book__cover { display: grid; gap: 12px; padding: 48px 0 24px; border-bottom: 1px solid var(--crust); }
  .book__kicker { margin: 0; font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--smoke); }
  .book__cover h1 { margin: 0; font-size: clamp(40px, 6vw, 72px); line-height: 1; }
  .book__desc { margin: 0; font-size: 1.125rem; color: var(--smoke); max-width: 60ch; white-space: pre-line; }
  .book__by { margin: 0; color: var(--smoke); }
  .book__toc h2 { margin: 0 0 8px; }
  .book__toc ol { margin: 0; padding-left: 1.5em; columns: 2 16rem; column-gap: 32px; }
  .book__toc li { break-inside: avoid; padding: 3px 0; }
  .book__toc a { color: var(--ink); }
  .book__recipe { display: grid; gap: 16px; padding-top: 24px; border-top: 1px solid var(--crust); }
  .book__rhead { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 14px; align-items: baseline; }
  .book__num { font-family: var(--font-display); font-size: 1.75rem; color: var(--smoke); grid-row: span 2; }
  .book__rhead h2 { margin: 0; font-size: clamp(26px, 3vw, 34px); }
  .book__meta { margin: 0; color: var(--smoke); font-size: var(--text-small); }
  .book__cols { display: grid; gap: 24px; }
  @media (min-width: 760px) { .book__cols { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); } }
  .book .units, .book .units__default, .book .ing__swap, .book .chip-timer__ring, .book [data-units] { display: none !important; }
  .book__foot { margin: 0; font-size: 12px; color: var(--smoke); }

  @media print {
    .book-page .topbar, .book-page .site-footer, .book-page .tabbar { display: none !important; }
    body.book-page { background: #FFFFFF; }
    .book { page: book; max-width: none; padding: 0; gap: 0; font-size: 10pt; }
    .book__cover { min-height: 80vh; align-content: center; border: 0; break-after: page; }
    .book__toc { break-after: page; }
    .book__recipe { break-before: page; border: 0; padding-top: 0; }
    .book__cols { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
    .book__toc a { text-decoration: none; }
  }
}

@page book { margin: 16mm 14mm 18mm; @bottom-center { content: counter(page); font: 9pt "Inter", sans-serif; color: #6B6158; } }

/* css/pages/browse.css */
@layer pages {
  /* Explore and listing pages (spec 12, 18.5; design Browse) */
  .browse { display: grid; gap: var(--s-5); padding-block: var(--s-4) var(--s-12); }
  .browse__title { margin: 0; font-size: var(--text-h1); }
  .browse__head {
    display: grid; gap: 6px; align-content: end; min-height: clamp(160px, 22vw, 300px);
    padding: clamp(20px, 4vw, 32px); border-radius: var(--r-xl, 28px);
    background:
      linear-gradient(180deg, transparent 30%, color-mix(in srgb, var(--ink) 72%, transparent)),
      repeating-linear-gradient(135deg, color-mix(in srgb, var(--band) 88%, white) 0 18px, var(--band) 18px 36px);
    color: #FAF6EF;
  }
  .browse__head h1 { margin: 0; font-size: clamp(2.25rem, 1.6rem + 3vw, 3.75rem); line-height: 1.02; color: inherit; }
  .browse__head p { margin: 0; max-width: 60ch; font-size: var(--text-body); color: inherit; opacity: .92; }
  .browse__kicker { font-size: var(--text-small); opacity: .9; }
  .browse__sec { display: grid; gap: 12px; }
  .browse__sechead { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
  .browse__sechead h2 { margin: 0; font-size: var(--text-h2); }
  .browse__sechead a { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; text-decoration: none; min-height: 44px; }
  .browse__eyebrow { margin: 0; font-family: var(--font-ui, inherit); font-size: var(--text-small); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
  .browse__filters { display: grid; gap: 10px; }
  .browse__sort { justify-self: start; }
  .browse__count { margin: 0; color: var(--smoke); font-size: var(--text-ui); }
  .ctile .rcard__media { aspect-ratio: 1; }
  .ctiles--row { grid-auto-flow: column; grid-auto-columns: minmax(150px, 1fr); grid-template-columns: none; overflow-x: auto; scrollbar-width: none; scroll-snap-type: x mandatory; scroll-padding-inline: var(--gutter); margin-inline: calc(-1 * var(--gutter)); padding-inline: var(--gutter); }
  .ctiles--row::-webkit-scrollbar { display: none; }
  .ctiles--row > li { scroll-snap-align: start; }
  @media (min-width: 1000px) { .ctiles--row { grid-auto-columns: calc((100% - 5 * 16px) / 6); margin-inline: 0; padding-inline: 0; scroll-padding-inline: 0; } }
  .facetlist { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }
  .facetlist li { padding-left: calc(var(--depth, 0) * 18px); display: flex; gap: 8px; align-items: baseline; min-height: 40px; }
  .facetlist a { font-weight: 600; color: var(--ink); text-underline-offset: 3px; }
  .facetlist span { color: var(--smoke); font-size: var(--text-small); }
  .pager { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: center; }
  .pager > :last-child { justify-self: end; }
  .pager__at { color: var(--smoke); font-size: var(--text-small); }
  .badge--cat { background: var(--card); border: 1px solid var(--crust); font-weight: 600; }
  .filed-under a { color: inherit; }
}

@layer pages {
  .ctile .rcard__title { font-family: var(--font-ui); font-weight: 600; font-size: var(--text-ui); }
}

@layer pages {
  /* Search (spec 18.10; design Browse, Search) */
  .search__form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px; padding: 6px 6px 6px 20px; border: 1px solid var(--crust); border-radius: var(--r-lg); background: var(--card); }
  .search__form input { border: 0; background: transparent; font-size: 1.125rem; min-height: 48px; min-width: 0; outline: none; }
  .search__form:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
  .search__form .btn span { display: none; }
  @media (min-width: 600px) { .search__form .btn span { display: inline; } }
  .search__chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
  .search__label { color: var(--smoke); font-size: var(--text-small); }
  .ichip { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px; border-radius: var(--r-pill); font-weight: 600; font-size: var(--text-ui); text-decoration: none; }
  .ichip--have { background: var(--basil-tint); color: var(--basil); }
  .ichip--without { background: var(--beet-tint); color: var(--beet); }
  .ichip:hover { text-decoration: line-through; }
  .search__understood { margin: 0; color: var(--smoke); font-size: var(--text-ui); }
  .search__intro { text-align: left; justify-items: start; }
  .search__intro p { max-width: 60ch; }
  .search__tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--crust); margin-inline: calc(-1 * var(--gutter)); padding-inline: var(--gutter); }
  .search__tabs::-webkit-scrollbar { display: none; }
  .search__tabs a { flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 48px; padding: 0 14px; color: var(--smoke); font-weight: 600; text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; }
  .search__tabs a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--ink); }
  .search__tabs a span { font-weight: 400; }
  .ingresults { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
  .ingresults li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px; align-items: center; padding: 10px 12px; border-radius: var(--r-lg); background: var(--card); border: 1px solid var(--crust); }
  .ingresults__name { display: grid; min-width: 0; }
  .ingresults__name span { color: var(--smoke); font-size: var(--text-small); }
}

@layer pages {
  .seg.browse__sort { max-width: 100%; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .browse__sort::-webkit-scrollbar { display: none; }
  .browse__sort .seg__link { flex: none; white-space: nowrap; }
}

@layer pages {
  /* Dish page and compare view (spec 12.4; design Dish) */
  .dish__head { display: grid; gap: 6px; }
  .dish__head h1 { margin: 0; font-size: clamp(2.25rem, 1.6rem + 3vw, 3.75rem); line-height: 1.02; }
  .dish__head p { margin: 0; max-width: 62ch; color: var(--smoke); font-size: var(--text-body); }
  .dish__head .browse__kicker { color: var(--smoke); }
  .dish__tabs { justify-self: start; }
  .dish__item { display: grid; gap: 8px; align-content: start; }
  .dish__pick { justify-self: start; }
  .dish__note { margin: 0; color: var(--smoke); font-size: var(--text-small); }
  .dish__compare th[scope="col"] { text-align: right; vertical-align: bottom; }
  .dish__compare th[scope="col"]:first-child { text-align: left; font-size: var(--text-small); color: var(--smoke); }
  .dish__compare th[scope="col"] a { display: block; font-family: var(--font-display); font-weight: 500; font-size: 1.0625rem; color: var(--ink); text-decoration: none; }
  .dish__compare th[scope="col"] span { display: block; font-weight: 400; font-size: 12px; color: var(--smoke); }
  .dish__compare td.is-off { background: var(--saffron-tint); font-weight: 700; }
  .dish__compare td.is-base { text-decoration: underline; text-decoration-color: var(--crust); text-underline-offset: 4px; }
  .dish__sum th, .dish__sum td { border-top: 2px solid var(--crust); color: var(--smoke); }
}

/* css/pages/cards.css */
@layer pages {
  /* Recipe cards (spec 9, design Recipe Cards) */
  .cards { max-width: 1000px; margin: 0 auto; padding: 12px var(--gutter, 16px) 48px; display: grid; gap: 20px; }
  .cards__bar { max-width: 900px; width: 100%; margin: 0 auto; display: grid; gap: 12px; }
  .cards__top { display: flex; align-items: center; gap: 12px; }
  .cards__top h1 { margin: 0; flex: 1; font-size: 1.75rem; }
  .cards__back { min-height: 48px; display: inline-flex; align-items: center; gap: 4px; font-weight: 600; text-decoration: none; color: var(--ink); }
  .cards__types { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; }
  .cards__types .fchip { flex: none; }
  .cards__note { margin: 0; font-size: var(--text-small); color: var(--smoke); }

  .card {
    background: var(--card); border-radius: var(--r-lg); padding: clamp(20px, 5vw, 28px);
    box-shadow: var(--shadow-3); display: grid; gap: 18px; width: 100%; margin: 0 auto;
  }
  .card--ingredients { max-width: 560px; }
  .card--quick { max-width: 820px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 28px; align-items: start; }
  .card__col { display: grid; gap: 14px; align-content: start; }
  .card__head { display: grid; gap: 4px; }
  .card__head h2 { margin: 0; font-size: 1.875rem; line-height: 1.05; }
  .card__kind, .card__makes { font-size: var(--text-small); color: var(--smoke); }
  .card__makes { font-size: 0.9375rem; }
  .card__group { display: grid; gap: 6px; }
  .card__group h3 { margin: 6px 0 2px; font-family: var(--font-ui); font-size: 0.8125rem; letter-spacing: .08em; text-transform: uppercase; }
  .card__checklist { list-style: none; margin: 0; padding: 0; display: grid; }
  .card__checklist label {
    display: grid; grid-template-columns: 22px minmax(72px, 90px) 1fr; gap: 10px; align-items: center;
    padding: 7px 0; border-bottom: 1px solid var(--parchment); font-size: 1.0625rem; cursor: pointer; min-height: 44px;
  }
  .card__checklist input { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); }
  .card__checklist input:checked ~ span { color: var(--smoke); text-decoration: line-through; }
  .card__amt { text-align: right; font-weight: 600; }
  .card__lines { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
  .card__lines li { display: grid; grid-template-columns: minmax(64px, 78px) 1fr; gap: 10px; font-size: 0.9375rem; padding: 3px 0; }
  .card__steps { margin: 0; padding: 0 0 0 20px; display: grid; gap: 10px; font-size: 0.9375rem; line-height: 1.5; align-content: start; }
  .card__steps li.is-critical::marker { color: var(--beet); font-weight: 700; }
  .card__stepcomp { font-weight: 700; text-transform: uppercase; font-size: 0.75rem; letter-spacing: .06em; color: var(--smoke); }
  .card__facts { white-space: nowrap; }

  /* Index cards: 6 x 4 in (152 x 102 mm) or A6 landscape (148 x 105 mm). */
  .ixcards { display: flex; gap: 24px; flex-wrap: wrap; justify-content: center; }
  .ixcard {
    width: min(100%, 576px); min-height: calc(min(100vw - 32px, 576px) * 4 / 6);
    background: #FFFDF8; color: #1E1A16; border-radius: 6px; box-shadow: var(--shadow-3);
    padding: 22px 26px; font-size: 13px;
  }
  .ixcards--a6 .ixcard { min-height: calc(min(100vw - 32px, 576px) * 105 / 148); }
  .ixcard--front {
    display: grid; grid-template-rows: auto 1fr auto; gap: 8px;
    background-image: repeating-linear-gradient(to bottom, transparent 0 29px, #DCE6EE 29px 30px);
    background-position: 0 58px;
  }
  .ixcard__title { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; border-bottom: 1.5px solid #C9747A; padding-bottom: 6px; }
  .ixcard__title h2 { margin: 0; font-size: 1.5rem; line-height: 1.1; }
  .ixcard__title span, .ixcard__foot { font-size: 11px; color: #6B6158; }
  .ixcard__lines { columns: 2; column-gap: 20px; line-height: 30px; }
  .ixcard__line { break-inside: avoid; }
  .ixcard__group { break-after: avoid; font-weight: 700; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; }
  .ixcard--back { display: grid; grid-template-columns: 1fr 88px; gap: 16px; }
  .ixcard__steps { margin: 0; padding-left: 18px; line-height: 1.45; display: grid; gap: 4px; align-content: start; }
  .ixcard__steps li.is-critical::marker { color: #C94F2D; font-weight: 700; }
  .ixcard__qr { display: grid; align-content: end; justify-items: center; gap: 4px; text-align: center; }
  .ixcard__qr svg { width: 84px; height: 84px; display: block; }
  .ixcard__qr span { font-size: 9px; color: #6B6158; }
  @media (max-width: 480px) {
    .ixcard__lines { columns: 1; }
    .ixcard--back { grid-template-columns: 1fr; }
    .ixcard__qr { justify-items: start; }
  }

  /* Station cards */
  .stations { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 16px; max-width: 1000px; width: 100%; margin: 0 auto; }
  .station { background: var(--card); border-radius: var(--r-lg); padding: 22px; border-top: 8px solid var(--ink); box-shadow: var(--shadow-3); display: grid; gap: 12px; align-content: start; }
  .station__head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
  .station__head h2 { margin: 0; font-size: 1.625rem; }
  .station__head span { font-size: var(--text-small); color: var(--smoke); }
  .card__lines--station li { grid-template-columns: minmax(72px, 84px) 1fr; font-size: 1.0625rem; padding: 4px 0; border-bottom: 1px solid var(--parchment); }
  .card__lines--station .card__amt { font-weight: 700; }
  .station__tol { color: var(--smoke); font-size: 0.875rem; }
  .card__steps--station { font-size: 0.9375rem; }
  .station__ccp { display: inline-block; font-size: 0.6875rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: 1px 6px; border-radius: 4px; background: var(--beet); color: #FFFFFF; }
  .station__checks { list-style: none; margin: 0; padding: 12px; border-radius: var(--r-md); background: var(--parchment); display: grid; gap: 8px; font-size: 0.9375rem; }
  .station__checks li { display: grid; gap: 2px; }
  .station__checks span { color: var(--smoke); }

  @media print {
    .topbar, .site-footer, .no-print, .site-banner { display: none !important; }
    body.cards-page { background: #FFFFFF; }
    .cards { padding: 0; max-width: none; }
    .card, .station { box-shadow: none; border-radius: 0; padding: 0; max-width: none; }
    .card__checklist label { min-height: 0; }
    .station { border: 1px solid #000; border-top-width: 6px; padding: 12px; break-inside: avoid; }
    /* Index cards print on card sized pages; long recipes continue on more cards. */
    .cards-page--index .ixcards { display: block; }
    .cards-page--index .ixcard { width: auto; min-height: 0; box-shadow: none; border-radius: 0; padding: 0; background: none; font-size: 9.5pt; }
    .cards-page--4x6 .ixcard { page: index46; }
    .cards-page--a6 .ixcard { page: indexa6; }
    .ixcard--back { break-before: page; }
    .ixcard__lines { line-height: 1.55; }
  }
  /* Ingredient declaration (spec 17.2) */
  .card--declaration { max-width: 720px; gap: 12px; }
  .decl__draft { margin: 0; padding: 10px 12px; border-radius: 10px; background: var(--saffron-tint); border: 1px solid var(--saffron-line); font-size: var(--text-small); }
  .decl__text { margin: 0; line-height: 1.55; }
  .decl__allergen { font-weight: 800; }
  .decl__note { margin: 0; font-size: var(--text-small); color: var(--smoke); }
  .decl__warn { margin: 0; font-size: var(--text-small); color: var(--beet); }
  .decl__table { width: 100%; border-collapse: collapse; font-size: var(--text-ui); }
  .decl__table caption { text-align: start; font-weight: 700; padding-bottom: 6px; }
  .decl__table caption span { font-weight: 400; color: var(--smoke); }
  .decl__table th, .decl__table td { padding: 5px 8px; border-bottom: 1px solid var(--parchment); text-align: start; }
  .decl__table .num { text-align: end; white-space: nowrap; }
  .decl__table thead th { font-size: 12px; color: var(--smoke); text-transform: uppercase; letter-spacing: .03em; }
  .decl__table tfoot th, .decl__table tfoot td { font-weight: 700; border-bottom: 0; }
  .decl__panel { max-width: 420px; border: 2px solid var(--ink); }
  .decl__panel tr.is-sub th { padding-left: 22px; font-weight: 400; }
  .decl__tag { font-size: 11px; font-weight: 700; color: var(--smoke); text-transform: uppercase; letter-spacing: .03em; }

}

@page index46 { size: 152mm 102mm; margin: 7mm 8mm; }
@page indexa6 { size: 148mm 105mm; margin: 7mm 8mm; }

/* css/pages/catalogs.css */
@layer pages {
  /* Catalogs (spec 10.3, 18.6, design Library) */
  .iconbtn {
    width: 44px; height: 44px; display: inline-grid; place-items: center; border-radius: 12px;
    border: 1px solid var(--crust); background: var(--flour); color: var(--ink); cursor: pointer;
  }
  .iconbtn:disabled { opacity: .35; cursor: default; }
  .iconbtn:not(:disabled):hover { border-color: var(--accent); }

  .catalogs { display: grid; gap: 20px; }
  .catalogs__new { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; max-width: 560px; }
  .catalogs__new .field { flex: 1 1 240px; }

  .ctree { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; max-width: 760px; }
  .ctree__node {
    display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 12px; align-items: center;
    min-height: 60px; padding: 6px 6px 6px 10px; border-radius: 16px; background: var(--card); border: 1px solid var(--crust);
    margin-inline-start: calc(var(--level) * 24px);
  }
  .ctree__thumb { width: 44px; height: 44px; border-radius: 10px; overflow: hidden; display: block; }
  .ctree__thumb > *, .ctree__thumb picture, .ctree__thumb img, .ctree__thumb svg { width: 100%; height: 100%; object-fit: cover; }
  .ctree__thumb > :not(.mosaic), .ctree__thumb picture, .ctree__thumb img { display: block; }
  .ctree__main { display: grid; min-width: 0; text-decoration: none; color: var(--ink); }
  .ctree__main strong { font-size: 1rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .ctree__main span { font-size: var(--text-small); color: var(--smoke); }
  .ctree__moves { display: flex; gap: 4px; }
  @media (max-width: 480px) { .ctree__node { margin-inline-start: calc(var(--level) * 12px); } }

  /* 2 x 2 photo mosaic for catalog covers */
  .mosaic { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(2, minmax(0, 1fr)); gap: 2px; width: 100%; height: 100%; aspect-ratio: 4 / 5; background: var(--flour); }
  .mosaic > span { overflow: hidden; display: block; min-height: 0; }
  .mosaic > span > *, .mosaic picture, .mosaic img, .mosaic svg { width: 100%; height: 100%; object-fit: cover; display: block; }
  .mosaic--2 > span { grid-row: span 2; }
  .mosaic--3 > span:first-child { grid-row: span 2; }

  .catalog { display: grid; gap: 28px; padding-block: 16px 48px; }
  .catalog__head { display: grid; grid-template-columns: minmax(120px, 280px) minmax(0, 1fr); gap: clamp(16px, 4vw, 40px); align-items: start; }
  .catalog__cover { border-radius: var(--r-lg); overflow: hidden; aspect-ratio: 4 / 5; }
  .catalog__cover > *, .catalog__cover picture, .catalog__cover img { width: 100%; height: 100%; object-fit: cover; }
  .catalog__cover > :not(.mosaic), .catalog__cover picture, .catalog__cover img { display: block; }
  .catalog__info { display: grid; gap: 12px; align-content: start; }
  .catalog__info h1 { margin: 0; font-size: var(--text-h1); line-height: var(--leading-tight); }
  .catalog__meta { margin: 0; color: var(--smoke); font-size: var(--text-ui); }
  .catalog__desc { max-width: 60ch; }
  .catalog__actions form { display: contents; }
  @media (max-width: 600px) {
    .catalog__head { grid-template-columns: 1fr; }
    .catalog__cover { max-width: 220px; }
  }
  .catalog__section { display: grid; gap: 14px; }
  .catalog__section h2 { margin: 0; font-size: var(--text-h3); }
  .catalog__edit { display: grid; gap: 28px; max-width: 720px; }
  .catalog__edit h3 { margin: 0; font-size: 1.125rem; }
  .catalog__delete summary { cursor: pointer; font-weight: 600; color: var(--beet); min-height: 44px; display: flex; align-items: center; }

  .clist { list-style: none; margin: 0; padding: 0; display: grid; border: 1px solid var(--crust); border-radius: var(--r-lg); background: var(--card); overflow: hidden; }
  .clist > li { border-bottom: 1px solid var(--parchment); }
  .clist > li:last-child { border-bottom: 0; }
  .clist a, .clist__gone { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; min-height: 56px; text-decoration: none; color: var(--ink); }
  .clist a span, .clist__gone span span { color: var(--smoke); font-size: var(--text-small); }
  .clist__gone > span { display: grid; }

  .arrange { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; max-width: 760px; counter-reset: arr; }
  .arrange > li { display: flex; align-items: center; gap: 12px; padding: 6px 6px 6px 14px; border-radius: 14px; background: var(--card); border: 1px solid var(--crust); min-height: 56px; }
  .arrange__title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
  .arrange [draggable="true"] { cursor: grab; }
  .arrange .is-dragging { opacity: .5; }
  .arrange.is-busy { cursor: progress; opacity: .7; }
  .arrange__grip { flex: none; width: 12px; height: 20px; background: radial-gradient(circle, var(--smoke) 1.2px, transparent 1.6px) 0 0 / 6px 6px; opacity: .7; }
  .arrange__acts { display: flex; gap: 4px; align-items: center; }

  .savecat { display: grid; gap: 20px; padding-block: 16px 48px; }
}

@layer pages {
  .savecat-dialog { width: min(92vw, 440px); }
  .savecat__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; max-height: min(50vh, 420px); overflow-y: auto; }
  .savecat__new { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
  .savecat__new .field { flex: 1 1 180px; }
  .savecat__status { margin: 0; min-height: 1.4em; font-size: var(--text-small); color: var(--smoke); }
  .savecat__status.is-error { color: var(--beet); }
  [data-save-catalog].is-saved { --btn-bd: var(--accent); }
}

@layer pages {
  .savecat__row { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 12px; align-items: center; min-height: 48px; padding: 6px 10px; border-radius: 12px; cursor: pointer; }
  .savecat__row:hover { background: var(--parchment); }
  .savecat__row input { width: 20px; height: 20px; margin: 0; accent-color: var(--accent); }
  .savecat__text { display: grid; min-width: 0; }
  .savecat__text strong { font-weight: 600; }
  .savecat__text span { font-size: var(--text-small); color: var(--smoke); }
}

/* Cards mode (spec 9): ingredient cards in a grid, printable as a binder */
@layer pages {
  .ccards__bar { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; margin-bottom: 12px; }
  .ccards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 380px), 1fr)); gap: 16px; align-items: start; }
  .ccards .card { box-shadow: var(--shadow-1); max-width: none; }
  .ccards .card__head h2 { font-size: 1.5rem; }
  .ccards .card__head h2 a { color: inherit; text-decoration: none; }
  .ccards .card__head h2 a:hover { text-decoration: underline; }
  @media print {
    .ccards__bar { display: none !important; }
    .ccards { display: block; }
    .ccards .card { break-inside: avoid; box-shadow: none; border: 1px solid #BBB; margin: 0 0 12px; }
  }
}

/* css/pages/cook.css */
@layer pages {
  /* Cook mode is always dark ("after service"), whatever the site theme. */
  .cook-body {
    background: #15120F;
    color: #F3ECE2;
    --ink: #F3ECE2;
    --smoke: #B8ADA1;
    --crust: #2E2822;
    --card: #221D18;
    --accent: #F3ECE2;
    --on-accent: #15120F;
    color-scheme: dark;
  }
  .cook {
    height: 100dvh;
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    max-width: 900px;
    margin: 0 auto;
    overflow: hidden;
  }
  .cook__top { display: flex; align-items: center; gap: 12px; padding: calc(env(safe-area-inset-top) + 8px) 16px 8px; }
  .cook__exit { width: var(--hit-cook); height: var(--hit-cook); flex: none; border-radius: 50%; background: #221D18; display: grid; place-items: center; text-decoration: none; font-size: 26px; color: #F3ECE2; }
  .cook__exit:hover { color: #F3ECE2; }
  .cook__title { flex: 1; min-width: 0; display: grid; line-height: 1.2; }
  .cook__where { font-size: var(--text-small); color: #B8ADA1; }
  .cook__name { font-family: var(--font-display); font-size: 1.0625rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .cook__wake { font-size: var(--text-small); color: #B8ADA1; padding: 6px 10px; border: 1px solid #2E2822; border-radius: var(--r-pill); white-space: nowrap; }
  /* Hands free: read aloud and voice commands */
  .cook__voice { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 16px 8px; }
  .cook__voice:empty { display: none; }
  .cook__toggle { min-height: 40px; padding: 0 14px; border-radius: var(--r-pill); border: 1px solid #2E2822; background: none; color: #E8DFD2; font: inherit; font-size: var(--text-small); font-weight: 600; cursor: pointer; }
  .cook__toggle[aria-pressed="true"] { background: #FAF6EF; color: #15120F; border-color: #FAF6EF; }
  .cook__voicenote { margin: 0; padding: 0 16px 8px; font-size: 12px; color: #B8ADA1; }
  .cook__progress { display: grid; grid-template-columns: repeat(var(--n), 1fr); gap: 4px; padding: 0 16px 10px; }
  .cook__progress span { height: 4px; border-radius: 2px; background: #2E2822; transition: background-color var(--dur-base); }
  .cook__progress span.on { background: #F3ECE2; }
  .cook__main { overflow: auto; overscroll-behavior: contain; padding: 0 16px 16px; }
  .cook__steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 40px; }
  .cook__step { display: grid; gap: 18px; align-content: start; }
  .cook__label { font-size: var(--text-small); color: #B8ADA1; }
  .cook__text { display: flex; align-items: baseline; gap: 14px; }
  .cook__n { font-family: var(--font-display); font-size: 3.5rem; line-height: .9; color: #B8ADA1; }
  .cook__text p { font-size: clamp(1.375rem, 1.1rem + 1.4vw, 1.875rem); line-height: 1.4; text-wrap: pretty; }
  .cook__text strong { font-weight: 600; box-shadow: inset 0 -2px 0 #4F3F1F; }
  .cook__cue { font-family: var(--font-display); font-style: italic; font-size: 1.25rem; color: #B8ADA1; }
  .cook__ings { background: #221D18; border-radius: var(--r-lg); padding: 6px; display: grid; }
  .cook__ing {
    width: 100%;
    min-height: var(--hit-cook);
    display: grid;
    grid-template-columns: 40px 100px 1fr;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    text-align: start;
    font-size: 1.1875rem;
    color: #F3ECE2;
    border-radius: 16px;
  }
  .cook__ing[aria-checked="true"] { color: #6E655C; }
  .cook__mark { width: 36px; height: 36px; border-radius: 50%; border: 2px solid #B8ADA1; display: grid; place-items: center; }
  .cook__ing[aria-checked="true"] .cook__mark { background: #7FC49A; border-color: #7FC49A; }
  .cook__ing[aria-checked="true"] .cook__mark::after { content: ""; width: 16px; height: 16px; background: #15120F; clip-path: polygon(14% 52%, 0 66%, 38% 100%, 100% 22%, 86% 8%, 38% 72%); }
  .cook__amt { text-align: right; font-weight: 600; }
  .cook__timer {
    min-height: var(--hit-cook);
    border-radius: 18px;
    border: 1.5px solid #F3ECE2;
    background: transparent;
    color: #F3ECE2;
    font-size: 1.1875rem;
    font-weight: 600;
  }
  .cook__timer.is-running { background: #F3ECE2; color: #15120F; }
  .cook__temp { font-size: 1.25rem; font-weight: 600; }
  .cook__safety { padding: 14px 16px; border-radius: 18px; background: #221D18; border: 1px solid #2E2822; font-size: 1.0625rem; line-height: 1.5; }
  .cook__safety a { color: #F3ECE2; }
  .cook__foot { padding: 10px 16px calc(env(safe-area-inset-bottom) + 12px); display: grid; gap: 10px; background: #15120F; border-top: 1px solid #2E2822; }
  .cook__timers { display: flex; gap: 8px; overflow-x: auto; }
  .cook__timers:empty { display: none; }
  .cook__nav { display: grid; grid-template-columns: 1fr 2fr; gap: 10px; }
  .cook__btn { min-height: var(--hit-cook); border-radius: 18px; border: 1px solid #2E2822; background: #221D18; color: #F3ECE2; font-size: 1.1875rem; font-weight: 600; transition: transform var(--dur-instant); }
  .cook__btn:active { transform: scale(.98); }
  .cook__btn:disabled { opacity: .4; }
  .cook__btn--next { background: #F3ECE2; color: #15120F; border: 0; font-weight: 700; }

  /* With JavaScript: one step at a time. */
  .cook.is-live .cook__step { display: none; }
  .cook.is-live .cook__label { display: none; }
  .cook.is-live .cook__step.is-current { display: grid; animation: step-in var(--dur-smooth) var(--ease-standard); }
  .cook.is-live .cook__step.is-current.from-left { animation-name: step-in-left; }
  @keyframes step-in { from { opacity: 0; transform: translateX(24px); } }
  @keyframes step-in-left { from { opacity: 0; transform: translateX(-24px); } }
  @media (prefers-reduced-motion: reduce) { .cook.is-live .cook__step.is-current { animation: none; } }
}

/* The step's clip or photo, large above the text (spec 7.3, 8.3) */
@layer pages {
  .cook__video { display: grid; gap: 6px; }
  .cook__video .rvideo__stage { box-shadow: none; }
  .cook__vnote { font-size: var(--text-small); color: #B8AC9C; }
  .cook__photo { margin: 0; border-radius: var(--r-md); overflow: hidden; aspect-ratio: 16 / 9; background: #2A241F; }
  .cook__photo picture, .cook__photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
}

/* css/pages/editor.css */
@layer pages {
  .newrec { display: grid; gap: var(--s-6); padding-block: var(--s-8) var(--s-12); }
  .newrec__grid { display: grid; gap: var(--s-4); grid-template-columns: minmax(0, 1fr); }
  .newrec .panel { max-width: none; align-content: start; }
  .newrec .panel h2 { font-size: 1.5rem; }
  @media (min-width: 900px) {
    .newrec__grid { grid-template-columns: 1fr 1.4fr; align-items: start; }
    /* Paste takes the tall right column; scratch and link stack on the left. */
    .newrec__grid > form:nth-child(4) { grid-column: 2; grid-row: 1 / span 3; }
  }
  .ed__flash { max-width: 1100px; margin: 12px auto 0; padding-inline: var(--gutter); display: grid; gap: 8px; }

  /* Editor (design Editor) */
  .ed { min-height: 100dvh; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
  .ed__top {
    position: sticky;
    top: 0;
    z-index: var(--z-sticky);
    display: flex;
    align-items: center;
    gap: 10px;
    padding: calc(env(safe-area-inset-top) + 6px) var(--gutter) 6px;
    background: color-mix(in srgb, var(--flour) 94%, transparent);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--crust);
  }
  .ed__back { width: var(--hit); height: var(--hit); display: grid; place-items: center; border-radius: 50%; color: var(--ink); flex: none; }
  .ed__titlebox { flex: 1; min-width: 0; display: grid; }
  .ed__title {
    border: 0;
    background: transparent;
    font-family: var(--font-display);
    font-size: clamp(1.1875rem, 1rem + 1vw, 1.5rem);
    font-weight: 500;
    color: var(--ink);
    min-width: 0;
    padding: 2px 0;
    border-bottom: 1px dashed transparent;
  }
  .ed__title:focus-visible { outline: none; border-bottom-color: var(--crust); }
  .ed__status { font-size: var(--text-small); color: var(--smoke); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .ed__status.is-error { color: var(--beet); }
  .ed__actions { display: flex; gap: 6px; align-items: center; }
  .ed__actions .btn--ghost { padding-inline: 8px; }
  @media (max-width: 600px) { .ed__actions a.btn--secondary { display: none; } }
  /* Phones: the title gets the room; Undo and Redo move to the bottom bar. */
  .ed__barundo { display: none; }
  @media (max-width: 799px) {
    .ed__topundo { display: none; }
    .ed__barundo { display: inline-flex; width: 44px; padding: 0; justify-content: center; }
    .ed .ed__bar { grid-template-columns: auto auto 1fr 1fr; }
    .ed__status { white-space: normal; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-height: 1.25; }
  }

  .ed__body { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-6); padding: var(--s-4) var(--gutter) 120px; max-width: 1500px; margin: 0 auto; width: 100%; }
  .ed__outline, .ed__side { display: none; }
  .ed__canvas { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-4); align-content: start; min-width: 0; }
  .ecard, .ecard * { min-width: 0; }
  .ecard select { max-width: 100%; text-overflow: ellipsis; }
  .ed__bar {
    position: sticky;
    bottom: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 10px var(--gutter) calc(env(safe-area-inset-bottom) + 10px);
    background: color-mix(in srgb, var(--flour) 94%, transparent);
    border-top: 1px solid var(--crust);
  }
  @media (min-width: 1100px) {
    .ed__body { grid-template-columns: 220px minmax(0, 1fr) 340px; }
    .ed__outline, .ed__side { display: block; position: sticky; top: 76px; align-self: start; max-height: calc(100dvh - 90px); overflow: auto; overscroll-behavior: contain; }
    .ed__bar { display: none; }
  }
  @media (min-width: 800px) and (max-width: 1099px) {
    .ed__body { grid-template-columns: minmax(0, 1fr) 320px; }
    .ed__side { display: block; position: sticky; top: 76px; align-self: start; max-height: calc(100dvh - 90px); overflow: auto; }
    .ed__bar { display: none; }
  }
  .ed__hint { padding: 10px 14px; border-radius: var(--r-md); background: var(--saffron-tint); border: 1px solid var(--saffron-line); font-size: var(--text-ui); }

  .eoutline__h { font-size: var(--text-small); letter-spacing: .08em; text-transform: uppercase; color: var(--smoke); display: block; padding: 4px 10px 8px; }
  .eoutline, .eoutline ul { list-style: none; margin: 0; padding: 0; }
  .eoutline__comp { display: block; padding: 8px 10px; border-radius: var(--r-md); font-weight: 600; color: var(--ink); text-decoration: none; }
  .eoutline__item { display: block; width: 100%; text-align: start; padding: 6px 10px 6px 22px; border-radius: 10px; font-size: var(--text-ui); color: var(--ink); }
  .eoutline__item.is-on { background: var(--parchment); }
  .eoutline__row { display: flex; align-items: center; gap: 2px; }
  .eoutline__row > .eoutline__comp, .eoutline__row > .eoutline__item { flex: 1; min-width: 0; }
  .eoutline__item { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .eoutline__item--step { color: var(--smoke); }
  .eoutline__steps { margin-top: 4px !important; }
  .eoutline__grip { flex: none; display: grid; place-items: center; width: 22px; height: 32px; border: 0; border-radius: 6px; background: none; color: var(--smoke); cursor: grab; touch-action: none; opacity: 0; transition: opacity .15s; }
  .eoutline__row:hover > .eoutline__grip, .eoutline__grip:focus-visible, .is-dragging .eoutline__grip { opacity: 1; }
  .eoutline__grip:hover { background: var(--parchment); color: var(--ink); }
  .eoutline__group .eoutline__item { padding-left: 10px; }
  .eoutline__group > ul > li > .eoutline__row { padding-left: 14px; }
  .is-dragging, .is-dragging * { cursor: grabbing !important; user-select: none; }
  .is-dragging [data-drop="line"], .is-dragging [data-drop="step"] { min-height: 24px; }
  .eoutline .is-dragged { opacity: .4; }
  .eoutline__marker { height: 3px; margin: 2px 10px; border-radius: 2px; background: var(--accent); list-style: none; }
  @media (hover: none) { .eoutline__grip { opacity: 1; } }

  .ecard { display: grid; gap: 10px; padding: 18px; border-radius: var(--r-lg); background: var(--card); border: 1px solid var(--crust); }
  .ecard:focus-within { border-color: var(--accent); }
  .ecard--details summary { list-style: none; display: flex; align-items: baseline; justify-content: space-between; gap: 12px; cursor: pointer; min-height: 40px; }
  .ecard--details summary::-webkit-details-marker { display: none; }
  .ecard--details h2 { font-size: 1.25rem; }
  .ecard__sum { font-size: var(--text-small); color: var(--smoke); }
  .ecard__head { display: flex; align-items: center; gap: 8px; }
  .ecard__name { flex: 1; min-width: 0; border: 0; background: transparent; font-family: var(--font-display); font-style: italic; font-size: 1.4375rem; color: var(--ink); padding: 4px 0; border-bottom: 1px dashed transparent; }
  .ecard__name:focus-visible { outline: none; border-bottom-color: var(--crust); }
  .ecard__total { font-size: var(--text-small); color: var(--smoke); }
  .ecard__sub { font-family: var(--font-ui); font-size: var(--text-small); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--smoke); margin-top: 6px; }

  .egrid { display: grid; gap: 14px; margin-top: 12px; }
  .egrid__row { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(140px, 100%), 1fr)); gap: 10px; align-items: start; }

  .elines, .esteps { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
  .eline { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 6px; row-gap: 4px; align-items: start; padding: 10px 8px 10px 12px; border-radius: var(--r-md); background: var(--flour); border: 1px solid var(--parchment); }
  .eline.is-selected { border-color: var(--accent); }
  .eline__chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
  .chip {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 9px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    background: var(--parchment);
    color: var(--ink);
    white-space: nowrap;
  }
  .chip--q { background: var(--accent); color: var(--on-accent); }
  .chip--u { background: var(--crust); }
  .chip--i { background: var(--card); border: 1px solid var(--crust); font-size: 15px; }
  .chip--p { font-style: italic; font-weight: 400; }
  .chip--b { background: var(--basil-tint); color: var(--basil); }
  .chip--warn { background: var(--saffron-tint); color: var(--saffron); }
  .eline__spacer { flex: 1; }
  .eline__acts { display: inline-flex; flex-wrap: nowrap; }
  .eline__raw { grid-column: 1 / -1; }
  /* Phones: the chips get the whole first row; the buttons share the second with the raw text. */
  @media (max-width: 599px) {
    .eline__chips { grid-column: 1 / -1; }
    .eline__raw { grid-column: 1; grid-row: 2; align-self: center; }
    .eline__acts { grid-column: 2; grid-row: 2; }
  }
  .eline__btn { min-width: 36px; min-height: 36px; border-radius: 10px; color: var(--smoke); font-size: 16px; }
  @media (hover: hover) and (pointer: fine) { .eline__btn:hover { background: var(--parchment); color: var(--ink); } }
  .eline__raw { text-align: start; font-family: var(--font-mono); font-size: 12.5px; color: var(--smoke); padding: 2px 0; }

  .eadd { position: relative; display: grid; gap: 8px; }
  .eadd__row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
  .eadd__input { min-height: 48px; padding: 0 14px; border-radius: var(--r-md); border: 1.5px dashed var(--crust); background: var(--card); font-size: var(--text-input); color: var(--ink); }
  .eadd__input:focus-visible { outline: none; border-style: solid; border-color: var(--accent); }
  .eadd__units { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
  .eadd__units .chip-btn { flex: none; }
  /* The quick units above the on-screen keyboard (touch screens). */
  .ekbd { position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 8px 16px calc(8px + env(safe-area-inset-bottom, 0px)); background: var(--flour); border-top: 1px solid var(--crust); box-shadow: 0 -6px 18px rgb(0 0 0 / .06); }
  .ekbd[hidden] { display: none; }
  .ekbd .chip-btn { flex: none; }
  .has-kbd .eadd__units, .has-kbd .ed__bar { display: none; }
  .chip-btn { min-height: 40px; min-width: 44px; padding: 0 12px; border-radius: 12px; background: var(--parchment); font-weight: 600; font-size: var(--text-ui); }

  .ac {
    position: absolute;
    z-index: var(--z-dropdown);
    left: 0;
    right: 0;
    top: 52px;
    margin: 0;
    padding: 6px;
    list-style: none;
    border-radius: var(--r-md);
    background: var(--card);
    border: 1px solid var(--crust);
    box-shadow: var(--shadow-3);
    max-height: 320px;
    overflow: auto;
    animation: menu-in var(--dur-base) var(--ease-spring);
  }
  .field .ac { top: auto; position: relative; margin-top: 6px; }
  .ac [role="option"] { display: grid; gap: 1px; padding: 8px 10px; border-radius: 10px; cursor: pointer; }
  .ac [role="option"]:focus, .ac [role="option"]:hover { background: var(--parchment); outline: none; }
  .ac small { font-size: var(--text-small); color: var(--smoke); }
  .ac__h { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--smoke); padding: 8px 10px 4px; }
  .ac--tok { top: auto; bottom: -8px; transform: translateY(100%); }

  .estep { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 10px; }
  .estep.is-selected .estep__text { border-color: var(--accent); }
  .estep__n { font-family: var(--font-display); font-size: 1.25rem; color: var(--smoke); padding-top: 8px; }
  .estep__body { display: grid; gap: 6px; position: relative; }
  .estep__text { width: 100%; min-height: 64px; padding: 10px 12px; border-radius: var(--r-md); border: 1px solid var(--crust); background: var(--card); font-size: var(--text-body); line-height: 1.5; resize: none; overflow: hidden; color: var(--ink); }
  .estep__text:focus-visible { outline: none; border-color: var(--accent); }
  .estep__meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
  .estep__warn { font-size: var(--text-small); color: var(--saffron); }

  .eaddcomp { min-height: 56px; border-radius: var(--r-lg); border: 1.5px dashed var(--crust); font-weight: 600; font-size: var(--text-ui); color: var(--ink); }
  @media (hover: hover) and (pointer: fine) { .eaddcomp:hover { border-color: var(--accent); } }

  .eside { display: grid; gap: 10px; padding: 14px 4px 18px; border-bottom: 1px solid var(--crust); }
  .eside h2 { font-family: var(--font-ui); font-size: var(--text-small); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
  .eside input[type="range"] { width: 100%; accent-color: var(--accent); min-height: 32px; }
  .eside__factor { font-size: 1.5rem; }
  .eprev { display: grid; gap: 4px; }
  .eprev__row { display: grid; grid-template-columns: 90px minmax(0, 1fr); gap: 10px; font-size: var(--text-ui); }
  .eprev__row span:first-child { text-align: right; font-weight: 600; }
  .echecks { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
  .echeck { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 8px; font-size: var(--text-ui); line-height: 1.4; }
  .echeck--ok > span:first-child { color: var(--basil); }
  .echeck--warn > span:first-child { color: var(--saffron); font-weight: 700; }
  .echeck--error > span:first-child { color: var(--beet); font-weight: 700; }
  .eside--insp { border-bottom: 0; }
  .insp { display: grid; gap: 12px; }
  .insp h2 { font-family: var(--font-display); font-size: 1.25rem; font-weight: 500; letter-spacing: 0; text-transform: none; }
  .insp__match { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
  .insp__checks { display: grid; }
  .insp .field__label { font-size: 14px; }

  /* Bottom sheet (phones) on a native dialog */
  .sheet {
    width: 100%;
    max-width: 640px;
    max-height: 88dvh;
    margin: auto auto 0;
    padding: 8px 18px calc(env(safe-area-inset-bottom) + 18px);
    border: 0;
    border-radius: var(--r-xl) var(--r-xl) 0 0;
    background: var(--flour);
    color: var(--ink);
    box-shadow: var(--shadow-4);
    overscroll-behavior: contain;
  }
  .sheet::backdrop { background: var(--overlay); backdrop-filter: blur(3px); }
  .sheet[open] { animation: sheet-in var(--dur-smooth) var(--ease-spring); }
  @keyframes sheet-in { from { transform: translateY(40%); opacity: 0; } }
  @media (prefers-reduced-motion: reduce) { .sheet[open] { animation: none; } }
  .sheet { transition: height var(--dur-smooth) var(--ease-standard); }
  .sheet.is-dragging { transition: none; user-select: none; }
  @media (prefers-reduced-motion: reduce) { .sheet { transition: none; } }
  /* The handle: a wide, easy target for the thumb, drawn as a short bar. */
  .sheet__handle { position: sticky; top: -8px; z-index: 1; display: grid; place-items: center; height: 28px; margin: -8px -18px 4px; background: var(--flour); cursor: grab; touch-action: none; }
  .sheet__handle::before { content: ""; width: 40px; height: 5px; border-radius: 3px; background: var(--crust); }
  .sheet__handle:focus-visible::before { background: var(--ink); }
  .sheet__head { display: flex; justify-content: flex-end; }
}

@layer pages {
  .publish { display: grid; gap: var(--s-5); padding-block: var(--s-6) var(--s-12); max-width: calc(760px + 2 * var(--gutter)); }
  .publish h1 { font-size: clamp(1.75rem, 1.4rem + 1.6vw, 2.5rem); }
  .publish .panel { max-width: none; }
  .publish .panel h2 { font-size: 1.25rem; }
  .publish legend { padding: 0; margin-bottom: 8px; }
  .choice.choice--plain { grid-template-columns: 24px minmax(0, 1fr); padding: 12px 14px; }
  .choice.choice--plain input { position: static; opacity: 1; pointer-events: auto; width: 20px; height: 20px; accent-color: var(--accent); margin: 2px 0 0; }
  .choice.is-disabled { opacity: .6; cursor: not-allowed; }
  .publish--done { justify-items: start; }
  .publish__mark { position: relative; display: inline-block; line-height: 0; }
  .publish__mark[data-celebrate] svg { animation: publish-pop var(--dur-smooth) var(--ease-spring) both; }
  @keyframes publish-pop { from { transform: scale(.6); opacity: 0; } }
  @media (prefers-reduced-motion: reduce) { .publish__mark[data-celebrate] svg { animation: none; } }
  .publish__link code { font-size: 1rem; padding: 8px 12px; border-radius: var(--r-sm); background: var(--parchment); }
}

@layer pages {
  .ecard__h { font-size: 1.25rem; }
  .ephoto { display: grid; gap: 12px; }
  .ephoto__main { position: relative; display: block; width: 100%; max-width: 520px; border-radius: var(--r-md); overflow: hidden; cursor: crosshair; padding: 0; }
  .ephoto__main img { display: block; width: 100%; height: auto; }
  .ephoto__dot { position: absolute; width: 22px; height: 22px; margin: -11px 0 0 -11px; border-radius: 50%; border: 3px solid #FFFFFF; box-shadow: 0 0 0 2px rgb(0 0 0 / .45); pointer-events: none; }
  .ephoto__crops { display: flex; gap: 10px; align-items: flex-end; }
  .ephoto__crop { margin: 0; display: grid; gap: 4px; font-size: 12px; color: var(--smoke); text-align: center; }
  .ephoto__crop > span { display: block; width: 88px; border-radius: 10px; overflow: hidden; position: relative; }
  .ephoto__crop picture, .ephoto__crop img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
  .ephoto__tip { font-size: var(--text-small); color: var(--saffron); }
  .egallery { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
  .egallery li { position: relative; width: 96px; height: 96px; border-radius: 12px; overflow: hidden; }
  .egallery picture, .egallery img { width: 100%; height: 100%; object-fit: cover; display: block; }
  .egallery .eline__btn { position: absolute; top: 4px; right: 4px; background: color-mix(in srgb, var(--flour) 85%, transparent); }
  .egallery .egallery__edit { right: auto; left: 4px; }
  .eupload { justify-self: start; cursor: pointer; }
}

@layer pages {
  .importres { display: grid; gap: 16px; padding-block: 8px 48px; }
  .importres h1 { margin: 0; }
  .importres__main { display: grid; min-width: 0; }
  .importres__main span { color: var(--smoke); font-size: var(--text-small); }
  .importres__flag { flex: none; font-size: var(--text-small); font-weight: 600; color: var(--basil); }
  .importres__flag.is-check { color: var(--saffron); }
  .importres__failed { display: grid; gap: 8px; }
  .importres__failed h2 { margin: 0; font-size: var(--text-h3); }
}

@layer pages {
  /* Variants (card on the canvas, inspector in the side panel or sheet) */
  .ecard--variants { display: grid; gap: 12px; }
  .evariants { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
  .evariant { width: 100%; display: grid; gap: 2px; text-align: start; padding: 10px 14px; border-radius: 14px; border: 1px solid var(--crust); background: var(--card); cursor: pointer; color: var(--ink); }
  .evariant span { font-size: var(--text-small); color: var(--smoke); }
  .evariant.is-on, .evariant:hover { border-color: var(--accent); }
  .insp--variant { display: grid; gap: 14px; }
  .insp--variant h3 { margin: 0; font-size: 1rem; }
  .evclaims { display: flex; flex-wrap: wrap; gap: 6px 14px; }
  .evchanges { margin: 0; padding-left: 20px; display: grid; gap: 6px; font-size: var(--text-small); }
  .evchanges li { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
  .evadd { display: grid; gap: 10px; padding: 12px; border-radius: 14px; background: var(--parchment); }
}

@layer pages {
  .eembed[open] { display: grid; gap: 12px; }
  .eembed h3 { margin: 0; }
  .eembed__opt { display: grid; gap: 4px; text-align: start; padding: 14px 16px; border-radius: 16px; border: 1.5px solid var(--crust); background: var(--card); color: var(--ink); cursor: pointer; }
  .eembed__opt span { font-size: var(--text-small); color: var(--smoke); }
  .eembed__opt:hover:not(:disabled), .eembed__opt:focus-visible { border-color: var(--accent); }
  .eembed__opt:disabled { opacity: .55; cursor: not-allowed; }
  .eembed > .btn { justify-self: start; }
}

@layer pages {
  .ecard--embed { display: grid; gap: 10px; }
  .eembed__src { margin: 0; font-size: var(--text-small); color: var(--smoke); }
  .elines--embed { list-style: none; margin: 0; padding: 10px 14px; display: grid; gap: 4px; border-radius: 14px; background: var(--parchment); font-size: var(--text-small); }
  .elines--embed .tnum { font-weight: 600; }
  .eembed__adj { color: var(--saffron); font-weight: 600; }
  .ecard--embed > .btn { justify-self: start; }
}

@layer pages {
  .insp__subs { display: grid; gap: 8px; }
  .insp__sublist { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: var(--text-small); }
  .insp__sublist li { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 10px; background: var(--parchment); }
  .insp__subadd { display: grid; gap: 8px; padding: 12px; border-radius: 14px; border: 1px dashed var(--crust); }
}

@layer pages {
  .elines--embed li { display: flex; flex-wrap: wrap; gap: 6px; align-items: baseline; }
  .elines--embed li .linkbtn { margin-left: auto; min-height: 28px; font-size: var(--text-small); color: var(--smoke); }
  .elines--embed li.is-on { font-weight: 600; }
}

@layer pages {
  /* Photo tools dialog (public/js/components/photo-editor.js) */
  .phed { width: min(96vw, 620px); max-height: 94dvh; overflow-y: auto; }
  .phed[open] { display: grid; gap: 12px; }
  .phed h3 { margin: 0; }
  .phed__canvas { justify-self: center; max-width: 100%; height: auto; border-radius: var(--r-md); background: var(--parchment); touch-action: none; cursor: grab; box-shadow: 0 0 0 1px var(--crust); }
  .phed__canvas:active { cursor: grabbing; }
  .phed__canvas:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
  .phed__sliders { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 8px 16px; }
  .phed__val { font-weight: 400; color: var(--smoke); font-variant-numeric: tabular-nums; }
  .phed .seg--pill { flex-wrap: wrap; }
}

@layer pages {
  /* Publish: Filed Under (spec 12) */
  .filed { display: grid; gap: 14px; }
  .catchips { display: flex; flex-wrap: wrap; gap: 8px; }
  .catchips--list { padding-top: 8px; }
  .catgroups { display: grid; gap: 10px; padding-top: 8px; }
  .catgroup { padding-bottom: 10px; border-bottom: 1px solid var(--parchment); }
  .catgroup:last-child { border-bottom: 0; }
  .catgroup .catchip[style*="--depth:0"] span { border-color: var(--ink); }
  .catchip { position: relative; display: inline-flex; }
  .catchip input { position: absolute; opacity: 0; pointer-events: none; }
  .catchip span { display: inline-flex; flex-direction: column; justify-content: center; min-height: 40px; padding: 4px 14px; border-radius: 12px; border: 1px solid var(--crust); background: var(--card); font-weight: 600; font-size: var(--text-ui); cursor: pointer; line-height: 1.2; }
  .catchip small { font-weight: 400; font-size: 12px; color: var(--smoke); }
  .catchip input:checked + span { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
  .catchip input:checked + span small { color: inherit; opacity: .8; }
  .catchip input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
  .filed__facets { display: grid; gap: 4px; }
  .filed__facet > summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; gap: 8px; font-weight: 600; }
  .filed__facet > summary small { font-weight: 400; color: var(--smoke); font-size: var(--text-small); }
}

/* Linked video card and the step inspector's clip fields */
@layer pages {
  .evideo { display: grid; grid-template-columns: 128px minmax(0, 1fr); gap: 12px; align-items: start; }
  .evideo__poster { display: block; aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden; background: var(--parchment); }
  .evideo__poster picture, .evideo__poster img { width: 100%; height: 100%; object-fit: cover; display: block; }
  .evideo__text { display: grid; gap: 2px; min-width: 0; }
  .evideo__text strong { overflow-wrap: anywhere; }
  .evideo__text > span:not(.field__hint) { font-size: var(--text-small); color: var(--smoke); }
  .evideo .btn { grid-column: 1 / -1; justify-self: start; }
  .evideo__add { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: end; }
  @media (max-width: 520px) { .evideo__add { grid-template-columns: minmax(0, 1fr); } .evideo__add .btn { justify-self: start; } }
  .insp__video, .insp__uses { border: 0; margin: 0; padding: 0; display: grid; gap: 8px; min-width: 0; }
  .insp__video legend, .insp__uses legend { padding: 0; margin-bottom: 4px; }
}

@layer pages {
  .insp__custom { border: 1px dashed var(--crust); border-radius: var(--r-md); padding: 8px 12px; }
  .insp__custom > summary { cursor: pointer; font-weight: 600; min-height: 36px; display: flex; align-items: center; }
  .insp__custom[open] { display: grid; gap: 10px; padding-bottom: 12px; }
}

/* A step's reader preview under its text: tokens as pills */
@layer pages {
  .estep__preview { margin: 6px 0 0; padding: 8px 10px; border-radius: var(--r-sm, 10px); background: var(--parchment); font-size: var(--text-ui); line-height: 1.7; color: var(--ink); }
  .etok { display: inline; padding: 1px 6px; margin: 0 1px; border-radius: 6px; background: var(--card); box-shadow: inset 0 -2px 0 var(--crust); font-weight: 600; font-variant-numeric: tabular-nums; }
  .etok--time { box-shadow: inset 0 -2px 0 var(--accent); }
  .etok--bad { background: none; box-shadow: inset 0 -2px 0 var(--beet); color: var(--beet); }
}

/* Import page (spec 18.12, design Import): tabs, then the original beside the parsed recipe. */
@layer pages {
  .imp { display: grid; gap: 20px; padding-block: 8px 120px; max-width: 1200px; }
  .imp h1 { margin: 0; }
  .imp__tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--crust); overflow-x: auto; scrollbar-width: none; }
  .imp__tabs a { flex: none; display: grid; place-items: center; min-height: 48px; padding: 0 14px; font-weight: 600; font-size: 15px; color: var(--smoke); text-decoration: none; }
  .imp__tabs a[aria-current="page"] { color: var(--ink); box-shadow: inset 0 -2.5px 0 var(--accent); }
  .imp__link { display: grid; gap: 12px; max-width: 760px; }
  .imp__link > .btn { justify-self: start; }
  .imp__card { background: var(--card); border: 1px solid var(--crust); border-radius: 22px; padding: 18px; }
  .imp__card h2 { margin: 0; font-size: 1.375rem; }
  .imp__card .panel__intro { margin: 0; }
  .imp__row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: end; }
  .imp__row .btn { min-height: 52px; }
  .imp__review { display: grid; gap: 16px; }
  .imp__panes { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: 16px; align-items: start; }
  .imp__orig, .irev { background: var(--card); border: 1px solid var(--crust); border-radius: 22px; padding: 18px; display: grid; gap: 10px; min-width: 0; }
  .imp__orig h2, .irev__head h2 { margin: 0; font-family: var(--font-ui, inherit); font-size: 13px; letter-spacing: .08em; text-transform: uppercase; }
  .imp__src { margin: 0; font-size: var(--text-small); color: var(--smoke); }
  .imp__orig textarea { width: 100%; padding: 14px; border-radius: 12px; border: 1px solid var(--parchment); background: var(--flour); font-family: var(--font-mono); font-size: 13px; line-height: 1.6; resize: vertical; }
  .irev__head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
  .irev__count { font-size: 13px; font-weight: 600; color: var(--saffron); }
  .irev__count--ok { color: var(--smoke); }
  .irev__title { margin: 0; font-weight: 600; }
  .irev__comp { margin: 6px 0 0; font-size: var(--text-ui); }
  .irev__lines { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
  .irev__line { display: grid; grid-template-columns: 84px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 12px; background: var(--flour); border: 1px solid var(--parchment); }
  .irev__line.is-check { background: var(--saffron-tint); border-color: var(--saffron-line); }
  .irev__amt { text-align: right; font-weight: 600; }
  .irev__name { display: grid; min-width: 0; overflow-wrap: anywhere; }
  .irev__why { font-size: 13px; color: var(--saffron); }
  .irev__fixes { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
  .irev__fixes .btn { border-color: var(--saffron); color: var(--saffron); background: var(--card); }
  .irev__steps, .irev__empty { margin: 0; font-size: var(--text-small); color: var(--smoke); }
  .imp__actions .btn--primary { min-height: 52px; padding-inline: 28px; }
  @media (max-width: 480px) {
    .irev__line { grid-template-columns: 64px minmax(0, 1fr); }
    .irev__fixes { grid-column: 1 / -1; justify-content: flex-start; }
  }
}

/* What changed in an included recipe's newer version (spec 3.5). */
@layer pages {
  .eembed__update { display: grid; gap: 8px; padding: 12px; border-radius: 12px; background: var(--saffron-tint); border: 1px solid var(--saffron-line); }
  .eembed__update > p { margin: 0; font-size: var(--text-ui); }
  .ediff { display: grid; gap: 6px; }
  .ediff__note { margin: 0; font-size: var(--text-small); }
  .ediff__rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
  .ediff__row { display: grid; grid-template-columns: 72px minmax(0, 1fr) auto; gap: 8px; align-items: baseline; padding: 6px 8px; border-radius: 8px; background: var(--card); font-size: var(--text-ui); }
  .ediff__sym { font-size: var(--text-small); font-weight: 600; color: var(--smoke); }
  .ediff__row--add .ediff__sym { color: var(--basil); }
  .ediff__row--del .ediff__sym { color: var(--beet); }
}

/* css/pages/follows.css */
@layer pages {
  /* Follows and updates (spec 16, 18.4) */
  .social { display: grid; gap: var(--s-4); padding-block: var(--s-4) var(--s-12); max-width: 760px; }
  .social h1 { margin: 0; font-size: var(--text-h1); }
  .social__sec { display: grid; gap: 12px; margin-top: var(--s-4); }
  .social__sec h2 { margin: 0; font-size: var(--text-h2); }
  .follow { display: inline-flex; margin: 0; }
  .follow__btn { min-width: 112px; }

  .people { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
  .people--grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); }
  .person { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 12px; border-radius: var(--r-lg); background: var(--card); border: 1px solid var(--crust); }
  .person__link { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 12px; align-items: center; color: var(--ink); text-decoration: none; min-width: 0; }
  .person__text { display: grid; gap: 1px; min-width: 0; }
  .person__text strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .person__text span { color: var(--smoke); font-size: var(--text-small); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .person__link:hover strong { text-decoration: underline; text-underline-offset: 3px; }

  .updates { list-style: none; margin: 0; padding: 0; display: grid; }
  .update { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 12px 0; border-bottom: 1px solid var(--parchment); }
  .update:last-child { border-bottom: 0; }
  .update__icon { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--parchment); color: var(--ink); }
  .update__body { display: grid; gap: 4px; min-width: 0; }
  .update__body p { margin: 0; overflow-wrap: anywhere; }
  .update__body a { color: var(--ink); font-weight: 600; text-underline-offset: 3px; }
  .update__note { color: var(--smoke); font-size: var(--text-small); }
  .update__when { color: var(--smoke); font-size: var(--text-small); white-space: nowrap; padding-top: 2px; }

  /* Onboarding step 3: checkboxes that read as Follow / Following toggles */
  .pickcooks { display: grid; gap: 8px; }
  .pickcook { position: relative; display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 18px; border: 1px solid var(--crust); background: var(--card); cursor: pointer; }
  .pickcook input { position: absolute; opacity: 0; pointer-events: none; }
  .pickcook:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
  .pickcook__text { display: grid; gap: 1px; min-width: 0; }
  .pickcook__text span { color: var(--smoke); font-size: var(--text-small); }
  .pickcook__state { min-height: 40px; min-width: 104px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--ink); display: grid; place-items: center; font-weight: 600; font-size: var(--text-small); background: var(--card); color: var(--ink); }
  .pickcook__on { display: none; }
  .pickcook:has(input:checked) .pickcook__state { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
  .pickcook:has(input:checked) .pickcook__on { display: inline; }
  .pickcook:has(input:checked) .pickcook__off { display: none; }
  @media (max-width: 420px) { .update { grid-template-columns: 36px minmax(0, 1fr); } .update__when { grid-column: 2; padding-top: 0; } }
}

@layer pages {
  .creator__report, .catalog__report { color: var(--smoke); font-size: var(--text-small); }
}

/* css/pages/home.css */
@layer pages {
  .home { display: grid; gap: var(--s-8); padding-block: var(--s-6) var(--s-12); }
  .home h1 { font-size: var(--text-h1); }
  .home__grid { display: grid; gap: var(--s-4); grid-template-columns: minmax(0, 1fr); }
  @media (min-width: 900px) { .home__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
  .home .panel { max-width: none; align-content: start; }
  .panel__head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
  .panel__head h2 { font-size: 1.5rem; }
  .panel__head a { display: inline-flex; align-items: center; gap: 4px; font-size: var(--text-ui); font-weight: 600; text-decoration: none; min-height: 44px; }
  .draftlist { list-style: none; margin: 0; padding: 0; display: grid; }
  .draftlist a { display: grid; gap: 2px; padding: 12px 0; border-bottom: 1px solid var(--parchment); color: var(--ink); text-decoration: none; }
  .draftlist li:last-child a { border-bottom: 0; }
  .draftlist__meta { font-size: var(--text-small); color: var(--smoke); }
  .draftlist__ready { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; }
  .draftlist__bar { display: block; height: 4px; border-radius: 2px; background: var(--parchment); overflow: hidden; }
  .draftlist__bar > span { display: block; height: 100%; background: var(--ink); border-radius: 2px; }
  .draftlist__meta.is-ready { color: var(--basil); }
  .draftlist--row a { grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; gap: 12px; }
  .draftlist a.draftlist__day { grid-template-columns: 56px minmax(0, 1fr); align-items: baseline; gap: 12px; }
  .draftlist__dow { font-size: 13px; font-weight: 700; color: var(--smoke); }
  .home__section { display: grid; gap: var(--s-4); }
  .home__sectionhead { display: flex; justify-content: space-between; align-items: baseline; }
  .home__sectionhead h2 { font-size: var(--text-h2); }
  .home__sectionhead a { display: inline-flex; gap: 4px; align-items: center; font-weight: 600; text-decoration: none; min-height: 44px; }
  .library { display: grid; gap: var(--s-4); padding-block: var(--s-4) var(--s-12); }
  .library__head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
}

@layer pages {
  .home__updates { grid-column: 1 / -1; }
  .home__updates .person { background: var(--flour); }
}

/* Continue Cooking (design Home) */
@layer pages {
  .home__eyebrow { margin: 0 0 10px; font: 700 13px / 1.2 var(--font-ui); letter-spacing: .08em; text-transform: uppercase; }
  .cont { display: flex; align-items: center; gap: 20px; padding: 18px 22px; border-radius: var(--r-lg); background: #1E1E1E; color: #FAF6EF; text-decoration: none; }
  .cont__text { flex: 1; display: grid; gap: 4px; min-width: 0; }
  .cont__text strong { font-family: var(--font-display); font-size: 1.375rem; font-weight: 500; line-height: 1.2; overflow-wrap: anywhere; }
  .cont__pic { flex: none; width: 96px; height: 96px; border-radius: 16px; overflow: hidden; background: #3A332C; }
  .cont__pic picture, .cont__pic img, .cont__pic svg, .cont__pic > * { width: 100%; height: 100%; object-fit: cover; display: block; }
  @media (max-width: 420px) { .cont { gap: 14px; padding: 14px; } .cont__pic { width: 80px; height: 80px; } }
  .cont__text > span:not(.cont__bar) { font-size: var(--text-small); color: #D9CFC2; }
  .cont__bar { display: block; height: 4px; border-radius: 2px; background: #3A332C; margin-top: 8px; overflow: hidden; }
  .cont__bar span { display: block; height: 100%; background: #FAF6EF; border-radius: 2px; }
  .cont__go { display: inline-flex; gap: 6px; align-items: center; font-weight: 600; white-space: nowrap; }
  .cont:hover .cont__go { text-decoration: underline; }
  /* Leftovers panel (spec 17.1) */
  .leftovers__row { display: flex; align-items: center; gap: 8px; }
  .leftovers__row > a { flex: 1; min-width: 0; }
}

/* css/pages/ingredient.css */
@layer pages {
  /* Ingredient pages and converter (design Ingredient, Converter) */
  .ingpage { display: grid; gap: var(--s-6); padding-block: var(--s-4) var(--s-12); }
  .ingpage__head { display: grid; gap: 20px; align-items: center; }
  @media (min-width: 800px) { .ingpage__head { grid-template-columns: 240px minmax(0, 1fr); gap: 40px; } }
  .ingpage__art { aspect-ratio: 1; max-width: 240px; border-radius: var(--r-xl); background: var(--parchment); border: 1px solid var(--crust); display: grid; place-items: center; }
  .ingpage__icon { width: 62%; height: 62%; }
  .ingpage__who { display: grid; gap: 8px; }
  .ingpage__who h1 { margin: 0; font-size: clamp(2.5rem, 1.8rem + 3vw, 4rem); line-height: 1; }
  .ingpage__also { margin: 0; color: var(--smoke); }
  .ingpage__desc { margin: 0; font-size: var(--text-body); max-width: 62ch; }
  .ingpage__badges { flex-wrap: wrap; margin: 4px 0 0; padding: 0; overflow: visible; }
  .ingpage__grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); }
  .ingpage__card { max-width: none; display: grid; gap: 10px; align-content: start; }
  .ingpage__card h2 { margin: 0; font-size: 1.375rem; }
  .ingpage__dl { margin: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; }
  .ingpage__dl dt, .ingpage__dl dd { padding: 9px 0; border-bottom: 1px solid var(--parchment); margin: 0; }
  .ingpage__dl dd { text-align: right; font-weight: 700; }
  .ingpage__subs { list-style: none; margin: 0; padding: 0; display: grid; }
  .ingpage__subs li { display: grid; gap: 2px; padding: 9px 0; border-bottom: 1px solid var(--parchment); }
  .ingpage__subs a { color: var(--ink); }
  .ingpage__subs span { color: var(--smoke); font-size: var(--text-small); }
  .ingpage__safety p { margin: 0; }
  .ingpage__kids { flex-wrap: wrap; }
  .ingindex { display: grid; gap: 6px; }
  .ingindex h2 { margin: 12px 0 0; font-size: var(--text-h2); }
  .ingindex ul { list-style: none; margin: 0; padding: 0; columns: 14rem; column-gap: 24px; }
  .ingindex li { padding: 4px 0; break-inside: avoid; }
  .ingindex a { color: var(--ink); text-underline-offset: 3px; }
  .convert { display: grid; gap: 16px; padding-block: var(--s-6) var(--s-12); }
  .container--reading.convert { max-width: calc(920px + 2 * var(--gutter)); }
  .convert h1 { margin: 0; font-size: var(--text-h1); }
  .convert__card { max-width: none; display: grid; gap: 14px; align-content: start; }
  .convert__card h2 { margin: 0; font-size: 1.375rem; }
  .convert__row { display: grid; gap: 12px; }
  @media (min-width: 640px) { .convert__row { grid-template-columns: 1fr 1fr 1.3fr; } .convert__row--2 { grid-template-columns: 1fr 1fr; } }
  .convert__result { display: flex; flex-wrap: wrap; gap: 10px; align-items: baseline; padding: 20px; border-radius: var(--r-lg); background: var(--ink); color: var(--flour); }
  .convert__result strong { font-size: clamp(2.5rem, 2rem + 2vw, 3.5rem); line-height: 1; }
  .convert__result span { color: color-mix(in srgb, var(--flour) 80%, var(--ink)); font-size: var(--text-small); }
  .convert__grid { display: grid; gap: 16px; }
  @media (min-width: 760px) { .convert__grid { grid-template-columns: 1fr 1fr; } }
  .convert__temps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .convert__temps span { display: grid; justify-items: center; gap: 2px; padding: 12px 6px; border-radius: var(--r-md); background: var(--parchment); font-size: 12px; color: var(--smoke); text-align: center; }
  .convert__temps strong { font-size: 1.5rem; color: var(--ink); }
  .convert__pan { display: grid; gap: 4px; padding: 16px; border-radius: var(--r-md); background: var(--parchment); }
  .convert__pan strong { font-size: 2rem; }
  .convert__pan span { color: var(--smoke); font-size: var(--text-small); }
}

/* css/pages/landing.css */
@layer pages {
  /* Landing for guests (spec 18.3; design Landing) */
  .landing { display: grid; gap: clamp(40px, 6vw, 72px); padding-bottom: var(--s-12); }
  /* The hero stays in the centered page container (aligned with the logo and
     the rows below, as in the design); only its contents are narrow. */
  .landing__hero { display: grid; gap: 16px; padding-top: clamp(24px, 6vw, 72px); justify-items: start; }
  .landing__hero > * { max-width: 760px; }
  .landing__hero h1 { margin: 0; font-size: clamp(2.25rem, 1.2rem + 5vw, 5rem); line-height: .98; letter-spacing: -.02em; }
  .landing__lead { margin: 0; font-size: clamp(1.0625rem, 1rem + .4vw, 1.25rem); color: var(--smoke); max-width: 640px; }
  .landing__search { width: 100%; max-width: 640px; box-shadow: 0 6px 24px rgb(var(--shade) / .06); }
  .landing__hero > .landing__quick { flex-wrap: wrap; max-width: none; }
  /* Phones: one row that scrolls sideways (design Landing). */
  @media (max-width: 767px) {
    .landing__hero > .landing__quick { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; justify-self: stretch; margin-inline: calc(-1 * var(--gutter)); padding-inline: var(--gutter); }
    .landing__hero > .landing__quick::-webkit-scrollbar { display: none; }
    .landing__quick .fchip { flex: none; }
  }
  .landing__sec { display: grid; gap: 16px; }
  .landing__sec > h2 { margin: 0; font-size: var(--text-h2); }

  .colls { list-style: none; margin: 0 calc(-1 * var(--gutter)); padding: 0 var(--gutter); display: grid; grid-auto-flow: column; grid-auto-columns: minmax(260px, 85%); gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: var(--gutter); scrollbar-width: none; }
  .colls::-webkit-scrollbar { display: none; }
  .colls > li { scroll-snap-align: start; }
  @media (min-width: 800px) { .colls { grid-auto-columns: calc((100% - 2 * 14px) / 3.2); } }
  /* Very wide screens: the strip runs the full width of the window (design Landing at 1920). */
  @media (min-width: 1440px) { .colls { margin-inline: calc(50% - 50vw); padding-inline: 40px; scroll-padding-inline: 40px; grid-auto-columns: 380px; } }
  .coll { position: relative; display: block; border-radius: var(--r-xl); overflow: hidden; aspect-ratio: 4 / 5; color: #FAF6EF; text-decoration: none; background: var(--parchment); }
  .coll__media, .coll__media > * { position: absolute; inset: 0; width: 100%; height: 100%; }
  .coll__media img, .coll__media svg { width: 100%; height: 100%; object-fit: cover; }
  .coll__media .mosaic { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: minmax(0, 1fr) minmax(0, 1fr); gap: 3px; }
  .coll__text { position: absolute; inset: auto 0 0 0; display: grid; gap: 2px; padding: 48px 20px 18px; background: linear-gradient(180deg, transparent, rgb(30 26 22 / .78)); }
  .coll__text strong { font-family: var(--font-display); font-weight: 500; font-size: clamp(1.375rem, 1.1rem + 1vw, 1.75rem); line-height: 1.1; }
  .coll__text span { font-size: var(--text-small); opacity: .9; }
  .coll:hover .coll__text strong { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }

  .landing__band { background: var(--ink); color: var(--flour); padding-block: clamp(48px, 8vw, 88px); }
  .landing__bandin { display: grid; gap: 32px; align-items: center; }
  @media (min-width: 900px) { .landing__bandin { grid-template-columns: 1fr 1fr; gap: 64px; } }
  .landing__band h2 { margin: 0 0 16px; font-size: clamp(2rem, 1.4rem + 2.6vw, 3.25rem); line-height: 1.02; color: var(--flour); }
  .landing__band h2 em { display: block; color: color-mix(in srgb, var(--flour) 62%, var(--ink)); }
  .landing__band p { margin: 0 0 20px; max-width: 46ch; color: color-mix(in srgb, var(--flour) 82%, var(--ink)); }
  .landing__try { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
  .landing__try label { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
  .landing__try input { width: 7.5em; min-height: 48px; padding: 0 12px; border-radius: var(--r-md); border: 1px solid color-mix(in srgb, var(--flour) 30%, transparent); background: color-mix(in srgb, var(--flour) 8%, transparent); color: var(--flour); font-size: 1.125rem; font-variant-numeric: tabular-nums; }
  .landing__demo { background: var(--flour); color: var(--ink); border-radius: var(--r-lg); padding: 18px; }
  .landing__demohead { display: flex; justify-content: space-between; align-items: center; font-family: var(--font-display); font-size: 1.125rem; padding-bottom: 6px; }
  .landing__demo ul { list-style: none; margin: 0; padding: 0; }
  .landing__demo li { display: grid; grid-template-columns: 6.5em minmax(0, 1fr); gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--crust); }
  .landing__demo li:last-child { border-bottom: 0; }
  .landing__demo li span:first-child { text-align: right; font-weight: 600; }

  .ccards2 { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); }
  .ccard2 { display: grid; gap: 8px; align-content: start; padding: 0 16px 16px; border: 1px solid var(--crust); border-radius: var(--r-lg); background: var(--card); overflow: hidden; }
  .ccard2__band { height: 64px; margin: 0 -16px -32px; background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--band) 88%, white) 0 14px, var(--band) 14px 28px); }
  .ccard2__who { display: grid; gap: 8px; justify-items: start; color: var(--ink); text-decoration: none; }
  .ccard2__who strong { font-size: 1.0625rem; }
  .ccard2 p { margin: 0; color: var(--smoke); font-size: var(--text-small); }
  .ccard2 .follow, .ccard2 > .btn { justify-self: start; }

  .landing__cta { display: grid; gap: 10px; justify-items: center; text-align: center; padding-block: 24px; }
  .landing__cta h2 { margin: 0; font-size: clamp(1.75rem, 1.3rem + 2vw, 2.75rem); }
  .landing__cta p { margin: 0 0 8px; color: var(--smoke); }
}

@layer pages {
  /* Denser grids than the library: seven across on a wide screen (design Landing). */
  @media (min-width: 700px) { .landing .rgrid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); } }
}

/* css/pages/library.css */
/* My Recipes selection and bulk bar (design Library: round checkbox on each
   card, a dark bar pinned to the bottom with the count and actions). */
@layer pages {
  .library__item { position: relative; }
  .rsel { position: absolute; top: 8px; left: 8px; z-index: 2; width: 44px; height: 44px; border-radius: 50%; background: rgb(250 246 239 / .92); display: grid; place-items: center; cursor: pointer; }
  .rsel input { width: 22px; height: 22px; margin: 0; accent-color: var(--accent); cursor: pointer; }
  .library__item.is-selected .rcard__media { box-shadow: 0 0 0 3px var(--accent); }
  .table__sel { width: 48px; }
  .table__sel .rsel { position: static; background: none; }
  tr.is-selected { background: var(--parchment); }

  .bulkbar { position: sticky; bottom: 0; z-index: 20; padding: 12px 0 calc(env(safe-area-inset-bottom) + 14px); margin-top: 16px; pointer-events: none; }
  .bulkbar__in { pointer-events: auto; max-width: 760px; margin: 0 auto; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px; align-items: center; background: #1E1E1E; color: #FAF6EF; border-radius: 18px; padding: 8px 8px 8px 16px; box-shadow: 0 16px 40px -16px rgb(30 26 22 / .6); }
  .bulkbar__acts { display: flex; gap: 8px; justify-content: flex-end; overflow-x: auto; scrollbar-width: none; }
  .bulkbar__acts::-webkit-scrollbar { display: none; }
  .bulkbar__btn { flex: none; white-space: nowrap; }
  /* Phones: the count and clear on top, the actions in one scrolling row. */
  @media (max-width: 640px) {
    .bulkbar__in { grid-template-columns: minmax(0, 1fr) auto; padding: 8px; }
    .bulkbar__count { padding-left: 8px; }
    .bulkbar__acts { grid-column: 1 / -1; grid-row: 2; justify-content: flex-start; }
  }
  .bulkbar.is-live { transition: transform 380ms cubic-bezier(.2, .8, .2, 1), opacity 200ms; }
  .bulkbar.is-live.is-empty { transform: translateY(120%); opacity: 0; }
  .bulkbar__count { font-size: 15px; white-space: nowrap; }
  .bulkbar__btn, .bulkbar__clear { min-height: 44px; padding: 0 14px; border-radius: 12px; border: 0; background: rgb(250 246 239 / .14); color: #FAF6EF; font-weight: 600; cursor: pointer; }
  .bulkbar__btn:hover, .bulkbar__clear:hover { background: rgb(250 246 239 / .24); }
  .bulkbar__btn--danger { background: #9B2C2C; }
  .bulkbar__btn--danger:hover { background: #B23A3A; }
  .bulkbar__clear { width: 44px; padding: 0; font-size: 20px; }
  .bulkbar :focus-visible { outline-color: #FAF6EF; }
  @media (prefers-reduced-motion: reduce) { .bulkbar.is-live { transition: none; } }
  @media print { .bulkbar, .rsel { display: none !important; } }

  .bulkpick__titles { margin: 0; padding-left: 20px; display: grid; gap: 4px; font-weight: 600; }
  .catchoice { display: grid; gap: 6px; }
  /* Me (the Me tab) */
  .mehub { display: grid; gap: 24px; padding-block: var(--s-6) var(--s-12); }
  .mehub__who { display: flex; align-items: center; gap: 16px; }
  .mehub__who h1 { margin: 0; font-size: var(--text-h2, 1.75rem); overflow-wrap: anywhere; }
  .mehub__who a { color: var(--smoke); font-size: 14px; }
  .mehub__new { display: flex; flex-wrap: wrap; gap: 8px; }
  .mehub__new .btn { flex: 1 1 140px; }
  .mehub__group h2 { margin: 0 0 6px; font-family: var(--font-ui); font-size: 13px; font-weight: 700; color: var(--smoke); letter-spacing: .04em; text-transform: uppercase; }
  .mehub__group ul { list-style: none; margin: 0; padding: 0; border-radius: var(--r-lg); background: var(--card); border: 1px solid var(--crust); overflow: hidden; }
  .mehub__group li + li { border-top: 1px solid var(--parchment); }
  .mehub__group a { display: grid; grid-template-columns: 22px minmax(0, 1fr) 18px; gap: 14px; align-items: center; min-height: 52px; padding: 0 14px; color: var(--ink); text-decoration: none; font-weight: 500; }
  .mehub__group a:hover { background: var(--parchment); color: var(--ink); }
  .mehub__group a > .icon:last-child { color: var(--smoke); }
  /* Above the phone tab bar (the bar sets --tabbar-h). */
  .has-tabbar .bulkbar { bottom: var(--tabbar-h, 0px); }
}

/* css/pages/lists.css */
@layer pages {
  /* Shopping lists (spec 15, design Shopping List) */
  .lists { display: grid; gap: 16px; padding-block: 8px 48px; }
  .lists h1 { margin: 0; font-size: var(--text-h1); }
  .lists__all { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
  .lists__card { display: grid; gap: 8px; padding: 16px; border-radius: var(--r-lg); border: 1px solid var(--crust); background: var(--card); text-decoration: none; color: var(--ink); }
  .lists__card:hover { border-color: var(--accent); }
  .lists__top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
  .lists__top strong { font-size: 1.125rem; }
  .lists__top span, .lists__src { font-size: var(--text-small); color: var(--smoke); }
  .lists__new { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
  .lists__new .field { flex: 1 1 220px; }
  .lref { display: grid; gap: 6px; padding-block: 6px; }

  .lpage { display: grid; }
  .lhead { position: sticky; top: 0; z-index: var(--z-sticky); background: color-mix(in srgb, var(--flour) 97%, transparent); border-bottom: 1px solid var(--crust); }
  .lhead__in { max-width: 760px; margin: 0 auto; padding: 6px var(--gutter) 10px; display: grid; gap: 10px; }
  .lhead__top { display: flex; align-items: center; gap: 10px; }
  .lhead__top h1 { margin: 0; flex: 1; min-width: 0; font-size: 1.5rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .lhead__back { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; color: var(--ink); }
  .lpass { display: grid; grid-template-columns: 1fr 1fr; background: var(--parchment); border-radius: 14px; padding: 3px; }
  .lpass a { min-height: 44px; display: grid; place-items: center; border-radius: 11px; font-weight: 600; color: var(--ink); text-decoration: none; font-size: var(--text-ui); }
  .lpass a[aria-current="page"] { background: var(--card); box-shadow: 0 1px 3px rgb(var(--shade) / .14); }
  .lprogress { height: 10px; border-radius: 3px; background: var(--parchment); position: relative; overflow: hidden; }
  .lprogress span { position: absolute; inset: 0 auto 0 0; background: var(--accent); transition: width var(--dur-smooth) var(--ease-standard); }
  .lprogress::after { content: ""; position: absolute; inset: 0; background-image: repeating-linear-gradient(90deg, color-mix(in srgb, var(--flour) 90%, transparent) 0 1px, transparent 1px 10px); }
  .lhead__hint, .lhead__sync { font-size: 0.8125rem; color: var(--smoke); }
  .lhead__sync.is-offline { color: var(--beet); font-weight: 600; }

  .lbody { max-width: 760px; width: 100%; margin: 0 auto; padding: 12px var(--gutter) 120px; display: grid; gap: 16px; }
  .lsec { display: grid; gap: 4px; }
  .lsec > summary { display: flex; align-items: center; justify-content: space-between; min-height: 44px; padding: 0 4px; cursor: pointer; list-style: none; }
  .lsec > summary::-webkit-details-marker { display: none; }
  .lsec > summary h2 { margin: 0; font-family: var(--font-ui); font-size: 0.8125rem; letter-spacing: .08em; text-transform: uppercase; }
  .lsec > summary span { font-size: 0.8125rem; color: var(--smoke); }
  .lsec > summary span::after { content: " ▾"; }
  .lsec:not([open]) > summary span::after { content: " ▸"; }
  .litems { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }

  .litem { position: relative; border-radius: 16px; background: var(--card); border: 1px solid var(--crust); scroll-margin-top: 200px; touch-action: pan-y; }
  .litem__row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; min-height: 64px; padding: 8px 8px 8px 10px; }
  .litem form { margin: 0; }
  .litem__text { display: grid; min-width: 0; }
  .litem__name { font-size: 1.0625rem; }
  .litem__tag { font-size: 0.75rem; font-weight: 600; color: var(--smoke); border: 1px solid var(--crust); border-radius: 999px; padding: 1px 6px; vertical-align: middle; }
  .litem__meta { font-size: 0.875rem; color: var(--smoke); line-height: 1.35; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
  .litem__from { color: var(--ash); }
  .litem__acts { display: flex; gap: 6px; }
  .litem__acts .lchip { padding: 0 10px; }
  .ldot { width: 12px; height: 12px; border-radius: 50%; margin-left: 6px; background: var(--crust); }
  .litem--have .ldot { background: var(--basil); }
  .litem--have_some .ldot { background: var(--saffron); }
  .litem--have .litem__name, .litem--have .litem__amt { color: var(--ash); }
  .lchip { min-height: 44px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--crust); background: var(--card); color: var(--ink); font-weight: 600; font-size: 0.875rem; cursor: pointer; }
  .lchip--have.is-on { background: var(--basil); border-color: var(--basil); color: #FFFFFF; }
  /* Need is where every item starts, so it is marked quietly; Have stands out. */
  .lchip--need.is-on { background: var(--parchment); border-color: var(--ink); color: var(--ink); }
  /* Check pass: More sits at the end of the row, beside Have and Need (design Shopping List). */
  .litem--check .litem__row { align-items: start; gap: 10px; padding-right: 44px; }
  .litem--check .ldot { margin-top: 10px; }
  .litem__more > summary { position: absolute; top: 8px; right: 4px; z-index: 1; width: 36px; height: 44px; display: grid; place-items: center; border-radius: 12px; list-style: none; cursor: pointer; color: var(--smoke); }
  .litem__more > summary:hover { background: var(--parchment); color: var(--ink); }
  .litem__more[open] > summary { background: var(--parchment); color: var(--ink); }
  .litem__more > summary::-webkit-details-marker { display: none; }
  .litem__panel { display: grid; gap: 12px; padding: 4px 14px 14px 34px; }
  .litem__some, .litem__edit { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
  .litem__some .field, .litem__edit .field { flex: 1 1 200px; }
  .lcheck { width: 48px; height: 48px; border: 0; background: none; display: grid; place-items: center; cursor: pointer; padding: 0; }
  .lcheck > span { width: 28px; height: 28px; border-radius: 8px; border: 2px solid var(--ink); background: var(--card); color: var(--on-accent); display: grid; place-items: center; transition: background-color var(--dur-quick); }
  .lcheck[aria-checked="true"] > span { background: var(--accent); border-color: var(--accent); }
  .litem--bought { background: var(--parchment); }
  .litem--bought .litem__name { text-decoration: line-through; color: var(--ash); }
  /* Swipe (scripts): the row slides over a colored layer naming the result. */
  .litem.is-swiping .litem__row { transition: none; }
  .litem__row { transition: transform var(--dur-smooth) var(--ease-standard); background: inherit; border-radius: inherit; position: relative; }
  .litem__under { position: absolute; inset: 0; border-radius: inherit; display: flex; justify-content: space-between; align-items: center; padding: 0 18px; font-weight: 700; font-size: 0.875rem; color: #FFFFFF; }
  .litem__under.is-have { background: var(--basil); }
  .litem__under.is-need { background: var(--ink); }
  @media (prefers-reduced-motion: reduce) { .litem__row, .lprogress span { transition: none; } }

  .lnew { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
  .lnew .field { flex: 1 1 220px; }
  .lsources { display: grid; gap: 8px; }
  .lsources h2 { margin: 0; font-size: var(--text-h3); }
  .lsources__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
  .lsources__list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 14px; background: var(--card); border: 1px solid var(--crust); }
  .lsources__list li > span { display: grid; min-width: 0; }
  .lsources__meta { font-size: var(--text-small); color: var(--smoke); }
  .lfoot { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-start; }
  .lfoot__more { flex-basis: 100%; }
  .lfoot__more summary { cursor: pointer; font-weight: 600; min-height: 44px; display: flex; align-items: center; }
  .lfoot__more form { margin-top: 10px; }

  @media print {
    .lhead, .lnew, .lsources, .lfoot, .litem__more, .litem__acts, .topbar, .site-footer { display: none !important; }
    .litem { border: 0; border-bottom: 1px solid #CCC; border-radius: 0; }
  }
}

/* css/pages/moderation.css */
@layer pages {
  /* Reports, copyright notices, moderation (spec 11.6, 18.18) */
  .modform { display: grid; gap: 16px; padding-block: var(--s-6) var(--s-12); }
  .modform h1 { margin: 0; font-size: var(--text-h1); }
  .modform .fieldset { display: grid; gap: 8px; }
  .modpage { display: grid; gap: 16px; padding-block: var(--s-4) var(--s-12); }
  .modpage h1 { margin: 0; font-size: var(--text-h1); }
  .modpage .panel { max-width: none; display: grid; gap: 12px; }
  .modpage .panel h2 { margin: 0; font-size: 1.25rem; }
  .modlist { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
  .moditem { display: grid; gap: 10px; padding: 14px 16px; border-radius: var(--r-lg); background: var(--card); border: 1px solid var(--crust); }
  .moditem p { margin: 0; white-space: pre-line; }
  .moditem__head { display: grid; gap: 2px; }
  .moditem__head a { color: var(--ink); }
  .moditem__head span { color: var(--smoke); font-size: var(--text-small); }
  .moditem__quote { margin: 0; padding: 8px 12px; border-left: 3px solid var(--crust); color: var(--smoke); white-space: pre-line; font-size: var(--text-small); }
  .moditem__dl { margin: 0; display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 14px; font-size: var(--text-small); }
  .moditem__dl dt { font-weight: 600; }
  .moditem__dl dd { margin: 0; white-space: pre-line; overflow-wrap: anywhere; }
  .modact { display: grid; gap: 8px; }
  .modact textarea { min-height: 64px; }
  @media (max-width: 600px) { .moditem__dl { grid-template-columns: 1fr; } }
}

/* css/pages/notifications.css */
@layer pages {
  /* Notifications (spec 18.16) */
  .notes__head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
  .notes__list { list-style: none; margin: 0; padding: 0; display: grid; }
  .ntf { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 12px; align-items: start; padding: 12px 8px; border-bottom: 1px solid var(--parchment); border-radius: var(--r-md); }
  .ntf.is-unread { background: var(--card); }
  .ntf.is-unread .ntf__body > span:first-child { font-weight: 600; }
  .ntf__icon { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--parchment); }
  .ntf__body { display: grid; gap: 2px; color: var(--ink); text-decoration: none; min-width: 0; overflow-wrap: anywhere; }
  .ntf__body:hover > span:first-child { text-decoration: underline; text-underline-offset: 3px; }
  .ntf__body time { color: var(--smoke); font-size: var(--text-small); }
  .notes__prefs { display: grid; gap: 14px; max-width: 720px; }
  .notes__prefs input[type="checkbox"] { width: 22px; height: 22px; accent-color: var(--accent); }
  .notes__lock { display: block; font-weight: 400; font-size: 12px; color: var(--smoke); }
  /* The bell in the top bar */
  .topbar__bell { position: relative; }
  .topbar__count { position: absolute; top: 6px; right: 2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--beet); color: #FFFFFF; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; }
}

/* css/pages/onboarding.css */
@layer pages {
  .onb { min-height: 100dvh; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
  .onb__head, .onb__main, .onb__foot > * { max-width: 760px; width: 100%; margin-inline: auto; }
  .onb__head { display: grid; gap: 14px; padding: calc(env(safe-area-inset-top) + 16px) 20px 0; }
  .onb__dots { display: grid; grid-template-columns: repeat(var(--n), 1fr); gap: 4px; }
  .onb__dots span { height: 4px; border-radius: 2px; background: var(--crust); }
  .onb__dots span.on { background: var(--accent); }
  .onb__step { font-size: var(--text-small); color: var(--smoke); }
  .onb__main { padding: 12px 20px 24px; display: grid; gap: 18px; align-content: start; }
  .onb__main h1 { font-size: clamp(1.875rem, 1.4rem + 2vw, 2.75rem); }
  .onb__lead { color: var(--smoke); }
  .onb__foot {
    position: sticky;
    bottom: 0;
    padding: 12px 20px calc(env(safe-area-inset-bottom) + 12px);
    background: color-mix(in srgb, var(--flour) 94%, transparent);
    border-top: 1px solid var(--crust);
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 10px;
  }
  .onb__foot > * { margin: 0; }
  @media (min-width: 800px) { .onb__foot { grid-template-columns: minmax(0, 1fr) 180px 300px minmax(0, 1fr); } .onb__foot > :first-child { grid-column: 2; } }

  .choices { display: grid; gap: 10px; }
  .choice {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 14px;
    align-items: center;
    padding: 12px;
    border-radius: var(--r-lg);
    border: 1.5px solid var(--crust);
    background: var(--card);
    cursor: pointer;
    transition: border-color var(--dur-quick) var(--ease-standard);
  }
  .choice:has(input:checked) { border-color: var(--accent); }
  .choice:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
  .choice input { position: absolute; opacity: 0; pointer-events: none; }
  .choice__art { width: 72px; height: 72px; border-radius: 16px; overflow: hidden; display: block; }
  .choice__art svg { width: 100%; height: 100%; }
  .choice__text { display: grid; gap: 4px; }
  .choice__text strong { font-size: 1.125rem; }
  .choice__text span { font-size: var(--text-ui); color: var(--smoke); line-height: 1.4; }

  .example { padding: 18px; border-radius: var(--r-lg); background: #1E1E1E; color: #FAF6EF; display: grid; gap: 10px; }
  .example__label { font-size: var(--text-small); color: #D9D0C4; }
  .example__row { display: grid; grid-template-columns: 120px 1fr; gap: 12px; font-size: 1.125rem; }
  .example__row > span:first-child { text-align: right; font-weight: 600; }
  .example__row small { color: #D9D0C4; font-size: var(--text-small); }

  .chips-radio { display: flex; gap: 8px; flex-wrap: wrap; }
  .chip-radio { position: relative; }
  .chip-radio input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
  .chip-radio span {
    display: inline-flex;
    align-items: center;
    min-height: var(--hit);
    padding: 0 16px;
    border-radius: var(--r-md);
    border: 1.5px solid var(--crust);
    background: var(--card);
    font-weight: 600;
    transition: background-color var(--dur-quick), color var(--dur-quick), border-color var(--dur-quick);
  }
  .chip-radio input:checked + span { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
  .chip-radio input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
}

/* css/pages/planner.css */
@layer pages {
  /* Meal planner (spec 17.1; design Planner) */
  .plan { display: grid; gap: 20px; padding-block: var(--s-3) var(--s-12); }
  .plan__top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; }
  .plan__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; }
  .plan__title { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; min-width: 0; }
  .plan__head h1 { margin: 0; font-size: clamp(32px, 4.5vw, 48px); }
  .plan__weeks { display: flex; align-items: center; gap: 6px; }
  .plan__weeks .fchip { min-height: 44px; display: inline-flex; align-items: center; }

  /* Plan | Cook Log (shared with the cook log page) */
  .ktabs { display: flex; padding: 3px; border-radius: var(--r-pill); background: var(--parchment); }
  .ktabs__tab { min-height: 40px; padding: 0 14px; display: inline-flex; align-items: center; border-radius: var(--r-pill); color: var(--ink); font-weight: 600; font-size: 14px; text-decoration: none; }
  .ktabs__tab:hover { color: var(--ink); background: color-mix(in srgb, var(--card) 50%, transparent); }
  .ktabs__tab[aria-current="page"] { background: var(--card); box-shadow: 0 1px 2px rgb(0 0 0 / .06); }

  .plan__pool { display: grid; gap: 8px; min-width: 0; }
  .plan__hint { margin: 0; font-size: 13px; color: var(--smoke); }
  .plan__tray { list-style: none; margin: 0 calc(-1 * var(--gutter)); padding: 2px var(--gutter) 4px; display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
  .plan__tray::-webkit-scrollbar { display: none; }
  .plan__chip { flex: none; min-height: 48px; display: flex; align-items: center; gap: 8px; padding: 0 14px 0 6px; border-radius: var(--r-pill); border: 1.5px solid var(--crust); background: var(--card); color: var(--ink); font-weight: 600; font-size: 14px; text-decoration: none; cursor: grab; white-space: nowrap; }
  .plan__chip:hover { color: var(--ink); border-color: var(--smoke); }
  .plan__chip[aria-pressed="true"] { background: var(--ink); color: var(--flour); border-color: var(--ink); }
  .plan__chipart { width: 36px; height: 36px; flex: none; border-radius: 50%; overflow: hidden; background: var(--parchment); display: block; }
  .plan__chipart img, .plan__chipart svg { width: 100%; height: 100%; object-fit: cover; display: block; }

  .plan__days { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .plan__day { display: grid; gap: 8px; align-content: start; min-height: 150px; min-width: 0; padding: 12px; border-radius: 18px; background: var(--parchment); border: 1.5px solid var(--crust); transition: background 160ms, border-color 160ms; }
  .plan__day.is-today { border-color: var(--ink); }
  .plan.is-picking .plan__day, .plan.is-dragging .plan__day { border-style: dashed; border-color: var(--smoke); cursor: copy; }
  .plan.is-picking .plan__day:hover, .plan__day.is-over { background: var(--card); border-color: var(--ink); }
  .plan.is-busy { cursor: progress; }
  .plan__dayhead { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; }
  .plan__dayhead strong { font-size: 15px; }
  .plan__dayhead span { color: var(--smoke); font-size: 13px; white-space: nowrap; }
  .plan__entries { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
  .plan__entries:empty { display: none; }
  .plan__entry { display: grid; grid-template-columns: 28px minmax(0, 1fr) 32px; gap: 8px; align-items: center; padding: 8px 2px 8px 8px; border-radius: 12px; background: var(--card); border: 1px solid var(--crust); cursor: grab; }
  .plan__entry.is-gone { opacity: .7; cursor: default; }
  .plan__thumb { width: 28px; height: 28px; border-radius: 8px; overflow: hidden; background: var(--parchment); display: block; }
  .plan__thumb img, .plan__thumb svg { width: 100%; height: 100%; object-fit: cover; display: block; }
  .plan__entrytext { display: grid; min-width: 0; font-size: 14px; line-height: 1.25; }
  .plan__entrytext a { color: var(--ink); text-decoration: none; overflow-wrap: break-word; hyphens: auto; }
  .plan__entrytext a:hover { text-decoration: underline; }
  .plan__entrytext small { color: var(--smoke); font-size: 12px; }
  .plan__remove { width: 32px; height: 32px; border: 0; border-radius: 50%; background: none; color: var(--smoke); font-size: 20px; cursor: pointer; }
  .plan__remove:hover { background: var(--parchment); color: var(--ink); }
  .plan__place { min-height: 40px; padding: 0 10px; border-radius: 12px; border: 1px solid var(--ink); background: var(--card); color: var(--ink); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
  .plan__place[hidden] { display: none; }

  /* Cook log timeline (spec 17.2; design Planner, Cook Log) */
  .cooklog__head { display: grid; gap: 8px; }
  .cooklog__head h1 { margin: 0; font-size: clamp(32px, 4.5vw, 48px); }
  .cooklog__lead { margin: 0; color: var(--smoke); font-size: 15px; }
  .cooklog__list { list-style: none; margin: 0; padding: 0; display: grid; max-width: 760px; }
  .cooklog__item { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 12px; }
  .cooklog__when { display: grid; justify-items: center; align-content: start; gap: 6px; padding-top: 10px; }
  .cooklog__when time { font-size: 13px; font-weight: 700; text-align: center; line-height: 1.2; }
  .cooklog__rail { width: 1.5px; height: 100%; min-height: 60px; background: var(--crust); }
  .cooklog__card { margin: 6px 0 16px; display: grid; grid-template-columns: minmax(0, 100px) minmax(0, 1fr); background: var(--card); border: 1px solid var(--crust); border-radius: 22px; overflow: hidden; }
  .cooklog__pic { display: block; min-height: 120px; background: var(--parchment); }
  .cooklog__pic picture, .cooklog__pic img, .cooklog__pic svg { width: 100%; height: 100%; object-fit: cover; display: block; }
  .cooklog__body { padding: 14px 16px; display: grid; gap: 6px; align-content: start; min-width: 0; }
  .cooklog__body p { margin: 0; font-size: 15px; line-height: 1.45; white-space: pre-line; overflow-wrap: break-word; }
  .cooklog__title { margin: 0; font-family: var(--font-display); font-weight: 500; font-size: 19px; line-height: 1.25; }
  .cooklog__title a { color: var(--ink); text-decoration: none; }
  .cooklog__title a:hover { text-decoration: underline; }
  .cooklog__body .cooklog__meta { font-size: 13px; color: var(--smoke); font-variant-numeric: tabular-nums; }
  .cooklog__body .clog__photos a { width: 72px; }
  .cooklog__delete { justify-self: start; font-size: 13px; color: var(--smoke); }
  @media (min-width: 560px) {
    .cooklog__item { grid-template-columns: 64px minmax(0, 1fr); gap: 14px; }
    .cooklog__card { grid-template-columns: minmax(0, 160px) minmax(0, 1fr); }
  }
}

/* css/pages/prefs.css */
@layer pages {
  /* Settings: Creator and Privacy */
  .prefs { display: grid; gap: 22px; max-width: 720px; }
  .prefs__group { display: grid; gap: 8px; }
  .prefs__caps { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
  .prefs__check { align-items: flex-start; }
  .prefs__check span { display: grid; gap: 2px; }
  .prefs__check small { color: var(--smoke); font-size: var(--text-small); }
}

/* Kitchen: equipment, planning and prices sections, one after another. */
@layer pages {
  .prefs + .prefs { border-top: 1px solid var(--crust); padding-top: 28px; margin-top: 28px; }
  .prefs h2 { margin: 0; }
  .pricelist { list-style: none; margin: 0; padding: 0; display: grid; border: 1px solid var(--crust); border-radius: var(--r-md); background: var(--card); }
  .pricelist li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 12px; align-items: center; padding: 8px 8px 8px 14px; }
  .pricelist li + li { border-top: 1px solid var(--parchment); }
  .pricelist__name { font-weight: 600; }
  .pricelist__price { color: var(--ink); }
  .prefs__price { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr) auto; gap: 10px; align-items: end; }
  .prefs__price .field__error { grid-column: 1 / -1; }
  @media (max-width: 640px) {
    .pricelist li { grid-template-columns: minmax(0, 1fr) auto; }
    .pricelist__price { grid-row: 2; }
    .prefs__price { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .prefs__price .field:first-of-type { grid-column: 1 / -1; }
  }
}

/* css/pages/profile.css */
@layer pages {
  /* Creator profile (spec 10.4, design Creator): cover with the avatar over
     its lower edge, header row with actions on the right, featured, tabs. */
  .creator { display: grid; gap: 36px; padding-block: 16px 64px; }
  .creator__head { display: grid; gap: 14px; }
  .creator__cover { aspect-ratio: 4 / 1; border-radius: var(--r-xl, 32px); overflow: hidden; background: linear-gradient(135deg, var(--parchment), color-mix(in srgb, var(--crust) 70%, var(--parchment))); }
  .creator__head.is-plain .creator__cover { background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--crust) 80%, var(--parchment)) 0 22px, color-mix(in srgb, var(--crust) 62%, var(--parchment)) 22px 44px); }
  .creator__cover picture, .creator__cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
  .creator__avatar { margin: calc(-58px - 14px) 0 0 clamp(16px, 2.5vw, 28px); position: relative; width: max-content; }
  .creator__avatar .avatar { box-shadow: 0 0 0 6px var(--flour); }
  .creator__row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px 24px; align-items: start; padding-inline: clamp(0px, 2vw, 24px); }
  .creator__who { display: grid; gap: 8px; max-width: 64ch; }
  .creator__who h1 { margin: 0; font-size: clamp(2.25rem, 1.6rem + 2.4vw, 3.25rem); line-height: 1.05; letter-spacing: -0.02em; }
  .creator__meta { margin: 0; color: var(--smoke); font-size: var(--text-ui); }
  .creator__bio { margin: 0; font-size: var(--text-body); line-height: var(--leading-body); }
  .creator__facts { margin: 4px 0 0; display: flex; flex-wrap: wrap; gap: 6px 20px; font-size: var(--text-ui); color: var(--smoke); align-items: baseline; }
  .creator__facts strong { color: var(--ink); }
  .creator__facts a { color: var(--ink); text-underline-offset: 3px; }
  .creator__links { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 16px; }
  .creator__links a { font-weight: 600; color: var(--ink); text-underline-offset: 3px; }
  .creator__actions { display: flex; gap: 8px; align-items: center; padding-top: 28px; }
  .creator__sec { display: grid; gap: 14px; }
  .creator__sec h2 { margin: 0; font-size: var(--text-h2); }
  .creator__report { margin: 0; font-size: var(--text-small); }
  @media (max-width: 640px) {
    .creator__cover { aspect-ratio: 5 / 2; border-radius: var(--r-lg); }
    .creator__avatar { margin-top: calc(-44px - 14px); }
    .creator__avatar .avatar { --size: 88px !important; width: 88px; height: 88px; }
    .creator__row { grid-template-columns: 1fr; padding-inline: 0; }
    .creator__actions { padding-top: 0; }
  }

  /* Featured: three wide cards with the title over the photo */
  .fgrid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr)); gap: 14px; }
  .fcard { position: relative; display: block; aspect-ratio: 4 / 3; border-radius: var(--r-xl, 28px); overflow: hidden; color: #FAF6EF; text-decoration: none; background: var(--parchment); }
  .fcard__media, .fcard__media > * { position: absolute; inset: 0; width: 100%; height: 100%; }
  .fcard__media img { width: 100%; height: 100%; object-fit: cover; }
  .fcard__text { position: absolute; left: 0; right: 0; bottom: 0; display: grid; gap: 2px; padding: 40px 16px 14px; background: linear-gradient(to top, rgb(20 16 12 / .78), transparent); }
  .fcard__text strong { font-family: var(--font-display); font-size: 1.5rem; font-weight: 500; line-height: 1.15; }
  .fcard__text span { font-size: var(--text-small); color: #E8DFD2; }
  .fcard:hover .fcard__text strong { text-decoration: underline; text-underline-offset: 3px; }

  /* Tabs as links */
  .ptabs { display: flex; gap: 4px; border-bottom: 1px solid var(--crust); overflow-x: auto; scrollbar-width: none; margin-bottom: -20px; scroll-margin-top: 80px; }
  .ptabs__tab { flex: none; min-height: 48px; display: inline-flex; align-items: center; gap: 6px; padding: 0 14px; color: var(--smoke); font-weight: 600; text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; }
  .ptabs__tab span { font-weight: 500; }
  .ptabs__tab[aria-current="page"] { color: var(--ink); border-bottom-color: var(--ink); }
  .creator__panel { scroll-margin-top: 140px; }

  /* Catalogs tab: the tree */
  .ptree { list-style: none; margin: 0; padding: 0; display: grid; max-width: 720px; }
  .ptree a { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; min-height: 56px; padding: 0 10px 0 calc(10px + var(--lvl, 0) * 28px); border-radius: 12px; color: var(--ink); text-decoration: none; }
  .ptree li:first-child a, .ptree li[style*="--lvl:0"] a { font-weight: 700; }
  .ptree a:hover { background: var(--parchment); }
  .ptree .tines { display: inline-flex; gap: 2px; align-items: flex-end; height: 14px; }
  .ptree .tines span { width: 2px; background: var(--smoke); border-radius: 1px; height: 14px; }
  .ptree .tines span:nth-child(2) { height: 10px; }
  .ptree__n { color: var(--smoke); }

  /* Cooked It tab */
  .pcooked { list-style: none; margin: 0; padding: 0; display: grid; gap: 18px; max-width: 760px; }
  .pcooked > li { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 12px; }
  .pcooked__body { display: grid; gap: 6px; }
  .pcooked__body p { margin: 0; }
  .pcooked__who span { color: var(--smoke); font-size: var(--text-small); }
  .pcooked__photo { margin: 0; width: 180px; aspect-ratio: 1; border-radius: var(--r-md); overflow: hidden; }
  .pcooked__photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
}

@layer pages {
  /* Privacy and Terms */
  .legal { display: grid; gap: 14px; padding-block: 16px 64px; }
  .legal h1 { margin: 0; }
  .legal h2 { margin: 18px 0 0; font-size: var(--text-h3); }
  .legal__lead { margin: 0; font-size: 1.1875rem; line-height: 1.5; }
  .legal__date { margin: 0; color: var(--smoke); font-size: var(--text-small); }
  .legal ul { margin: 0; padding-left: 20px; display: grid; gap: 8px; }
  .legal p { margin: 0; line-height: var(--leading-body); }
}

@layer pages {
  /* Versions and forks (spec 11.5, design Versions) */
  .versions { display: grid; gap: 16px; padding-block: 8px 64px; }
  .versions h1 { margin: 0; }
  /* Versions (design Versions): a timeline, and what changed in the one picked */
  .versions { display: grid; gap: 20px; padding-block: var(--s-3) var(--s-12); max-width: 1020px; }
  .versions__top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; }
  .versions h1 { margin: 0; font-size: clamp(32px, 4.5vw, 48px); }
  .versions__cols { display: grid; gap: 24px; align-items: start; }
  @media (min-width: 900px) { .versions__cols { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .vpanel { position: sticky; top: 88px; } }
  .vlist { list-style: none; margin: 0; padding: 0; display: grid; }
  .vitem { position: relative; display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 16px; padding-bottom: 12px; }
  .vitem::before { content: ""; position: absolute; left: 10px; top: 34px; bottom: 0; width: 1.5px; background: var(--crust); }
  .vitem:last-child::before { bottom: 12px; }
  .vitem__dot { width: 22px; height: 22px; margin-top: 12px; border-radius: 50%; border: 1.5px solid var(--ink); background: var(--flour); }
  .vitem.is-current .vitem__dot { box-shadow: inset 0 0 0 3px var(--flour); background: var(--ink); }
  .vitem__card { display: grid; gap: 4px; padding: 14px 16px; border-radius: 16px; border: 1px solid var(--crust); background: var(--parchment); color: var(--ink); text-decoration: none; }
  .vitem__card:hover { color: var(--ink); border-color: var(--smoke); }
  .vitem.is-current .vitem__card { background: var(--card); border-color: var(--ink); }
  .vitem__head { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
  .vitem__head time, .vitem__none, .vitem__steps { color: var(--smoke); font-size: var(--text-small); margin: 0; }
  .vitem__note { font-size: 15px; line-height: 1.4; }
  .vpanel { display: grid; gap: 10px; padding: 20px; border-radius: 22px; background: var(--card); border: 1px solid var(--crust); scroll-margin-top: 80px; }
  .vpanel h2 { margin: 0 0 4px; font-size: 1.375rem; }
  .vdiff { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
  .vdiff__row { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 10px; align-items: center; min-height: 40px; padding: 6px 12px; border-radius: 12px; background: var(--parchment); }
  .vdiff__sym { font-weight: 700; text-align: center; }
  .vdiff__amt { white-space: nowrap; }
  .vdiff__amt s { color: var(--ash); }
  .vdiff--add { background: var(--basil-tint); } .vdiff--add .vdiff__sym { color: var(--basil); }
  .vdiff--rem { background: var(--beet-tint); } .vdiff--rem .vdiff__sym { color: var(--beet); }
  .vdiff--chg { background: var(--saffron-tint); } .vdiff--chg .vdiff__sym { color: var(--saffron); }
  /* Remix tree (spec 17.4): each fork under what it came from, with what it changed */
  .rtree { overflow-x: auto; padding-bottom: 8px; }
  .rtree ul { list-style: none; margin: 0; padding: 0; }
  .rtree ul ul { margin-left: 18px; padding-left: 22px; border-left: 1.5px solid var(--crust); }
  .rtree li { position: relative; padding-top: 10px; }
  .rtree ul ul > li::before { content: ""; position: absolute; left: -22px; top: 34px; width: 20px; border-top: 1.5px solid var(--crust); }
  .rtree ul ul > li:last-child::after { content: ""; position: absolute; left: -24px; top: 35px; bottom: 0; width: 4px; background: var(--flour); }
  .rtree__node { display: grid; gap: 2px; max-width: 520px; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--crust); background: var(--card); text-decoration: none; color: var(--ink); }
  a.rtree__node:hover { border-color: var(--smoke); color: var(--ink); }
  .rtree__node span { color: var(--smoke); font-size: var(--text-small); }
  .rtree__node .rtree__changes { color: var(--ink); font-size: 13px; }
  .rtree__node--root { background: var(--parchment); }
}

@layer pages {
  .creator__note { padding: 12px 14px; border-radius: var(--r-md); background: var(--card); border: 1px solid var(--crust); font-size: var(--text-ui); }
}

/* css/pages/recipe.css */
@layer pages {
  /* Recipe page (spec 7, brief 9.4, design Recipe Page). Mobile first; the
     wide layout starts at 960px like the design. */
  .recipe { padding-bottom: 120px; }
  .crumbs { font-size: var(--text-small); color: var(--smoke); }
  .crumbs ol { list-style: none; margin: 0; padding: 0; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
  .crumbs a { color: var(--smoke); text-decoration: none; }
  .crumbs li[aria-current] { color: var(--ink); }
  .tines { display: inline-flex; gap: 2px; }
  .tines span { width: 1.5px; height: 10px; background: var(--ash); }

  /* Hero */
  .hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: clamp(16px, 3vw, 40px);
    align-items: stretch;
  }
  .hero__media {
    position: relative;
    height: min(40dvh, 340px);
    border-radius: var(--r-lg);
    overflow: hidden;
    background: var(--parchment);
    box-shadow: var(--photo-inset);
    view-transition-name: recipe-hero;
  }
  .hero__media > svg, .hero__media > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
  /* Phones: one title block laid over the bottom of the photo (same grid cell). */
  .hero { grid-template-areas: "stack"; }
  .hero__media, .hero__info { grid-area: stack; }
  .hero__info {
    align-self: end;
    z-index: 1;
    display: grid;
    gap: 10px;
    padding: 64px 18px 16px;
    border-radius: 0 0 var(--r-lg) var(--r-lg);
    background: linear-gradient(to top, rgb(30 26 22 / .86), rgb(30 26 22 / 0));
    color: #FAF6EF;
  }
  .hero__info h1 { font-size: 2rem; line-height: 1.05; color: #FAF6EF; font-variation-settings: "opsz" 96; }
  .hero__author { display: flex; align-items: center; gap: 8px; font-size: var(--text-small); color: #F2EBDF; flex-wrap: wrap; }
  .hero__author a { color: #F2EBDF; text-decoration: none; font-weight: 600; }
  .hero__author .avatar { --size: 24px; box-shadow: none; }
  .hero__info .facts, .hero__info .badges, .hero__info .toolbar { display: none; }

  .meta-line { display: grid; gap: 10px; padding: 12px 0 4px; }
  .meta-line p { font-size: var(--text-ui); font-variant-numeric: tabular-nums; }
  .meta-line p span { color: var(--smoke); }

  .badges {
    display: flex;
    gap: 8px;
    align-items: center;
    overflow-x: auto;
    scrollbar-width: none;
    margin-inline: calc(-1 * var(--gutter));
    padding-inline: var(--gutter);
  }
  .badges::-webkit-scrollbar { display: none; }
  .badge {
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-height: 32px;
    padding: 0 12px;
    border-radius: var(--r-pill);
    font-size: var(--text-small);
    white-space: nowrap;
    text-decoration: none;
    color: var(--ink);
    background: var(--parchment);
  }
  a.badge:hover { color: var(--ink); }
  .badge--ahead { background: none; border: 1px dashed var(--smoke); }
  .badge--verified { background: var(--basil); color: #FFFFFF; font-weight: 600; }
  :root[data-theme="dark"] .badge--verified { color: #15120F; }
  @media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .badge--verified { color: #15120F; } }
  .badge--claimed { background: none; border: 1.5px solid var(--saffron); color: var(--saffron); font-weight: 600; }
  .badge--plain { background: none; color: var(--smoke); padding-inline: 4px; }

  .toolbar { display: flex; gap: 8px; flex-wrap: wrap; }
  .hero__info .toolbar .btn { min-height: 48px; }

  /* Body: aside (scale + ingredients) and method */
  .recipe__body {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: clamp(20px, 4vw, 56px);
    align-items: start;
    margin-top: 10px;
  }
  .recipe__aside { display: grid; gap: 12px; }

  /* Scale card */
  .scale {
    display: grid;
    gap: 12px;
    padding: 14px;
    border-radius: var(--r-lg);
    background: var(--card);
    border: 1px solid var(--crust);
    box-shadow: 0 1px 2px rgb(var(--shade) / .04), 0 6px 18px -10px rgb(var(--shade) / .16);
  }
  .scale__base { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
  .scale__label { font-family: var(--font-display); font-size: 1.1875rem; font-weight: 500; }
  .scale__input {
    display: flex;
    align-items: center;
    gap: 6px;
    height: 48px;
    padding: 0 12px;
    border-radius: var(--r-md);
    background: var(--parchment);
    border: 1px solid var(--crust);
    color: var(--smoke);
  }
  .scale__input:focus-within { border-color: var(--accent); }
  .scale__input input {
    width: 76px;
    border: 0;
    background: transparent;
    font-size: 1.25rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    text-align: right;
    color: var(--ink);
    outline: none;
  }
  .scale__read { margin-inline-start: auto; display: grid; text-align: right; line-height: 1.25; }
  .scale__read span { font-size: var(--text-small); color: var(--smoke); }
  .scale__read strong { font-size: 1.0625rem; font-weight: 600; }
  .stepper { display: inline-flex; align-items: center; border: 1px solid var(--crust); border-radius: var(--r-md); overflow: hidden; }
  .stepper button { width: 48px; height: 48px; background: var(--parchment); font-size: 1.25rem; }
  .stepper input { width: 56px; height: 48px; border: 0; text-align: center; font-size: 1.1875rem; font-weight: 600; background: var(--card); color: var(--ink); }

  .ruler {
    --shift: 0px;
    position: relative;
    height: 16px;
    border-radius: 4px;
    overflow: hidden;
    background-image:
      repeating-linear-gradient(90deg, var(--ink) 0 1px, transparent 1px 8px),
      repeating-linear-gradient(90deg, var(--ash) 0 1px, transparent 1px 4px);
    background-size: 40px 16px, 8px 7px;
    background-repeat: repeat-x;
    background-position: calc(50% + var(--shift)) 0, calc(50% + var(--shift)) 0;
    transition: background-position var(--dur-base) var(--ease-standard);
    opacity: .55;
  }
  .ruler span { position: absolute; left: 50%; top: 0; bottom: 0; width: 2px; background: var(--accent); transform: translateX(-1px); }

  .scale__chips { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
  .chip-x {
    min-height: 44px;
    display: grid;
    place-items: center;
    border-radius: var(--r-md);
    border: 1px solid var(--crust);
    background: var(--card);
    color: var(--ink);
    font-size: var(--text-ui);
    font-weight: 600;
    text-decoration: none;
    transition: background-color var(--dur-quick), color var(--dur-quick), transform var(--dur-instant);
  }
  .chip-x:active { transform: scale(.97); }
  .chip-x[aria-current="true"] { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
  .chip-x:hover { color: var(--ink); }
  .chip-x[aria-current="true"]:hover { color: var(--on-accent); }

  .scale__pieces {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    padding-top: 10px;
    border-top: 1px solid var(--parchment);
  }
  .scale__result { display: grid; font-size: var(--text-ui); line-height: 1.3; }
  .scale__result span { font-size: var(--text-small); color: var(--smoke); }
  .scale__warn, .scale__note { font-size: var(--text-small); color: var(--saffron); }
  .scale__note { color: var(--smoke); }

  /* Segmented controls */
  .seg { position: relative; display: grid; background: var(--parchment); }
  .seg--units { --seg-i: 0; grid-template-columns: repeat(4, minmax(0, 1fr)); border-radius: var(--r-md); height: 48px; }
  .seg__pill { position: absolute; left: 0; top: 0; bottom: 0; width: 25%; padding: 3px; transform: translateX(calc(var(--seg-i) * 100%)); transition: transform var(--dur-base) var(--ease-standard); }
  .seg__pill::before { content: ""; display: block; height: 100%; border-radius: 11px; background: var(--card); box-shadow: 0 1px 3px rgb(var(--shade) / .14); }
  .seg__opt {
    position: relative;
    display: grid;
    place-items: center;
    font-size: 14px;
    font-weight: 600;
    color: var(--smoke);
    text-decoration: none;
    white-space: nowrap;
    padding: 0 4px;
  }
  .seg__opt[aria-checked="true"] { color: var(--ink); }
  .seg--pill { display: flex; flex-wrap: wrap; gap: 4px; border-radius: var(--r-pill); padding: 3px; }
  .scale__pieces .seg--pill { flex: 1 1 260px; }
  .scale__pieces .seg--pill button { flex: 1; }
  .seg--pill button, .seg--pill a[role="radio"] { min-height: 36px; padding: 0 12px; border-radius: var(--r-pill); font-size: var(--text-small); font-weight: 600; display: inline-flex; align-items: center; justify-content: center; color: var(--ink); text-decoration: none; }
  .seg--pill button[aria-checked="true"], .seg--pill a[aria-checked="true"] { background: var(--card); box-shadow: 0 1px 3px rgb(var(--shade) / .14); }
  .scale__variants .seg--pill a { flex: 1; }
  .seg--2 { grid-template-columns: 1fr 1fr; gap: 6px; background: none; }
  .seg--2 button { min-height: 44px; border-radius: 12px; border: 1px solid var(--accent); font-weight: 600; }
  .seg--2 button[aria-checked="true"] { background: var(--accent); color: var(--on-accent); }

  /* Mobile tabs */
  .rtabs {
    position: sticky;
    top: 0;
    z-index: 5;
    background: var(--flour);
    display: grid;
    grid-template-columns: 1fr 1fr;
    margin-inline: calc(-1 * var(--gutter));
    padding-inline: var(--gutter);
    border-bottom: 1px solid var(--crust);
  }
  .rtabs a {
    min-height: 52px;
    display: grid;
    place-items: center;
    font-family: var(--font-display);
    font-size: 1.1875rem;
    font-weight: 500;
    color: var(--smoke);
    text-decoration: none;
    position: relative;
  }
  .rtabs a[aria-selected="true"] { color: var(--ink); }
  .rtabs a[aria-selected="true"]::after {
    content: "";
    position: absolute;
    left: 18%;
    right: 18%;
    bottom: -2px;
    height: 6px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 6' preserveAspectRatio='none'%3E%3Cpath d='M2 3.4 C 25 1.8, 60 4.6, 98 2.8' fill='none' stroke='%231E1E1E' stroke-width='2.5' stroke-linecap='round' vector-effect='non-scaling-stroke'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
  }

  /* Ingredients */
  .ingredients { display: grid; gap: 10px; }
  .ingredients__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 4px; }
  .ingredients__head h2 { font-size: 1.5rem; letter-spacing: -0.01em; }
  .counter {
    font-size: var(--text-small);
    font-weight: 600;
    padding: 6px 12px;
    border-radius: var(--r-pill);
    background: var(--parchment);
    font-variant-numeric: tabular-nums;
    transition: background-color var(--dur-base), color var(--dur-base);
  }
  .counter.is-done { background: var(--basil); color: #FFFFFF; }
  .comp { display: grid; gap: 2px; margin-top: 6px; }
  .comp__head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 6px 4px; }
  .comp__head h3 { font-family: var(--font-ui); font-size: var(--text-small); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
  .comp__src { font-size: var(--text-small); font-weight: 400; letter-spacing: 0; text-transform: none; margin-inline-start: 6px; color: var(--smoke); }
  .comp__meta { white-space: nowrap; font-size: var(--text-small); color: var(--smoke); }
  .comp__group { font-size: var(--text-small); color: var(--smoke); font-weight: 600; padding: 8px 4px 2px; font-family: var(--font-ui); }
  .ings { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
  .ing { display: grid; grid-template-columns: 52px minmax(0, 1fr); align-items: center; border-radius: var(--r-md); transition: background-color var(--dur-base); position: relative; }
  .ing.is-hl { background: color-mix(in srgb, var(--saffron-fill) 22%, transparent); }
  .ing__icon {
    width: 52px;
    height: 56px;
    display: grid;
    place-items: center;
    border-radius: var(--r-md);
  }
  .ing__icon .ing-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--parchment) 70%, var(--card));
    box-shadow: inset 0 0 0 1px rgb(30 26 22 / .08);
    padding: 3px;
    transition: transform 180ms var(--ease-standard);
  }
  :root[data-theme="dark"] .ing__icon .ing-icon { background: #E9DFCF; }
  @media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .ing__icon .ing-icon { background: #E9DFCF; } }
  .ing__row {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    min-height: 56px;
    padding: 8px 8px 8px 0;
    text-align: start;
    border-radius: var(--r-md);
    color: var(--ink);
  }
  .ing__row:active { background: var(--parchment); }
  .ing__amt { justify-self: end; text-align: right; font-size: var(--text-body); line-height: 1.2; font-weight: 600; display: flex; gap: 4px; align-items: baseline; white-space: nowrap; }
  .ing__unit { font-weight: 400; color: var(--smoke); }
  .ing__name { font-size: var(--text-body); line-height: 1.35; min-width: 0; }
  .ing__label { position: relative; display: inline; }
  .ing__sub { display: block; font-size: 14px; color: var(--smoke); }
  .ing__tag { font-size: 12px; color: var(--smoke); white-space: nowrap; }
  .ink {
    position: absolute;
    left: -3px;
    top: 50%;
    width: calc(100% + 6px);
    height: 10px;
    margin-top: -5px;
    overflow: visible;
    pointer-events: none;
  }
  .ink path {
    fill: none;
    stroke: var(--accent);
    stroke-width: 2;
    stroke-linecap: round;
    vector-effect: non-scaling-stroke;
    stroke-dasharray: 100 200;
    stroke-dashoffset: 100;
    opacity: 0;
    transition: stroke-dashoffset 260ms var(--ease-standard), opacity 120ms;
  }
  .ing.is-checked .ink path { stroke-dashoffset: 0; opacity: 1; }
  .ing.is-checked .ing__amt, .ing.is-checked .ing__name { color: var(--ash); }
  .ing.is-checked .ing__unit, .ing.is-checked .ing__sub { color: var(--ash); }
  .ing.is-hopping .ing-icon { transform: translateY(-4px); }
  @media (prefers-reduced-motion: reduce) { .ink path { transition: none; } .ing.is-hopping .ing-icon { transform: none; } }
  .ings--process .ing__amt { color: var(--smoke); }
  .allergens { font-size: var(--text-small); color: var(--smoke); line-height: 1.5; padding: 8px 4px 0; }

  /* Reference card */
  .ref { grid-column: 1 / -1; display: grid; gap: 10px; padding: 14px; margin: 4px 0 8px 52px; border-radius: 18px; background: var(--card); border: 1px solid var(--crust); }
  .ref__head { display: flex; align-items: center; gap: 12px; }
  .ref__thumb { width: 44px; height: 44px; border-radius: 12px; background: var(--parchment); flex: none; }
  .ref__title { display: grid; flex: 1; font-size: var(--text-ui); }
  .ref__title a { font-weight: 600; }
  .ref__meta, .ref__note { font-size: var(--text-small); color: var(--smoke); }

  /* Method */
  .method { display: grid; gap: 28px; max-width: var(--reading-max); padding-top: 4px; }
  .method > h2 { font-size: var(--text-h2); letter-spacing: -0.01em; }
  .mcomp { display: grid; gap: 14px; }
  .mcomp__head { display: flex; align-items: center; gap: 12px; }
  .mcomp__head h3 { font-style: italic; font-size: 1.4375rem; }
  .mcomp__rule { flex: 1; height: 1px; background: var(--crust); }
  .mcomp__note { font-size: var(--text-small); color: var(--smoke); }
  .steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 18px; }
  .step { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 12px; scroll-margin-top: 80px; }
  .step__n { font-family: var(--font-display); font-size: 1.4375rem; line-height: 1.1; color: var(--smoke); }
  .step__body { display: grid; gap: 10px; min-width: 0; }
  .step__text { font-size: var(--text-body); line-height: var(--leading-body); }
  .tok {
    display: inline;
    padding: 0 3px;
    margin: 0 1px;
    border-radius: 5px;
    box-shadow: inset 0 -2px 0 var(--crust);
    font: inherit;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: inherit;
    transition: background-color 300ms, box-shadow 300ms;
  }
  button.tok { cursor: pointer; }
  .tok.is-hl, .tok.is-glow { background: color-mix(in srgb, var(--saffron-fill) 30%, transparent); box-shadow: inset 0 -2px 0 var(--saffron); }
  .tok--plain { box-shadow: none; padding: 0; }
  .step__extras { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
  .chip-timer {
    min-height: 40px;
    padding: 0 14px 0 10px;
    border-radius: var(--r-pill);
    border: 1px solid var(--accent);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    background: var(--card);
    color: var(--ink);
    transition: transform var(--dur-instant);
  }
  .chip-timer:active { transform: scale(.97); }
  .chip-timer.is-running { background: var(--accent); color: var(--on-accent); }
  .chip-timer__ring { width: 16px; height: 16px; border-radius: 50%; border: 2px dotted currentColor; }
  .chip-temp { min-height: 40px; display: inline-flex; align-items: center; padding: 0 12px; border-radius: var(--r-pill); background: var(--parchment); font-size: 14px; font-weight: 600; }
  .cue { font-family: var(--font-display); font-style: italic; font-size: var(--text-ui); color: var(--smoke); }
  .pause { display: inline-flex; align-items: center; gap: 6px; font-size: var(--text-small); color: var(--smoke); }
  .pause .icon { width: 18px; height: 18px; }
  .step__warn { font-size: var(--text-small); color: var(--saffron); }
  .step__ccp { font-size: var(--text-small); font-weight: 700; color: var(--beet); letter-spacing: .04em; text-transform: uppercase; }
  .step__checks { margin: 0; padding-inline-start: 18px; font-size: var(--text-ui); }
  .step__corrective { color: var(--smoke); }
  .safety {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr);
    gap: 10px;
    padding: 12px 14px;
    border-radius: var(--r-md);
    background: var(--parchment);
    border: 1px solid var(--crust);
    font-size: var(--text-ui);
    line-height: 1.5;
  }
  .safety--strong { background: var(--saffron-tint); border-color: var(--saffron-line); }
  .safety__i { width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; font-size: 13px; font-weight: 700; }
  .safety a { color: var(--ink); }

  /* After the method */
  .after { display: grid; gap: 24px; max-width: var(--reading-max); padding-top: 12px; border-top: 1px solid var(--crust); margin-top: 28px; }
  .after h2 { font-size: 1.5rem; }
  .after p, .after .md { font-size: var(--text-body); line-height: 1.6; }
  .after details summary { cursor: pointer; min-height: var(--hit); display: flex; align-items: center; font-family: var(--font-display); font-size: 1.25rem; }
  .recipe__foot { font-size: var(--text-small); color: var(--smoke); display: grid; gap: 4px; margin-top: 24px; }

  /* Floating bar (mobile): Ingredients pill and Cook, timers above */
  .dock {
    position: sticky;
    bottom: 0;
    z-index: var(--z-sticky);
    pointer-events: none;
    padding: 0 var(--gutter) calc(env(safe-area-inset-bottom) + 14px);
    display: grid;
    gap: 10px;
    justify-items: end;
  }
  .dock > * { pointer-events: auto; }
  .dock__bar { display: flex; gap: 10px; justify-content: space-between; width: 100%; }
  .dock__pill {
    min-height: 52px;
    padding: 0 18px;
    border-radius: var(--r-pill);
    border: 1px solid var(--crust);
    background: var(--card);
    font-size: var(--text-ui);
    font-weight: 600;
    box-shadow: 0 10px 30px -14px rgb(var(--shade) / .45);
  }
  .timers { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
  .timer {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--accent);
    color: var(--on-accent);
    border-radius: var(--r-pill);
    padding: 5px 6px 5px 5px;
    box-shadow: 0 10px 30px -12px rgb(var(--shade) / .5);
  }
  .timer.is-done { background: var(--basil); animation: timer-pulse 1.2s var(--ease-standard) 3; }
  @keyframes timer-pulse { 50% { transform: scale(1.04); } }
  .timer__main { display: flex; align-items: center; gap: 10px; min-height: 40px; color: inherit; }
  .timer__ring { transform: rotate(-90deg); }
  .timer__ring circle { fill: none; stroke-width: 4; }
  .timer__ring .t-track { stroke: color-mix(in srgb, currentColor 25%, transparent); stroke-dasharray: 1.2 2.99; }
  .timer__ring .t-fill { stroke: currentColor; stroke-dasharray: 100.53; transition: stroke-dashoffset 1s linear; }
  .timer__text { display: grid; text-align: start; line-height: 1.15; }
  .timer__text small { font-size: 12px; opacity: .8; }
  .timer__text strong { font-size: 1.0625rem; font-variant-numeric: tabular-nums; }
  .timer__close { width: 40px; height: 40px; border-radius: 50%; background: color-mix(in srgb, currentColor 14%, transparent); color: inherit; font-size: 18px; }

  /* Hover card */
  .icard {
    position: absolute;
    z-index: var(--z-dropdown);
    width: min(320px, calc(100vw - 32px));
    padding: 16px;
    border-radius: var(--r-lg);
    background: var(--card);
    border: 1px solid var(--crust);
    box-shadow: var(--shadow-3);
    display: grid;
    gap: 8px;
    font-size: var(--text-ui);
    transform-origin: top left;
    animation: icard-in var(--dur-base) var(--ease-spring);
  }
  @keyframes icard-in { from { opacity: 0; transform: scale(.94) translateY(-4px); } }
  @media (prefers-reduced-motion: reduce) { .icard { animation: none; } }
  .icard__head { display: flex; align-items: center; gap: 12px; }
  .icard__head .ing-icon { width: 48px; height: 48px; }
  .icard__head strong { font-family: var(--font-display); font-size: 1.25rem; font-weight: 500; }
  .icard__aliases, .icard__meta { font-size: var(--text-small); color: var(--smoke); }
  .icard__tags { display: flex; flex-wrap: wrap; gap: 6px; }

  /* Wide layout (design breakpoint 960px) */
  @media (min-width: 960px) {
    .hero { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); grid-template-areas: "media info"; }
    .hero__media { grid-area: media; height: 400px; border-radius: var(--r-xl); }
    .hero__info {
      grid-area: info;
      align-self: stretch;
      display: flex; flex-direction: column; justify-content: center; gap: 18px;
      padding: 8px 0; background: none; color: var(--ink); border-radius: 0;
    }
    .hero__info h1 { font-size: 3.25rem; line-height: 1.02; letter-spacing: -0.025em; font-variation-settings: "opsz" 144; color: var(--ink); }
    .hero__author { gap: 10px; font-size: var(--text-ui); color: var(--ink); }
    .hero__author a { color: var(--ink); }
    .hero__author .avatar { --size: 36px; box-shadow: 0 0 0 2px var(--flour), 0 0 0 3.5px var(--accent); }
    .hero__info .facts, .hero__info .badges { display: grid; }
    .hero__info .badges { display: flex; }
    .hero__info .toolbar { display: flex; }
    .facts {
      margin: 0;
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 1px;
      background: var(--crust);
      border: 1px solid var(--crust);
      border-radius: var(--r-md);
      overflow: hidden;
    }
    .facts > div { background: var(--flour); padding: 12px 14px; }
    .facts dt { font-size: var(--text-small); color: var(--smoke); }
    .facts dd { margin: 4px 0 0; font-size: 1.0625rem; font-weight: 600; font-variant-numeric: tabular-nums; }
    .meta-line { display: none; }
    .badges { overflow: visible; flex-wrap: wrap; margin: 0; padding: 0; }
    .recipe__body { grid-template-columns: minmax(340px, 420px) minmax(0, 1fr); margin-top: 40px; }
    /* Below the sticky top bar (64 px), and below the reading bar while it shows. */
    .recipe__aside { position: sticky; top: 76px; max-height: calc(100dvh - 88px); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; transition: top var(--dur-base); }
    .recipe:has(.rbar.is-on) .recipe__aside { top: 136px; max-height: calc(100dvh - 148px); }
    /* Taller than the window: in the page flow, so the whole list reads without a scroll box (design). */
    .recipe__aside.is-tall { position: static; max-height: none; overflow: visible; }
    .rtabs, .dock__bar { display: none; }
    .method { padding-top: 14px; }
    .recipe__body [data-panel] { display: grid !important; }
  }
  @media screen and (max-width: 959px) {
    /* Tabs: with JavaScript the inactive panel hides; without it both show. */
    .js .recipe__body [data-panel][data-tab-hidden] { display: none; }
  }
  @media (max-width: 959px) {
    .toolbar--wide { display: none; }
  }

  @media print {
    .topbar, .site-footer, .dock, .rtabs, .toolbar, .scale, .seg, .ing__icon, .hero__media, .badges, .crumbs, .after details summary { display: none !important; }
    body { background: #FFFFFF; color: #000000; }
    .hero { display: block; }
    .hero__info { display: block !important; position: static; background: none; color: #000; padding: 0; }
    .hero__info h1, .hero__author a { color: #000; }
    .hero__info .facts { display: none !important; }
    .recipe__body { grid-template-columns: 1fr 1.4fr !important; gap: 24px; margin-top: 12px; }
    .recipe__aside { position: static; max-height: none; overflow: visible; }
    html { font-size: 12px; background: #FFFFFF; }
    .counter, .chip-timer__ring { display: none !important; }
    .tok { box-shadow: none; padding: 0; margin: 0; }
    .chip-timer { border: 0; padding: 0; min-height: 0; background: none; font-weight: 600; }
    .method { gap: 14px; }
    .mcomp, .steps { gap: 8px; }
    .step__body { gap: 4px; }
    .safety { padding: 6px 10px; }
    /* The icon column is hidden, so the row takes the whole line. */
    .ing { grid-template-columns: minmax(0, 1fr); }
    .ing__row { min-height: 0; padding: 2px 0; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 8px; }
    .step { break-inside: avoid; }
    .ing__label::after { content: ""; }
    .print-qr { display: grid !important; }
  }
  .print-qr { display: none; }
}

@layer pages {
  .dock__cook { border-radius: var(--r-pill); min-height: 52px; padding-inline: 22px; box-shadow: 0 10px 30px -12px rgb(var(--shade) / .5); gap: 10px; }
  .dock__cook .icon { width: 20px; height: 20px; }
}

@layer pages {
  .hero__media > picture, .hero__media .hero__pic { position: absolute; inset: 0; }
  .hero__media img { width: 100%; height: 100%; object-fit: cover; }
  .step__photo { margin: 0; border-radius: var(--r-md); overflow: hidden; max-width: 640px; box-shadow: var(--photo-inset); }
  .step__photo img { width: 100%; height: auto; display: block; }
  .rcard__media > picture img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
}

@layer pages {
  /* Print view QR code back to the recipe (spec 7.4); screen readers and
     screens skip it, the link above is the same. */
  .print-qr { display: none; }
  @media print {
    .recipe { position: relative; }
    .print-qr { gap: 2px; justify-items: center; position: absolute; top: 0; right: 0; }
    .print-qr svg { width: 20mm; height: 20mm; }
    .print-qr span { font-size: 7pt; }
    .recipe__foot { font-size: 8pt; gap: 2px; margin-top: 8px; padding-top: 8px; break-inside: avoid; }
    .after { border-top: 0; margin-top: 12px; padding-top: 0; }
  }
}

/* Print pages (recipe print view, spec 7.4): one page where it fits. */
@page { margin: 12mm 12mm; }

@layer pages {
  .scale__variants { display: grid; gap: 8px; margin-top: 4px; }
  .scale__variants .seg { flex-wrap: wrap; }
  .scale__variants .seg a { text-decoration: none; }
  .scale__vlabels { font-size: var(--text-small); color: var(--basil); font-weight: 600; }
}

@layer pages {
  /* Substitutes on the ingredient list */
  .ing__swap { grid-column: 2; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 0 8px 8px 108px; font-size: var(--text-small); color: var(--smoke); }
  .swapchip { min-height: 32px; padding: 0 10px; border-radius: var(--r-pill); border: 1px dashed var(--crust); background: var(--card); color: var(--ink); font-size: var(--text-small); cursor: pointer; }
  .swapchip:hover { border-color: var(--accent); border-style: solid; }
  .linkbtn { background: none; border: 0; padding: 0 2px; min-height: 32px; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font: inherit; }
  .ing__adj { display: block; font-size: var(--text-small); color: var(--saffron); font-weight: 600; }
  @media (max-width: 500px) { .ing__swap { padding-left: 12px; } }
  @media print { .ing__swap button { display: none; } }
}

@layer pages {
  .toolbar__form { display: contents; }
}

@layer pages {
  /* Cooked it (spec 16) */
  .cooked { display: grid; gap: 14px; padding-top: 8px; }
  .cooked h2 { margin: 0; }
  .cooked__stats { margin: 0; color: var(--smoke); }
  .cooked__form { display: grid; gap: 12px; padding: 16px; border-radius: var(--r-lg); background: var(--card); border: 1px solid var(--crust); }
  .cooked__form .cluster .choice { flex: 0 1 140px; }
  .cooked__notes { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
  .cooked__notes > li { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 12px; }
  .cooked__body { display: grid; gap: 4px; }
  .cooked__body p { margin: 0; white-space: pre-line; }
  .cooked__who span { color: var(--smoke); font-size: var(--text-small); }
  .hero__cooked { color: inherit; text-decoration: none; }
  .hero__cooked:hover { text-decoration: underline; }
}

@layer pages {
  /* Questions and suggested fixes (spec 16) */
  .qa { padding-top: 8px; }
  .qa__box > summary { display: flex; align-items: baseline; gap: 10px; cursor: pointer; list-style: none; min-height: 44px; }
  .qa__box > summary::-webkit-details-marker { display: none; }
  .qa__box > summary h2 { margin: 0; }
  .qa__box > summary::after { content: '+'; margin-left: auto; font-size: 22px; color: var(--smoke); }
  .qa__box[open] > summary::after { content: '\2212'; }
  .qa__count { color: var(--smoke); font-size: var(--text-small); }
  .qa__inner { display: grid; gap: 16px; padding-top: 12px; }
  .qa__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 18px; }
  .qa__item { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 12px; }
  .qa__item.is-pinned { padding: 12px; border-radius: var(--r-lg); background: var(--card); border: 1px solid var(--crust); }
  .qa__body { display: grid; gap: 6px; min-width: 0; }
  .qa__body p, .qa__fix p { margin: 0; white-space: pre-line; overflow-wrap: anywhere; }
  .qa__who span { color: var(--smoke); font-size: var(--text-small); }
  .qa__q { font-weight: 600; }
  .qa__a { border-left: 3px solid var(--accent); padding-left: 12px; display: grid; gap: 2px; }
  .qa__label { font-size: var(--text-small); font-weight: 600; color: var(--smoke); }
  .qa__tag { display: inline-block; padding: 1px 8px; border-radius: 999px; background: var(--parchment); color: var(--ink); font-size: 12px; font-weight: 600; }
  .qa__tag--ok { background: var(--basil-tint); color: var(--basil); }
  .qa__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
  .qa__answer-form, .qa__actions > details[open] { flex: 1 1 100%; }
  .qa__answer-form, .qa__form { display: grid; gap: 10px; }
  .after .qa__edit > summary { display: inline-flex; min-height: 32px; font: inherit; list-style: none; }
  .qa__edit[open] > summary { margin-bottom: 8px; }
  .qa__edit > summary::-webkit-details-marker { display: none; }
  .qa__h3 { margin: 8px 0 0; font-size: var(--text-body); }
  .qa__fix { display: grid; gap: 6px; }
  .qa__forms { display: grid; gap: 16px; padding: 16px; border-radius: var(--r-lg); background: var(--card); border: 1px solid var(--crust); }
  @media print { .qa, .cooked { display: none !important; } }
}

@layer pages {
  /* More like this (spec 12.6) */
  .related { display: grid; gap: 12px; padding-top: 8px; }
  .related__head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
  .related__head h2 { margin: 0; }
  .related__head a { font-weight: 600; min-height: 44px; display: inline-flex; align-items: center; }
  .related .rgrid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  @media print { .related { display: none; } }
}

@layer pages {
  .cooked__report, .qa__report { justify-self: start; color: var(--smoke); font-size: var(--text-small); }
}

@layer pages {
  .icard__more { display: inline-flex; min-height: 36px; align-items: center; font-weight: 600; font-size: var(--text-small); color: var(--ink); text-underline-offset: 3px; }
}

/* Linked video behind a privacy facade (spec 8.2) and step clips (8.3) */
@layer pages {
  .rvideo { display: grid; gap: 10px; max-width: var(--reading-max); margin-bottom: 28px; scroll-margin-top: 80px; }
  .rvideo > h2 { font-size: var(--text-h2); letter-spacing: -0.01em; }
  .rvideo__stage { position: relative; aspect-ratio: 16 / 9; border-radius: var(--r-md); overflow: hidden; background: #15120F; box-shadow: var(--photo-inset); }
  .rvideo__stage picture, .rvideo__stage img { width: 100%; height: 100%; object-fit: cover; display: block; }
  .rvideo__play { position: absolute; inset: 0; display: grid; place-items: center; color: #FAF6EF; background: linear-gradient(to top, rgb(0 0 0 / .35), transparent 55%); }
  .rvideo__btn { width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; background: rgb(21 18 15 / .78); box-shadow: 0 6px 20px -6px rgb(0 0 0 / .6); transition: transform var(--dur-instant); }
  .rvideo__btn .icon { width: 30px; height: 30px; margin-left: 4px; }
  .rvideo__play:hover .rvideo__btn, .rvideo__play:focus-visible .rvideo__btn { transform: scale(1.06); }
  .rvideo__play:focus-visible { outline: 3px solid #FAF6EF; outline-offset: -6px; }
  .rvideo__frame { width: 100%; height: 100%; border: 0; display: block; }
  .rvideo__note { font-size: var(--text-small); color: var(--smoke); }
  .rvideo__title { color: var(--ink); font-weight: 600; }
  .rvideo__chapters { margin: 0; padding: 0; list-style: none; display: grid; gap: 2px; border-top: 1px solid var(--crust); padding-top: 8px; }
  .rvideo__chapters a { display: grid; grid-template-columns: 4.2em minmax(0, 1fr); gap: 10px; align-items: baseline; min-height: var(--hit); padding: 8px 6px; border-radius: 10px; font-size: var(--text-ui); color: inherit; text-decoration: none; }
  .rvideo__chapters a:hover, .rvideo__chapters a[aria-current] { background: var(--parchment); }
  .rvideo__time { font-weight: 700; color: var(--smoke); }
  .chip-clip {
    min-height: 40px;
    padding: 0 14px 0 10px;
    border-radius: var(--r-pill);
    border: 1px solid var(--crust);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    background: var(--card);
    color: var(--ink);
    text-decoration: none;
  }
  .chip-clip:hover { border-color: var(--ink); }
  .chip-clip .icon { width: 16px; height: 16px; }
  @media print { .rvideo, .chip-clip, [data-watch] { display: none !important; } }
}

/* Made by Others: readers' photos (spec 8.5) and the photo on a cooked note */
@layer pages {
  .made { display: grid; gap: 12px; }
  .made h2 { margin: 0; }
  .made__strip { list-style: none; margin: 0; padding: 0 0 6px; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(150px, 44%); gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: 0; }
  @media (min-width: 960px) { .made__strip { grid-auto-columns: 220px; } }
  .made__item { display: grid; gap: 8px; align-content: start; scroll-snap-align: start; }
  .made__item figure { margin: 0; display: grid; gap: 6px; }
  .made__item picture { display: block; aspect-ratio: 1; border-radius: var(--r-md); overflow: hidden; background: var(--parchment); }
  .made__item img { width: 100%; height: 100%; object-fit: cover; display: block; }
  .made__item figcaption { font-size: var(--text-small); color: var(--smoke); overflow-wrap: anywhere; }
  .made__item.is-waiting picture { outline: 2px dashed var(--saffron); outline-offset: 2px; }
  .made__item.is-hidden picture { opacity: .45; }
  .made__acts { display: flex; flex-wrap: wrap; gap: 6px; }
  .made__report { font-size: var(--text-small); justify-self: start; }
  .cooked__photo { display: grid; gap: 10px; }
  .cooked__own { margin: 4px 0 0; display: grid; gap: 4px; justify-items: start; }
  .cooked__own picture { display: block; width: 160px; aspect-ratio: 1; border-radius: var(--r-md); overflow: hidden; }
  .cooked__own img { width: 100%; height: 100%; object-fit: cover; display: block; }
  .cooked__own figcaption { font-size: var(--text-small); color: var(--smoke); }
  @media print { .made { display: none !important; } }
}

/* The author's gallery (spec 7.2) and its lightbox */
@layer pages {
  .gallery { display: grid; gap: 12px; }
  .gallery h2 { margin: 0; }
  .gallery__grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(150px, 45%), 1fr)); gap: 10px; }
  .gallery__grid li { display: grid; gap: 4px; }
  .gallery__item { display: block; aspect-ratio: 4 / 3; border-radius: var(--r-md); overflow: hidden; background: var(--parchment); }
  .gallery__item picture, .gallery__item img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform var(--dur-base); }
  .gallery__item:hover img { transform: scale(1.03); }
  .gallery__credit { font-size: var(--text-small); color: var(--smoke); }
  .lightbox { width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: #0C0A08; color: #FAF6EF; overflow: hidden; opacity: 1; }
  .lightbox::backdrop { background: rgb(12 10 8 / .6); }
  .lightbox__stage { margin: 0; height: 100%; display: grid; place-items: center; padding: 56px 16px 72px; gap: 8px; grid-template-rows: minmax(0, 1fr) auto; }
  .lightbox__img { max-width: 100%; max-height: 100%; object-fit: contain; touch-action: none; user-select: none; cursor: zoom-in; transition: transform 160ms ease-out; }
  .lightbox__img.is-zoomed { cursor: grab; transition: none; }
  .lightbox__cap { font-size: var(--text-small); color: #D9CFC2; min-height: 1em; }
  .lightbox__btn { position: absolute; width: 48px; height: 48px; border-radius: 50%; border: 0; background: rgb(250 246 239 / .14); color: #FAF6EF; font-size: 28px; line-height: 1; cursor: pointer; display: grid; place-items: center; }
  .lightbox__btn:hover { background: rgb(250 246 239 / .26); }
  .lightbox__btn:focus-visible { outline: 2px solid #FAF6EF; }
  .lightbox__close { top: 12px; right: 12px; }
  .lightbox__prev { left: 12px; top: 50%; translate: 0 -50%; }
  .lightbox__next { right: 12px; top: 50%; translate: 0 -50%; }
  .lightbox__count { position: absolute; bottom: 16px; left: 0; right: 0; margin: 0; text-align: center; font-size: var(--text-small); color: #D9CFC2; }
  @media (prefers-reduced-motion: reduce) { .gallery__item img, .lightbox__img { transition: none; } }
  @media print { .gallery__grid { grid-template-columns: repeat(3, 1fr); } }
}

@layer pages {
  .units__default { display: flex; justify-content: flex-end; margin: -4px 0 4px; }
  .units__default .linkbtn { font-size: var(--text-small); }
  @media print { .units__default { display: none !important; } }
}

/* Scale Details (spec 7.7): "I have", yield and pan targets, a free
   multiplier, per component scales and pins, percentages. */
@layer pages {
  .sdet { border-top: 1px solid var(--crust); margin-top: 10px; padding-top: 6px; }
  .sdet > summary { cursor: pointer; min-height: 40px; display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: var(--text-ui); list-style: none; }
  .sdet > summary::-webkit-details-marker { display: none; }
  .sdet > summary::after { content: "+"; margin-left: auto; font-size: 20px; transition: transform var(--dur-base); }
  .sdet[open] > summary::after { transform: rotate(45deg); }
  .sdet__form { display: grid; gap: 14px; padding: 6px 0 4px; }
  .sdet__sec { border: 0; margin: 0; padding: 0; display: grid; gap: 8px; min-width: 0; }
  .sdet__sec .field__hint { margin: 0; }
  .sdet__have { display: grid; grid-template-columns: minmax(0, 1fr) 7.5em; gap: 8px; }
  .sdet__have .scale__input { display: flex; align-items: center; gap: 4px; }
  .sdet__have .scale__input .input, .sdet__comp .scale__input .input { min-width: 0; width: 100%; }
  .sdet__row { display: grid; grid-template-columns: repeat(auto-fit, minmax(7.5em, 1fr)); gap: 8px; }
  .sdet__pan { border: 0; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
  .sdet__pan legend { padding: 0; margin-bottom: 4px; }
  .sdet__pan .field__hint { grid-column: 1 / -1; }
  .sdet__factor { max-width: 8em; }
  .sdet__comp { display: grid; grid-template-columns: minmax(0, 1fr) 6.5em; gap: 4px 10px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--crust); }
  .sdet__comp > span { font-weight: 600; }
  .sdet__comp .scale__input { display: flex; align-items: center; gap: 4px; }
  .sdet__comp .check { grid-column: 1 / -1; font-size: var(--text-small); }
  .sdet__links { margin: 0; padding-left: 18px; font-size: var(--text-small); color: var(--smoke); display: grid; gap: 2px; }
  @media (prefers-reduced-motion: reduce) { .sdet > summary::after { transition: none; } }
  @media print { .sdet { display: none !important; } }
}

/* Desktop reading bar: the title block's essentials once it scrolls away */
@layer pages {
  .rbar { display: none; }
  @media (min-width: 960px) {
    .rbar { display: block; position: sticky; top: 64px; z-index: calc(var(--z-sticky) - 1); height: 0; pointer-events: none; }
    .rbar__in { display: flex; align-items: center; gap: 16px; padding: 8px 12px 8px 20px; border-radius: 0 0 var(--r-lg) var(--r-lg); background: color-mix(in srgb, var(--flour) 92%, transparent); backdrop-filter: blur(8px); border: 1px solid var(--crust); border-top: 0; box-shadow: var(--shadow-1); transform: translateY(-110%); opacity: 0; transition: transform var(--dur-base), opacity var(--dur-base); }
    .rbar.is-on .rbar__in { transform: none; opacity: 1; pointer-events: auto; }
    .rbar__title { font-family: var(--font-display); font-size: 1.25rem; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
    .rbar__scale { color: var(--smoke); font-size: var(--text-small); margin-right: auto; white-space: nowrap; }
  }
  @media (prefers-reduced-motion: reduce) { .rbar__in { transition: none; } }
  @media print { .rbar { display: none !important; } }
}

/* My Cook Log (spec 17): a private journal on the recipe page and /me/cook-log */
@layer pages {
  .clog { border-top: 1px solid var(--crust); padding-top: 8px; }
  .clog > summary { list-style: none; cursor: pointer; display: flex; align-items: baseline; gap: 12px; min-height: 48px; }
  .clog > summary::-webkit-details-marker { display: none; }
  .clog > summary h2 { margin: 0; font-size: 1.5rem; }
  .clog__count { color: var(--smoke); font-size: var(--text-small); }
  .clog[open] { display: grid; gap: 14px; }
  .clog__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
  .clog__list > li { display: grid; gap: 6px; padding: 14px 16px; border-radius: var(--r-md); background: var(--card); border: 1px solid var(--crust); }
  .clog__list p { margin: 0; line-height: 1.5; white-space: pre-line; }
  .clog__when { color: var(--smoke); font-size: var(--text-small); }
  .clog__stars { color: var(--saffron, #C8962B); letter-spacing: 1px; }
  .clog__photos { display: flex; flex-wrap: wrap; gap: 8px; }
  .clog__photos a { display: block; width: 96px; aspect-ratio: 1; border-radius: 10px; overflow: hidden; }
  .clog__photos picture, .clog__photos img { width: 100%; height: 100%; object-fit: cover; display: block; }
  .clog__form { display: grid; gap: 12px; padding: 16px; border-radius: var(--r-lg); background: var(--card); border: 1px solid var(--crust); }
  .clog__form h3 { margin: 0; }
  .clog__row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
  .cooklog__filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; }
  .cooklog__filters .field { min-width: 160px; }
  .clog__recipe { font-size: 1.0625rem; }
  @media print { .clog { display: none !important; } }
}

/* When to Start (spec 17.1): the backwards schedule */
@layer pages {
  .tplan { border-top: 1px solid var(--crust); padding-top: 8px; scroll-margin-top: 150px; }
  .tplan > summary { list-style: none; cursor: pointer; display: flex; align-items: baseline; gap: 12px; min-height: 48px; }
  .tplan > summary::-webkit-details-marker { display: none; }
  .tplan > summary h2 { margin: 0; font-size: 1.5rem; }
  .tplan__hint { color: var(--smoke); font-size: var(--text-small); }
  .tplan[open] { display: grid; gap: 14px; }
  .tplan__form { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; }
  .tline { display: grid; gap: 10px; margin-top: 14px; }
  .tline__start { margin: 0; font-size: 1.0625rem; }
  .tline__warn { margin: 0; font-size: var(--text-small); color: var(--saffron); }
  .tline__day { margin: 8px 0 0; font-size: var(--text-ui); letter-spacing: .06em; text-transform: uppercase; }
  .tline__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; border-left: 2px solid var(--crust); }
  .tline__step { display: grid; grid-template-columns: 7.5em minmax(0, 1fr); gap: 12px; padding: 8px 0 8px 14px; position: relative; }
  .tline__step::before { content: ""; position: absolute; left: -6px; top: 13px; box-sizing: border-box; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); border: 2px solid var(--accent); }
  .tline__step.is-passive::before { background: var(--flour); }
  .tline__step.is-untimed { opacity: .75; }
  .tline__time { font-weight: 700; font-size: var(--text-ui); }
  .tline__what { display: grid; gap: 2px; font-size: var(--text-ui); line-height: 1.45; }
  .tline__meta { color: var(--smoke); font-size: var(--text-small); }
  @media print { .tplan:not([open]) { display: none !important; } }
}

/* What a recipe needs (equipment) and what it costs from the reader's prices. */
@layer pages {
  .needs { margin: 6px 0 0; font-size: var(--text-small); color: var(--smoke); }
  .needs__h { font-weight: 600; color: var(--ink); }
  .needs__missing { color: var(--saffron); text-decoration: underline dotted; text-underline-offset: 3px; }
  .needs__note { margin-left: 4px; color: var(--saffron); }
  .cost { margin: 10px 4px 0; font-size: var(--text-small); color: var(--ink); }
  .cost span { color: var(--smoke); }
}

/* A tester's report form on a draft. */
@layer pages {
  .tester { border-top: 1px solid var(--crust); padding-top: 12px; }
  .tester h2 { margin: 0; }
  .tester__weights summary { cursor: pointer; font-weight: 600; min-height: 44px; display: flex; align-items: center; gap: 8px; }
  .tester__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(200px, 100%), 1fr)); gap: 10px; margin-top: 8px; }
}

/* Phone actions under the meta line: Save, Add to List, and the rest under More. */
@layer pages {
  .macts { display: flex; gap: 8px; align-items: flex-start; flex-wrap: wrap; }
  .macts__more { position: relative; }
  .macts__more > summary { list-style: none; cursor: pointer; }
  .macts__more > summary::-webkit-details-marker { display: none; }
  .macts__more > summary::after { content: ""; width: 8px; height: 8px; margin-left: 2px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-2px) rotate(45deg); }
  .macts__more[open] > summary::after { transform: translateY(2px) rotate(-135deg); }
  .macts__menu { position: absolute; z-index: 30; top: calc(100% + 6px); right: 0; min-width: 200px; display: grid; padding: 6px; border-radius: var(--r-md); background: var(--card); border: 1px solid var(--crust); box-shadow: 0 8px 24px rgb(var(--shade) / .14); }
  .macts__menu a, .macts__menu button { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 12px; border-radius: 10px; color: var(--ink); text-decoration: none; font-weight: 600; font-size: var(--text-ui); background: none; border: 0; width: 100%; text-align: left; cursor: pointer; }
  .macts__menu a:hover, .macts__menu button:hover { background: var(--parchment); }
  .macts__menu form { margin: 0; }
  @media print { .macts { display: none !important; } }
  /* Batch splitting past the reader's equipment */
  .capnote { margin: 0 0 12px; padding: 10px 12px; border-radius: var(--r-md); background: var(--saffron-tint); border: 1px solid var(--saffron-line); font-size: var(--text-ui); }
  /* Category chips above the title (design Recipe Page) */
  .hero__cats { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 4px; }
  /* Above the phone tab bar (the bar sets --tabbar-h). */
  .has-tabbar .dock { bottom: var(--tabbar-h, 0px); }
}

/* css/pages/settings.css */
@layer pages {
  .settings {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--s-8);
    padding-block: var(--s-6) var(--s-12);
  }
  .settings__back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: var(--hit);
    font-weight: 600;
    text-decoration: none;
    color: var(--ink);
  }
  .settings__nav h1 { margin-bottom: var(--s-4); }
  .settings__nav ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
  .settings__nav li a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 52px;
    padding: 0 14px;
    border-radius: var(--r-md);
    color: var(--ink);
    text-decoration: none;
    font-weight: 500;
  }
  .settings__nav li a[aria-current="page"] { background: var(--parchment); font-weight: 700; }
  @media (hover: hover) and (pointer: fine) { .settings__nav li a:hover { background: color-mix(in srgb, var(--parchment) 60%, transparent); color: var(--ink); } }
  .settings__nav .icon { width: 18px; height: 18px; color: var(--smoke); }

  .settings__page { display: grid; gap: var(--s-6); align-content: start; min-width: 0; }
  .settings__page > h2 { font-size: var(--text-h1); }

  /* Mobile: the index is the list; each page shows a back link instead. */
  .settings--index .settings__page { display: none; }
  .settings--page .settings__nav { display: none; }
  .settings__mobile-back { display: inline-flex; }

  @media (min-width: 880px) {
    .settings { grid-template-columns: 260px minmax(0, 1fr); gap: var(--s-10); }
    .settings--index .settings__page, .settings--page .settings__page { display: grid; }
    .settings--page .settings__nav { display: block; }
    .settings__nav { position: sticky; top: 88px; align-self: start; }
    .settings__nav li a .icon { display: none; }
    .settings__mobile-back { display: none; }
    .settings__nav li a.is-default { background: var(--parchment); font-weight: 700; }
  }
  .settings__home { margin-bottom: var(--s-2); }
  .settings__home .icon { color: var(--ink); }

  /* Profile: the form with a live preview of the profile card beside it. */
  .pedit { display: grid; gap: var(--s-6); align-items: start; }
  .pedit__main { display: grid; gap: var(--s-6); min-width: 0; }
  .pprev { display: grid; gap: 8px; }
  .pprev__card { border-radius: 22px; overflow: hidden; background: var(--card); border: 1px solid var(--crust); }
  .pprev__cover { height: 80px; background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--crust) 72%, var(--smoke)) 0 10px, color-mix(in srgb, var(--crust) 64%, var(--smoke)) 10px 20px); }
  .pprev__cover picture, .pprev__cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
  .pprev__body { display: grid; gap: 4px; padding: 0 16px 16px; }
  .pprev__avatar { margin-top: -28px; line-height: 0; }
  .pprev__name { font-size: 18px; overflow-wrap: anywhere; }
  .pprev__meta { font-size: 13px; color: var(--smoke); }
  .pprev__bio { margin: 0; font-size: 14px; line-height: 1.45; color: var(--smoke); white-space: pre-line; overflow-wrap: anywhere; }
  .pprev__link { justify-self: start; font-size: 14px; }
  @media (min-width: 1100px) {
    .pedit { grid-template-columns: minmax(0, 1fr) 320px; }
    .pprev { position: sticky; top: 88px; }
  }

  /* Sections are cards with a title and rows. */
  .panel {
    display: grid;
    gap: var(--s-4);
    padding: var(--s-5);
    border-radius: var(--r-lg);
    background: var(--card);
    border: 1px solid var(--crust);
    max-width: 720px;
  }
  .panel > h3 { font-size: 1.25rem; }
  .panel > .btn, .panel form > .btn { justify-self: start; }
  .panel__intro { color: var(--smoke); font-size: var(--text-ui); }
  .row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--s-3);
    padding-block: var(--s-3);
    border-top: 1px solid var(--crust);
  }
  .panel > .row:first-of-type, .panel > h3 + .row { border-top: 0; padding-top: 0; }
  .row__main { display: grid; gap: 2px; min-width: 0; flex: 1 1 220px; }
  .row__main strong { font-weight: 600; }
  .row__meta { font-size: var(--text-small); color: var(--smoke); }
  .row__actions { display: flex; flex-wrap: wrap; gap: var(--s-2); }
  .status-on { color: var(--basil); }
  .status-off { color: var(--saffron); }
  .pill {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: var(--r-pill);
    background: var(--parchment);
    font-size: var(--text-small);
    font-weight: 600;
    color: var(--smoke);
  }
  .timeline { list-style: none; margin: 0; padding: 0; display: grid; }
  .timeline li {
    display: grid;
    grid-template-columns: 10px minmax(0, 1fr) auto;
    gap: 12px;
    align-items: baseline;
    padding-block: 10px;
    border-top: 1px solid var(--crust);
    font-size: var(--text-ui);
  }
  .timeline li:first-child { border-top: 0; }
  .timeline li::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--dot, var(--blueberry)); transform: translateY(-1px); }
  .timeline time { font-size: var(--text-small); color: var(--smoke); white-space: nowrap; }
  .timeline .row__meta { display: block; }

  /* Wizard (2FA setup): progress bar and steps as separate pages. */
  .wizard { display: grid; gap: var(--s-5); max-width: 560px; }
  .wizard__progress { display: grid; grid-template-columns: repeat(var(--steps, 3), 1fr); gap: 6px; }
  .wizard__progress span { height: 4px; border-radius: 2px; background: var(--crust); }
  .wizard__progress span.on { background: var(--accent); }
  .qr {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: var(--s-4);
    align-items: center;
  }
  .qr__code { width: 176px; height: 176px; padding: 8px; background: #FFFFFF; border-radius: var(--r-md); border: 1px solid var(--crust); }
  .qr__code svg { width: 100%; height: 100%; }
  .qr__key { display: grid; gap: 6px; min-width: 0; }
  .qr__key code { font-size: 1rem; letter-spacing: .06em; word-break: break-all; padding: 10px 12px; background: var(--parchment); border-radius: var(--r-sm); }
  @media (max-width: 480px) { .qr { grid-template-columns: minmax(0, 1fr); justify-items: center; } }

  .danger-zone { border-color: var(--beet-line); }

  @media print {
    .topbar, .site-footer, .settings__nav, .settings__mobile-back, .no-print { display: none !important; }
    .auth__codes, .codes-print { font-size: 14pt; }
  }
}

@layer pages {
  /* Profile photo and crop (spec 10.6) */
  .pphoto { display: grid; gap: var(--s-4); justify-items: start; }
  .pphoto__form { display: grid; gap: var(--s-3); justify-items: start; justify-self: stretch; min-width: 0; }
  .pphoto__form .field { width: 100%; min-width: 0; }
  .pcrop {
    width: min(92vw, 400px); padding: var(--s-5); border: 0; border-radius: var(--r-lg);
    background: var(--flour); color: var(--ink); box-shadow: var(--shadow-3);
  }
  .pcrop[open] { display: grid; gap: var(--s-3); }
  .pcrop::backdrop { background: var(--overlay); backdrop-filter: blur(3px); }
  .pcrop h3 { margin: 0; }
  .pcrop__hint { margin: 0; color: var(--smoke); font-size: var(--text-small); }
  .pcrop__stage {
    position: relative; width: 100%; aspect-ratio: 1; overflow: hidden; border-radius: var(--r-md);
    background: var(--parchment); touch-action: none; cursor: grab; user-select: none;
  }
  .pcrop__stage:active { cursor: grabbing; }
  .pcrop__stage:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
  .pcrop__stage img { position: absolute; top: 0; left: 0; max-width: none; transform-origin: 0 0; pointer-events: none; }
  /* Everything outside the circle is dimmed: that part is cut off. */
  .pcrop__ring { position: absolute; inset: 0; border-radius: 50%; box-shadow: 0 0 0 999px rgb(20 14 8 / .55); outline: 2px solid rgb(255 255 255 / .9); pointer-events: none; }
}

@layer pages {
  .panel--danger { border-color: var(--beet-line); }
  .panel--danger h3 { color: var(--beet); }
}

@layer pages {
  .pcover { display: grid; gap: 12px; }
  .pcover h3 { margin: 0; }
  .pcover__preview { position: relative; display: block; width: 100%; max-width: 720px; aspect-ratio: 4 / 1; border-radius: var(--r-lg); overflow: hidden; padding: 0; border: 0; cursor: crosshair; background: var(--parchment); }
  .pcover__preview picture, .pcover__preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
}

/* css/pages/static.css */
/* Static pages (design Static Pages): Principles, About, Help, and the
   system pages (404, 410, errors) with the fork's tines. */
@layer pages {
  .statics { padding-block: clamp(24px, 5vw, 56px) 96px; }
  .statics h1 { margin: 0; font-weight: 500; letter-spacing: -0.03em; }

  .principles { display: grid; gap: 28px; }
  .principles h1 { font-size: clamp(2.5rem, 7vw, 5rem); line-height: .98; max-width: 14ch; }
  .principles h1 em { font-weight: 400; }
  .principles__list { list-style: none; margin: 0; padding: 0; display: grid; }
  .principles__list > li { display: grid; grid-template-columns: minmax(48px, 80px) minmax(0, 1fr); gap: clamp(12px, 3vw, 32px); padding: 22px 0; border-top: 1px solid var(--crust); }
  .principles__n { font-family: var(--font-display); font-size: clamp(2rem, 4vw, 3rem); line-height: 1; color: var(--smoke); opacity: .8; }
  .principles__list > li > div { display: grid; gap: 6px; }
  .principles__list h2 { margin: 0; font-weight: 500; font-size: clamp(1.375rem, 2.6vw, 1.875rem); }
  .principles__list p { margin: 0; font-size: 1.0625rem; line-height: 1.6; max-width: 60ch; }

  .about { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: clamp(24px, 5vw, 64px); align-items: start; }
  .about__text { display: grid; gap: 18px; }
  .about h1 { font-size: clamp(2.5rem, 6vw, 4rem); line-height: 1; }
  .about__text p { margin: 0; font-size: 1.0625rem; line-height: 1.6; color: var(--smoke); max-width: 60ch; }
  .about__text .about__lead { font-size: 1.1875rem; color: var(--ink); }
  .about__text .about__links { color: var(--ink); }
  .about__facts { margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
  .about__facts > div { padding: 22px; border-radius: var(--r-lg); background: var(--parchment); display: grid; gap: 4px; }
  .about__facts dt { font-size: var(--text-small); color: var(--smoke); font-weight: 600; }
  .about__facts dd { margin: 0; font-family: var(--font-display); font-size: clamp(2rem, 4vw, 3rem); line-height: 1; }

  .help { display: grid; gap: 20px; max-width: calc(760px + 2 * var(--gutter)); margin-inline: auto; }
  .help h1 { font-size: clamp(2.25rem, 5vw, 3.5rem); }
  .help__search { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
  .help__search .input { min-height: 56px; border-radius: 18px; font-size: 1.0625rem; }
  .help__search .btn { min-height: 56px; }
  .help__count { margin: 0; color: var(--smoke); }
  .help__group { scroll-margin-top: 84px; display: grid; gap: 8px; }
  .help__group h2 { margin: 12px 0 4px; font-size: var(--text-h3); }
  .help__items { display: grid; gap: 8px; }
  .help__item { background: var(--card); border: 1px solid var(--crust); border-radius: 18px; overflow: hidden; }
  .help__item summary { list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 60px; padding: 12px 18px; font-weight: 600; cursor: pointer; }
  .help__item summary::-webkit-details-marker { display: none; }
  .help__plus { flex: none; font-size: 1.25rem; transition: transform 240ms; }
  .help__item[open] .help__plus { transform: rotate(45deg); }
  .help__item p { margin: 0; padding: 0 18px 18px; line-height: 1.6; }
  .help__more { margin: 12px 0 0; color: var(--smoke); }
  @media (prefers-reduced-motion: reduce) { .help__plus { transition: none; } }

  .sysp { display: grid; justify-items: center; text-align: center; gap: 18px; padding-block: clamp(40px, 8vw, 96px) 96px; }
  .sysp__tines { display: flex; gap: 10px; align-items: flex-end; height: 120px; }
  .sysp__tines span { width: 14px; background: var(--accent); border-radius: 7px; transform-origin: bottom; }
  .sysp__tines.is-faded span + span { background: var(--crust); }
  .sysp__code { margin: 0; font-family: var(--font-mono, ui-monospace, monospace); font-size: 13px; color: var(--smoke); }
  .sysp h1 { margin: 0; font-weight: 500; font-size: clamp(2.125rem, 5vw, 3.5rem); letter-spacing: -0.02em; max-width: 16ch; text-wrap: balance; }
  .sysp__text { margin: 0; font-size: 1.0625rem; line-height: 1.55; color: var(--smoke); max-width: 46ch; }
  .sysp__links { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
  .sysp__ref { margin: 0; color: var(--smoke); font-size: var(--text-small); }
  .sysp__kept { display: grid; gap: 10px; width: min(100%, 480px); text-align: left; }
  .sysp__kept h2 { margin: 0; font-size: var(--text-h3); text-align: center; }
  .sysp__kept ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
  .sysp__kept a { display: flex; justify-content: space-between; gap: 12px; align-items: center; min-height: 52px; padding: 0 16px; border-radius: 14px; background: var(--card); border: 1px solid var(--crust); color: inherit; text-decoration: none; font-weight: 600; }
  .sysp__kept a span { font-weight: 400; font-size: var(--text-small); color: var(--smoke); }
}

/* API docs (/developers) and the token shown once in Settings, API. */
@layer pages {
  .devs pre { overflow-x: auto; padding: 12px 14px; border-radius: 12px; background: var(--parchment); font-size: 13px; }
  .devs__op { border-top: 1px solid var(--crust); padding: 12px 0; }
  .devs__op h3 { margin: 0 0 4px; font-size: 1rem; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
  .devs__op code { overflow-wrap: anywhere; }
  .devs__method { font-family: var(--font-mono); font-size: 12px; font-weight: 700; padding: 2px 6px; border-radius: 6px; background: var(--parchment); }
  .devs__method--get { background: var(--blueberry-tint); color: var(--blueberry); }
  .devs__method--post, .devs__method--put, .devs__method--patch { background: var(--basil-tint); color: var(--basil); }
  .devs__method--delete { background: var(--beet-tint); color: var(--beet); }
  .devs__params { margin: 6px 0 0; padding-left: 18px; font-size: var(--text-small); }
  .apitoken { display: block; margin-top: 6px; padding: 8px 10px; border-radius: 8px; background: var(--card); font-family: var(--font-mono); font-size: 13px; overflow-wrap: anywhere; user-select: all; }
}

/* css/pages/studio.css */
@layer pages {
  /* Creator studio (spec 18.20; design Studio) */
  .studio { display: grid; gap: var(--s-5); padding-block: var(--s-4) var(--s-12); }
  .studio h1 { margin: 0; font-size: var(--text-h1); }
  .studio__top { display: flex; justify-content: space-between; align-items: center; }
  .studio__period { color: var(--smoke); font-size: var(--text-small); }
  .studio__cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 170px), 1fr)); }
  .studio__card { display: grid; gap: 6px; padding: 16px; border-radius: var(--r-lg); background: var(--card); border: 1px solid var(--crust); }
  .studio__label { color: var(--smoke); font-size: var(--text-small); }
  .studio__card strong { font-size: clamp(1.75rem, 1.4rem + 1.2vw, 2.25rem); line-height: 1.05; }
  .studio__spark { width: 100%; height: 32px; }
  .studio__spark rect { fill: var(--crust); }
  .studio__spark rect.is-last { fill: var(--ink); }
  .studio__spacer { height: 32px; }
  .studio__trend { font-size: var(--text-small); font-weight: 600; color: var(--basil); }
  .studio__trend.is-down { color: var(--beet); }
  .studio__trend.is-flat { color: var(--smoke); font-weight: 400; }
  .studio__sec { display: grid; gap: 12px; }
  .studio__sechead { display: grid; gap: 8px; }
  .studio__sechead h2 { margin: 0; font-size: var(--text-h2); }
  .studio__rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
  .studio__row { display: grid; gap: 10px; padding: 14px 16px; border-radius: var(--r-lg); background: var(--card); border: 1px solid var(--crust); }
  .studio__rowhead { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 12px; align-items: baseline; }
  .studio__rowhead a { font-family: var(--font-display); font-size: 1.125rem; color: var(--ink); text-decoration: none; }
  .studio__rowhead a:hover { text-decoration: underline; text-underline-offset: 3px; }
  .studio__status { color: var(--smoke); font-size: var(--text-small); }
  .studio__nums { margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 6px 16px; }
  .studio__nums div { display: grid; }
  .studio__nums dt { color: var(--smoke); font-size: 12px; }
  .studio__nums dd { margin: 0; font-weight: 700; font-size: 1.0625rem; }
  .studio__inbox { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; max-width: 760px; }
  .studio__msg { display: grid; gap: 10px; padding: 14px 16px; border-radius: var(--r-lg); background: var(--card); border: 1px solid var(--crust); }
  .studio__msg p { margin: 0; white-space: pre-line; }
  .studio__who { display: flex; gap: 10px; align-items: center; }
  .studio__who > span { display: grid; }
  .studio__who > span span { color: var(--smoke); font-size: var(--text-small); }
}

/* Tester reports: weights against the recipe. */
@layer pages {
  .tests__weights { width: 100%; border-collapse: collapse; font-size: var(--text-ui); margin-top: 6px; }
  .tests__weights th, .tests__weights td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--parchment); }
  .tests__weights td { text-align: right; }
  .tests__weights thead th { font-size: var(--text-small); color: var(--smoke); font-weight: 600; }
  .tests__weights .is-off { color: var(--saffron); font-weight: 600; }
  .tests__report { display: grid; gap: 6px; }
}

/* css/pages/styleguide.css */
@layer pages {
  /* Styleguide (plan P1) */
  .sg { display: grid; gap: 48px; padding-block: 16px 64px; }
  .sg__head { display: grid; gap: 14px; }
  .sg__head h1 { margin: 0; font-size: var(--text-hero); line-height: var(--leading-tight); }
  .sg__intro { margin: 0; max-width: 64ch; color: var(--smoke); }
  .sg__sec { display: grid; gap: 16px; scroll-margin-top: 16px; }
  .sg__sec > h2 { margin: 0; padding-bottom: 8px; border-bottom: 1px solid var(--crust); }
  .sg__sec h3 { margin: 0 0 8px; font-size: 1rem; }
  .sg__swatches { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
  .sg__swatches li { display: grid; gap: 2px; font-size: var(--text-small); }
  .sg__swatches span:last-child { color: var(--smoke); }
  .sg__swatch { height: 64px; border-radius: var(--r-md); border: 1px solid var(--crust); margin-bottom: 6px; }
  .sg__type { display: grid; gap: 14px; }
  .sg__mono { font-family: var(--font-mono); font-size: .875rem; background: var(--parchment); padding: 4px 8px; border-radius: var(--r-sm); justify-self: start; }
  .sg__shape { display: grid; gap: 20px; }
  .sg__row { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 16px; }
  .sg__row li { display: grid; gap: 6px; justify-items: center; font-size: var(--text-small); color: var(--smoke); }
  .sg__box { width: 72px; height: 72px; background: var(--parchment); border: 1px solid var(--crust); display: block; }
  .sg__box--card { background: var(--card); border: 0; border-radius: var(--r-md); }
  .sg__space { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
  .sg__space li { display: flex; align-items: center; gap: 12px; font-size: var(--text-small); color: var(--smoke); }
  .sg__space li span:first-child { height: 12px; background: var(--accent); border-radius: 2px; }
  .sg__stack { display: grid; gap: 16px; }
  .sg__stack > .seg, .sg__stack > .lpass { justify-self: start; }
  .sg__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 20px; align-items: start; }
  .sg__ph { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; max-width: 520px; }
  .sg__ph > div { border-radius: var(--r-md); overflow: hidden; aspect-ratio: 4 / 5; }
  .sg__ph svg { width: 100%; height: 100%; display: block; }
  .sg__acc { border: 1px solid var(--crust); border-radius: var(--r-md); background: var(--card); padding: 0 16px; }
  .sg__acc summary { min-height: 48px; display: flex; align-items: center; cursor: pointer; font-weight: 600; }
  .sg__acc p { margin: 0 0 14px; }
  .sg__missing { margin: 0; padding-left: 20px; display: grid; gap: 6px; color: var(--smoke); }
  .sg__brand { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
  .sg__lockup { margin: 0; display: grid; gap: 8px; }
  .sg__lockbox { display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 160px; border-radius: var(--r-lg); background: var(--card); border: 1px solid var(--crust); color: var(--ink); }
  .sg__lockbox--dark { --accent: #F3ECE2; --on-accent: #15120F; --ink: #F3ECE2; background: #15120F; border-color: #2E2822; color: #F3ECE2; }
  .sg__lockup figcaption { font-size: var(--text-small); color: var(--smoke); }
  .sg__word { pointer-events: none; }
}

/* css/utilities.css */
@layer utilities {
  .u-muted { color: var(--smoke); }
  .u-small { font-size: var(--text-small); }
  .u-center { text-align: center; }
  .u-nowrap { white-space: nowrap; }
}
