.loop-cards i { font-style: normal; }
.language-compact { margin-left: auto; }
.language-compact select {
  min-height: 34px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  padding: 4px 28px 4px 10px;
  font-size: .78rem;
  font-weight: 700;
}
.recipe-guide-open { border: 1px solid #b9c2b9; border-radius: 999px; background: #fff; color: #263229; padding: .38rem .72rem; font-size: .78rem; font-weight: 800; }
.command-bar { grid-template-columns: 1.2fr 1fr 1.2fr repeat(4, 1fr); }
.cooking-progress { display: block; width: 100%; height: 7px; margin: 8px 0 25px; border: 0; border-radius: 999px; overflow: hidden; background: #e9efec; color: var(--green); appearance: none; }
.cooking-progress::-webkit-progress-bar { background: #e9efec; border-radius: 999px; }
.cooking-progress::-webkit-progress-value { background: var(--green); border-radius: 999px; }
.cooking-progress::-moz-progress-bar { background: var(--green); border-radius: 999px; }

@media (max-width: 900px) {
  .command-bar { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 560px) {
  .language-compact { margin-left: 0; }
  .command-bar { grid-template-columns: repeat(2, 1fr); }
}

.catalog-picker { margin: 1rem 0; padding: .85rem; border: 1px solid rgba(30,33,29,.15); border-radius: 16px; background: rgba(255,255,255,.62); }
.catalog-heading, .catalog-search, .shopping-head, .shopping-head-actions { display: flex; align-items: center; justify-content: space-between; gap: .65rem; }
.catalog-heading small { color: #687067; }
.catalog-search { margin: .65rem 0; }
.catalog-interpretation { margin: -.15rem 0 .65rem; padding: .55rem .65rem; border-radius: 10px; background: #edf3ea; color: #344b38; font-size: .76rem; }
.catalog-search input { min-width: 0; flex: 1; border: 1px solid #c9cec7; border-radius: 10px; padding: .62rem .72rem; }
.catalog-search button, .catalog-more, .shopping-head button { border: 0; border-radius: 10px; padding: .62rem .8rem; background: #28372d; color: white; }
.recipe-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: .55rem; max-height: 330px; overflow: auto; padding-right: .2rem; }
.recipe-card { position: relative; border: 2px solid transparent; border-radius: 12px; padding: 0; overflow: hidden; background: #eff1eb; text-align: left; min-height: 112px; }
.recipe-card img { width: 100%; height: 74px; object-fit: cover; display: block; }
.recipe-card span { display: block; padding: .38rem .45rem; font-size: .76rem; line-height: 1.2; font-weight: 700; }
.recipe-card.selected { border-color: #e4532f; box-shadow: 0 0 0 2px rgba(228,83,47,.14); }
.catalog-more { width: 100%; margin-top: .6rem; background: #e7eae4; color: #263229; }
.catalog-attribution { margin: .5rem 0 0; font-size: .68rem; color: #737a72; }
.selected-recipe { display: flex; justify-content: space-between; gap: 1rem; margin: .4rem 0 .75rem; font-size: .86rem; }

.shopping-workspace { padding: clamp(1rem,3vw,2.4rem); }
.shopping-head-actions label { display:flex; align-items:center; gap:.5rem; font-weight:700; }
.shopping-head-actions select { min-width:12rem; max-width:24rem; }
.shopping-loading { padding:2rem; border:1px dashed #b8c8c0; border-radius:1rem; color:#52665c; text-align:center; background:#f4f8f5; }
.catalog-search select { min-width:9rem; }
.shopping-head { align-items: flex-start; margin-bottom: 1.4rem; }
.shopping-head h1 { margin: .2rem 0; }
.shopping-head p { max-width: 720px; color: #5d655d; }
.shopping-head-actions { align-items: stretch; }
.shopping-head-actions select { border: 1px solid #ccd1ca; border-radius: 10px; padding: .55rem; }
.shopping-grid { display: grid; grid-template-columns: minmax(0,1.4fr) minmax(280px,.75fr); gap: 1rem; }
.shopping-sections { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .8rem; }
.shopping-section, .shopping-photo-card { background: white; border: 1px solid rgba(30,33,29,.12); border-radius: 18px; padding: 1rem; box-shadow: 0 10px 30px rgba(35,42,35,.06); }
.shopping-section h2 { font-size: 1rem; margin: 0 0 .65rem; }
.shopping-item { display: flex; gap: .55rem; align-items: flex-start; padding: .4rem 0; border-top: 1px solid #edf0eb; }
.shopping-item input { margin-top: .25rem; accent-color: #e4532f; }
.shopping-item:has(input:checked) span { color: #879087; text-decoration: line-through; }
.shopping-photo-card h2 { font-size: 1.2rem; }
.shopping-photo-card p { color: #646b64; font-size: .88rem; }
.photo-picker { display: block; border: 2px dashed #b8c0b7; border-radius: 14px; padding: .9rem; text-align: center; cursor: pointer; margin-bottom: .75rem; }
.photo-picker input { display: block; width: 100%; margin-top: .5rem; font-size: .78rem; }
.photo-source-actions { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; margin-bottom: .8rem; }
.photo-source-input { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.photo-source-button { display: grid; min-height: 50px; place-items: center; margin: 0; padding: .65rem .75rem; border: 1px solid #b9c5bc; border-radius: 12px; background: #fff; color: #26372d; font-size: .85rem; font-weight: 800; text-align: center; cursor: pointer; }
.photo-source-button.camera { border-color: var(--green); background: var(--green); color: #fff; }
.photo-source-button:active { transform: translateY(1px); }
.photo-source-input:focus-visible + .photo-source-button { outline: 3px solid rgba(47,125,103,.3); outline-offset: 2px; }
.shopping-photo-preview { width: 100%; max-height: 240px; object-fit: contain; border-radius: 12px; margin-bottom: .75rem; background: #f3f4f0; }
.shopping-photo-card .btn { width: 100%; }
.shopping-photo-result { margin-top: .8rem; padding: .8rem; border-radius: 12px; background: #f2f4ef; white-space: pre-line; }
.shopping-photo-result.match { background: #e7f4e9; color: #234d2b; }
.shopping-photo-result.caution { background: #fff0db; color: #74480b; }

@media (max-width: 900px) {
  .shopping-grid { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .recipe-grid { grid-template-columns: repeat(2,minmax(0,1fr)); max-height: 290px; }
  .shopping-head, .shopping-head-actions { flex-direction: column; align-items: stretch; }
  .shopping-sections { grid-template-columns: 1fr; }
}

.chat-advance-hint { margin: .35rem 1rem .5rem; color: #5f695f; font-size: .78rem; }
.recipe-guide-dialog { width: min(920px, calc(100vw - 1.25rem)); max-height: calc(100dvh - 1.25rem); margin: auto; padding: 0; border: 0; border-radius: 20px; color: #283129; background: #fafbf8; box-shadow: 0 24px 80px rgba(20,30,22,.3); }
.recipe-guide-dialog::backdrop { background: rgba(19,28,21,.62); backdrop-filter: blur(3px); }
.recipe-guide-head { position: sticky; top: 0; z-index: 2; display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; padding: 1rem 1.15rem; border-bottom: 1px solid #e0e4dd; background: rgba(250,251,248,.96); }
.recipe-guide-head h2 { margin: .2rem 0 0; font-size: 1.4rem; }
.recipe-guide-head button { border: 0; border-radius: 999px; padding: .55rem .85rem; background: #26372c; color: #fff; font-weight: 800; }
.recipe-guide-grid { display: grid; grid-template-columns: minmax(220px,.7fr) minmax(0,1.5fr); gap: 1rem; padding: 1rem 1.15rem 1.25rem; overflow: auto; }
.recipe-guide-grid section { min-width: 0; }
.recipe-guide-grid h3 { margin: 0 0 .7rem; font-size: 1rem; }
.guide-ingredients { margin: 0; padding: 0; list-style: none; }
.guide-ingredients li { padding: .55rem .65rem; border-top: 1px solid #e3e7e0; background: #fff; }
.guide-ingredients li:first-child { border-top: 0; border-radius: 12px 12px 0 0; }
.guide-ingredients li:last-child { border-radius: 0 0 12px 12px; }
.guide-steps { display: grid; gap: .6rem; margin: 0; padding: 0; list-style: none; }
.guide-steps > li { padding: .8rem; border: 1px solid #dfe4dc; border-radius: 14px; background: #fff; scroll-margin: 6rem; }
.guide-steps > li.current { border-color: #e4532f; background: #fff4e5; box-shadow: 0 0 0 2px rgba(228,83,47,.12); }
.guide-steps > li.complete { background: #edf5ee; }
.guide-step-heading { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.guide-step-heading strong { font-size: .92rem; }
.guide-step-heading span { flex: none; border-radius: 999px; padding: .2rem .48rem; background: #e8ebe6; color: #626b63; font-size: .68rem; font-weight: 800; }
.guide-step.current .guide-step-heading span { background: #e4532f; color: #fff; }
.guide-step.complete .guide-step-heading span { background: #4f8462; color: #fff; }
.guide-steps p { margin: .5rem 0 0; color: #505a51; font-size: .82rem; line-height: 1.55; }

@media (max-width: 700px) {
  .recipe-guide-open { margin-left: auto; }
  .recipe-guide-dialog { width: 100vw; max-width: none; height: min(92dvh, 900px); max-height: 92dvh; margin: auto 0 0; border-radius: 20px 20px 0 0; }
  .recipe-guide-grid { grid-template-columns: 1fr; }
  .recipe-guide-head { padding: .85rem; }
  .recipe-guide-grid { padding: .85rem; }
}

.photo-recipe-workspace { max-width: 1240px; min-height: calc(100vh - 145px); margin: 0 auto; padding: clamp(1rem,3vw,2.4rem); }
.photo-recipe-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; }
.photo-recipe-head h1 { margin: .3rem 0; font-size: clamp(1.7rem,4vw,3rem); }
.photo-recipe-head p { max-width: 760px; margin: 0; color: #5d655d; line-height: 1.65; }
.photo-recipe-head-actions { display: flex; gap: .55rem; }
.photo-recipe-head-actions select, .photo-recipe-head-actions button { min-height: 42px; border: 1px solid #ccd1ca; border-radius: 10px; padding: .55rem .7rem; background: #fff; }
.photo-recipe-layout { display: grid; grid-template-columns: minmax(270px,.72fr) minmax(0,1.5fr); gap: 1rem; align-items: start; }
.photo-recipe-uploader, .photo-recipe-output { border: 1px solid rgba(30,33,29,.12); border-radius: 20px; background: #fff; box-shadow: 0 10px 30px rgba(35,42,35,.07); }
.photo-recipe-uploader { position: sticky; top: 1rem; padding: 1rem; }
.photo-recipe-uploader .btn { width: 100%; min-height: 50px; }
.photo-recipe-picker { margin: 0 0 .8rem; }
.photo-recipe-preview { display: block; width: 100%; max-height: 360px; margin-bottom: .8rem; border-radius: 14px; object-fit: contain; background: #f1f3ef; }
.photo-privacy { margin: .75rem 0 0; color: #697169; font-size: .75rem; line-height: 1.55; }
.photo-recipe-output { min-height: 360px; padding: 1rem; }
.photo-recipe-empty, .photo-recipe-not-found { display: grid; min-height: 320px; place-items: center; margin: 0; padding: 2rem; border: 2px dashed #d5ddd4; border-radius: 16px; color: #687168; text-align: center; }
.photo-recipe-summary { padding: 1rem; border-radius: 16px; background: #edf5ef; }
.photo-recipe-summary > span { color: var(--green); font-size: .7rem; font-weight: 800; letter-spacing: .12em; }
.photo-recipe-summary h2 { margin: .25rem 0 .4rem; font-size: clamp(1.6rem,4vw,2.7rem); }
.photo-recipe-summary > p { color: #536057; line-height: 1.6; }
.photo-recipe-summary dl { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: .6rem; margin: 1rem 0 0; }
.photo-recipe-summary dl div { padding: .7rem; border-radius: 12px; background: rgba(255,255,255,.75); }
.photo-recipe-summary dt { color: #6b746d; font-size: .7rem; font-weight: 700; }
.photo-recipe-summary dd { margin: .2rem 0 0; font-weight: 800; }
.photo-recipe-plan { display: grid; grid-template-columns: minmax(220px,.72fr) minmax(0,1.4fr); gap: .8rem; margin-top: .8rem; }
.photo-recipe-plan > section { padding: 1rem; border: 1px solid #e0e5de; border-radius: 16px; }
.photo-recipe-plan h3 { margin: 0 0 .75rem; font-size: 1rem; }
.photo-recipe-plan ul, .photo-recipe-plan ol { margin: 0; padding-left: 1.25rem; }
.photo-recipe-plan li { margin: .5rem 0; line-height: 1.55; }
.photo-recipe-plan ol { display: grid; gap: .65rem; padding: 0; list-style: none; }
.photo-recipe-plan ol li { margin: 0; padding: .75rem; border-radius: 12px; background: #f6f7f3; }
.photo-recipe-plan ol p { margin: .3rem 0 0; color: #586159; font-size: .85rem; }
.photo-recipe-cta { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: .8rem; padding: 1rem; border-radius: 16px; background: #fff0d5; }
.photo-recipe-cta .btn { min-height: 48px; font-weight: 800; }

@media (max-width: 800px) {
  .photo-recipe-head { flex-direction: column; }
  .photo-recipe-head-actions { width: 100%; }
  .photo-recipe-head-actions > * { flex: 1; }
  .photo-recipe-layout, .photo-recipe-plan { grid-template-columns: 1fr; }
  .photo-recipe-uploader { position: static; }
  .photo-recipe-summary dl { grid-template-columns: 1fr 1fr; }
  .photo-recipe-summary dl div:last-child { grid-column: 1 / -1; }
  .photo-recipe-cta { position: sticky; bottom: .5rem; z-index: 3; flex-direction: column; align-items: stretch; box-shadow: 0 8px 24px rgba(35,42,35,.15); }
}

.cooking-overview {
  margin: .75rem 0 1rem;
  padding: 1rem;
  border: 1px solid rgba(30,33,29,.14);
  border-radius: 18px;
  background: #fffdf4;
  box-shadow: 0 10px 28px rgba(35,42,35,.06);
  scroll-margin-top: .75rem;
}
.cooking-overview:focus { outline: 3px solid rgba(228,83,47,.3); outline-offset: 2px; }
.overview-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.overview-heading h2 { margin: .2rem 0 0; font-size: clamp(1.25rem,3vw,1.75rem); }
.overview-heading p { max-width: 520px; margin: 0; color: #5e665e; font-size: .88rem; }
.cooking-flow { display: flex; gap: .55rem; margin: .9rem 0 0; padding: 0 0 .2rem; overflow-x: auto; list-style: none; scroll-snap-type: x proximity; }
.cooking-flow li { display: flex; align-items: center; gap: .45rem; min-width: max-content; padding: .55rem .72rem; border: 1px solid #d9ddd6; border-radius: 999px; color: #687067; background: #f6f7f3; scroll-snap-align: start; }
.cooking-flow li span { display: grid; width: 1.45rem; height: 1.45rem; place-items: center; border-radius: 50%; background: #dfe4dc; font-size: .72rem; }
.cooking-flow li strong { font-size: .8rem; }
.cooking-flow li.complete { color: #4f6756; background: #e8f1e9; }
.cooking-flow li.complete span::after { content: '✓'; }
.cooking-flow li.complete span { font-size: 0; background: #4f8462; color: #fff; }
.cooking-flow li.complete span::after { font-size: .72rem; }
.cooking-flow li.active { border-color: #e4532f; color: #332d27; background: #fff0db; box-shadow: 0 0 0 2px rgba(228,83,47,.12); }
.cooking-flow li.active span { background: #e4532f; color: #fff; }
.cooking-flow li.jumpable { cursor: pointer; transition: border-color .15s ease, background .15s ease, transform .1s ease; }
.cooking-flow li.jumpable:hover { border-color: #e4532f; background: #fff6ea; }
.cooking-flow li.jumpable:active { transform: scale(.97); }
.cooking-flow li.jumpable:focus-visible { outline: 2px solid #e4532f; outline-offset: 2px; }

@media (max-width: 700px) {
  .cooking-overview { margin-top: .5rem; padding: .85rem; }
  .overview-heading { flex-direction: column; gap: .35rem; }
  .overview-heading p { font-size: .82rem; }
  .cooking-flow { margin-top: .7rem; }
  .cooking-flow li { padding: .5rem .62rem; }
}
