@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=DM+Serif+Display:ital@0;1&display=swap');
:root{font-family:'DM Sans',sans-serif;color:#26372f;background:#faf8f4;font-synthesis:none}*{box-sizing:border-box}body{margin:0}button,input{font:inherit}button{cursor:pointer}a{color:inherit}.topbar{max-width:1190px;padding:25px 36px;margin:auto;display:flex;align-items:center;justify-content:space-between}.brand{text-decoration:none;font-size:23px;font-weight:700;letter-spacing:-1.3px}.brand span:last-child{color:#ea794c}.brand-icon{display:inline-grid;place-items:center;background:#d9edcc;color:#336647;border-radius:12px;width:37px;height:37px;margin-right:7px;font-size:26px;vertical-align:middle}.saved-toggle{border:1px solid #dddcd4;background:#fff;border-radius:30px;padding:10px 17px;color:#3b4b42}.saved-toggle b{font-weight:600;background:#eff2e9;border-radius:100px;padding:3px 7px;margin-left:6px}.hero{text-align:center;max-width:900px;margin:74px auto 95px;padding:0 24px}.eyebrow,.overline{font-size:11px;letter-spacing:2.2px;font-weight:700;color:#7e9279}.dot{display:inline-block;background:#88a777;width:7px;height:7px;border-radius:50%;margin-right:9px}.hero h1{font-family:'DM Serif Display',Georgia,serif;letter-spacing:-3px;font-weight:400;font-size:clamp(54px,7vw,91px);line-height:1.02;margin:23px 0}.hero h1 em{font-weight:400;color:#ed835d}.hero>p:not(.hint){font-size:17px;line-height:1.75;max-width:540px;margin:0 auto 31px;color:#78857d}.url-form{max-width:690px;margin:auto}.field{padding:7px;box-shadow:0 7px 28px #253b2112;display:flex;align-items:center;border:1px solid #e8e7de;border-radius:16px;background:white;gap:12px}.field:focus-within{outline:2px solid #d4e4cf}.link-icon{font-size:24px;color:#9daa9a;padding-left:15px}.field input{flex:1;min-width:0;border:none;outline:none;font-size:15px;color:#26372f}.field input::placeholder{color:#a4aaa3}.field button{white-space:nowrap;background:#345c43;border:none;border-radius:11px;color:#fff;font-weight:600;padding:17px 21px}.field button:hover{background:#284a35}.field button:disabled{opacity:.65;cursor:wait}.field button span{margin-left:10px}.hint{font-size:12px;color:#9ca49c;margin-top:18px}.error{max-width:690px;margin:22px auto 0;background:#fff0e7;color:#a24728;border:1px solid #f5c7ae;border-radius:12px;padding:16px}.recipe{max-width:1080px;margin:0 auto 95px;padding:34px;border:1px solid #eae6dc;border-radius:22px;background:#fff;box-shadow:0 12px 55px #3446320c}.recipe-head{display:flex;justify-content:space-between;gap:25px;align-items:center}.recipe-head h2,.saved-header h2,.how h2{font-family:'DM Serif Display',Georgia,serif;font-weight:400;letter-spacing:-1px}.recipe-head h2{font-size:clamp(32px,4vw,51px);margin:10px 0}.recipe-head p{color:#7b857d;line-height:1.6;max-width:630px}.recipe-head img{width:245px;height:180px;object-fit:cover;border-radius:14px}.meta{display:flex;gap:11px;flex-wrap:wrap;margin-top:20px}.meta span{border-radius:50px;background:#f3f5ef;padding:8px 12px;color:#617467;font-size:12px}.toolbar{display:flex;flex-wrap:wrap;gap:9px;border-top:1px solid #eeeee8;border-bottom:1px solid #eeeee8;margin:30px 0;padding:17px 0}.toolbar button,.toolbar a{border:1px solid #e2e7df;background:#fff;border-radius:9px;padding:11px 15px;font-size:13px;text-decoration:none;color:#35553d}.toolbar button:hover,.toolbar a:hover{background:#f1f6ef}.toolbar a{margin-left:auto}.recipe-grid{display:grid;grid-template-columns:0.85fr 1.35fr;gap:55px}.section-heading{display:flex;align-items:center;justify-content:space-between;gap:10px}.section-heading h3{font-family:'DM Serif Display',Georgia,serif;font-size:29px;font-weight:400;margin:8px 0 20px}.section-heading span{font-size:12px;color:#9baba0}.ingredient-row{display:flex;gap:12px;line-height:1.55;border-bottom:1px solid #f1f1eb;padding:13px 0;font-size:14px;cursor:pointer}.ingredient-row input{accent-color:#4d7651;width:16px;height:16px;margin-top:3px;flex:none}.ingredient-row:has(input:checked) span{text-decoration:line-through;color:#b0b8af}.step{display:flex;gap:17px;padding:10px 0 20px}.step-number{background:#eaf1e6;color:#4b7853;display:grid;place-items:center;border-radius:50%;height:34px;width:34px;flex:none;font-weight:700;font-size:13px}.step p{font-size:15px;line-height:1.75;margin:4px 0;color:#4d5c51}.step.section{font-size:19px;font-weight:700;padding-bottom:5px}.attribution{margin-top:30px;border-top:1px solid #eee;padding-top:20px;font-size:12px;color:#9ca59e}.saved-header{max-width:1050px;margin:auto}.saved-header h2{font-size:44px;margin-bottom:0}.saved-header p{color:#8a968c}.saved-header button{border:0;background:none;color:#44684b}.saved-list{max-width:1050px;margin:35px auto;display:grid;grid-template-columns:repeat(auto-fill,minmax(240px,1fr));gap:16px}.saved-card{border:1px solid #ebe8e0;background:white;padding:18px;border-radius:14px;text-align:left}.saved-card h3{margin:0 0 8px}.saved-card p{color:#839184;font-size:13px}.saved-card button{border:0;background:#eaf1e6;border-radius:8px;padding:9px 13px;color:#3b6342}.saved-card .remove{background:#fbeeea;color:#af5445;margin-left:6px}.how{background:#f1f3e9;padding:75px 30px;text-align:center}.how h2{font-size:clamp(32px,4vw,43px);margin:15px 0 47px}.how-grid{max-width:970px;margin:auto;display:grid;grid-template-columns:repeat(3,1fr);gap:55px;text-align:left}.how-grid span{font-family:'DM Serif Display',Georgia,serif;font-size:38px;color:#90ad88}.how-grid h3{font-size:17px}.how-grid p{font-size:14px;line-height:1.6;color:#7c8a7c}footer{text-align:center;padding:35px;color:#a4aea5;font-size:12px}footer span{color:#ed835d;margin-left:8px}.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0)}[hidden]{display:none!important}
@media(max-width:680px){.topbar{padding:20px}.saved-toggle span{display:none}.hero{margin:70px auto 70px}.hero h1{letter-spacing:-2px}.hero>p:not(.hint){font-size:15px}.field{gap:4px}.field button{padding:15px 11px;font-size:12px}.field input{font-size:13px}.link-icon{padding-left:8px}.recipe{margin:0 12px 65px;padding:20px}.recipe-head{display:block}.recipe-head img{margin-top:20px;width:100%;height:210px}.recipe-grid,.how-grid{grid-template-columns:1fr;gap:25px}.toolbar a{margin-left:0}.how{padding:60px 28px}.how-grid{gap:10px}}
@media print{.topbar,.hero,.toolbar,.how,footer,.attribution,.saved-toggle{display:none!important}.recipe{display:block!important;border:0;box-shadow:none;padding:0;margin:0;max-width:none}.recipe-grid{gap:25px}.ingredient-row{break-inside:avoid}.step{break-inside:avoid}}

/* Cooking-for-Engineers-inspired operation flow with merged ingredient streams */
.card-view{max-width:1600px;margin:36px auto 70px;padding:0 20px}.card-top{display:flex;justify-content:space-between;align-items:center;gap:20px;margin-bottom:20px}.card-top h2{font-size:clamp(26px,4vw,40px);margin:8px 0}.card-top p{color:#66716d}.card-actions{display:flex;gap:10px;flex-wrap:wrap}.card-actions button{background:#fff;border:1px solid #bbc8be;border-radius:9px;padding:12px 17px;font-weight:650;color:#294e3a}.card-actions button:last-child{background:#315b43;color:#fff}.card-sheet{background:#fff;border:1px solid #dce5dd;padding:22px;box-shadow:0 8px 30px #173d2710}.card-sheet-head{display:flex;justify-content:space-between;gap:20px;border-bottom:3px solid #202820;padding-bottom:8px;margin-bottom:12px}.card-sheet-head h2{font-size:27px;margin:6px 0}.card-sheet-head p{font-size:13px;color:#56655c}.operation-scroll{width:100%;overflow-x:auto}.operation-grid{display:grid;grid-template-columns:230px repeat(var(--stages),minmax(135px,1fr));grid-template-rows:37px repeat(var(--ingredient-rows),minmax(57px,auto));width:max-content;min-width:100%;align-items:stretch;background:#fff;border-left:1px solid #72aa70;border-top:1px solid #72aa70}.operation-banner{display:flex;justify-content:center;align-items:center;text-align:center;border-right:1px solid #72aa70;border-bottom:1px solid #72aa70;font-size:11px;letter-spacing:.06em;font-weight:700;color:#315c40}.operation-ingredient{border-right:1px solid #72aa70;border-bottom:1px solid #72aa70;padding:9px 8px;display:flex;align-items:center;font-size:13px;line-height:1.3;font-weight:600;background:#fff;min-height:57px}.operation-stage{background:white;border-right:1px solid #72aa70;border-bottom:1px solid #72aa70;border-left:1px solid #72aa70;display:flex;justify-content:center;align-items:center;text-align:center;flex-direction:column;gap:9px;padding:12px 8px;font-size:13px;line-height:1.4;min-width:135px;z-index:1;overflow-wrap:anywhere}.operation-stage .operation-number{font-size:10px;letter-spacing:.08em;background:#ebf4e9;color:#315b43;border-radius:50%;width:22px;height:22px;display:grid;place-items:center;font-weight:700}.operation-label{max-width:210px}.operation-legend,.card-note{font-size:12px;color:#65726a;margin:16px 0}.operation-details{margin-top:14px;border-top:1px solid #dce6db;padding-top:12px}.operation-details summary{cursor:pointer;color:#315b43;font-weight:700}.operation-full-steps{font-size:14px;line-height:1.7}.operation-full-steps li{margin-bottom:10px}.toolbar #cardBtn{background:#315b43;color:white;border-color:#315b43}@media(max-width:650px){.card-top,.card-sheet-head{flex-direction:column}.card-sheet{padding:10px}.card-view{padding:0 10px}.operation-grid{grid-template-columns:160px repeat(var(--stages),minmax(115px,1fr))}.operation-ingredient,.operation-stage{font-size:11px}.operation-stage{min-width:115px}}
@media print{body.printing-card .topbar,body.printing-card main>.hero,body.printing-card #recipeView,body.printing-card #savedView,body.printing-card #how,body.printing-card footer,body.printing-card .card-top{display:none!important}body.printing-card #cardView{display:block!important;max-width:none;margin:0;padding:0}body.printing-card .card-sheet{box-shadow:none;border:0;padding:0}body.printing-card .operation-scroll{overflow:visible}body.printing-card .operation-grid{width:100%;grid-template-columns:150px repeat(var(--stages),minmax(0,1fr));grid-template-rows:28px repeat(var(--ingredient-rows),minmax(35px,auto))}body.printing-card .operation-stage{min-width:0;font-size:9px;padding:3px}body.printing-card .operation-ingredient{font-size:9px;min-height:35px;padding:3px}body.printing-card .operation-label{max-width:none}body.printing-card .operation-details{display:none}body.printing-card .card-note,body.printing-card .operation-legend{font-size:9px}@page{size:A4 landscape;margin:8mm}}

.operation-standalone{border:1px solid #72aa70;background:#f8fcf8;padding:10px;display:flex;align-items:flex-start;justify-content:center;text-align:center;font-size:12px;line-height:1.4;z-index:1;overflow-wrap:anywhere}
@media print{body.printing-card .operation-standalone{font-size:9px;padding:3px}}

/* Fit whole chart in one screen width, without horizontal scrolling.
   Work in full-size CSS pixels, then scale the entire chart uniformly. */
.operation-scroll{width:100%;overflow:visible;position:relative}
.operation-fit{position:relative;margin:0 auto;transform-origin:top left}
.operation-grid{position:relative;transform-origin:top left;grid-template-columns:220px repeat(var(--stages),var(--stage-width,175px));grid-template-rows:30px repeat(var(--ingredient-rows),minmax(44px,auto));width:max-content;min-width:0}
.operation-ingredient{min-height:44px;padding:6px 8px;position:relative;z-index:2}
.operation-stage{min-width:0;padding:7px 6px;position:relative;z-index:3}
.operation-standalone{position:relative;z-index:3}
.operation-connections{position:absolute;left:0;top:0;overflow:visible;pointer-events:none;z-index:1}
.ingredient-connector{stroke:#32854a;stroke-width:1.6;fill:none;vector-effect:non-scaling-stroke}
.ingredient-dot{fill:#32854a}
@media(max-width:650px){.operation-grid{grid-template-columns:220px repeat(var(--stages),var(--stage-width,175px))}}
@media print{
 body.printing-card .operation-fit{height:auto!important;width:100%!important}
 body.printing-card .operation-grid{transform:none!important;width:100%!important;min-width:0;grid-template-columns:150px repeat(var(--stages),minmax(0,1fr))}
 body.printing-card .operation-connections{display:none}
}

/* --- Rebuilt engineering-style recipe card --- */
.card-flow{display:block}
.card-diagram-shell{width:100%;display:flex;justify-content:center;align-items:flex-start;overflow:hidden;margin-top:8px}
.card-diagram-wrap{width:100%;display:flex;justify-content:center}
.card-svg{display:block;background:#fff;max-width:100%;height:auto}
.svg-border,.svg-header,.svg-topnote,.svg-ingredient-box,.svg-op-box{fill:#fff;stroke:#73aa73;stroke-width:1.2}
.svg-header-text,.svg-topnote-text,.svg-op-number,.svg-op-text,.svg-ingredient-text{fill:#1d2a1d;font-family:Arial,Helvetica,sans-serif}
.svg-header-text{font-weight:700;letter-spacing:.06em}
.svg-topnote-text{font-weight:600}
.svg-ingredient-text{font-weight:600}
.svg-op-number{font-weight:700}
.svg-op-text{font-weight:500}
.svg-connector-line{stroke:#73aa73;stroke-width:1.2}
.operation-legend{font-size:12px;color:#65726a;margin:14px 0 10px}
.operation-details{margin-top:14px;border-top:1px solid #dce6db;padding-top:12px}
.operation-details summary{cursor:pointer;color:#315b43;font-weight:700}
.operation-full-steps{font-size:14px;line-height:1.7;padding-left:22px}
.operation-full-steps li{margin-bottom:10px}
.card-sheet{overflow:hidden}
@media(max-width:650px){
  .card-sheet{padding:12px}
  .card-top,.card-sheet-head{flex-direction:column;align-items:flex-start}
}
@media print{
  body.printing-card .topbar,
  body.printing-card main>.hero,
  body.printing-card #recipeView,
  body.printing-card #savedView,
  body.printing-card #how,
  body.printing-card footer,
  body.printing-card .card-top,
  body.printing-card .operation-details,
  body.printing-card .operation-legend,
  body.printing-card .card-note{display:none!important}
  body.printing-card #cardView{display:block!important;max-width:none;margin:0;padding:0}
  body.printing-card .card-sheet{box-shadow:none;border:0;padding:0}
  body.printing-card .card-diagram-shell{overflow:visible}
  body.printing-card .card-svg{width:100%!important;height:auto!important;max-height:none!important}
  @page{size:A4 landscape;margin:8mm}
}
/* v3 engineering card: override legacy grid renderer */
.engineering-shell{width:100%;display:flex;justify-content:center;align-items:start;overflow:hidden;background:#fff;margin-top:6px}
.engineering-svg{display:block;flex:none;max-width:100%;background:#fff}
.engineering-unmatched{margin:9px 0;font-size:12px;color:#94623d;line-height:1.45}
.card-sheet{overflow:hidden}
@media print{
 body.printing-card .card-sheet-head{display:flex!important}
 body.printing-card #cardView{display:block!important;break-before:avoid;page-break-before:avoid}
 body.printing-card #cardFlow{display:block!important}
 body.printing-card .engineering-shell{display:block!important;width:100%!important;overflow:visible!important}
 body.printing-card .engineering-svg{width:100%!important;height:auto!important;max-width:100%!important;page-break-inside:avoid;break-inside:avoid}
 body.printing-card .card-sheet{break-inside:avoid;page-break-inside:avoid}
 body.printing-card .operation-legend,body.printing-card .engineering-unmatched{display:none!important}
 body.printing-card .card-note{display:none!important}
}
/* v4: closely matches the flat green outlined, merged-cell Cooking for Engineers recipe card */
.card-view{max-width:1900px;margin:16px auto 32px;padding:0 16px}
.card-top{margin-bottom:10px}
.card-top h2{font:600 22px Arial,sans-serif;margin:0 0 4px}
.card-top p{font:13px Arial,sans-serif;margin:0}
.card-sheet{box-shadow:none;border:none;border-radius:0;padding:6px;background:#fff}
.card-sheet-head{font-family:Arial,sans-serif;border-bottom:2px solid #202020;margin-bottom:10px;padding-bottom:7px}
.card-sheet-head h2{font-family:Arial,sans-serif;font-size:20px;font-weight:500;margin:4px 0}
.card-sheet-head .overline{font-size:10px;letter-spacing:.06em;color:#444}
.engineering-shell{display:block;width:100%;overflow:hidden;background:white}
.engineering-shell.zoomed{overflow:auto;max-height:calc(100vh - 240px)}
.engineering-svg{display:block;margin:0 auto;flex:none;max-width:none!important;background:white}
.engineering-shell.zoomed .engineering-svg{margin:0}
.operation-legend,.engineering-unmatched,.card-note{font:12px/1.4 Arial,sans-serif}
@media print{
 body.printing-card .card-view{max-width:none;padding:0;margin:0}
 body.printing-card .card-sheet{padding:0;border:0;box-shadow:none}
 body.printing-card .card-sheet-head{margin:0 0 6px}
 body.printing-card .card-sheet-head h2{font-size:15px;margin:3px 0}
 body.printing-card .card-sheet-head p{font-size:10px}
 body.printing-card .engineering-shell{overflow:visible!important;max-height:none!important}
 body.printing-card .engineering-svg{width:100%!important;height:auto!important;max-height:168mm!important;overflow:visible}
 body.printing-card .operation-details,body.printing-card .operation-legend,body.printing-card .engineering-unmatched{display:none!important}
 @page{size:A4 landscape;margin:8mm}
}

/* Recipe ingredient group headings preserved from original recipe card. */
.ingredient-group-title{font-size:12px;letter-spacing:.04em;text-transform:uppercase;color:#497552;background:#f3f7f0;border-radius:6px;padding:9px 10px;margin:18px 0 3px}
.recipe-extraction{font-size:12px;color:#647867;margin:-12px 0 22px}
