/* Wix Madefor Display - the site's voice. SIL Open Font License; bundled
   in web/fonts so the site never needs the internet. One variable file
   per character set; the browser picks whichever it needs. */
@font-face {
  font-family: "Wix Madefor Display";
  src: url("fonts/wixmadefordisplay-latin.woff2") format("woff2");
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Wix Madefor Display";
  src: url("fonts/wixmadefordisplay-latin-ext.woff2") format("woff2");
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Wix Madefor Display";
  src: url("fonts/wixmadefordisplay-vietnamese.woff2") format("woff2");
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1,
    U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329,
    U+1EA0-1EF9, U+20AB;
}

/* Tonight's Recipe — warm, food-forward, light.
   The chrome stays quiet on near-white paper; the food photos supply the colour.
   One accent family: paprika. */

:root {
  /* Coolors palette: #264653 #2A9D8F #E9C46A #F4A261 #E76F51.
     The coral and the teal are used a shade deeper wherever white text
     sits on them - at full strength the text is too pale to read. */
  --paper:      #FDF8F0;
  --panel:      #F7EAD5;
  --card:       #FFFCF6;
  --ink:        #264653;   /* charcoal */
  --ink-soft:   #4E717E;
  --ink-faint:  #6E8C99;
  --rule:       #EADCC6;
  --paprika:    #B85840;   /* burnt sienna, deepened for white text */
  --paprika-dp: #9D4B37;
  --ember:      #FBE7D6;   /* sandy tint, behind photos while they load */
  --sage:       #238579;   /* persian green, deepened for white text */
  --plum:       #264653;   /* charcoal - the "hard" badge */
  --amber:      #E9C46A;   /* saffron - the "medium" badge, dark text */
  --sand:       #F4A261;   /* sandy brown - the header sprigs */

  /* One family everywhere. The three names are kept so the rest of the
     stylesheet does not need rewriting. */
  --serif: "Wix Madefor Display", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, system-ui, sans-serif;
  --sans:  "Wix Madefor Display", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, system-ui, sans-serif;
  --mono:  "Wix Madefor Display", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, system-ui, sans-serif;

  --r: 10px;
  --shadow: 0 1px 2px rgba(36,26,21,.05), 0 8px 24px -14px rgba(36,26,21,.28);
}

* { box-sizing: border-box; }

/* Anything the script hides stays hidden: the layout rules below set
   `display`, which would otherwise outrank the browser's own [hidden] rule. */
[hidden] { display: none !important; }

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 17px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p, ul, ol, figure { margin: 0; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }

:focus-visible {
  outline: 3px solid var(--paprika);
  outline-offset: 2px;
  border-radius: 4px;
}

.skip {
  position: absolute; left: -9999px; top: 0;
  background: var(--ink); color: var(--paper);
  padding: 12px 18px; z-index: 60; text-decoration: none;
}
.skip:focus { left: 8px; top: 8px; }

/* ---------------- header ---------------- */

.head {
  border-bottom: 1px solid var(--rule);
  background: var(--paper);
}
.head-in {
  max-width: 1360px;
  margin: 0 auto;
  padding: 26px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.head-name {
  font: 400 29px/1.1 var(--serif);
  letter-spacing: -.015em;
}
.head-tag {
  margin-top: 4px;
  color: var(--ink-soft);
  font-size: 15px;
}

/* ---------------- buttons ---------------- */

.btn {
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 11px 22px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  background: none;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
.btn-solid { background: var(--paprika); color: #fff; }
.btn-solid:hover { background: var(--paprika-dp); }
.btn-quiet { border-color: var(--rule); background: var(--card); color: var(--ink); }
.btn-quiet:hover { border-color: var(--paprika); color: var(--paprika); }
.btn-danger { border-color: var(--rule); color: var(--paprika); background: var(--card); }
.btn-danger:hover { background: var(--paprika); border-color: var(--paprika); color: #fff; }
.btn[disabled] { opacity: .5; cursor: default; }

.linkish {
  border: 0; background: none; padding: 0;
  color: var(--ink-soft);
  font-size: 14px;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.linkish:hover { color: var(--paprika); }

/* ---------------- shell ---------------- */

.wrap {
  max-width: 1360px;
  margin: 0 auto;
  padding: 34px 32px 90px;
  display: grid;
  grid-template-columns: 306px minmax(0, 1fr);
  gap: 52px;
  align-items: start;
}

/* ---------------- criteria panel ---------------- */

.panel {
  background: var(--panel);
  border-radius: 16px;
  padding: 26px 24px 30px;
  position: sticky;
  top: 24px;
  /* the panel is taller than a short window, so let it scroll inside itself --
     otherwise the last controls sit off-screen and can never be reached */
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--rule) transparent;
}
.panel::-webkit-scrollbar { width: 11px; }
.panel::-webkit-scrollbar-track { background: transparent; }
.panel::-webkit-scrollbar-thumb {
  background: var(--rule);
  border-radius: 999px;
  border: 3px solid var(--panel);
}
.panel::-webkit-scrollbar-thumb:hover { background: var(--ink-faint); }
.panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 18px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--rule);
}
.panel-title { font: 400 20px/1.2 var(--serif); }
/* Keep the "Start over" link on one line. */
.panel-head .linkish { white-space: nowrap; flex: 0 0 auto; }

.field { display: block; }
.field + .field { margin-top: 26px; }

.field-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 9px;
  font-family: var(--mono);
}
.field-help {
  font-size: 13px;
  color: var(--ink-faint);
  margin: -4px 0 9px;
}
.field-value {
  display: block;
  font: 400 24px/1.2 var(--serif);
  color: var(--ink);
  margin-bottom: 10px;
}

/* slider */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  background: transparent;
  margin: 4px 0 6px;
  cursor: pointer;
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 4px; border-radius: 999px; background: var(--rule);
}
input[type="range"]::-moz-range-track {
  height: 4px; border-radius: 999px; background: var(--rule);
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 22px; height: 22px; margin-top: -9px;
  border-radius: 50%;
  background: var(--paprika);
  border: 3px solid var(--panel);
  box-shadow: 0 1px 4px rgba(36,26,21,.3);
}
input[type="range"]::-moz-range-thumb {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--paprika);
  border: 3px solid var(--panel);
  box-shadow: 0 1px 4px rgba(36,26,21,.3);
}
.ticks {
  display: flex;
  justify-content: space-between;
  font: 400 11px/1 var(--mono);
  color: var(--ink-faint);
}

/* segmented control */
.seg {
  display: flex;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: 3px;
}
.seg-btn {
  flex: 1;
  border: 0;
  background: none;
  border-radius: 999px;
  padding: 8px 4px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease;
}
.seg-btn:hover { color: var(--paprika); }
.seg-btn.is-on { background: var(--paprika); color: #fff; }

/* chips */
.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip {
  border: 1px solid var(--rule);
  background: var(--card);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 14px;
  color: var(--ink-soft);
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
.chip:hover { border-color: var(--paprika); color: var(--paprika); }
.chip.is-on {
  background: var(--paprika);
  border-color: var(--paprika);
  color: #fff;
}

/* checkboxes */
.checks { display: grid; gap: 9px; }
.check {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15.5px;
  cursor: pointer;
}
.check input {
  width: 19px; height: 19px;
  accent-color: var(--paprika);
  cursor: pointer;
  flex: none;
}

/* free-tag input */
.tagbox {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--r);
  padding: 7px 9px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.tagbox:focus-within { border-color: var(--paprika); }
.tags { display: contents; }
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--ember);
  color: var(--paprika-dp);
  border: 0;
  border-radius: 999px;
  padding: 4px 6px 4px 11px;
  font-size: 13.5px;
  font-weight: 600;
}
.tag-x {
  border: 0; background: none; padding: 0 3px;
  color: inherit; font-size: 16px; line-height: 1;
  cursor: pointer; opacity: .6;
}
.tag-x:hover { opacity: 1; }
.tag-input {
  border: 0;
  outline: none;
  padding: 5px 2px;
  min-width: 90px;
  flex: 1;
  background: none;
  font-size: 15.5px;
}

.text-input {
  width: 100%;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--r);
  padding: 11px 13px;
  font-size: 15.5px;
}
.text-input:focus { border-color: var(--paprika); outline-offset: 0; }
.area { resize: vertical; line-height: 1.5; }

/* ---------------- results ---------------- */

.results { min-width: 0; }

/* the signature: your choices, read back as a sentence */
.tonight {
  font: 400 clamp(27px, 3.4vw, 41px)/1.28 var(--serif);
  letter-spacing: -.018em;
  max-width: 22ch;
  margin-bottom: 18px;
  text-wrap: balance;
}
.tonight-lead { color: var(--ink-faint); }
.tl-chip {
  border: 0;
  background: none;
  padding: 0 0 2px;
  font: inherit;
  color: var(--paprika);
  cursor: pointer;
  border-bottom: 2px dotted rgba(196,68,30,.4);
  transition: color .15s ease, border-color .15s ease;
}
.tl-chip:hover { color: var(--paprika-dp); border-bottom-color: var(--paprika-dp); }
/* The remove "x" must take up no room while it is hidden, or it leaves a
   gap before the comma that follows the chip. */
.tl-x {
  font-family: var(--sans);
  font-size: .55em;
  vertical-align: .12em;
  display: inline-block;
  max-width: 0;
  margin-left: 0;
  overflow: hidden;
  opacity: 0;
  transition: opacity .15s ease, max-width .15s ease, margin-left .15s ease;
}
.tl-chip:hover .tl-x,
.tl-chip:focus-visible .tl-x { opacity: 1; max-width: 2em; margin-left: .22em; }

.count {
  font: 700 12px/1 var(--mono);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-soft);
  padding-bottom: 16px;
  margin-bottom: 26px;
  border-bottom: 1px solid var(--rule);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(248px, 1fr));
  gap: 30px 26px;
}

/* ---------------- recipe card ---------------- */

.card {
  display: flex;
  background: var(--card);
  border: 0;
  border-radius: 14px;
  padding: 0;
  text-align: left;
  font: inherit;
  cursor: pointer;
  overflow: hidden;
  position: relative;
  box-shadow: var(--shadow);
  transition: transform .18s ease, box-shadow .18s ease;
  animation: rise .32s ease both;
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 2px 4px rgba(36,26,21,.06), 0 16px 30px -16px rgba(36,26,21,.4);
}
@keyframes rise { from { opacity: 0; transform: translateY(9px); } }

/* flex all the way down so the time/skill/match row sits on the same
   baseline across a row of cards, however long the titles run */
.card-hit {
  display: flex;
  flex-direction: column;
  width: 100%;
  border: 0;
  background: none;
  padding: 0;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
}

.thumb {
  position: relative;
  flex: none;
  aspect-ratio: 4 / 3;
  background: var(--ember);
  overflow: hidden;
}
.thumb::after {
  content: "🍳";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  opacity: .45;
}
.thumb img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.thumb img.is-broken { display: none; }

.card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 15px 16px 17px;
}
.card-title {
  font: 400 18.5px/1.3 var(--serif);
  letter-spacing: -.01em;
  margin-bottom: 11px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-title + .card-meta { margin-top: auto; }
.card-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font: 400 12px/1 var(--mono);
  color: var(--ink-soft);
}
.mins { letter-spacing: .02em; }

.badge {
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #fff;
}
.badge-easy   { background: var(--sage); }
.badge-medium { background: var(--amber); color: var(--ink); }
.badge-hard   { background: var(--plum); }

.star {
  position: absolute;
  z-index: 2;
  top: 10px; right: 10px;
  width: 38px; height: 38px;
  border: 0;
  border-radius: 50%;
  background: rgba(255,255,255,.9);
  color: var(--ink-faint);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 1px 5px rgba(36,26,21,.22);
  transition: transform .15s ease, color .15s ease;
}
.star:hover { transform: scale(1.11); }
.star.is-on { color: var(--paprika); }

.card.is-new {
  animation: flash 1.9s ease both;
}
@keyframes flash {
  0%, 62%  { box-shadow: 0 0 0 3px var(--paprika), var(--shadow); }
  100%     { box-shadow: 0 0 0 3px transparent, var(--shadow); }
}

/* ---------------- empty / more ---------------- */

.empty { padding: 46px 0 10px; max-width: 34ch; }
.empty-big { font: 400 27px/1.3 var(--serif); margin-bottom: 8px; }
.empty-small { color: var(--ink-soft); }

.more-wrap { display: flex; justify-content: center; padding-top: 40px; }

/* ---------------- overlays ---------------- */

.sheet {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.sheet-bg {
  position: absolute;
  inset: 0;
  background: rgba(36,26,21,.55);
  animation: fade .2s ease both;
}
@keyframes fade { from { opacity: 0; } }

.sheet-box {
  position: relative;
  z-index: 1;
  background: var(--paper);
  border-radius: 18px;
  width: min(880px, 100%);
  max-height: 92vh;
  display: flex;
  box-shadow: 0 30px 70px -20px rgba(36,26,21,.6);
  animation: pop .22s cubic-bezier(.2,.9,.3,1) both;
}
.sheet-narrow { width: min(560px, 100%); }
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(.985); } }

.sheet-scroll {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  width: 100%;
  padding: 34px 38px 38px;
  border-radius: 18px;
}
.sheet-x {
  position: absolute;
  z-index: 2;
  top: 14px; right: 16px;
  width: 40px; height: 40px;
  border: 0;
  border-radius: 50%;
  background: rgba(253,250,247,.92);
  color: var(--ink-soft);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}
.sheet-x:hover { background: var(--ember); color: var(--paprika); }
.sheet-title { font: 400 27px/1.2 var(--serif); letter-spacing: -.015em; }

/* detail */
.d-hero {
  aspect-ratio: 16 / 7;
  border-radius: 12px;
  margin-bottom: 24px;
}
.d-title {
  font: 400 clamp(28px, 3.6vw, 38px)/1.2 var(--serif);
  letter-spacing: -.02em;
  max-width: 24ch;
  margin-bottom: 14px;
  padding-right: 40px;
}
.d-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  font: 400 12.5px/1 var(--mono);
  color: var(--ink-soft);
  padding-bottom: 22px;
  border-bottom: 1px solid var(--rule);
}
.d-dot { color: var(--ink-faint); }
.d-nutrition { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: baseline; margin-top: 6px; }
.d-nut-figs { color: var(--ink-soft); font-size: 0.95rem; }
.d-nut-note { color: var(--ink-faint); font-size: 0.8rem; }

.d-h {
  font: 700 12px/1 var(--mono);
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 30px 0 14px;
}
.d-ings {
  list-style: none;
  padding: 0;
  columns: 2;
  column-gap: 36px;
}
.d-ing {
  break-inside: avoid;
  padding: 7px 0;
  border-bottom: 1px solid var(--rule);
  font-size: 15.5px;
}
.d-amt { color: var(--paprika-dp); font-family: var(--mono); font-size: 13px; }

.d-steps { list-style: none; padding: 0; counter-reset: s; max-width: 62ch; }
.d-step {
  counter-increment: s;
  position: relative;
  padding: 0 0 18px 46px;
  font-size: 16.5px;
  line-height: 1.6;
}
.d-step::before {
  content: counter(s);
  position: absolute;
  left: 0; top: 1px;
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--ember);
  color: var(--paprika-dp);
  font: 700 13px/30px var(--mono);
  text-align: center;
}
.d-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 30px;
  padding-top: 24px;
  border-top: 1px solid var(--rule);
}
.d-src {
  color: var(--paprika);
  font-size: 15px;
  text-decoration: underline;
  text-underline-offset: 3px;
  margin-right: auto;
}
.d-src:hover { color: var(--paprika-dp); }

/* add */
.tabs {
  display: flex;
  gap: 26px;
  margin: 22px 0 22px;
  border-bottom: 1px solid var(--rule);
}
.tab {
  border: 0;
  background: none;
  padding: 0 0 12px;
  margin-bottom: -1px;
  border-bottom: 2px solid transparent;
  font-size: 15.5px;
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
}
.tab:hover { color: var(--paprika); }
.tab.is-on { color: var(--paprika); border-bottom-color: var(--paprika); }

.pane .field-label { margin-top: 18px; }
.pane .field-label:first-child { margin-top: 0; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.row-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 24px;
}
.err {
  margin-top: 12px;
  color: var(--paprika-dp);
  background: var(--ember);
  border-radius: var(--r);
  padding: 11px 14px;
  font-size: 15px;
}

.spinner {
  width: 20px; height: 20px;
  border: 2.5px solid var(--rule);
  border-top-color: var(--paprika);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------- toast ---------------- */

.toast {
  position: fixed;
  z-index: 70;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  max-width: min(560px, calc(100vw - 32px));
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: var(--ink);
  color: var(--paper);
  border-radius: 12px;
  padding: 15px 15px 15px 20px;
  font-size: 15.5px;
  line-height: 1.45;
  box-shadow: 0 18px 40px -14px rgba(36,26,21,.7);
  animation: toast-in .24s ease both;
}
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 14px); } }

/* good news, not a problem: herb green rather than the dark problem toast */
.toast.is-good { background: var(--sage); }
.toast-x {
  border: 0; background: none;
  color: var(--paper);
  font-size: 22px; line-height: 1;
  padding: 0 2px;
  cursor: pointer;
  opacity: .65;
  flex: none;
}
.toast-x:hover { opacity: 1; }

/* ---------------- responsive ---------------- */

@media (max-width: 899px) {
  .wrap {
    grid-template-columns: minmax(0, 1fr);
    gap: 34px;
    padding: 24px 20px 70px;
  }
  /* stacked above the results, so the page scrolls it -- not an inner scrollbar */
  .panel { position: static; max-height: none; overflow: visible; }
  .head-in { padding: 20px; }
  .tonight { max-width: none; }
  .sheet { padding: 0; }
  .sheet-box { max-height: 100vh; height: 100%; border-radius: 0; width: 100%; }
  .sheet-scroll { padding: 26px 20px 34px; border-radius: 0; }
  .d-ings { columns: 1; }
  .grid { gap: 24px 18px; }
}

@media (max-width: 460px) {
  .pair { grid-template-columns: 1fr; }
  .grid { grid-template-columns: minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .card:hover { transform: none; }
}

/* ---------- printing: one recipe, clean ---------- */
@media print {
  body.detail-open header,
  body.detail-open .panel,
  body.detail-open main,
  body.detail-open .toast,
  body.detail-open #add,
  body.detail-open .sheet-bg,
  body.detail-open .sheet-x,
  body.detail-open .d-foot .btn { display: none !important; }

  body.detail-open { overflow: visible !important; background: #fff; }
  body.detail-open .sheet,
  body.detail-open .sheet-box,
  body.detail-open .sheet-scroll {
    position: static !important;
    display: block !important;
    width: auto !important;
    max-width: none !important;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
    box-shadow: none !important;
    border: 0 !important;
    padding: 0 !important;
    background: #fff !important;
    color: #000 !important;
  }
  body.detail-open .d-hero { max-height: 3in; overflow: hidden; }
  body.detail-open .d-title { color: #000; }
  body.detail-open .d-ings { break-inside: auto; }
  body.detail-open .d-step { break-inside: avoid; }
  body.detail-open .d-src::after { content: " (" attr(href) ")"; font-size: 0.85em; }
}

.d-print-opt {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--ink-soft, #6b5e54);
  cursor: pointer;
  user-select: none;
}
@media print {
  body.detail-open.print-no-photo .d-hero { display: none !important; }
  body.detail-open .d-print-opt { display: none !important; }
}

@media print {
  /* Chrome prints animated elements as blank pages - stop all motion on paper */
  body.detail-open *, body.detail-open *::before, body.detail-open *::after {
    animation: none !important;
    transition: none !important;
    transform: none !important;
  }
}

/* ---------- search box above the results ---------- */
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
.search-row { margin-bottom: 14px; }
.search-box {
  width: 100%;
  font-size: 1.05rem;
  padding: 12px 16px;
  border-radius: 999px;
}
.card-from {
  font-size: 0.78rem;
  color: var(--ink-faint, #8a7b70);
  margin: 2px 0 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
@media print { body.detail-open .search-row { display: none !important; } }

/* ---------- my-notes box on each recipe ---------- */
.d-notes {
  width: 100%;
  font: inherit;
  font-size: 0.95rem;
  color: var(--ink, #2c2622);
  background: var(--paper, #fff);
  border: 1px solid var(--rule, #e3d9d0);
  border-radius: 10px;
  padding: 10px 12px;
  resize: vertical;
  min-height: 70px;
}
.d-notes:focus-visible { outline: 2px solid var(--paprika, #bc5457); outline-offset: 1px; }
.d-notes-state { min-height: 1.1em; font-size: 0.8rem; color: var(--ink-faint, #8a7b70); margin: 4px 0 0; }
.d-notes-print { display: none; }

@media print {
  /* print the note text, not the typing box */
  body.detail-open .d-notes,
  body.detail-open .d-notes-state { display: none !important; }
  body.detail-open .d-notes-print { display: block; white-space: pre-wrap; }
  body.detail-open .d-notes-print:empty { display: none; }
}


/* ---------- warm magazine look ---------- */
.head-name, .panel-title, .sheet-title, .d-title, .card-title, .empty-big {
  font-family: var(--serif);
  font-weight: 600;
  letter-spacing: -0.01em;
}
.head-name { font-size: 2rem; }
.head-tag { font-family: var(--serif); font-style: italic; color: var(--ink-soft); }
.d-title { font-size: 2.1rem; line-height: 1.12; }
.card-title { font-size: 1.12rem; line-height: 1.25; }

/* the "Tonight:" sentence reads like a pull-quote */
.tonight { font-family: var(--serif); font-style: italic; font-size: 1.3rem; line-height: 1.5; }
.tonight-lead { font-style: normal; font-weight: 600; }
.tl-chip { font-family: var(--serif); font-style: italic; font-size: 1.05rem; }

/* more breathing room */
.grid { gap: 26px; }
.card { border-radius: 14px; }
.panel { border-radius: 16px; }
.field-label {
  font-family: var(--sans);
  font-size: 0.72rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-soft);
}


/* ---------- botanical stationery header ---------- */
.head {
  background: var(--ink);                 /* charcoal band */
  border-bottom: 3px solid var(--amber);
}
.head-name { color: var(--paper); display: inline-flex; align-items: center; gap: 14px; }
.head-tag { color: #E3CBA4; }
.head .btn-solid { background: var(--paprika); border-color: var(--paprika); }
.sprig-l, .sprig-r { color: var(--sand); display: inline-flex; }
.sprig-r svg { transform: scaleX(-1); }
@media (max-width: 640px) { .sprig-l, .sprig-r { display: none; } }

@media print { body.detail-open .head { background: #fff; border: 0; } }
