/* dd-style: the style configuration's numbers, written by the builder from theme/style.json (the dials are the data-dd-* attributes on <html> in layout.html). Edit style.json, not this. */
:root { --dd-hue: 139; --dd-chroma: 0.4; --dd-contrast: 0.53; }
/* end dd-style */

/* Hasty Dish — "from garden to table".
   Colour-pencil ingredients faded into the page, a thick wooden counter edge under the
   header, a mound of rice on a plate (radish, carrot, a wisp of steam) as the mark.
   Warm, quick, playful; tidy and uncluttered. Every colour comes from the style
   configuration's tokens; the app's own tokens below are mixed from them. */

/* ---- type: Libre Franklin for headings, Source Sans 3 for text ---- */
@font-face { font-family: "Libre Franklin"; src: url("fonts/LibreFranklin-normal.woff2?v=52e605852c") format("woff2"); font-weight: 300 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Source Sans 3"; src: url("fonts/SourceSans3-normal.woff2?v=19143dca07") format("woff2"); font-weight: 300 800; font-style: normal; font-display: swap; }

:root {
  --font: "Source Sans 3", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  --font-body: var(--font);
  --font-head: "Libre Franklin", "Franklin Gothic Medium", "Segoe UI", system-ui, sans-serif;

  /* the app's own tokens, worked out from the configuration's */
  --hd-paper: color-mix(in oklab, var(--bg) 88%, #f4e6c8);
  --hd-glass: color-mix(in srgb, var(--surface) 86%, transparent);
  --hd-wood: color-mix(in oklab, #c8955c 62%, var(--bg));
  --hd-wood-deep: color-mix(in oklab, #9a6a3a 70%, var(--ink));
  --hd-wood-pale: color-mix(in oklab, #d7ad7c 55%, var(--bg));
  --hd-carrot: color-mix(in oklab, #e88a45 80%, var(--ink));
  --hd-carrot-soft: color-mix(in oklab, #f2b083 35%, var(--surface));
  --hd-radish: color-mix(in oklab, #d4567a 78%, var(--ink));
  --hd-radish-soft: color-mix(in oklab, #ec9fb5 35%, var(--surface));
  --hd-herb: color-mix(in oklab, var(--accent) 85%, var(--ink));
  --hd-mustard: color-mix(in oklab, #d9a93a 75%, var(--ink));
  --hd-accent-deep: color-mix(in srgb, var(--accent) 72%, var(--ink));

  /* the seven tastes: pale grounds, deep text */
  --taste-savory: color-mix(in oklab, #9a7550 82%, var(--ink));
  --taste-sweet: color-mix(in oklab, #c08a1c 82%, var(--ink));
  --taste-sour: color-mix(in oklab, #8f8d12 85%, var(--ink));
  --taste-bitter: color-mix(in oklab, #82507f 85%, var(--ink));
  --taste-salty: color-mix(in oklab, #3f7396 85%, var(--ink));
  --taste-spicy: color-mix(in oklab, #c2452c 85%, var(--ink));
  --taste-mild: color-mix(in oklab, #7a7466 85%, var(--ink));
}

html { background: var(--bg); }
body { font-family: var(--font-body); background: transparent; color: var(--ink); position: relative; min-height: 100vh; }
h1, h2, h3, h4, .brand, .dd-frame-brand { font-family: var(--font-head); }
h1 { letter-spacing: -.02em; }

/* faded hand-drawn ingredients scattered behind everything, quieter at the centre */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: url("img/1x4isfuczn-kitchen-scatter-background.webp?v=79e8a86e8e") center / cover no-repeat;
  opacity: .5;
  -webkit-mask-image: radial-gradient(ellipse 70% 65% at 50% 45%, rgba(0, 0, 0, .25) 0%, #000 80%);
  mask-image: radial-gradient(ellipse 70% 65% at 50% 45%, rgba(0, 0, 0, .25) 0%, #000 80%);
}

/* ================= the frame (every shell) ================= */
.dd-frame-header, .dd-frame-side, .dd-frame-strip, .dd-frame-tabs {
  background: var(--hd-glass);
  -webkit-backdrop-filter: blur(10px) saturate(1.1);
  backdrop-filter: blur(10px) saturate(1.1);
}
.dd-frame-header, .dd-frame-strip { border-bottom: 0; }
.dd-frame-side { border-right: 0; box-shadow: inset -7px 0 0 var(--hd-wood-pale), inset -8px 0 0 color-mix(in srgb, var(--hd-wood-deep) 30%, transparent); }
.dd-frame-tabs { border-top: 0; box-shadow: 0 -6px 0 var(--hd-wood-pale), 0 -7px 0 color-mix(in srgb, var(--hd-wood-deep) 25%, transparent); }

/* the brand: the rice-plate mark with its wisp of steam, then the name */
.dd-frame-brand { color: var(--ink); text-decoration: none; gap: .65rem; }
.dd-frame-brand:hover { text-decoration: none; }
.hd-logo { position: relative; display: inline-block; width: 2.9rem; height: 2.9rem; flex: 0 0 auto; }
.dd-frame-brand .hd-logo img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; box-shadow: 0 2px 6px color-mix(in srgb, var(--hd-wood-deep) 25%, transparent); transition: transform var(--motion, .2s) var(--ease); }
.dd-frame-brand:hover .hd-logo img { transform: rotate(-8deg) scale(1.05); }
.hd-steam { position: absolute; left: 46%; top: -.55rem; width: .55rem; height: .9rem; border-left: 2px solid color-mix(in srgb, var(--muted) 55%, transparent); border-radius: 50% 0 0 50%; opacity: 0; animation: hd-steam 3.2s ease-in-out infinite; }
@keyframes hd-steam { 0% { opacity: 0; transform: translateY(.3rem) scaleY(.7); } 35% { opacity: .8; } 100% { opacity: 0; transform: translateY(-.5rem) translateX(.15rem) scaleY(1.1); } }
.hd-name { font-weight: 900; font-size: 1.35rem; letter-spacing: -.03em; line-height: 1; }

/* the main links */
.dd-frame-nav a { color: var(--ink); text-decoration: none; padding: .4rem .85rem; border-radius: 999px; font-weight: 600; position: relative; transition: background var(--motion-fast, .12s) var(--ease); }
.dd-frame-nav a:hover { background: var(--hover, color-mix(in srgb, var(--ink) 6%, transparent)); text-decoration: none; }
.dd-frame-nav a.active { background: var(--accent-soft); color: var(--hd-accent-deep); }
.dd-frame-nav a.active::after { content: ""; position: absolute; left: 50%; bottom: .1rem; width: .3rem; height: .3rem; margin-left: -.15rem; border-radius: 50%; background: var(--hd-carrot); }
.dd-shell-sidebar .dd-frame-side .dd-frame-nav a, .dd-shell-top_bar_sidebar .dd-frame-side .dd-frame-nav a { border-radius: var(--radius); }
.dd-frame-tabs a { color: var(--muted); font-weight: 600; font-size: .85rem; position: relative; }
.dd-frame-tabs a.active { color: var(--hd-accent-deep); }
.dd-frame-tabs a.active::before { content: ""; position: absolute; top: .45rem; left: 50%; width: .35rem; height: .35rem; margin-left: -.175rem; border-radius: 50%; background: var(--hd-carrot); }

.hd-note { display: inline-flex; align-items: center; gap: .45rem; color: var(--muted); font-size: .88rem; font-style: italic; white-space: nowrap; }
.hd-note-dot { width: .5rem; height: .5rem; border-radius: 50%; background: var(--accent); box-shadow: .65rem 0 0 var(--hd-carrot), 1.3rem 0 0 var(--hd-radish); margin-right: 1.3rem; }
.dd-frame-account .signin { font-weight: 600; color: var(--ink); }

/* the thick wooden counter edge under the header */
.hd-counter {
  height: 14px;
  background:
    linear-gradient(180deg, color-mix(in srgb, #fff 50%, transparent) 0 2px, transparent 2px calc(100% - 3px), color-mix(in srgb, var(--hd-wood-deep) 40%, transparent) calc(100% - 3px)),
    repeating-linear-gradient(90deg, transparent 0 9rem, color-mix(in srgb, var(--hd-wood-deep) 16%, transparent) 9rem calc(9rem + 2px)),
    repeating-linear-gradient(179deg, color-mix(in srgb, var(--hd-wood-deep) 12%, transparent) 0 1px, transparent 1px 4px),
    var(--hd-wood-pale);
  box-shadow: 0 7px 12px -9px color-mix(in srgb, var(--hd-wood-deep) 60%, transparent);
}

/* the admin area's sections */
.dd-frame-adminnav { padding-block: .9rem 0; gap: .35rem; }
.dd-frame-adminnav a { padding: .3rem .8rem; border-radius: 999px; border: 1px solid var(--line); background: var(--hd-glass); color: var(--ink); font-size: .9rem; font-weight: 600; text-decoration: none; }
.dd-frame-adminnav a.active { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

.dd-frame-main { padding-top: clamp(1.25rem, 3vw, 2.25rem); }

/* the footer: the counter again, with a steaming pot, faded at the top */
.dd-frame-footer { position: relative; isolation: isolate; background: transparent; color: var(--muted); margin-top: 3rem; padding: 2.25rem 0 clamp(7rem, 13vw, 11rem); }
.dd-frame-footer::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: url("img/eewqfr3by1-counter-footer.webp?v=e97a2ecd8a") center bottom / cover no-repeat;
  opacity: .75;
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 45%);
  mask-image: linear-gradient(180deg, transparent 0%, #000 45%);
}
.hd-foot { display: flex; flex-direction: column; gap: .35rem; max-width: 40rem; }
.hd-foot-brand { display: inline-flex; align-items: center; gap: .55rem; font-family: var(--font-head); font-weight: 900; font-size: 1.15rem; color: var(--ink); text-decoration: none; opacity: 1; }
.hd-foot-brand img { border-radius: 50%; }
.foot-note { margin: 0; color: var(--ink); font-weight: 600; }
.hd-foot-small { margin: 0; font-size: .9rem; }

/* ================= shared pieces ================= */
/* Back navigation above the title, shared by the framework and custom pages. */
.page-back { margin: 0 0 .5rem; }
.page-back a {
  display: inline-flex;
  align-items: center;
  gap: .4em;
  box-sizing: border-box;
  min-block-size: 32px;
  min-inline-size: 32px;
  max-inline-size: 100%;
  padding: .2rem .5rem;
  border-radius: var(--radius-s, 8px);
  color: var(--muted);
  font-size: .9rem;
  font-weight: 600;
  line-height: 1.35;
  white-space: normal;
  overflow-wrap: anywhere;
  text-decoration: underline;
  text-underline-offset: .16em;
}
.page-back a:is(:hover, :focus-visible) { color: var(--hd-accent-deep); background: var(--accent-soft); }
.page-back a:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }

.hd-kicker { display: inline-flex; align-items: center; gap: .55rem; margin: 0 0 .35rem; font-size: .82rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--hd-accent-deep); }
.hd-kicker::before { content: ""; width: 1.5rem; height: 3px; border-radius: 3px; background: linear-gradient(90deg, var(--hd-radish) 0 33%, var(--hd-carrot) 33% 66%, var(--accent) 66%); }
.hd-pagehead h1 { font-size: clamp(1.7rem, 1.2rem + 1.6vw, 2.5rem); font-weight: 900; }
.hd-pagehead .actions .view { margin: 0; }
.hd-pagehead .actions .view.text { padding: 0; }

/* the side panel: a glassy card that stays beside the page */
.dd-arrange-side_panel { gap: clamp(1.25rem, 2.5vw, 2.25rem); }
.hd-panel { background: var(--hd-glass); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); border: 1px solid var(--line); border-radius: var(--radius-lg, 18px); padding: 1.1rem 1.2rem; box-shadow: var(--shadow); max-height: calc(100vh - 2rem); overflow-y: auto; scrollbar-width: thin; }
.hd-panel > .view { margin-bottom: 1.25rem; }
.hd-panel > .view:last-child { margin-bottom: 0; }
.hd-panel .form-view { padding: 1rem; box-shadow: none; }
.hd-panel .view h2, .hd-panel-head h2 { font-size: 1.1rem; margin: 0; }
.hd-panel-head { display: flex; justify-content: space-between; align-items: center; gap: .75rem; margin-bottom: .35rem; }
.hd-panel .kit-aside { margin: 0 0 .75rem; }

/* tags chosen in the panel (drawn by app.js: details.sb-group > summary + .sb-chips) */
.hd-tag-groups .sb-group { display: block; border-top: 1px solid var(--line); padding: .6rem 0; margin: 0; }
.hd-tag-groups .sb-group:first-child { border-top: 0; padding-top: .2rem; }
.hd-tag-groups .sb-group > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: .5rem; font-family: var(--font-head); font-weight: 700; font-size: .95rem; }
.hd-tag-groups .sb-group > summary::-webkit-details-marker { display: none; }
.hd-tag-groups .sb-group > summary::after { content: ""; margin-left: auto; width: .45rem; height: .45rem; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform var(--motion-fast, .12s) var(--ease); }
.hd-tag-groups .sb-group[open] > summary::after { transform: rotate(-135deg); }
.sb-group-count { display: inline-grid; place-content: center; min-width: 1.2rem; height: 1.2rem; padding: 0 .35rem; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-size: .72rem; font-weight: 800; font-family: var(--font-body); }
.sb-group-count:empty { display: none; }
.sb-chips { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .55rem; }
.sb-chip { appearance: none; -webkit-appearance: none; display: inline-flex; align-items: center; gap: .35rem; font: inherit; font-size: .9rem; font-weight: 600; text-transform: none; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: .25rem .75rem; cursor: pointer; transition: background var(--motion-fast, .12s) var(--ease), border-color var(--motion-fast, .12s), transform var(--motion-fast, .12s) var(--ease); }
.sb-chip:hover { border-color: var(--accent); transform: translateY(-1px); }
.sb-chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.sb-chip[aria-pressed="true"]::before { content: "✓"; font-size: .8em; }
.sb-chip[aria-busy="true"] { opacity: .55; pointer-events: none; }
/* a category's number of recipes (its kept recipe_count), a small soft pill in the chip */
.sb-chip-n { display: inline-grid; place-content: center; min-width: 1.3rem; height: 1.15rem; padding: 0 .35rem; margin-right: -.35rem; border-radius: 999px; background: color-mix(in srgb, var(--hd-paper) 80%, var(--line)); color: var(--muted); font-size: .7rem; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1; }
.sb-chip[aria-pressed="true"] .sb-chip-n { background: color-mix(in srgb, var(--accent-ink) 22%, transparent); color: var(--accent-ink); }
.sb-child .sb-chip-n { height: 1.05rem; font-size: .66rem; }
.sb-child[aria-pressed="true"] .sb-chip-n { background: color-mix(in srgb, var(--surface) 25%, transparent); color: var(--surface); }
.sb-help { color: var(--muted); font-size: .9rem; margin: 0; }
.sb-error:empty, .hd-error:empty { display: none; }
.sb-error, .hd-error { color: var(--danger); font-weight: 600; font-size: .9rem; margin: .5rem 0 0; }

/* dish families folded beneath their cuisine — the panel's markup (app.js draws it, on
   home and on a search, from the tag-list's parent_ref and child_count):
     <div class="sb-chips has-families">                    a heading whose tags have families
       <div class="sb-family" data-family="<cuisine id>">   a tag with families (child_count > 0)
         <button class="chip sb-chip sb-parent" data-tag-id …>Persian <span class="sb-chip-n">3</span></button>
         <details class="sb-family-fold">                   opened by the viewer; open when a family is chosen
           <summary class="sb-family-toggle" aria-label="Persian dishes"><span class="sb-family-n">6</span></summary>
           <div class="sb-children">
             <button class="chip sb-chip sb-child" data-tag-id … data-parent-id="<cuisine id>">khoresh</button> …
           </div>
         </details>
       </div>
       <button class="chip sb-chip" …>…</button>             a tag with no families stays a plain chip
     </div>
   A chosen family is pressed (aria-pressed) and so is its cuisine (the search chooses
   both); .is-chosen on .sb-family marks the row where :has() is missing. */
.sb-chips.has-families { flex-direction: column; flex-wrap: nowrap; align-items: stretch; gap: .2rem; }
.sb-chips.has-families > .sb-chip { align-self: flex-start; }
.sb-family { position: relative; padding: .2rem 2.6rem .2rem .2rem; border-radius: calc(var(--radius, 12px) - 2px); transition: background var(--motion-fast, .12s) var(--ease); }
.sb-family:hover { background: color-mix(in srgb, var(--hd-paper) 70%, transparent); }
.sb-family.is-chosen, .sb-family:has([aria-pressed="true"]) { background: color-mix(in srgb, var(--accent-soft) 55%, transparent); }
.sb-family > .sb-parent { max-width: 100%; }

/* the fold's handle: a small round tab at the row's right, the number of families in it */
.sb-family-fold { margin: 0; }
.sb-family-toggle {
  list-style: none; cursor: pointer; position: absolute; top: .3rem; right: .25rem;
  display: inline-flex; align-items: center; justify-content: center; gap: .2rem;
  min-width: 2.15rem; height: 1.75rem; padding: 0 .45rem;
  border-radius: 999px; border: 1px solid var(--line); background: var(--surface);
  color: var(--muted); font-size: .75rem; font-weight: 700; font-variant-numeric: tabular-nums;
  transition: border-color var(--motion-fast, .12s), color var(--motion-fast, .12s), background var(--motion-fast, .12s);
}
.sb-family-toggle::-webkit-details-marker { display: none; }
.sb-family-toggle::after { content: ""; width: .32rem; height: .32rem; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translateY(-1px); transition: transform var(--motion-fast, .12s) var(--ease); }
.sb-family-toggle:hover { border-color: var(--hd-carrot); color: var(--hd-carrot); }
.sb-family-fold[open] > .sb-family-toggle { background: var(--hd-carrot-soft); border-color: transparent; color: var(--hd-carrot); }
.sb-family-fold[open] > .sb-family-toggle::after { transform: rotate(-135deg) translate(-1px, -1px); }
/* a family chosen inside a closed fold: a carrot dot on its handle */
.sb-family-fold:not([open]):has(.sb-child[aria-pressed="true"]) > .sb-family-toggle::before { content: ""; position: absolute; top: -.15rem; right: -.1rem; width: .55rem; height: .55rem; border-radius: 50%; background: var(--hd-carrot); border: 2px solid var(--surface); }

/* the families: smaller chips hanging from the cuisine on a pencil-drawn cut line */
.sb-children { display: flex; flex-wrap: wrap; gap: .3rem; margin: .4rem -2.2rem .25rem .7rem; padding: .15rem 0 .2rem .8rem; border-left: 2px dashed color-mix(in oklab, var(--hd-carrot) 45%, var(--surface)); animation: hd-unfold var(--motion, .2s) var(--ease); }
.sb-child { font-size: .84rem; font-weight: 600; padding: .18rem .65rem; background: color-mix(in srgb, var(--surface) 82%, var(--hd-paper)); }
.sb-child:hover { border-color: var(--hd-carrot); }
.sb-child[aria-pressed="true"] { background: var(--hd-carrot); border-color: var(--hd-carrot); color: var(--surface); }
.sb-family .sb-parent[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--accent-soft); }
@keyframes hd-unfold { from { opacity: 0; transform: translateY(-.25rem); } to { opacity: 1; transform: none; } }

/* the empty state: the rice plate */
.empty { background: var(--hd-glass); border-style: dashed; }
.empty-mark { width: 3.25rem; height: 3.25rem; background: url("img/jq23pfyj0a-logo-rice-plate-w176.webp?v=6009e3a7c6") center / cover no-repeat; opacity: .8; }
.empty-mark::after { display: none; }

/* cards: tidy recipe cards, the logo's colours along the top */
.kit-card { background: var(--hd-glass); }
.kit-card::after { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px; z-index: 3; background: linear-gradient(90deg, var(--hd-radish) 0 33%, var(--hd-carrot) 33% 66%, var(--accent) 66%); opacity: 0; transition: opacity var(--motion-fast, .12s); }
.kit-card:hover::after { opacity: 1; }
.kit-cards:not(.kit-tiles) .kit-card:not(.has-media) { border-top: 1px solid var(--line); }
.kit-cards:not(.kit-tiles) .kit-card:not(.has-media)::before { content: ""; position: absolute; right: -.75rem; bottom: -.75rem; width: 5.5rem; height: 5.5rem; background: url("img/jq23pfyj0a-logo-rice-plate-w176.webp?v=6009e3a7c6") center / cover no-repeat; border-radius: 50%; opacity: .14; pointer-events: none; }
.kit-media { background: var(--hd-paper); }
.kit-media img { filter: saturate(.88) brightness(1.03); }
.kit-title { font-weight: 800; }
.kit-meta[data-dd-field="stars_shown"] .kit-value, .kit-meta[data-dd-field="rating_avg"] .kit-value { color: var(--hd-mustard); font-weight: 700; }
/* Compact recipe times come from the model's single summary. Wrap it on
   narrow cards and in tables without shortening or rewording it. */
.hd-card-times {
  order: 4; flex: 0 0 100%; min-width: 0;
  display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .85rem;
  padding-top: .45rem; margin-top: .1rem; border-top: 1px solid var(--line);
}
.hd-card-times-summary,
.view :is(td, dd)[data-dd-field="times_summary"],
.hd-recipe .goes-with td[data-dd-field="dish_times"] {
  font-variant-numeric: tabular-nums;
  white-space: normal;
  overflow-wrap: anywhere;
}
.hd-card-times-summary { color: var(--ink); font-size: .9rem; font-weight: 650; line-height: 1.35; min-width: 0; }
.view.list td[data-dd-field="times_summary"] { min-width: 14ch; }
.hd-variation-page [data-view="original"] .f:has(> [data-dd-field="times_summary"]) { grid-column: 1 / -1; }
.tag.hd-storage-badge {
  --hd-chill: var(--taste-salty);
  display: inline-flex; align-items: center; gap: .25em;
  border: 1px solid color-mix(in srgb, var(--hd-chill) 28%, var(--line));
  color: color-mix(in srgb, var(--hd-chill) 75%, var(--ink));
  background: color-mix(in srgb, var(--hd-chill) 11%, var(--surface));
  font-weight: 750; text-transform: none; white-space: nowrap;
}
.tag.hd-storage-badge.is-freezer { --hd-chill: var(--taste-bitter); }
.card-head h2 { font-weight: 800; }

/* Standard list deletes: style the framework's confirmation links only. A row
   with no link still has its empty cell and never gets a target from the theme. */
.view.list .table-wrap:has(tbody td:last-child a[href*="_op=delete"]) {
  max-inline-size: 100%;
  overflow-x: auto;
}
.view.list table:has(tbody td:last-child a[href*="_op=delete"]) tr > :is(th, td):last-child {
  box-sizing: border-box;
  width: 36px;
  padding-inline: 2px;
  text-align: center;
  vertical-align: middle;
}
.view.list tbody td:last-child a[href*="_op=delete"] {
  display: inline-grid;
  place-items: center;
  box-sizing: border-box;
  inline-size: 32px;
  block-size: 32px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-s, 8px);
  color: var(--muted);
  font-size: 0;
  text-decoration: none;
  vertical-align: middle;
}
.view.list tbody td:last-child a[href*="_op=delete"]::before {
  content: "×";
  content: "×" / "";
  font: 650 1.2rem/1 var(--font);
}
.view.list tbody td:last-child a[href*="_op=delete"]:is(:hover, :focus) {
  color: var(--danger);
  background-color: color-mix(in srgb, var(--danger) 10%, var(--surface));
  text-decoration: none;
}
.view.list tbody td:last-child a[href*="_op=delete"]:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: -2px;
}
/* Use a replacement with text alternative where supported. Keep the native
   link (and its original text as fallback), not a second action or a button. */
@supports (content: linear-gradient(transparent, transparent) / "Remove") {
  .view.list tbody td:last-child a[href*="_op=delete"] {
    content: linear-gradient(transparent, transparent) / "Remove";
    background-image: linear-gradient(45deg, transparent 44%, currentColor 45% 55%, transparent 56%),
                      linear-gradient(-45deg, transparent 44%, currentColor 45% 55%, transparent 56%);
    background-position: center;
    background-repeat: no-repeat;
    background-size: .65rem .65rem;
  }
  .view.list tbody td:last-child a[href*="_op=delete"]::before { content: none; }
}
@media (forced-colors: active) {
  .view.list tbody td:last-child a[href*="_op=delete"] {
    forced-color-adjust: none;
    color: LinkText;
    background-color: Canvas;
  }
  .view.list tbody td:last-child a[href*="_op=delete"]:is(:hover, :focus) {
    color: HighlightText;
    background-color: Highlight;
  }
}
@media (max-width: 720px) {
  .view.list table:has(tbody td:last-child a[href*="_op=delete"]) tr > :is(th, td):not(:last-child) {
    padding-inline: .35rem;
    white-space: normal;
    overflow-wrap: anywhere;
  }
}

/* forms and buttons sit on paper */
.form-view { background: var(--hd-glass); }
.btn.large { font-weight: 800; }

/* The framework draws the sign-in and recovery pages. Keep its forms, notices,
   and conditional recovery link; target the rendered routes, including at a mount prefix. */
.dd-frame-main .card.narrow:has(
  a:is([href$="/forgot"], [href*="/forgot?"]),
  form:is([action$="/forgot"], [action*="/forgot?"], [action$="/reset"], [action*="/reset?"])
) {
  box-sizing: border-box;
  width: min(100%, 28rem);
  margin-inline: auto;
  padding: var(--hd-recovery-padding, clamp(1.25rem, 3vw, 2rem));
  border: 1px solid var(--line);
  border-block-start: 4px solid var(--hd-wood-pale);
  background: var(--hd-glass);
  box-shadow: var(--shadow);
  overflow-wrap: anywhere;
}
.dd-frame-main a:is([href$="/forgot"], [href*="/forgot?"]):not(.btn) {
  color: var(--muted);
  font-size: .9rem;
  text-decoration: underline;
  text-underline-offset: .16em;
}
.dd-frame-main a:is([href$="/forgot"], [href*="/forgot?"]):not(.btn):is(:hover, :focus-visible) {
  color: var(--hd-accent-deep);
}

/* the seven tastes */
.tag-savory { background: color-mix(in oklab, var(--taste-savory) 16%, var(--surface)); color: var(--taste-savory); }
.tag-sweet { background: color-mix(in oklab, var(--taste-sweet) 16%, var(--surface)); color: var(--taste-sweet); }
.tag-sour { background: color-mix(in oklab, var(--taste-sour) 18%, var(--surface)); color: var(--taste-sour); }
.tag-bitter { background: color-mix(in oklab, var(--taste-bitter) 15%, var(--surface)); color: var(--taste-bitter); }
.tag-salty { background: color-mix(in oklab, var(--taste-salty) 15%, var(--surface)); color: var(--taste-salty); }
.tag-spicy { background: color-mix(in oklab, var(--taste-spicy) 15%, var(--surface)); color: var(--taste-spicy); }
.tag-mild { background: color-mix(in oklab, var(--taste-mild) 14%, var(--surface)); color: var(--taste-mild); }
.kit-card[data-dd-taste="savory"] { border-left: 4px solid color-mix(in oklab, var(--taste-savory) 45%, var(--surface)); }
.kit-card[data-dd-taste="sweet"] { border-left: 4px solid color-mix(in oklab, var(--taste-sweet) 45%, var(--surface)); }
.kit-card[data-dd-taste="sour"] { border-left: 4px solid color-mix(in oklab, var(--taste-sour) 45%, var(--surface)); }
.kit-card[data-dd-taste="bitter"] { border-left: 4px solid color-mix(in oklab, var(--taste-bitter) 45%, var(--surface)); }
.kit-card[data-dd-taste="salty"] { border-left: 4px solid color-mix(in oklab, var(--taste-salty) 45%, var(--surface)); }
.kit-card[data-dd-taste="spicy"] { border-left: 4px solid color-mix(in oklab, var(--taste-spicy) 45%, var(--surface)); }
.kit-card[data-dd-taste="mild"] { border-left: 4px solid color-mix(in oklab, var(--taste-mild) 45%, var(--surface)); }

/* outcomes and the assistant's states */
.tag-created, .tag-answered { background: color-mix(in srgb, var(--ok) 14%, var(--surface)); color: var(--ok); }
.tag-not_a_recipe, .tag-ambiguous, .tag-duplicate, .tag-same_as_original { background: color-mix(in srgb, var(--warn) 14%, var(--surface)); color: var(--warn); }

/* ================= the home page: the search builder ================= */
.hd-builder .dd-arrange-main > * + * { margin-top: 1.25rem; }
.hd-hero {
  position: relative; isolation: isolate; overflow: hidden;
  display: flex; align-items: center;
  min-height: clamp(14rem, 24vw, 20rem);
  padding: clamp(1.5rem, 4vw, 3rem);
  border-radius: var(--radius-lg, 18px);
  border: 1px solid var(--line);
  background: var(--hd-paper) url("img/oxvpqdiuth-counter-hero.webp?v=bc63ed01b8") right 35% / cover no-repeat;
  box-shadow: var(--shadow);
}
.hd-hero::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, color-mix(in srgb, var(--hd-paper) 94%, transparent) 0%, color-mix(in srgb, var(--hd-paper) 70%, transparent) 38%, transparent 68%); }
.hd-hero-text { max-width: 30rem; }
.hd-hero h1 { font-size: clamp(2rem, 1.3rem + 2.8vw, 3.4rem); font-weight: 900; line-height: 1.04; margin: 0 0 .6rem; }
.hd-hero .lede { margin: 0; font-size: clamp(1.05rem, 1rem + .35vw, 1.25rem); color: var(--ink); opacity: .85; }

.hd-pantry, .hd-dishes, .hd-go { background: var(--hd-glass); border: 1px solid var(--line); border-radius: var(--radius-lg, 18px); padding: clamp(1rem, 2.5vw, 1.5rem); box-shadow: var(--shadow); }
.hd-pantry h2, .hd-dishes h2 { display: flex; align-items: center; gap: .6rem; font-size: 1.2rem; font-weight: 800; margin: 0 0 .85rem; }
.hd-step { display: inline-grid; place-content: center; width: 1.8rem; height: 1.8rem; border-radius: 50%; background: var(--hd-carrot-soft); color: var(--hd-carrot); font-size: .95rem; font-weight: 900; flex: 0 0 auto; }
.hd-dishes .hd-step { background: var(--hd-radish-soft); color: var(--hd-radish); }
.hd-pantry-row { display: flex; gap: .5rem; }
.hd-pantry-row input { flex: 1; min-width: 0; font-size: 1.05rem; min-height: calc(var(--control-h, 2.5rem) + .3rem); border-radius: 999px; padding-inline: 1.1rem; }
.hd-pantry-row .btn { border-radius: 999px; }
.hd-pantry .help { margin-top: .45rem; }
.hd-ing-list { list-style: none; margin: .75rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: .4rem; }
.hd-ing-list:empty { display: none; }
.sb-ing { display: inline-flex; align-items: center; gap: .25rem; padding: .25rem .3rem .25rem .8rem; border-radius: 999px; background: var(--accent-soft); color: var(--ink); font-weight: 600; animation: hd-pop var(--motion, .2s) var(--ease); }
.sb-remove { appearance: none; border: 0; background: transparent; color: var(--muted); width: 1.5rem; height: 1.5rem; border-radius: 50%; font-size: 1.05rem; line-height: 1; cursor: pointer; }
.sb-remove:hover { background: var(--surface); color: var(--danger); }
@keyframes hd-pop { from { transform: scale(.8); opacity: 0; } to { transform: none; opacity: 1; } }

/* the illustrated dish filters */
.hd-dish-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(7.25rem, 1fr)); gap: .75rem; }
.dish-tile { appearance: none; -webkit-appearance: none; position: relative; display: flex; flex-direction: column; align-items: center; gap: .35rem; padding: .5rem .35rem .6rem; border: 1px solid transparent; border-radius: var(--radius, 12px); background: transparent; color: var(--ink); font: inherit; text-transform: none; cursor: pointer; transition: transform var(--motion, .2s) var(--ease), background var(--motion-fast, .12s); }
.dish-tile:hover { transform: translateY(-3px) rotate(-1.5deg); background: color-mix(in srgb, var(--surface) 70%, transparent); }
.dish-art { display: block; width: 100%; max-width: 7rem; aspect-ratio: 1; border-radius: 50%; overflow: hidden; background: var(--hd-paper); box-shadow: 0 3px 10px -4px color-mix(in srgb, var(--hd-wood-deep) 45%, transparent); transition: box-shadow var(--motion-fast, .12s); }
.dish-art img { display: block; width: 100%; height: 100%; object-fit: cover; transform: scale(1.12); filter: saturate(.8) brightness(1.05); }
/* a dish with no picture yet (not drawn, or the drawing failed): a plain cream plate with its name */
.dish-art.is-plain { display: grid; place-content: center; padding: 12%; background: radial-gradient(circle at 50% 50%, var(--hd-paper) 0 58%, color-mix(in oklab, var(--hd-paper) 88%, var(--hd-wood-pale)) 59% 62%, var(--hd-paper) 63%); border: 1px dashed color-mix(in srgb, var(--hd-wood-deep) 22%, transparent); }
.dish-plain { font-family: var(--font-head); font-weight: 800; font-size: clamp(.8rem, .7rem + .4vw, 1rem); line-height: 1.1; text-align: center; color: color-mix(in oklab, var(--hd-wood-deep) 70%, var(--muted)); overflow-wrap: anywhere; }
.hd-dish-empty { grid-column: 1 / -1; margin: 0; }
.dish-name { font-family: var(--font-head); font-weight: 800; font-size: .98rem; }
.dish-note { font-size: .75rem; color: var(--muted); min-height: 1em; }
.dish-note:empty { display: none; }
/* how many recipes the category has (its kept count), a small pencil-line label */
.dish-count { margin-top: -.2rem; font-size: .76rem; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.dish-count:empty { display: none; }
.dish-tile:not(.is-empty) .dish-count::before { content: ""; display: inline-block; width: .38rem; height: .38rem; margin-right: .3rem; border-radius: 50%; background: var(--hd-carrot); opacity: .7; vertical-align: .08em; }
.dish-tile[aria-pressed="true"] .dish-count { color: var(--hd-accent-deep); }
/* a category with no recipes yet: its plate paler, still pickable */
.dish-tile.is-empty .dish-art { filter: grayscale(.45); opacity: .62; }
.dish-tile.is-empty .dish-count { font-style: italic; font-weight: 400; }
.dish-tile[aria-pressed="true"] .dish-art { box-shadow: 0 0 0 3px var(--accent), 0 0 0 7px var(--accent-soft); }
.dish-tile[aria-pressed="true"]::after { content: "✓"; position: absolute; top: .35rem; right: calc(50% - 3.6rem); display: grid; place-content: center; width: 1.6rem; height: 1.6rem; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-weight: 900; font-size: .85rem; box-shadow: var(--shadow); animation: hd-pop var(--motion, .2s) var(--ease); }
.dish-tile.is-missing .dish-art { filter: grayscale(.5); opacity: .6; }

.hd-go { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; background: color-mix(in srgb, var(--accent-soft) 55%, var(--hd-glass)); }
.hd-summary { margin: 0; font-weight: 600; }
.hd-search-btn { border-radius: 999px; padding-inline: 1.8rem; }

.hd-fallback { margin-top: 1.25rem; }
.hd-latest { margin-top: clamp(2rem, 5vw, 3.5rem); }

/* ================= a search: ingredients, then dishes in a recipe-box stack ================= */
.hd-pantry-search { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 1.25rem; align-items: start; margin-bottom: 1.75rem; }
.hd-pantry-search .view { margin: 0; }
.hd-pantry-search .form-view { padding: 0; border: 0; box-shadow: none; background: transparent; }
.hd-pantry-search .card-head h2, .hd-pantry-search .form-view > h2 { font-size: 1.1rem; }
.hd-pantry-search .table-wrap { box-shadow: none; }
.hd-results .card-head h2 { font-size: 1.4rem; }

/* the ingredients typed, as a tidy pantry list rather than a table: each term a row —
   the name, then what it was matched to (or "Not recognised — check the spelling"), a
   remove "×" at the right. The table stays (rows keep tr[data-dd-id] and td[data-dd-field]);
   only its look changes. An unrecognised term (its "Change it" link is drawn) is warmed
   with carrot, its suggestions (suggest_1..3) shown as small chips under it.
   The script's suggestion buttons, when it draws them in a row:
     <tr … class="is-unrecognised has-picks">          the row (has-picks hides the raw cells)
       <td data-dd-field="status_note">Not recognised — check the spelling
         <div class="hd-suggest" role="group" aria-label="Suggestions">
           <span class="hd-suggest-lead">Did you mean</span>
           <button type="button" class="hd-suggest-btn" data-suggest="tomato">tomato</button> …
         </div>
         <p class="hd-error hd-suggest-status" role="alert"></p>
       </td> …
   A button being sent carries aria-busy="true". */
[data-view="terms"] .table-wrap { background: transparent; border: 0; box-shadow: none; border-radius: 0; overflow: visible; }
[data-view="terms"] table { display: block; width: 100%; border: 0; background: transparent; }
[data-view="terms"] thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[data-view="terms"] tbody { display: flex; flex-direction: column; gap: .45rem; }
[data-view="terms"] tbody tr {
  display: flex; flex-wrap: wrap; align-items: center; gap: .15rem .5rem;
  padding: .55rem .6rem .55rem 1rem; position: relative;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  border: 1px solid var(--line); border-left: 4px solid var(--accent-soft);
  border-radius: var(--radius, 12px);
  animation: hd-pop var(--motion, .2s) var(--ease);
}
[data-view="terms"] tbody tr:hover { background: color-mix(in srgb, var(--surface) 96%, transparent); }
[data-view="terms"] td { display: block; padding: 0; border: 0; background: transparent; min-width: 0; }
[data-view="terms"] td:empty { display: none; }
[data-view="terms"] td[data-dd-field="text"] { order: 1; flex: 1 1 auto; font-family: var(--font-head); font-weight: 800; font-size: 1.02rem; overflow-wrap: anywhere; }
[data-view="terms"] td:not([data-dd-field]) { order: 2; margin-left: auto; flex: 0 0 auto; }
[data-view="terms"] td[data-dd-field="status_note"] { order: 3; flex: 0 0 100%; display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; font-size: .88rem; color: var(--muted); }
[data-view="terms"] td[data-dd-field="status_note"]::before { content: ""; width: .45rem; height: .45rem; border-radius: 50%; background: var(--accent); opacity: .75; flex: 0 0 auto; }
[data-view="terms"] td[data-dd-field^="suggest_"] { order: 4; }
[data-view="terms"] td[data-dd-field="fix_note"] { order: 5; }
/* the categories a term fits: what the script puts in the dishes' address, never shown */
[data-view="terms"] td[data-dd-field="alternatives"], [data-view="terms"] th[data-dd-field="alternatives"] { display: none; }

/* remove: a small round "×" */
[data-view="terms"] td:not([data-dd-field]) a {
  display: inline-grid; place-content: center; width: 1.9rem; height: 1.9rem; border-radius: 50%;
  font-size: 0; color: var(--muted); text-decoration: none;
  transition: background var(--motion-fast, .12s), color var(--motion-fast, .12s);
}
[data-view="terms"] td:not([data-dd-field]) a::before { content: "×"; font-size: 1.2rem; line-height: 1; font-weight: 600; }
[data-view="terms"] td:not([data-dd-field]) a:hover { background: color-mix(in srgb, var(--danger) 10%, var(--surface)); color: var(--danger); }

/* The model's match_state, not the presence of a link or a client-added class,
   decides which terms get the question mark and correction controls. */
[data-view="terms"] td[hidden],
[data-view="terms"] tr:not([data-match-state="unrecognised"]) :is(td[data-dd-field^="suggest_"], td[data-dd-field="fix_note"], .hd-suggest, .hd-suggest-status) { display: none; }
[data-view="terms"] tbody tr[data-match-state="pending"] td[data-dd-field="status_note"]::before { background: var(--hd-wood-deep); animation: hd-typing 1.2s ease-in-out infinite; }
[data-view="terms"] tbody tr[data-match-state="salt"] td[data-dd-field="status_note"]::before { background: var(--muted); }
[data-view="terms"] tbody tr[data-match-state="unrecognised"] {
  border-left: 4px dashed color-mix(in oklab, var(--hd-carrot) 60%, var(--surface));
  background: color-mix(in srgb, var(--hd-carrot-soft) 32%, var(--surface));
}
[data-view="terms"] tr[data-match-state="unrecognised"] td[data-dd-field="text"] { text-decoration: underline wavy color-mix(in oklab, var(--hd-carrot) 55%, transparent); text-underline-offset: .22em; text-decoration-thickness: 1px; }
[data-view="terms"] tr[data-match-state="unrecognised"] td[data-dd-field="status_note"] { color: var(--hd-carrot); font-weight: 600; }
[data-view="terms"] tr[data-match-state="unrecognised"] td[data-dd-field="status_note"]::before {
  content: "?"; display: inline-grid; place-content: center; width: 1.1rem; height: 1.1rem; opacity: 1;
  background: var(--hd-carrot); color: var(--surface); font-size: .7rem; font-weight: 900; font-family: var(--font-body);
}

/* its suggestions without the script: the raw cells as small chips after "Did you mean" */
[data-view="terms"] td[data-dd-field^="suggest_"]:not(:empty) {
  display: inline-flex; align-items: center; margin-top: .35rem;
  padding: .12rem .65rem; border-radius: 999px; font-size: .85rem; font-weight: 600;
  background: var(--surface); border: 1px dashed color-mix(in oklab, var(--hd-carrot) 45%, var(--line)); color: var(--ink);
}
[data-view="terms"] td[data-dd-field="suggest_1"]:not(:empty) { position: relative; margin-left: 6.6em; }
[data-view="terms"] td[data-dd-field="suggest_1"]:not(:empty)::before { content: "Did you mean"; position: absolute; right: calc(100% + .5rem); white-space: nowrap; font-size: .8rem; font-weight: 600; color: var(--muted); }
[data-view="terms"] td[data-dd-field="fix_note"] a {
  display: inline-flex; align-items: center; gap: .3rem; margin-top: .35rem;
  padding: .12rem .7rem; border-radius: 999px; font-size: .85rem; font-weight: 700;
  color: var(--hd-accent-deep); background: var(--accent-soft); text-decoration: none;
}
[data-view="terms"] td[data-dd-field="fix_note"] a::before { content: "✎"; font-size: .85em; }
[data-view="terms"] td[data-dd-field="fix_note"] a:hover { background: color-mix(in oklab, var(--accent-soft) 70%, var(--accent)); }

/* …and with it: the buttons inside the note, the raw cells hidden */
[data-view="terms"] tbody tr.has-picks td[data-dd-field^="suggest_"] { display: none; }
.hd-suggest { flex: 0 0 100%; display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; margin-top: .3rem; }
.hd-suggest-lead { font-size: .8rem; font-weight: 600; color: var(--muted); margin-right: .1rem; }
.hd-suggest-btn {
  appearance: none; -webkit-appearance: none; display: inline-flex; align-items: center; gap: .3rem;
  font: inherit; font-size: .88rem; font-weight: 700; text-transform: none; cursor: pointer;
  padding: .2rem .8rem; border-radius: 999px;
  background: var(--surface); color: var(--ink);
  border: 1px dashed color-mix(in oklab, var(--hd-carrot) 50%, var(--line));
  transition: background var(--motion-fast, .12s) var(--ease), border-color var(--motion-fast, .12s), color var(--motion-fast, .12s), transform var(--motion-fast, .12s) var(--ease);
}
.hd-suggest-btn::before { content: "↺"; font-size: .85em; color: var(--hd-carrot); opacity: .8; }
.hd-suggest-btn:hover { border-style: solid; border-color: var(--accent); background: var(--accent-soft); color: var(--hd-accent-deep); transform: translateY(-1px); }
.hd-suggest-btn:hover::before { color: currentColor; }
.hd-suggest-btn[aria-busy="true"], .hd-suggest-btn:disabled { opacity: .55; cursor: progress; transform: none; }
.hd-suggest-status { flex: 0 0 100%; margin-top: .25rem; }

/* fixing one term on its own page (/search-term/{id}): the note and the suggestions stand out */
[data-view="term"] [data-dd-field="status_note"] { color: var(--hd-carrot); font-weight: 700; }
[data-view="term"] [data-dd-field="suggestions"] { font-family: var(--font-head); font-weight: 800; color: var(--hd-accent-deep); }
[data-view="term"] [data-dd-field="text"] { font-weight: 700; }
[data-view="fix"] { max-width: 36rem; border-left: 4px dashed color-mix(in oklab, var(--hd-carrot) 55%, var(--surface)); }
[data-view="fix"] input[name="text"] { border-radius: 999px; padding-inline: 1.1rem; font-size: 1.05rem; }

/* The results stay a grid until the script picks .is-front. Then the other cards
   read as overlapping recipe-box strips, in rank order, with the full card below.
   Client hooks: mark collapsed rows [hidden]; append li.hd-stack-more > button
   to the list for the disclosure (the front card is ordered last). A compact
   .hd-strip-time inside .hd-card-times replaces the long time line on strips
   only. An unrated .kit-meta[data-dd-field="rating"] can carry [data-unrated]. */
[data-view="results"] .kit-cards:has(> .is-front) {
  --hd-strip-height: 2rem;
  --hd-strip-overlap: .4rem;
  --hd-strip-padding: .75rem;
  --hd-strip-shadow: 0 -3px 7px -2px color-mix(in srgb, var(--ink) 23%, transparent);
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  isolation: isolate;
}
[data-view="results"] .kit-cards:has(> .is-front) > :is(.kit-card:not(.is-front), .hd-stack-more) {
  --hd-strip-edge: var(--accent);
  --hd-strip-inset: .35rem;
  position: relative;
  z-index: 0;
  box-sizing: border-box;
  min-width: 0;
  height: calc(var(--hd-strip-height) + var(--hd-strip-overlap));
  margin-inline: var(--hd-strip-inset);
  flex-direction: row;
  border: 1px solid var(--line);
  border-top: 3px solid color-mix(in oklab, var(--hd-strip-edge) 65%, var(--surface));
  border-radius: .65rem .65rem 0 0;
  background: color-mix(in oklab, var(--bg) 90%, var(--hd-wood-pale));
  box-shadow: var(--hd-strip-shadow);
  cursor: pointer;
}
[data-view="results"] .kit-cards:has(> .is-front) > :is(.kit-card:not(.is-front), .hd-stack-more)[hidden] { display: none; }
[data-view="results"] .kit-cards:has(> .is-front) > :is(.kit-card:not(.is-front), .hd-stack-more):not([hidden]) ~ :is(.kit-card:not(.is-front), .hd-stack-more) {
  margin-block-start: calc(-1 * var(--hd-strip-overlap));
}
/* Count back from the card, skipping collapsed strips and the front card itself. */
[data-view="results"] .kit-cards:has(> .is-front) > :nth-last-child(2 of :is(.kit-card:not(.is-front), .hd-stack-more):not([hidden])) { --hd-strip-inset: .7rem; }
[data-view="results"] .kit-cards:has(> .is-front) > :nth-last-child(3 of :is(.kit-card:not(.is-front), .hd-stack-more):not([hidden])) { --hd-strip-inset: 1.05rem; }
[data-view="results"] .kit-cards:has(> .is-front) > :nth-last-child(n+4 of :is(.kit-card:not(.is-front), .hd-stack-more):not([hidden])) { --hd-strip-inset: 1.4rem; }
[data-view="results"] .kit-cards:has(> .is-front) > .kit-card:nth-child(4n+2 of .kit-card):not(.is-front) { --hd-strip-edge: var(--hd-carrot); }
[data-view="results"] .kit-cards:has(> .is-front) > .kit-card:nth-child(4n+3 of .kit-card):not(.is-front) { --hd-strip-edge: var(--hd-radish); }
[data-view="results"] .kit-cards:has(> .is-front) > .kit-card:nth-child(4n+4 of .kit-card):not(.is-front) { --hd-strip-edge: var(--hd-mustard); }
[data-view="results"] .kit-cards:has(> .is-front) > :is(.kit-card:not(.is-front), .hd-stack-more):hover {
  transform: none;
  box-shadow: var(--hd-strip-shadow);
  background: var(--hd-paper);
}
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  [data-view="results"] .kit-cards:has(> .is-front) > :is(.kit-card:not(.is-front), .hd-stack-more):hover { transform: translateY(-2px); }
}
[data-view="results"] .kit-cards:has(> .is-front) > .kit-card:not(.is-front)::before,
[data-view="results"] .kit-cards:has(> .is-front) > .kit-card:not(.is-front)::after,
[data-view="results"] .kit-cards:has(> .is-front) > .kit-card:not(.is-front) .kit-media { display: none; }
[data-view="results"] .kit-cards:has(> .is-front) > .kit-card:not(.is-front) .kit-body {
  min-width: 0;
  flex-wrap: nowrap;
  gap: .4rem;
  padding: 0 var(--hd-strip-padding) var(--hd-strip-overlap);
}
[data-view="results"] .kit-cards:has(> .is-front) > .kit-card:not(.is-front) .kit-body > :not(.kit-title, [data-dd-field="rating"], .hd-card-times:has(.hd-card-times-summary, .hd-strip-time)) { display: none; }
[data-view="results"] .kit-cards:has(> .is-front) > .kit-card:not(.is-front) .kit-title {
  flex: 1 1 0;
  min-width: 0;
  font-size: .82rem;
  font-weight: 700;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
[data-view="results"] .kit-cards:has(> .is-front) > .kit-card:not(.is-front):has(.kit-title a:focus-visible) {
  outline: 2px solid var(--hd-accent-deep);
  outline-offset: -3px;
}
/* The title link already fills the strip via the kit's stretched-link pseudo-element. */
[data-view="results"] .kit-cards:has(> .is-front) > .kit-card:not(.is-front) .kit-title a:focus-visible { outline: none; }
[data-view="results"] .hd-strip-time { display: none; }
[data-view="results"] .kit-cards:has(> .is-front) > .kit-card:not(.is-front) .hd-card-times {
  display: block;
  flex: 0 1 auto;
  max-width: 46%;
  padding: 0;
  margin: 0;
  border: 0;
  line-height: 1.2;
}
[data-view="results"] .kit-cards:has(> .is-front) > .kit-card:not(.is-front) .hd-card-times :is(.hd-card-times-summary, .hd-strip-time) {
  display: block;
  color: var(--muted);
  font-size: .72rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
[data-view="results"] .kit-cards:has(> .is-front) > .kit-card:not(.is-front) .hd-card-times:has(.hd-strip-time) .hd-card-times-summary,
[data-view="results"] .kit-cards:has(> .is-front) > .kit-card:not(.is-front) .hd-card-times .hd-storage-badge { display: none; }
[data-view="results"] .kit-cards:has(> .is-front) > .kit-card:not(.is-front) [data-dd-field="rating"] { order: 2; margin: 0; flex: 0 0 auto; line-height: 1; }
[data-view="results"] .kit-cards:has(> .is-front) > .kit-card:not(.is-front) [data-dd-field="rating"]:is([hidden], [data-unrated], :not(:has(.kit-value:not(:empty)))) { display: none; }
[data-view="results"] .kit-cards:has(> .is-front) > .kit-card:not(.is-front) [data-dd-field="rating"] .kit-value {
  display: inline-flex;
  align-items: center;
  gap: .1rem;
  padding: .13rem .38rem;
  border-radius: var(--radius-tag, 999px);
  background: color-mix(in oklab, var(--hd-mustard) 20%, var(--hd-paper));
  color: color-mix(in oklab, var(--hd-mustard) 62%, var(--ink));
  font-size: .72rem;
  font-weight: 800;
  white-space: nowrap;
}
[data-view="results"] .kit-cards:has(> .is-front) > .kit-card:not(.is-front) [data-dd-field="rating"] .kit-value::before { content: "★"; font-size: .9em; }

/* The disclosure is another edge in the stack, but a button rather than a title link. */
[data-view="results"] .kit-cards:has(> .is-front) > .hd-stack-more { overflow: hidden; transition: transform var(--motion-fast, .12s) var(--ease); }
[data-view="results"] .hd-stack-more > button {
  appearance: none;
  display: block;
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  min-height: 0;
  margin: 0;
  padding: 0 var(--hd-strip-padding) var(--hd-strip-overlap);
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--hd-accent-deep);
  font: 700 .82rem/1.2 var(--font-body);
  text-align: start;
  text-transform: none;
  cursor: pointer;
}
[data-view="results"] .hd-stack-more > button:hover { background: var(--hd-paper); }
[data-view="results"] .hd-stack-more > button:focus-visible { outline-offset: -3px; }
@media (pointer: coarse) {
  [data-view="results"] .kit-cards:has(> .is-front) { --hd-strip-height: 2.4rem; }
}
@media (forced-colors: active) {
  [data-view="results"] .kit-cards:has(> .is-front) > :is(.kit-card:not(.is-front), .hd-stack-more) { border-color: ButtonText; }
  [data-view="results"] .kit-cards:has(> .is-front) > .kit-card:not(.is-front):has(.kit-title a:focus-visible),
  [data-view="results"] .hd-stack-more > button:focus-visible { outline-color: Highlight; }
}

[data-view="results"] .kit-card.is-front { grid-column: 1 / -1; order: 99; flex-direction: row; margin-top: .15rem; border-radius: 6px 6px var(--radius-lg, 18px) var(--radius-lg, 18px); border-top: 4px solid var(--accent); box-shadow: var(--shadow-2, var(--shadow)); background: color-mix(in srgb, var(--surface) 94%, transparent); animation: hd-front var(--motion, .22s) var(--ease); }
[data-view="results"] .kit-cards:has(> :is(.kit-card:not(.is-front), .hd-stack-more):not([hidden])) > .kit-card.is-front {
  z-index: 1;
  margin-block-start: calc(-1 * var(--hd-strip-overlap));
  box-shadow: var(--shadow-2, var(--shadow)), var(--hd-strip-shadow);
}
[data-view="results"] .kit-card.is-front:hover { transform: none; }
[data-view="results"] .kit-card.is-front::after { display: none; }
[data-view="results"] .kit-card.is-front .kit-media { flex: 0 0 clamp(10rem, 32%, 18rem); aspect-ratio: auto; min-height: 12rem; }
[data-view="results"] .kit-card.is-front .kit-body { padding: 1.25rem 1.5rem 1.4rem; }
[data-view="results"] .kit-card.is-front .kit-title { font-size: clamp(1.25rem, 1.05rem + .8vw, 1.65rem); font-weight: 900; }
[data-view="results"] .kit-card.is-front [data-dd-field="rating"] .kit-value { font-size: 1.05rem; }

/* the dishes' details: the raw average (kept for the script's tie check) never shows;
   the stars and the rating read as one mustard line, without labels; times cooked,
   reviews and the time stay small labelled details; "with N variations" is a radish
   pill linking to the dish, where its variations are listed */
[data-view="results"] [data-dd-field="rating_avg"] { display: none; }
[data-view="results"] .kit-meta[data-dd-field="stars_shown"] .kit-label,
[data-view="results"] .kit-meta[data-dd-field="rating"] .kit-label,
[data-view="results"] .kit-meta[data-dd-field="variations_note"] .kit-label { display: none; }
[data-view="results"] .kit-meta[data-dd-field="stars_shown"] { margin-right: .15rem; }
[data-view="results"] .kit-meta[data-dd-field="stars_shown"] .kit-value { color: var(--hd-mustard); letter-spacing: .04em; }
[data-view="results"] .kit-meta[data-dd-field="rating"] .kit-value { color: var(--hd-mustard); font-weight: 800; font-variant-numeric: tabular-nums; }
[data-view="results"] .kit-meta[data-dd-field="author_name"] .kit-value { color: var(--ink); font-weight: 600; }
[data-view="results"] .kit-meta[data-dd-field="variations_note"] a {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .12rem .7rem; border-radius: 999px;
  background: var(--hd-radish-soft); color: var(--hd-radish);
  font-size: .82rem; font-weight: 700; text-decoration: none;
  transition: background var(--motion-fast, .12s) var(--ease), transform var(--motion-fast, .12s) var(--ease);
}
[data-view="results"] .kit-meta[data-dd-field="variations_note"] a::before { content: ""; width: .45rem; height: .45rem; border-radius: 50%; background: currentColor; box-shadow: .3rem 0 0 color-mix(in oklab, var(--hd-carrot) 70%, transparent); margin-right: .3rem; }
[data-view="results"] .kit-meta[data-dd-field="variations_note"] a:hover { background: color-mix(in oklab, var(--hd-radish-soft) 70%, var(--hd-radish)); color: var(--surface); transform: translateY(-1px); }

/* the results' own filters are the way to choose without scripts; once the side panel
   is drawn (tags) and the ingredients list holds the typed words, they stand aside */
.hd-search:has([data-tag-groups] > *) [data-view="results"] .facets,
.hd-search:has([data-tag-groups] > *) [data-view="results"] .filters { display: none; }
@keyframes hd-front { from { transform: translateY(-.6rem); opacity: .4; } to { transform: none; opacity: 1; } }

/* reloading: while the dishes and the side panel are brought up to date (app.js puts
   .is-busy on them), both fade a little and take no clicks until the class goes */
.hd-search [data-view="results"], .hd-search .hd-panel { transition: opacity var(--motion-fast, .15s) var(--ease, ease); }
.hd-search [data-view="results"].is-busy, .hd-search .hd-panel.is-busy { opacity: .6; pointer-events: none; -webkit-user-select: none; user-select: none; }

/* the front card's ingredients (app.js) */
.dish-ingredients { order: 5; flex: 0 0 100%; margin-top: .75rem; padding-top: .85rem; border-top: 1px dashed var(--line); }
.dish-ingredients h4 { margin: 0 0 .5rem; font-size: .8rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.dish-ingredients ul { list-style: none; margin: 0; padding: 0; columns: 2 12rem; column-gap: 1.75rem; }
.dish-ingredients li { break-inside: avoid; padding: .2rem 0 .2rem 1rem; position: relative; }
.dish-ingredients li::before { content: ""; position: absolute; left: 0; top: .7rem; width: .4rem; height: .4rem; border-radius: 50%; background: var(--hd-carrot); opacity: .7; }
.dish-ingredients .qty { font-weight: 700; color: var(--hd-accent-deep); font-variant-numeric: tabular-nums; }
.dish-ingredients.is-loading ul::before { content: "Fetching the ingredients…"; color: var(--muted); font-style: italic; }
.dish-ing-note { margin: 0; }

/* the next twenty */
[data-view="results"] a.kit-page.next { font-size: 0; padding-inline: 1rem; background: var(--accent); border-color: var(--accent); }
[data-view="results"] a.kit-page.next::after { content: "Skip to next 20 →"; font-size: .9rem; font-weight: 700; color: var(--accent-ink); }
[data-view="results"] span.kit-page.next { display: none; }

/* ================= categories: the seven tastes ================= */
.hd-tastes-art { margin: -.35rem -.4rem .5rem; border-radius: var(--radius, 12px); overflow: hidden; aspect-ratio: 3 / 1.25; background: var(--hd-paper); }
.hd-tastes-art img { display: block; width: 100%; height: 100%; object-fit: cover; filter: saturate(.85) brightness(1.04); }
.hd-taste-key { list-style: none; margin: 0 0 1.1rem; padding: 0; display: flex; flex-direction: column; gap: .45rem; font-size: .9rem; color: var(--muted); }
.hd-taste-key .tag { margin-right: .35rem; }
.hd-tastes .view.text.note { border-left-color: var(--hd-carrot); font-size: .93rem; padding-left: .9rem; }
.hd-tastes .view.text.note ul { padding-left: 1.1rem; }
.hd-tastes .view.text.note li { margin-bottom: .45rem; }

/* Recipe shelves: a warm paper edge for recipes specific to the ingredient and
   a herb-green edge for recipes shared by any member of its category. The page's
   view headings provide the distinction in words, including without JavaScript. */
.hd-shelf-page > .detail .fields,
.hd-category-record > .detail .fields { background: var(--hd-glass); }
.hd-recipe-shelf > .view {
  padding: clamp(.85rem, 2vw, 1.35rem);
  background: var(--hd-glass);
  border: 1px solid var(--line);
  border-top: 3px solid var(--hd-wood-pale);
  border-radius: var(--radius-lg, 18px);
  box-shadow: var(--shadow);
}
.hd-recipe-shelf > [data-view="category-recipes"],
.hd-category-record .hd-recipe-shelf > [data-view="recipes"] {
  border-top-color: color-mix(in srgb, var(--accent) 55%, var(--line));
}
.hd-recipe-shelf .card-head h2 { margin: 0; overflow-wrap: anywhere; }
.hd-recipe-shelf .kit-rows { gap: .55rem; }
.hd-recipe-shelf .kit-rows .kit-card { flex-direction: row; align-items: center; background: var(--surface); box-shadow: none; }
.hd-recipe-shelf .kit-rows .kit-card:hover { transform: none; border-color: var(--accent); }
.hd-recipe-shelf .kit-rows .kit-card:focus-within { outline: 2px solid var(--hd-accent-deep); outline-offset: 2px; }
.hd-recipe-shelf .kit-rows .kit-card:not(.has-media)::before { display: none; }
.hd-recipe-shelf .kit-rows .kit-media { flex: 0 0 clamp(3.5rem, 17%, 6.5rem); aspect-ratio: 1; margin-inline-start: .55rem; border-radius: var(--radius-s, 8px); }
.hd-recipe-shelf .kit-rows .kit-body { min-width: 0; padding: .75rem .95rem; gap: .25rem .65rem; overflow-wrap: anywhere; }
.hd-recipe-shelf .kit-meta { margin: 0; }
/* Keep what the recipe makes together, just below the title and above the ratings. */
.hd-recipe-shelf .kit-meta[data-dd-field="makes_name"] {
  order: 2;
  flex: 0 0 100%;
  min-width: 0;
  line-height: 1.4;
}
.hd-recipe-shelf [data-dd-field="makes_name"] .kit-label { margin-inline-end: .25rem; }
.hd-recipe-shelf [data-dd-field="makes_name"] .kit-value {
  display: inline-block;
  max-width: 100%;
  padding: .12rem .55rem;
  border-radius: var(--radius-tag, 999px);
  background: var(--accent-soft);
  color: var(--hd-accent-deep);
  font-weight: 700;
  overflow-wrap: anywhere;
}
.hd-recipe-shelf .kit-meta[data-dd-field="stars_shown"] .kit-label { display: none; }
[data-view="recipes-for"] td[data-dd-field="makes_name"] { font-weight: 650; }
.hd-recipe-shelf .empty { padding-block: 1rem; }
.hd-category-record .hd-panel .empty { padding: .65rem .75rem; align-items: start; font-size: .92rem; }
.hd-category-record .hd-panel .empty-mark { display: none; }

/* Hasty Tips on the ingredient's page: an uncluttered stack of notes. The text
   is meant to be read here, so don't use the recipe cards' preview clamp. */
#hasty-tips { scroll-margin-block-start: 1rem; }
#hasty-tips > .view {
  padding: clamp(.85rem, 2vw, 1.35rem);
  border: 1px solid var(--line);
  border-top: 3px solid var(--hd-carrot);
  border-radius: var(--radius-lg, 18px);
  background: color-mix(in srgb, var(--hd-glass) 80%, var(--hd-paper));
  box-shadow: var(--shadow);
}
#hasty-tips .card-head h2 { margin: 0; }
#hasty-tips .kit-rows { gap: .55rem; }
#hasty-tips .kit-card, #hasty-tips .kit-card:hover { background: var(--surface); box-shadow: none; transform: none; }
#hasty-tips .kit-card::before, #hasty-tips .kit-card::after { display: none; }
#hasty-tips .kit-body { display: block; min-width: 0; padding: .75rem clamp(.75rem, 2vw, 1.15rem); }
#hasty-tips [data-dd-field="title"] { font-weight: 800; overflow-wrap: anywhere; }
#hasty-tips [data-dd-field="text"] {
  display: block; max-width: 68ch; margin: .25rem 0 0;
  color: var(--ink); font-size: 1rem; line-height: 1.5;
  -webkit-line-clamp: unset; overflow: visible;
  white-space: pre-wrap; overflow-wrap: anywhere;
}
#hasty-tips [data-dd-field="text"] .kit-label { display: none; }

/* ================= admin: recipe categories ================= */
/* the front-page tiles' list: the order a carrot numeral, the illustration's address
   kept short; a category's own page shows its illustration as a round plate */
[data-view="front-page"] td[data-dd-field="front_page_order"] { font-family: var(--font-head); font-weight: 900; color: var(--hd-carrot); font-variant-numeric: tabular-nums; width: 3.5rem; }
[data-view="front-page"] td[data-dd-field="picture"] { max-width: 16rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: .85rem; }
[data-view="front-page"] td[data-dd-field="recipe_count"], [data-view="tags"] td[data-dd-field="recipe_count"], [data-view="children"] td[data-dd-field="recipe_count"] { font-weight: 700; font-variant-numeric: tabular-nums; }
.view.detail[data-view="info"] [data-dd-field="picture_note"] { font-weight: 600; }
.view.detail.has-media[data-view="info"]:is(:has([data-dd-field="picture_note"]), :has([data-dd-field="picture_drawing"])) .kit-figure { max-width: 14rem; aspect-ratio: 1; border-radius: 50%; overflow: hidden; background: var(--hd-paper); box-shadow: 0 3px 10px -4px color-mix(in srgb, var(--hd-wood-deep) 45%, transparent); }
.view.detail.has-media[data-view="info"]:is(:has([data-dd-field="picture_note"]), :has([data-dd-field="picture_drawing"])) .kit-figure img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.12); transition: opacity var(--motion, .2s) var(--ease), filter var(--motion, .2s) var(--ease); }

/* a drawing under way (picture_drawing, shown only then): an indeterminate progress bar —
   a pale wooden track with the logo's radish, carrot and herb sliding along it — over
   the words. The live refresh swaps it for the drawn picture or the image service's
   answer. The earlier illustration, if any, waits faded beside it. */
[data-dd-field="picture_drawing"]:not(:empty) {
  --hd-bar-h: .55rem;
  position: relative; display: block;
  padding-top: calc(var(--hd-bar-h) + .5rem);
  color: var(--hd-accent-deep); font-weight: 600; font-style: italic; line-height: 1.35;
}
[data-dd-field="picture_drawing"]:not(:empty)::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: var(--hd-bar-h);
  border-radius: 999px;
  background:
    linear-gradient(90deg, var(--hd-radish) 0 33%, var(--hd-carrot) 33% 66%, var(--accent) 66%) no-repeat,
    repeating-linear-gradient(115deg, color-mix(in srgb, var(--hd-wood-deep) 10%, transparent) 0 2px, transparent 2px 6px),
    var(--hd-wood-pale);
  background-size: 38% 100%, auto, auto;
  background-position: -62% 0, 0 0, 0 0;
  box-shadow: inset 0 1px 2px color-mix(in srgb, var(--hd-wood-deep) 25%, transparent);
  animation: hd-drawing 1.5s cubic-bezier(.45, .05, .4, .95) infinite;
}
@keyframes hd-drawing {
  from { background-position: -62% 0, 0 0, 0 0; }
  to { background-position: 162% 0, 0 0, 0 0; }
}
.view.detail[data-view="info"] .f:has(> [data-dd-field="picture_drawing"]) { grid-column: 1 / -1; }
.view.detail[data-view="info"] [data-dd-field="picture_drawing"]:not(:empty) { max-width: 28rem; }
.view.detail.has-media[data-view="info"]:has([data-dd-field="picture_drawing"]) .kit-figure img { opacity: .5; filter: grayscale(.35); }
[data-view="front-page"] td[data-dd-field="picture_drawing"]:not(:empty) { display: table-cell; min-width: 13rem; padding-top: calc(var(--hd-bar-h) + 1rem); font-size: .9rem; }
[data-view="front-page"] td[data-dd-field="picture_drawing"]:not(:empty)::before { left: .75rem; right: .75rem; top: .6rem; }
[data-view="front-page"] td[data-dd-field="picture_drawing"] { position: relative; }

/* Draw again while a drawing is under way: dimmed and still (the script disables it;
   the model refuses a second drawing all the same) */
[data-view="redraw"] button[type="submit"]:disabled,
[data-view="redraw"] .btn:disabled,
body:has([data-view="info"] [data-dd-field="picture_drawing"]:not(:empty)) [data-view="redraw"] button[type="submit"] {
  opacity: .5; cursor: progress; transform: none; box-shadow: none; pointer-events: none;
}

/* ================= a recipe ================= */
.hd-recipe { max-inline-size: 56rem; margin-inline: auto; }
.hd-recipe .view.detail .page-head h1 { font-size: clamp(1.9rem, 1.3rem + 2.2vw, 3rem); font-weight: 900; }

/* Keep the real detail and form sections for redraws. Share one visual row for
   their actions; the optional report still opens below it, in document flow. */
.hd-recipe-lead {
  display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .55rem;
  reading-flow: flex-visual;
}
.hd-recipe-lead > :is(.hd-recipe-timing, .hd-cooking-report) { display: contents; }
.hd-recipe .hd-recipe-timing :is(.page-head, .hd-times) { flex: 0 0 100%; max-width: none; margin: 0; box-sizing: border-box; }
.hd-recipe-timing h1 { overflow-wrap: anywhere; }
.hd-recipe-lead > .hd-quick,
.hd-recipe-lead .hd-recipe-edit,
.hd-recipe-lead > [data-view="tools"],
.hd-recipe-lead [data-view="tools"] .actions,
.hd-recipe-lead :is(.hd-cooked-toggle, .hd-cooked-locked) { margin: 0; }
.hd-recipe-lead .hd-recipe-edit { order: 1; }
.hd-recipe-lead > [data-view="tools"] { order: 2; padding: 0; }
.hd-recipe-lead .hd-cooking-report [data-view="cooked"] {
  order: 3; flex: 0 0 100%; min-width: 0; box-sizing: border-box; margin-block: .25rem 0;
}
.hd-recipe-lead :is(.hd-quick, .hd-recipe-edit, [data-view="tools"]) .btn,
.hd-recipe-lead .hd-cooking-report :is(.hd-cooked-toggle, .hd-cooked-locked > .btn) {
  width: auto; min-height: 2.1rem; padding: .3rem .7rem;
  font-size: .9rem; line-height: 1.2; text-transform: none;
}
.hd-recipe-lead .hd-cooked-locked { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .5rem; }
.hd-recipe-lead .hd-cooked-locked .hd-lock-note { margin: 0; }
.hd-recipe-lead .hd-cooked-locked .hd-lock-note > .view.text.note { padding-block: .15rem; }

.hd-recipe-ingredients { margin-block: .9rem 1.35rem; padding-block-start: .8rem; border-block-start: 1px solid var(--line); }
.hd-recipe-ingredients > .view.ingredient-lines { margin-block-end: 0; }
.hd-recipe-ingredients .card-head { margin-block-end: .55rem; }
.hd-recipe-ingredients .card-head h2 { margin: 0; }
.hd-recipe-overview { margin-block-end: 1.5rem; }
.hd-recipe-overview > .view { margin-block-end: 0; }
.hd-recipe-overview > .view + .view { margin-block-start: .9rem; }
.hd-recipe-overview :is([data-dd-field="stars_shown"], [data-dd-field="rating"]) {
  color: color-mix(in srgb, var(--hd-mustard) 65%, var(--ink)); font-weight: 700;
}
.hd-recipe .kit-figure { background: var(--hd-paper); }
.hd-recipe-summary { min-width: 0; }
.hd-recipe-summary .hd-recipe-sections { display: block; }
.hd-recipe-summary .hd-recipe-section { margin: 0; padding: 0; border: 0; }
.hd-recipe-summary .hd-recipe-section + .hd-recipe-section {
  margin-block-start: .75rem;
  padding-block-start: .75rem;
  border-block-start: 1px solid var(--line);
}
/* Only the groups own dividers. Suppress the kit's per-field and prose dividers. */
.hd-recipe-summary .hd-recipe-section > .f { min-width: 0; border: 0; padding: 0; }
.hd-recipe-summary .hd-recipe-section > .f > :is(dt, dd) { border: 0; }
.hd-recipe-extra { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 10rem), 1fr)); gap: .6rem 1.2rem; }
.hd-recipe-prose dd { white-space: pre-wrap; overflow-wrap: anywhere; }
.hd-recipe-facts dd { margin: 0; color: var(--muted); font-size: .9rem; line-height: 1.5; }
.hd-recipe-fact { display: inline-block; max-width: 100%; overflow-wrap: anywhere; }
.hd-recipe-fact-sep { margin-inline: .15em; }
/* A category output includes the preparation in its link. For an individual
   ingredient, the adjacent “Comes out” field shows the preparation on its own. */
.hd-recipe .fields [data-dd-field="makes_prepared"],
.hd-recipe .fields [data-dd-field="makes_any"] a {
  display: inline-block;
  width: fit-content;
  max-width: 100%;
  padding: .2rem .7rem;
  border-radius: var(--radius-tag, 999px);
  background: var(--accent-soft);
  color: var(--hd-accent-deep);
  font-weight: 700;
  overflow-wrap: anywhere;
}
.hd-recipe .fields [data-dd-field="makes_any"] a {
  text-decoration: underline;
  text-underline-offset: .16em;
}
.hd-recipe .fields [data-dd-field="makes_any"] a:hover { background: var(--hd-paper); }
[data-view="ingredients"] .table-wrap { border-left: 4px solid var(--hd-radish-soft); background: var(--hd-glass); }
[data-view="ingredients"] td[data-dd-field="amount"], [data-view="ingredients"] td[data-dd-field="unit"] { font-weight: 700; color: var(--hd-accent-deep); font-variant-numeric: tabular-nums; }

/* Ingredient amounts: a small segmented control above the grouped recipe table.
   The server supplies each display value. Only a row that has the selected
   conversion hides its written amount. Browsers without :has keep the original. */
.ingredient-lines .hd-measure { display: none; }
.ingredient-lines .hd-qty-weight,
.ingredient-lines .hd-qty-volume,
.ingredient-lines .hd-qty-weight-note { display: none; }
@supports selector(:has(*)) {
  .ingredient-lines .hd-measure {
    display: block; width: fit-content; max-width: 100%; min-width: 0;
    margin: 0 0 .8rem; padding: 0; border: 0;
  }
  .ingredient-lines:has(input[name="ingredient_measure"][value="weight"]:checked) .hd-ingredient-qty:has(.hd-qty-weight) .hd-qty-written,
  .ingredient-lines:has(input[name="ingredient_measure"][value="volume"]:checked) .hd-ingredient-qty:has(.hd-qty-volume) .hd-qty-written { display: none; }
  .ingredient-lines:has(input[name="ingredient_measure"][value="weight"]:checked) :is(.hd-qty-weight, .hd-qty-weight-note),
  .ingredient-lines:has(input[name="ingredient_measure"][value="volume"]:checked) .hd-qty-volume { display: inline; }
}
.hd-measure-options {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .15rem;
  padding: .2rem; background: var(--hd-paper); border: 1px solid var(--line);
  border-radius: var(--radius);
}
.hd-measure-options label { position: relative; min-width: 0; margin: 0; cursor: pointer; }
.hd-measure-options input[type="radio"] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; }
.hd-measure-options label > span {
  display: grid; place-items: center; min-height: 2.15rem; padding: .25rem .8rem;
  border: 1px solid transparent; border-radius: var(--radius-s, 8px);
  font: 600 .9rem/1.2 var(--font-body); text-align: center; color: var(--ink);
}
.hd-measure-options label:hover > span { background: var(--surface); }
.hd-measure-options input:checked + span {
  background: var(--accent-soft); color: var(--ink); font-weight: 750;
  border-color: color-mix(in srgb, var(--hd-accent-deep) 46%, var(--line));
}
.hd-measure-options input:focus-visible + span { outline: 2px solid var(--hd-accent-deep); outline-offset: 1px; }
@media (forced-colors: active) {
  .hd-measure-options input:checked + span { border-color: Highlight; }
  .hd-measure-options input:focus-visible + span { outline-color: Highlight; }
}

.ingredient-lines table { width: 100%; table-layout: fixed; }
.ingredient-lines .hd-ingredient-qty-col { width: clamp(5.75rem, 23%, 9rem); }
.ingredient-lines .hd-ingredient-category-col { width: 30%; }
.ingredient-lines td { vertical-align: top; overflow-wrap: anywhere; }
.ingredient-lines .hd-ingredient-qty { font-weight: 700; color: var(--hd-accent-deep); font-variant-numeric: tabular-nums; }
.ingredient-lines .hd-approx-mark { color: var(--hd-wood-deep); }
.hd-recipe .ingredient-lines:has(+ [data-view="approx-legend"]) { margin-block-end: 0; }
.hd-recipe .view[data-view="approx-legend"] {
  margin-block: .35rem 0;
  padding: 0 .75rem;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: var(--muted);
  font-size: .875rem;
  line-height: 1.4;
}
.hd-recipe [data-view="approx-legend"] p { margin: 0; color: inherit; }
.ingredient-lines .hd-ingredient-name > [data-dd-field="name"] { font-weight: 650; }
.ingredient-lines .hd-ingredient-preps { font-weight: 400; }
.ingredient-lines .hd-ingredient-name [title="inferred"],
[data-view="preparations"] td[data-dd-field="inferred_note"] { color: var(--muted); }
.ingredient-lines .hd-ingredient-category,
.ingredient-lines .hd-qty-weight-note { color: var(--muted); }
.ingredient-lines .hd-qty-weight-note { font-size: .9em; font-variant-numeric: tabular-nums; }
.ingredient-lines .hd-ingredient-optional { display: block; }
.ingredient-lines .hd-ingredient-group th {
  padding: .5rem .9rem; text-align: start; text-transform: none; white-space: normal;
  border-block: 1px solid var(--line); background: var(--hd-paper); color: var(--ink);
}
.hd-ingredient-group h3 {
  display: flex; align-items: center; gap: .45rem; margin: 0;
  font: 750 .88rem/1.35 var(--font-head); letter-spacing: 0; overflow-wrap: anywhere;
}
.hd-ingredient-group h3::before { content: ""; width: .75rem; height: 2px; flex: 0 0 auto; background: var(--hd-wood-deep); border-radius: 2px; }

/* Recipe-book and tip links sit together beside the ingredient. Both still
   lead to the ingredient's own page when scripts are unavailable. */
.hd-ingredient-links { display: inline-flex; flex-wrap: wrap; max-width: 100%; vertical-align: middle; }
.hd-recipes-for, .hd-tips-for {
  display: inline-grid;
  place-items: center;
  width: 1.75rem;
  height: 1.75rem;
  margin-inline-start: .25rem;
  vertical-align: middle;
  color: var(--hd-accent-deep);
  background: var(--accent-soft);
  border-radius: 50%;
  text-decoration: none;
}
.hd-recipes-for:hover, .hd-recipes-for[aria-expanded="true"],
.hd-tips-for:hover, .hd-tips-for[aria-expanded="true"] { color: var(--accent-ink); background: var(--accent); }
.hd-recipes-for:focus-visible, .hd-tips-for:focus-visible { outline-offset: 2px; }

/* A specific sub-recipe is a normal link, distinct from the preview buttons. */
.ingredient-lines .hd-component-recipe {
  display: flex; align-items: center; gap: .4rem;
  box-sizing: border-box; width: fit-content; max-width: 100%; min-height: 1.75rem;
  margin-block-start: .3rem; padding: .2rem .55rem;
  border-radius: var(--radius-s, 8px);
  background: var(--accent-soft); color: var(--hd-accent-deep);
  font-size: .9rem; font-weight: 650; line-height: 1.3; text-decoration: none;
}
.ingredient-lines .hd-component-recipe svg { flex: none; }
.ingredient-lines .hd-component-recipe [data-dd-field="component_recipe_title"] { text-decoration: underline; text-underline-offset: .15em; }
.ingredient-lines .hd-component-recipe:hover { background: var(--hd-paper); }

/* Inline tip notes span the table so the whole text fits on a phone. The script
   unhides the companion row and fills its body with a list of strong titles
   followed by paragraphs, or a loading / error message. */
.ingredient-lines .hd-ingredient-tip-row[hidden] { display: none; }
.ingredient-lines .hd-ingredient-tip-row > td { padding: .15rem .9rem .85rem; }
.hd-ingredient-tips-panel {
  padding: .7rem .95rem .8rem;
  border: 1px solid var(--line);
  border-inline-start: 3px solid var(--hd-carrot);
  border-radius: var(--radius-s, 8px);
  background: var(--hd-paper);
  color: var(--ink);
  line-height: 1.5;
  text-align: start;
  overflow-wrap: anywhere;
}
.hd-ingredient-tips-panel > h3 { margin: 0 0 .35rem; color: var(--hd-accent-deep); font-size: .85rem; font-weight: 800; }
.hd-ingredient-tips-panel ul { list-style: none; padding: 0; margin: 0; }
.hd-ingredient-tips-panel li + li { margin-top: .65rem; padding-top: .65rem; border-top: 1px solid var(--line); }
.hd-ingredient-tips-panel strong { display: block; font-weight: 800; }
.hd-ingredient-tips-panel p { margin: .15rem 0 0; max-width: 68ch; white-space: pre-wrap; }

/* The client step fills and opens this small top-layer panel; if the browser has
   no Popover API it stays hidden and the ingredient's real page is still available. */
.hd-ingredient-recipes-popover {
  display: none;
  position: fixed;
  inset: 0;
  margin: auto;
  box-sizing: border-box;
  width: min(24rem, calc(100% - 2rem));
  height: fit-content;
  max-height: min(76vh, 31rem);
  overflow: auto;
  padding: 0;
  border: 1px solid var(--line);
  border-top: 4px solid var(--accent);
  border-radius: var(--radius-lg, 18px);
  color: var(--ink);
  background: color-mix(in srgb, var(--hd-paper) 88%, white);
  box-shadow: var(--shadow-2, var(--shadow-lg));
  scroll-padding-block-start: 5rem;
}
.hd-ingredient-recipes-popover:popover-open { display: block; }
.hd-ingredient-recipes-head {
  position: sticky; inset-block-start: 0; z-index: 1;
  display: flex; justify-content: space-between; gap: .75rem; align-items: center;
  padding: .65rem .85rem .65rem 1rem;
  background: inherit; border-bottom: 1px solid var(--line);
}
.hd-ingredient-recipes-head h2 { margin: 0; font-size: 1.05rem; overflow-wrap: anywhere; }
.hd-ingredient-recipes-head .kit-x { flex: 0 0 auto; }
.hd-ingredient-recipes-body { padding: .65rem 1rem 1rem; overflow-wrap: anywhere; }
/* Keep the ingredient and category headings distinct from the recipe links. */
.hd-ingredient-recipes-body :is(h3, h4) {
  margin: .45rem 0 .15rem;
  padding: .45rem .65rem;
  border-inline-start: 3px solid var(--hd-wood-pale);
  border-radius: var(--radius-s, 8px);
  background: var(--surface);
  color: var(--ink);
  font: 750 .88rem/1.4 var(--font-head);
}
.hd-ingredient-recipes-body [data-recipes-for-kind="category"] :is(h3, h4) {
  border-inline-start-color: color-mix(in srgb, var(--accent) 55%, var(--line));
}
.hd-ingredient-recipes-body ul { list-style: none; margin: 0 0 .75rem; padding: 0; }
.hd-ingredient-recipes-body li { padding: .55rem 0; border-bottom: 1px solid var(--line); }
.hd-ingredient-recipes-body a { color: var(--hd-accent-deep); font-weight: 700; text-underline-offset: .16em; }
.hd-ingredient-recipes-body .hd-ingredient-recipes-meta { display: block; font-size: .88rem; color: var(--muted); }

/* Serving suggestions are separate from the ingredients and the cooking method.
   Keep the framework's table rows and field hooks for the recipe-book preview. */
.hd-recipe :is(.pairing-lines, .goes-with) {
  margin-block: 1.25rem;
  padding: .85rem clamp(.85rem, 2.4vw, 1.25rem);
  border: 1px solid var(--line);
  border-inline-start: 4px solid var(--hd-wood-pale);
  border-radius: var(--radius, 12px);
  background: color-mix(in srgb, var(--hd-glass) 80%, var(--hd-paper));
}
.hd-recipe .goes-with { border-inline-start-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.hd-recipe :is(.pairing-lines, .goes-with) .card-head { margin: 0 0 .35rem; }
.hd-recipe :is(.pairing-lines, .goes-with) h2 { margin: 0; font-size: 1.1rem; }
.hd-recipe :is(.pairing-lines, .goes-with) .table-wrap,
.hd-recipe :is(.pairing-lines, .goes-with) table { width: 100%; margin: 0; border: 0; border-radius: 0; box-shadow: none; background: transparent; overflow: visible; }
.hd-recipe :is(.pairing-lines, .goes-with) thead {
  position: absolute; width: 1px; height: 1px; padding: 0;
  clip: rect(0, 0, 0, 0); overflow: hidden; white-space: nowrap;
}
.hd-recipe :is(.pairing-lines, .goes-with) :is(table, tbody) { display: block; }
.hd-recipe :is(.pairing-lines, .goes-with) tbody tr {
  display: flex; flex-wrap: wrap; align-items: center; gap: .1rem .6rem;
  padding-block: .45rem; background: transparent;
}
.hd-recipe :is(.pairing-lines, .goes-with) tbody tr + tr { border-top: 1px solid var(--line); }
.hd-recipe :is(.pairing-lines, .goes-with) tbody td {
  display: block; padding: 0; border: 0; background: transparent;
  min-width: 0; white-space: normal; overflow-wrap: anywhere;
}
.hd-recipe :is(.pairing-lines, .goes-with) [data-dd-field="note"] { order: 3; flex: 0 0 100%; color: var(--muted); font-size: .92rem; }
.hd-recipe :is(.pairing-lines, .goes-with) td:empty { display: none; }
.hd-recipe :is(.pairing-lines, .goes-with) :is([data-dd-field="name_shown"], [data-dd-field="dish_title"]) { font-weight: 700; }
.hd-recipe :is(.pairing-lines, .goes-with) a:not(.hd-recipes-for) { text-underline-offset: .16em; }
.hd-recipe .pairing-lines :is(th, td)[data-dd-field]:not(:is([data-dd-field="name_shown"], [data-dd-field="note"], [data-dd-field="recipes_for"], [data-dd-field="category_recipes_for"], [data-dd-field="paired_recipe_label"])) { display: none; }
.hd-recipe .pairing-lines td:is([data-dd-field="recipes_for"], [data-dd-field="category_recipes_for"], [data-dd-field="paired_recipe_label"]):not(:has(a)) { display: none; }

/* A server-rendered link remains usable without the preview script. Give plain
   links the same book symbol; if the script supplies its SVG, use that instead. */
@supports (clip-path: path("M0 0H1V1Z")) {
  @media (forced-colors: none) {
    .hd-recipe .pairing-lines td:is([data-dd-field="recipes_for"], [data-dd-field="category_recipes_for"], [data-dd-field="paired_recipe_label"]) a:not(:has(svg)) {
      display: inline-grid; place-items: center; vertical-align: middle;
      width: var(--hd-pairing-target, 1.75rem); height: var(--hd-pairing-target, 1.75rem);
      border-radius: 50%; background: var(--accent-soft); color: var(--hd-accent-deep);
      font-size: 0; text-decoration: none;
    }
    .hd-recipe .pairing-lines td:is([data-dd-field="recipes_for"], [data-dd-field="category_recipes_for"], [data-dd-field="paired_recipe_label"]) a:not(:has(svg))::before {
      content: ""; width: 16px; height: 16px; background: currentColor;
      clip-path: path(evenodd, "M2 2H10Q13 2 13 5V15H5Q2 15 2 12Z M3.25 3.25V11H11.75V5Q11.75 3.25 10 3.25Z M3.25 12.25Q3.5 13.75 5 13.75H11.75V12.25Z M5.25 5H9.75V6.25H5.25Z M5.25 7.75H8.25V9H5.25Z");
    }
    .hd-recipe .pairing-lines td:is([data-dd-field="recipes_for"], [data-dd-field="category_recipes_for"], [data-dd-field="paired_recipe_label"]) a:not(:has(svg)):is(:hover, [aria-expanded="true"]) { color: var(--accent-ink); background: var(--accent); }
  }
}

/* The reverse list is a short dish index, not a second ingredient list. Keep the
   row link visible even if the table renderer puts it in the first field. */
.hd-recipe .goes-with [data-dd-field="dish_title"] { order: -2; }
.hd-recipe .goes-with [data-dd-field="dish_stars"] { color: var(--hd-mustard); font-weight: 700; letter-spacing: .04em; }
.hd-recipe .goes-with [data-dd-field="dish_times"] { color: var(--muted); font-size: .9rem; }
.hd-recipe .goes-with td[data-dd-field="dish_image"]:not(:has(a)) { display: none; }
.hd-recipe .goes-with td[data-dd-field="dish_image"] a { font-size: 0; }
.hd-recipe .goes-with td[data-dd-field="dish_image"] a::after { content: "Open recipe"; font-size: .9rem; font-weight: 650; text-decoration: underline; }

/* Cooking methods are the only route to instructions. The same card holds the
   framework's fallback form or the script's method buttons, then the live results. */
.hd-method {
  margin: 1.75rem 0 clamp(1.75rem, 4vw, 3rem);
  padding: clamp(1rem, 2.4vw, 1.5rem);
  background: color-mix(in srgb, var(--hd-glass) 80%, var(--hd-paper));
  border: 1px solid var(--line);
  border-top: 4px solid var(--hd-wood-pale);
  border-radius: var(--radius-lg, 18px);
  box-shadow: var(--shadow);
}
.hd-method-head h2 { margin: 0 0 1rem; font-weight: 800; }
.hd-method > .view { margin: 0; }
.hd-method > .view + .view { margin-top: 1rem; }
.hd-method > .hd-source { display: none; }
.hd-method [data-view="get-steps"], .hd-method [data-view="find-methods"] {
  max-width: none;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}
.hd-method [data-view="get-steps"] h2 { font-size: 1.05rem; font-weight: 800; margin: 0 0 .3rem; }
.hd-method [data-view="get-steps"] .muted, .hd-method [data-view="find-methods"] .muted { max-width: 62ch; }
.hd-method [data-view="get-steps"] .radios .check:focus-within { outline: 2px solid var(--accent); outline-offset: -2px; }
.hd-method [data-view="steps-coming"] {
  padding: .55rem .85rem;
  background: var(--hd-carrot-soft);
  border-radius: var(--radius);
  color: var(--ink);
  font-size: .95rem;
}
.hd-method [data-view="steps-coming"] p { margin: 0; color: inherit; }
.hd-method [data-view="steps-coming"] p:last-child::after { content: ""; display: inline-block; width: .45rem; height: .45rem; margin-inline-start: .45rem; border-radius: 50%; background: var(--hd-carrot); vertical-align: .13em; animation: hd-typing 1.2s ease-in-out infinite; }

/* "Get instructions for: <method> · <method> · …" (app.js draws these in get-steps). */
.hd-method-picks { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem .1rem; margin: .65rem 0 .1rem; }
.hd-method-lead { font-family: var(--font-head); font-weight: 800; margin-right: .5rem; }
.hd-method-sep { color: var(--hd-carrot); font-weight: 900; padding: 0 .25rem; opacity: .75; -webkit-user-select: none; user-select: none; }
.btn.hd-method-btn {
  position: relative; display: inline-flex; align-items: center; gap: .4rem;
  border-radius: 999px; padding-inline: .95rem; font-weight: 700;
  transition: background var(--motion-fast, .12s) var(--ease), border-color var(--motion-fast, .12s), color var(--motion-fast, .12s), transform var(--motion-fast, .12s) var(--ease);
}
.btn.hd-method-btn:hover { transform: translateY(-1px); }
/* not written yet: a clean dashed outline, ready to be cut */
.btn.hd-method-btn[data-method-state="new"], .btn.hd-method-btn[data-method-state="none"] { background: color-mix(in srgb, var(--surface) 70%, transparent); border: 1px dashed color-mix(in oklab, var(--accent) 55%, var(--line)); color: var(--ink); }
.btn.hd-method-btn[data-method-state="new"]:hover, .btn.hd-method-btn[data-method-state="none"]:hover { background: var(--accent-soft); border-style: solid; border-color: var(--accent); }
/* Being written: carrot, with the framework's leading busy spinner. */
.btn.hd-method-btn[data-method-state="writing"] { background: var(--hd-carrot-soft); border: 1px solid transparent; color: var(--hd-carrot); cursor: progress; }
/* written: herb green with a tick, opens the instructions */
.btn.hd-method-btn[data-method-state="written"] { background: var(--accent-soft); border: 1px solid color-mix(in oklab, var(--accent) 45%, transparent); color: var(--hd-accent-deep); }
.btn.hd-method-btn[data-method-state="written"]:not([aria-busy="true"])::before { content: "✓"; font-size: .85em; font-weight: 900; }
.btn.hd-method-btn[data-method-state="written"]:hover { background: color-mix(in oklab, var(--accent-soft) 70%, var(--accent)); }
/* the assistant could not answer: try again */
.btn.hd-method-btn[data-method-state="failed"] { background: color-mix(in srgb, var(--warn) 10%, var(--surface)); border: 1px dashed var(--warn); color: var(--warn); }
.btn.hd-method-btn[data-method-state="failed"]:not([aria-busy="true"])::before { content: "↻"; font-weight: 900; }
.btn.hd-method-btn[aria-busy="true"] { cursor: progress; }
.btn.hd-method-btn:disabled { opacity: .6; transform: none; }
.hd-method-status { margin-top: .6rem; }
.hd-method [data-view="find-methods"] button[type=submit], .hd-method [data-view="find-methods"] .actions .btn { border-radius: 999px; padding-inline: 1.4rem; }

/* The assistant's numbered lines keep their breaks and a comfortable reading width. */
.hd-method [data-view="steps"] .card-head { margin-bottom: .65rem; }
.hd-method [data-view="steps"] .card-head h2 { font-size: 1.1rem; font-weight: 800; }
.hd-method [data-view="steps"] .kit-acc { border-left: 4px solid var(--accent-soft); background: var(--hd-glass); scroll-margin-block: 1rem 5rem; transition: border-color var(--motion-fast, .12s); }
.hd-method [data-view="steps"] .kit-acc[open] { border-left-color: var(--accent); }
.hd-method [data-view="steps"] .kit-acc-title { font-family: var(--font-head); font-weight: 800; overflow-wrap: anywhere; }
.hd-method [data-view="steps"] summary:focus-visible { outline-offset: -3px; }
.hd-method [data-view="steps"] .kit-acc-fields { grid-template-columns: minmax(0, 1fr); gap: .9rem; margin-bottom: 0; }
.hd-method [data-view="steps"] [data-dd-field="instructions_shown"] { color: var(--ink); white-space: pre-wrap; overflow-wrap: anywhere; font-size: 1.04rem; line-height: 1.75; max-width: 68ch; }
.hd-method [data-view="steps"] [data-dd-field="written_at"] { color: var(--muted); font-size: .85rem; }
.hd-method [data-view="steps"] .empty { align-items: flex-start; padding: .85rem 1rem; }
.hd-method [data-view="steps"] .empty-mark { display: none; }

/* Fixed equipment guidance, set apart from the assistant's instructions. */
.recipe-steps .hd-method-caution {
  display: flex;
  align-items: flex-start;
  gap: .55rem;
  margin-block: 0 .9rem;
  padding: .6rem clamp(.6rem, 2vw, .9rem);
  border: 1px solid var(--line);
  border-radius: var(--radius-s, 8px);
  background: var(--hd-paper);
  color: var(--ink);
  font-size: .95rem;
  line-height: 1.45;
}
.hd-method-caution svg { flex: none; margin-block-start: .08em; color: var(--muted); }
.hd-method-caution p { min-width: 0; margin: 0; color: inherit; overflow-wrap: anywhere; }

/* Recipe and method times share a small, semantic comparison table. The
   table reads the view's formatted values; setting and storage stay separate
   from the four timed columns. */
.hd-times {
  margin-block-start: 1rem;
  min-width: 0; max-width: 48rem;
  border: 1px solid var(--line); border-radius: var(--radius, 12px);
  border-block-start: 3px solid var(--hd-wood-pale);
  background: var(--surface);
}
.hd-times-table-wrap { overflow-x: auto; border-radius: inherit; }
.hd-times-table { width: 100%; min-width: 14rem; margin: 0; border: 0; border-collapse: collapse; }
.hd-times-table caption {
  padding: .65rem .85rem; text-align: start; color: var(--ink);
  font: 800 .92rem/1.25 var(--font-head);
}
.hd-times-table th, .hd-times-table td {
  padding: .45rem clamp(.35rem, 1.4vw, .85rem); border: 0;
  vertical-align: top; text-align: start; line-height: 1.25;
}
.hd-times-table thead th {
  position: static; text-transform: none; letter-spacing: 0; white-space: normal;
  font: 700 .8rem/1.25 var(--font-body); color: var(--muted); background: var(--hd-paper);
}
.hd-times-table tbody th { font-size: .9rem; font-weight: 750; text-transform: none; letter-spacing: 0; color: var(--ink); background: transparent; }
.hd-times-table td { font-size: .94rem; font-variant-numeric: tabular-nums; background: transparent; }
.hd-times-table tbody tr { border-top: 1px solid var(--line); }
.hd-times-table .hd-time-estimate > th { max-width: 14ch; overflow-wrap: anywhere; }
.hd-times-table .hd-time-estimate td { font-weight: 650; }
.hd-times-table .hd-time-reported { background: color-mix(in srgb, var(--accent-soft) 42%, var(--surface)); }
.hd-time-reported small { display: block; margin-top: .15rem; color: var(--muted); font-size: .78rem; font-weight: 500; }
.hd-times-table .hd-time-total { border-inline-start: 1px solid var(--line); }
.hd-time-missing { color: var(--muted); font-weight: 400; }
.hd-time-storage { display: flex; align-items: center; flex-wrap: wrap; gap: .35rem .65rem; padding: .55rem .85rem; color: var(--ink); font-size: .9rem; overflow-wrap: anywhere; }
.hd-times-table-wrap + .hd-time-storage { border-top: 1px solid var(--line); }
.hd-time-setting { font-weight: 700; }
.hd-keeps-for { color: var(--muted); }
.hd-time-guess sup { margin-inline-start: .1em; color: var(--hd-wood-deep); font-size: .85em; font-weight: 800; line-height: 0; }
.hd-time-key { margin: 0; padding: .45rem .85rem; border-top: 1px dashed var(--line); color: var(--muted); font-size: .8rem; }

/* Optional cooked report: the client inserts .hd-cooked-toggle before the view
   and hides the view until opened. Without it the original form stays visible. */
.hd-cooking-report .hd-cooked-toggle[hidden],
.hd-cooking-report [data-view="cooked"][hidden] { display: none; }
.hd-cooked-locked .hd-lock-note .actions { margin: 0; }
.hd-cooked-locked .hd-lock-note a.btn {
  display: inline; min-height: 0; padding: 0; border: 0;
  background: transparent; box-shadow: none; transform: none;
  color: var(--hd-accent-deep); font-size: .92rem; line-height: 1.45;
  white-space: normal; text-align: start; text-transform: none;
  text-decoration: underline; text-underline-offset: .16em;
}
.hd-cooking-report [data-view="cooked"] {
  padding: .85rem; margin-bottom: 1rem;
  border-block-start: 3px solid var(--hd-wood-pale);
}
.hd-cooking-report [data-view="cooked"] .form fieldset {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .65rem .45rem; margin-bottom: .7rem;
}
.hd-cooking-report [data-view="cooked"] :is(.field:has([name="recipe_method_id"]), fieldset > legend) { grid-column: 1 / -1; }
.hd-cooking-report [data-view="cooked"] :is(input[type="number"], select) { width: 100%; min-width: 0; }
.hd-cooking-report [data-view="cooked"] input[type="number"] { padding-inline: .45rem; }
.hd-cooking-report [data-view="cooked"] .form .actions { margin: 0; padding-top: .65rem; }
.hd-cooking-report [data-view="cooked"] button[type="submit"] { width: 100%; border-radius: 999px; }
/* Once the client adds Skip, let the two actions share the row. */
.hd-cooking-report [data-view="cooked"] .actions:has(.hd-cooked-skip) { flex-wrap: wrap; gap: .5rem; }
.hd-cooking-report [data-view="cooked"] .actions:has(.hd-cooked-skip) .btn { flex: 1 1 auto; width: auto; border-radius: 999px; }
.hd-recipe [data-view="my-cooked"] { margin-bottom: 1.15rem; }
.hd-recipe [data-view="my-cooked"] .card-head { margin-bottom: .45rem; }
.hd-recipe [data-view="my-cooked"] .kit-body { padding: .7rem .85rem; }
.hd-recipe [data-view="my-cooked"] .kit-card::before { display: none; }
.hd-recipe [data-view="my-cooked"] .kit-title { font-size: .95rem; }
.hd-recipe [data-view="my-cooked"] .kit-title a { color: var(--hd-accent-deep); text-decoration: underline; text-underline-offset: .14em; }
.hd-recipe [data-view="my-cooked"] .empty { padding: .55rem .85rem; align-items: start; font-size: .9rem; }
.hd-recipe [data-view="my-cooked"] .empty-mark { display: none; }
.hd-quick:not(:has(> .view)) { display: none; }

/* an optional ingredient: "(optional)", quieter, its dot hollow */
.dish-ing-optional { font-style: italic; font-size: .85em; color: var(--muted); font-weight: 400; }
.dish-ingredients li.is-optional { color: color-mix(in srgb, var(--ink) 78%, var(--muted)); }
.dish-ingredients li.is-optional::before { background: transparent; border: 1.5px solid var(--hd-carrot); width: .32rem; height: .32rem; }
[data-view="ingredients"] [data-dd-field="optional_note"] { font-style: italic; font-size: .88rem; color: var(--muted); }
.hd-quick .view { margin: 0; }
.hd-quick .form-view { padding: 0; border: 0; background: transparent; box-shadow: none; }
.hd-quick .form .actions { margin: 0; padding: 0; border: 0; }
.hd-quick .btn,
.hd-cooking-report .hd-cooked-toggle,
.hd-cooked-locked > .btn { border-radius: 999px; }

/* Preparation management: distinguish the order and the effective cup weight
   from the comparison figures without replacing the kit's tables or forms. */
[data-view="preparations"] td[data-dd-field="position"],
[data-view="densities"] td[data-dd-field="grams_per_cup"],
.view.detail[data-view="density"] [data-dd-field="density_shown"] {
  color: var(--hd-accent-deep); font-weight: 700; font-variant-numeric: tabular-nums;
}
[data-view="densities"] td[data-dd-field="compact_gpc"],
[data-view="densities"] td[data-dd-field="factor_estimate"] {
  color: var(--muted); font-variant-numeric: tabular-nums;
}

/* ================= recipe submissions ================= */
[data-view="submission"].settings .form fieldset { grid-template-columns: minmax(0, 1fr); }
[data-view="submission"] textarea[name="text"] { min-height: 15rem; font-size: 1.05rem; line-height: 1.55; }
.hd-variation-page [data-view="original"] .kit-record { max-width: 48rem; }
.hd-variation-page [data-view="original"].has-media .kit-record { grid-template-columns: minmax(0, 8rem) minmax(0, 1fr); gap: 1rem; }
.hd-variation-page [data-view="original"] .kit-figure { aspect-ratio: 1; }
.hd-variation-page [data-view="original"] .kit-figure img { width: 100%; height: 100%; object-fit: cover; }
.hd-variation-page [data-view="ingredients"] .table-wrap { overflow-x: auto; box-shadow: none; }
.hd-variation-page [data-view="ingredients"] th,
.hd-variation-page [data-view="ingredients"] td { padding: .55rem .45rem; }
.hd-variation-page [data-view="ingredients"] td[data-dd-field="name"] { overflow-wrap: anywhere; }

.hd-submission-page { max-width: 52rem; margin-inline: auto; }
.hd-submission-page .view { margin-bottom: 1.25rem; }
.hd-submission-page [data-view="status"] .page-head { margin-bottom: .85rem; }
.hd-submission-page [data-view="status"] .fields {
  background: var(--hd-glass);
  border: 1px solid var(--line);
  border-top: 4px solid var(--hd-wood-pale);
  box-shadow: var(--shadow);
}
.hd-submission-page .f:has([data-dd-field="status_note"], [data-dd-field="guessed_notice"]) { grid-column: 1 / -1; }
.hd-submission-page [data-dd-field="status_note"] { font-size: 1.1rem; font-weight: 650; }
.hd-submission-page [data-view="next"] { padding: 0; }
.hd-submission-page [data-view="components"] {
  padding: clamp(.75rem, 2vw, 1.1rem);
  border: 1px solid var(--line);
  border-inline-start: 4px solid var(--hd-wood-pale);
  border-radius: var(--radius, 12px);
  background: var(--hd-paper);
}
.hd-submission-page [data-view="components"] .card-head { margin-bottom: .55rem; }
.hd-submission-page [data-view="components"] h2 { margin: 0; font-size: 1.15rem; }
.hd-submission-page [data-view="components"] .kit-rows { gap: .5rem; }
.hd-submission-page [data-view="components"] .kit-card { background: var(--surface); box-shadow: none; }
.hd-submission-page [data-view="components"] .kit-card:hover { transform: none; border-color: var(--accent); }
.hd-submission-page [data-view="components"] .kit-card:focus-within { outline: 2px solid var(--hd-accent-deep); outline-offset: 2px; }
.hd-submission-page [data-view="components"] .kit-card::before,
.hd-submission-page [data-view="components"] .kit-card::after { display: none; }
.hd-submission-page [data-view="components"] .kit-body {
  min-width: 0; padding: .65rem .85rem; gap: .2rem .6rem; overflow-wrap: anywhere;
}
.hd-submission-page [data-view="components"] .kit-title { font-size: 1rem; }
.hd-submission-page [data-view="components"] .kit-title a { color: var(--hd-accent-deep); text-decoration: underline; text-underline-offset: .15em; }
.hd-submission-page [data-view="components"] [data-dd-field="makes_name"] .kit-value { color: var(--ink); font-weight: 650; }
.hd-submission-page [data-view="components"] .hd-card-times { padding-top: .3rem; }
.hd-submission-page [data-view="retry"] { background: var(--hd-paper); }
.hd-submission-page [data-view="text"] { margin-top: 2rem; }
.hd-submission-page [data-view="text"] .page-head { margin-bottom: .5rem; }
.hd-submission-page [data-view="text"] .page-head h1 { font-size: 1.2rem; }
.hd-submission-page [data-view="text"] [data-dd-field="text"] { white-space: pre-wrap; overflow-wrap: anywhere; }

/* ================= my kitchen ================= */
.hd-kitchen [data-view="submissions"] .kit-accordion { background: transparent; }
.hd-kitchen [data-view="submissions"] .kit-acc > summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: .2rem .7rem;
  padding: .65rem .8rem;
}
.hd-kitchen [data-view="submissions"] .kit-acc-title { overflow-wrap: anywhere; font-weight: 650; font-size: .95rem; }
.hd-kitchen [data-view="submissions"] .kit-acc-tags { grid-column: 2; margin: 0; justify-content: flex-start; }
.hd-kitchen [data-view="submissions"] .kit-acc-tags:empty { display: none; }

/* ================= public cook profiles and kitchen levels ================= */
.hd-profile {
  padding: clamp(1rem, 3vw, 2rem);
  border: 1px solid var(--line);
  border-block-start: 4px solid var(--hd-wood-pale);
  border-radius: var(--radius-lg, 18px);
  background: var(--hd-glass);
  box-shadow: var(--shadow);
}
.hd-profile-head { display: flex; flex-wrap: wrap; align-items: center; gap: .85rem 1.15rem; }
.hd-avatar {
  --hd-avatar-size: 32px;
  display: inline-grid; grid-template: minmax(0, 1fr) / minmax(0, 1fr);
  box-sizing: border-box; inline-size: var(--hd-avatar-size); block-size: var(--hd-avatar-size);
  flex: 0 0 auto; overflow: hidden; vertical-align: middle;
  border-radius: 50%; background: var(--accent-soft); color: var(--hd-accent-deep);
  font: 800 .82rem/1 var(--font-head); text-transform: uppercase;
}
.hd-avatar-large {
  --hd-avatar-size: 96px;
  box-shadow: 0 0 0 1px var(--line);
  font-size: 2rem;
}
.hd-avatar > * { grid-area: 1 / 1; }
.hd-avatar-initial { place-self: center; }
.hd-avatar > img { position: relative; display: block; width: 100%; height: 100%; object-fit: cover; }
.hd-profile-identity { flex: 1 1 16rem; min-width: 0; }
.hd-profile-name { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .75rem; }
.hd-profile-name h1 { margin: 0; overflow-wrap: anywhere; }
.hd-profile-meta { display: flex; flex-wrap: wrap; gap: .1rem .7rem; margin: .25rem 0 0; color: var(--muted); }
.hd-profile-meta strong { color: var(--ink); }
.hd-profile-about { margin-block-start: 1rem; padding-block-start: .85rem; border-block-start: 1px solid var(--line); }
.hd-profile-bio, .hd-profile-web { margin: 0; overflow-wrap: anywhere; }
.hd-profile-bio { white-space: pre-wrap; max-width: 66ch; }
.hd-profile-bio + .hd-profile-web { margin-block-start: .6rem; }
.hd-profile-web a { font-weight: 650; }
.hd-cook-page [data-view="your-level"] { padding: .85rem 1.15rem; border-radius: var(--radius-s, 8px); background: var(--hd-paper); overflow-wrap: anywhere; }
.hd-cook-page [data-view="your-level"] h2 { font-size: 1.15rem; }
.hd-cook-page [data-view="reviews"] [data-dd-field="review"] {
  display: block; flex-basis: 100%; order: 5; -webkit-line-clamp: unset;
  overflow: visible; white-space: pre-wrap; overflow-wrap: anywhere;
  margin: 0; max-width: 66ch; color: var(--ink);
}
.hd-cook-page [data-view="reviews"] [data-dd-field="review"] .kit-label { display: none; }
.hd-cook-page .kit-title, .hd-cook-page .kit-meta { overflow-wrap: anywhere; }
.hd-cook-page .empty { padding-block: .9rem; align-items: flex-start; }
.hd-cook-page .empty-mark { display: none; }

.hd-chef-badge.tag {
  display: inline-block; margin-inline-start: .4rem;
  border: 1px solid color-mix(in srgb, var(--hd-herb) 24%, var(--line));
  background: var(--accent-soft); color: var(--hd-accent-deep);
  font-size: .75rem; line-height: 1.3; white-space: nowrap; text-transform: none;
}
.hd-chef-badge.tag.is-head {
  border-color: color-mix(in srgb, var(--hd-mustard) 38%, var(--line));
  background: color-mix(in srgb, var(--hd-mustard) 22%, var(--surface));
  color: color-mix(in srgb, var(--hd-wood-deep) 65%, var(--ink));
}
.hd-profile-name .hd-chef-badge, .hd-review-byline .hd-chef-badge { margin-inline-start: 0; }
.hd-review-byline { display: inline-flex; flex-wrap: wrap; align-items: center; gap: .2rem .5rem; max-width: 100%; overflow-wrap: anywhere; }
.hd-member-name { display: inline-flex; align-items: center; gap: .45rem; min-width: 0; }
.hd-member-name > [data-dd-field="member_name"] { min-width: 0; }
.hd-discussion .hd-member-name { font-weight: 700; }
.hd-discussion td { vertical-align: top; overflow-wrap: anywhere; }
.hd-discussion td[data-dd-field="shown_body"] { min-width: 12ch; white-space: pre-wrap; }
.hd-discussion td[data-dd-field="created_at"] { font-size: .9rem; }
.hd-discussion td[data-dd-field="reply_count"] a { text-decoration: underline; text-underline-offset: .16em; }
.view a[data-dd-field="website_domain"],
.view :is([data-dd-field="author_name"], [data-dd-field="recipe_author"], [data-dd-field="member_name"]) a { text-decoration: underline; text-underline-offset: .16em; }

.hd-head-chefs {
  display: flex; flex-wrap: wrap; align-items: center; gap: .65rem 1.15rem;
  padding: .75rem 1rem; border-block: 1px solid var(--line); background: var(--hd-glass);
}
.hd-head-chefs h2 { margin: 0; font-size: 1rem; }
.hd-chef-list { display: flex; flex-wrap: wrap; gap: .4rem .65rem; list-style: none; margin: 0; padding: 0; min-width: 0; }
.hd-chef-list li { min-width: 0; }
.hd-chef-list a {
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .24rem .75rem .24rem .28rem;
  border: 1px solid var(--line); border-radius: var(--radius-tag, 999px);
  background: var(--surface); color: var(--ink); font-weight: 650; overflow-wrap: anywhere;
}
.hd-chef-list .hd-avatar { --hd-avatar-size: 1.65rem; }
.hd-chef-list a:hover { border-color: var(--accent); }

/* A native disabled control stays visibly available to unlock. The note is
   adjacent and separately readable even when the control cannot take focus. */
.hd-locked-controls { min-width: 0; margin: 0; padding: 0; border: 0; }
.hd-comment-entry.is-locked { margin-block-end: 1.4rem; }
.hd-comment-entry.is-locked .form-view { margin-block-end: .5rem; }
.hd-locked-controls textarea { width: 100%; resize: none; }
.hd-lock-note > .view.text.note {
  margin: 0; padding: .45rem .75rem; border-inline-start: 3px solid var(--hd-carrot);
  border-radius: var(--radius-s, 8px); background: var(--hd-paper); color: var(--ink);
}
.hd-lock-note p { margin: 0; color: inherit; font-size: .92rem; }
.hd-member-edit { max-width: 54rem; }
.hd-member-edit:has(.hd-website-lock) [data-view="profile"] .field:has([name="website"]) { display: none; }
.hd-website-lock {
  display: grid; gap: .35rem; margin-block-end: 1.25rem; padding: .85rem 1rem;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--hd-glass);
}
.hd-website-lock input { width: 100%; max-width: 23rem; }
.hd-website-lock .hd-lock-note { margin-block-start: .15rem; }
.hd-member-edit [data-view="profile"] .field:has(textarea[name="bio"]) { grid-column: 1 / -1; }
/* Keep the footer action visible even before the kit's scroll reveal. */
.hd-member-edit [data-view="view-profile"].kit-reveal { opacity: 1; transform: none; }
.hd-member-edit [data-view="view-profile"] a.btn {
  color: var(--ink); background: transparent; border-color: var(--line);
}
.hd-member-edit [data-view="view-profile"] a.btn:is(:hover, :focus-visible) { background: var(--hover); }

/* Member photo controls share the settings card and lock-note treatment. The
   selected crop takes the place of the current portrait without moving the form. */
.hd-photo-card {
  padding: .85rem 1rem; margin-block-end: 1.25rem;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--hd-glass);
}
.hd-photo-card h2 { margin: 0 0 .75rem; font-size: 1.05rem; }
.hd-photo-row { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1rem; }
.hd-photo-display { flex: 0 0 auto; }
.hd-photo-preview:not([hidden]) ~ .member-photo { display: none; }
.hd-photo-display .hd-photo-preview[hidden] { display: none; }
.hd-photo-controls { flex: 1 1 12rem; min-width: 0; }
.hd-photo-actions, .hd-photo-upload:not([hidden]) { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .55rem; }
.hd-photo-card .view:not(.text.note) { margin: 0; }
.hd-photo-card .form-view { padding: 0; border: 0; background: transparent; box-shadow: none; }
/* The photo form's only field is a hidden upload payload, not a user input. */
.hd-member-edit .hd-photo-upload [data-view="photo"] .help { display: none; }
.hd-photo-card .form fieldset, .hd-photo-card .form .actions { margin: 0; padding: 0; border: 0; }
.hd-photo-card .btn { text-transform: none; }
.hd-photo-card [data-view="photo-remove"] .btn:not(:disabled) { color: var(--ink); border-color: var(--line); background: var(--surface); }
.hd-photo-card [data-view="photo-remove"] .btn:not(:disabled):is(:hover, :focus-visible) { color: var(--danger); border-color: var(--danger); }
.hd-photo-card .hd-lock-note, .hd-photo-card noscript .help { margin-block-start: .5rem; }
.hd-photo-status { margin: .35rem 0 0; color: var(--muted); font-size: .92rem; overflow-wrap: anywhere; }
.hd-photo-status:empty { margin: 0; }
.hd-photo-status.is-error { color: var(--danger); }

@keyframes hd-typing { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  .hd-steam { animation: none; opacity: .5; }
  [data-view="results"] .kit-card.is-front { animation: none; }
  [data-view="results"] .kit-card.is-front:hover .kit-media img { transform: none; }
  /* a still bar, the segment resting in the middle, with the same words */
  [data-dd-field="picture_drawing"]:not(:empty)::before { animation: none; background-position: 50% 0, 0 0, 0 0; }
}
