.cookbook-entry{display:flex;justify-content:center;margin:8px auto 0}
.cookbook-entry .secondary{min-height:44px;border-color:#aeb89d;background:#f7f4e8;color:#244b37}
.cookbook-entry svg{width:19px;height:19px;flex:none}
.cookbook-entry b{min-width:1.7em;padding:2px 5px;border-radius:1em;background:#e3e9d8;font-variant-numeric:tabular-nums}

#cookbook{width:min(36rem,calc(100% - 20px));max-height:calc(100% - 20px);padding:0;border:1px solid #c6cdb8;border-radius:22px;background:#faf5e9;color:#26382c}
#cookbook[open]{display:flex;flex-direction:column}
#cookbook header{padding:1.1rem 3.5rem .5rem 1.1rem}
#cookbook h2{margin:0}
.cookbook-filters{display:grid;grid-template-columns:minmax(0,2fr) minmax(0,1fr);gap:8px;padding:0 1.1rem}
.cookbook-filters label{display:grid;gap:4px;font-size:.82rem}
.cookbook-filters input,.cookbook-filters select{box-sizing:border-box;width:100%;min-width:0;min-height:44px;padding:6px 8px;border:1px solid #b9c1aa;border-radius:10px;background:#fffbf1;color:inherit;font:inherit;font-size:16px}
#cookbook-status,.storage-warning{margin:.5rem 1.1rem;font-size:.85rem}
.storage-warning{color:#714922}
#cookbook-list{overflow:auto;overscroll-behavior:contain;min-height:0;list-style:none;padding:0 1.1rem .8rem;margin:0}
.cookbook-item{display:grid;grid-template-columns:minmax(0,1fr) 44px;gap:5px;align-items:center;border-top:1px solid #d9dccd}
.cookbook-recipe,.cookbook-remove{border:0;background:none;color:inherit;cursor:pointer;font:inherit}
.cookbook-recipe{display:flex;gap:11px;align-items:center;padding:7px 0;text-align:left;min-height:60px}
.cookbook-recipe img{width:56px;height:56px;flex:none;border-radius:9px;object-fit:cover;background:#e5e7d8}
.cookbook-name{font-weight:650;overflow-wrap:anywhere}
.cookbook-remove{width:44px;height:44px;border-radius:50%;font-size:25px}
.cookbook-recipe:hover .cookbook-name{text-decoration:underline}
.cookbook-remove:hover{background:#e9eadf}

.recipe-footer #recipe-actions{width:100%}
.recipe-action-buttons{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:6px}
.recipe-action-buttons button,.recipe-page-servings button{min-height:44px;border:1px solid #b9c1aa;border-radius:999px;background:#fffaf0;color:#234b37;font:650 .8rem/1.15 system-ui,sans-serif;cursor:pointer}
.recipe-action-buttons button{padding:6px;white-space:normal}
.recipe-action-buttons button[aria-pressed=true]{background:#e3e9d8;border-color:#a2ae92}
.recipe-action-buttons button:disabled,.recipe-page-servings button:disabled{opacity:.55;cursor:default}
.recipe-action-buttons button:focus-visible,.recipe-page-servings button:focus-visible,#cookbook button:focus-visible{outline:2px solid #2d654c;outline-offset:2px}
.recipe-action-message{margin:6px 0 0;font-size:.8rem;overflow-wrap:anywhere}
.recipe-action-message:empty{display:none}
.recipe-page-servings{display:flex;align-items:center;gap:.6rem;margin:.75rem 0 .55rem}
.recipe-page-servings button{min-width:44px;font-size:1.2rem}
.recipe-page-servings output{min-width:2ch;text-align:center;font-variant-numeric:tabular-nums}
.recipe-print{display:none}
@media(max-width:420px){
  .recipe-action-buttons{grid-template-columns:repeat(2,minmax(0,1fr))}
  .cookbook-filters{gap:6px;padding-inline:.85rem}
  #cookbook-list{padding-inline:.85rem}
}
@media print{
  @page{size:A4 portrait;margin:15mm}
  html,body{height:auto!important;overflow:visible!important;background:white!important;color:black!important}
  body:has(.recipe-print) > :not(.recipe-print){display:none!important}
  .recipe-print{display:block;width:auto;margin:0;padding:0;color:black;background:white;font:11pt/1.42 Georgia,serif;overflow:visible;overflow-wrap:anywhere}
  .recipe-print h1{margin:.25em 0;font-size:23pt}
  .recipe-print h2{margin:.85em 0 .25em;font-size:14pt}
  .recipe-print h1,.recipe-print h2{break-after:avoid}
  .recipe-print p{margin:.4em 0;orphans:2;widows:2}
  .recipe-print li{margin:.25em 0;orphans:2;widows:2}
  .recipe-print ol,.recipe-print ul{padding-left:5mm;margin:.25em 0 .5em}
  .recipe-print figure{margin:.7em 0;break-inside:avoid}
  .recipe-print img{display:block;width:auto;max-width:70mm;height:auto;max-height:41mm;border-radius:0;object-fit:contain;filter:grayscale(1)}
  .recipe-print figcaption{font-size:9pt}
  .recipe-print a{color:black;text-decoration:underline}
}

/* V14.2: stable mobile photo height and recipe context above actions. */
@media screen and (max-width: 830px) {
  body[data-roulette-production="1"] { height: 100dvh; min-height: 100svh; }
  body[data-roulette-production="1"] > .header { flex: none; }
  body[data-roulette-production="1"] > main { flex: 1 1 0; height: auto; min-height: 0; }
  body[data-roulette-production="1"] .carousel-section {
    display: grid; flex: 1 1 0; min-height: 0;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: minmax(0, 1fr) auto auto auto auto;
    align-content: stretch; align-items: center; justify-items: center; row-gap: 3px;
  }
  body[data-roulette-production="1"] .stage { grid-area: 1 / 1 / 2 / -1; height: 100%; min-height: 0; max-height: 445px; }
  body[data-roulette-production="1"] .controls { grid-area: 3 / 1; justify-self: end; width: min(calc(100% - 12px), 240px); margin: 0 3px 0 0; }
  body[data-roulette-production="1"] .cookbook-entry { grid-area: 3 / 2; justify-self: start; width: min(calc(100% - 12px), 240px); margin: 0 0 0 3px; }
  body[data-roulette-production="1"] :is(.controls button, .cookbook-entry button) { width: 100%; min-width: 0; min-height: 44px; padding: 6px; gap: 4px; font-size: clamp(12px, 3.5vw, 15px); line-height: 1.15; }
  body[data-roulette-production="1"] :is(.controls .button-icon, .cookbook-entry svg) { width: 16px; height: 16px; }
  body[data-roulette-production="1"] .cookbook-entry b { padding: 2px 3px; min-width: 1.5em; }
  body[data-roulette-production="1"] .browse-count { grid-area: 4 / 1 / 5 / -1; margin: 0; }
  body[data-roulette-production="1"] #reaction { grid-area: 2 / 1 / 3 / -1; block-size: 3.6em; min-block-size: 3.6em; max-block-size: 3.6em; margin: 0; line-height: 1.2; overflow: hidden; display: flex; flex-direction: column; justify-content: center; }
  body[data-roulette-production="1"] #reaction-cuisine:empty { display: none; }
  body[data-roulette-production="1"] #reaction-cuisine { flex: 0 0 auto; line-height: 1.2; }
  body[data-roulette-production="1"] #reaction-ingredients { flex: 0 0 auto; line-height: 1.2; overflow-wrap: anywhere; }
  body[data-roulette-production="1"] .card-body { flex: none; }
  body[data-roulette-production="1"] .card h2 { block-size: 2.22em; }
  body[data-roulette-production="1"] .meta { white-space: nowrap; }
  body[data-roulette-production="1"] .filter-bar { grid-area: 5 / 1 / 6 / -1; margin: 0; }
  body[data-roulette-production="1"] .foot { flex: none; margin-top: 0; padding-block: 2px 4px; }
}
