/* Rumpfy: the menu and the recipes are the working surface. */
:root { --paper: #f4f6f4; --card: #fff; --ink: #18392a; --muted: #52655a; --line: #dce5de; --shadow: 0 5px 20px #15352308; }
body { font-size: 1rem; }
.app-shell { max-width: 1240px; padding: 0 32px 70px; }
.topbar { height: 76px; gap: 12px; }
.brand small { font-size: .875rem; letter-spacing: 0; }
.account-button span { font-size: .75rem; text-transform: none; letter-spacing: 0; }
.account-button strong { font-size: .875rem; }
.button, .small-button, .icon-button { min-height: 44px; }
.button, .small-button { font-size: .875rem; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible { outline: 3px solid #278258; outline-offset: 3px; }
.eyebrow { font-size: .75rem; color: #52655a; letter-spacing: .08em; }
.hero.week-context { min-height: 0; padding: 18px 24px; margin: 0 0 18px; border-radius: 20px; align-items: center; gap: 20px; background: #163e2c; }
.week-context::before, .week-context::after { display: none; }
.week-context .eyebrow { color: #c9decd; }
.week-context h1 { margin: 0; font-size: 1.625rem; line-height: 1.15; letter-spacing: -.025em; }
.week-context .hero-stats { min-width: 0; padding: 0; background: none; gap: 24px; backdrop-filter: none; }
.week-context .hero-stats strong { color: #fff; font-size: 1.25rem; }
.week-context .hero-stats span { font-size: .875rem; text-transform: none; letter-spacing: 0; color: #c9decd; }
.week-context .button { background: #ffffff10; border: 1px solid #ffffff40; color: white; }
.tabs { margin: 0 0 28px; gap: 8px; overflow: visible; padding-bottom: 12px; }
.tabs .tab { padding: 10px 18px; font-size: .9375rem; border-radius: 12px; white-space: nowrap; }
.tabs .tab.active { background: #e2eee4; }
.tabs .tab.active::after { display: none; }
.tabs .tab[data-tab="breakfast"], .tabs .tab[data-tab="lunch"], .tabs .tab[data-tab="dinner"], .tabs .tab[data-tab="desserts"], .tabs .tab[data-tab="archive"], .tabs .tab[data-tab="fridge"], .tabs .tab[data-tab="bar"] { display: none; }
.tabs .mobile-more-tab { display: block; border: 0; border-radius: 12px; padding: 10px 18px; background: transparent; font-size: .9375rem; color: var(--muted); font-weight: 700; }
.tabs .mobile-more-tab.active { background: #e2eee4; color: var(--green); }
.section-heading { align-items: center; margin-bottom: 18px; gap: 16px; }
.section-heading h2 { font-size: 1.875rem; line-height: 1.2; letter-spacing: -.025em; }
.section-heading .actions { flex-wrap: wrap; gap: 8px; }
.meal-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.meal-card, .catalog-card, .recipe-collection, .inventory-panel, .chat-panel { backdrop-filter: none; -webkit-backdrop-filter: none; box-shadow: var(--shadow); }
.meal-card { border-radius: 18px; }
.meal-art.has-photo { height: 180px; }
.meal-body { padding: 18px; }
.meal-body h3 { font-size: 1.1875rem; line-height: 1.3; }
.meal-description { font-size: .9375rem; }
.metadata { font-size: .875rem; gap: 6px 14px; color: var(--muted); }
.meal-actions { gap: 8px; flex-wrap: wrap; }
.meal-actions .small-button { padding: 8px 12px; }
.day { font-size: .875rem; background: #fff; color: var(--ink); }
.empty-card { padding: 28px; border-radius: 18px; }
.empty-card p { font-size: 1rem; }
.empty-illustration { display: none; }
.week-prompt { padding: 14px 18px; background: #e8f0e9; border-radius: 16px; }
.week-prompt small, .week-prompt p { font-size: .875rem; }
.discovery-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.discovery-summary { margin: -8px 0 14px; font-size: .875rem; color: var(--muted); }
.discovery-search { display: block; margin-bottom: 16px; }
.discovery-search input { width: 100%; min-height: 50px; background: white; border: 1px solid var(--line); border-radius: 14px; padding: 12px 16px; font-size: 1rem; }
.choice-guide { padding: 0; background: transparent; border: 0; box-shadow: none; margin: 0 0 24px; }
.choice-guide-intro { display: block; margin-bottom: 10px; }
.choice-guide-intro h3 { font-size: 1rem; margin-bottom: 10px; }
.choice-guide-avatar { display: none; }
.guide-options { display: flex; flex-wrap: nowrap; overflow-x: auto; padding: 3px 3px 10px; gap: 8px; }
.guide-options label { flex: none; }
.guide-options span { min-height: 44px; font-size: .875rem; padding: 10px 14px; background: #fff; border: 1px solid var(--line); }
.guide-options input:checked + span { background: #163e2c; border-color: #163e2c; color: #fff; }
.guide-more { margin-top: 4px; }
.guide-more summary { font-size: .875rem; min-height: 44px; }
.guide-more small { font-size: .875rem; }
.guide-selects label { font-size: .875rem; }
.guide-submit { display: none; }
.catalog-explorer { margin: 0 0 20px; border-radius: 14px; }
.catalog-explorer summary, .catalog-explorer small { font-size: .875rem; }
.catalog-toolbar label, .catalog-toolbar label span { font-size: .875rem; }
.collection-heading h3 { font-size: 1.25rem; line-height: 1.25; }
.collection-heading p { font-size: .875rem; }
.collection-shelf { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.catalog-card { border-radius: 18px; background: white; }
.catalog-photo { height: 160px; }
.catalog-card-body { padding: 16px; }
.catalog-card-body h3 { font-size: 1.125rem; line-height: 1.3; min-height: 0; }
.catalog-tags, .catalog-card .nutrition { display: none; }
.catalog-description { font-size: .875rem; line-height: 1.5; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.catalog-at-a-glance { font-size: .875rem; }
.catalog-at-a-glance span { background: #edf3ee; padding: 4px 8px; }
.catalog-rating, .catalog-memory { font-size: .875rem; }
.catalog-card-actions { grid-template-columns: 1fr 1fr; gap: 6px; }
.catalog-card .catalog-card-actions button { font-size: .875rem; min-height: 44px; }
.catalog-card .photo-select { display: none; }
.catalog-card .catalog-card-actions .course-recipe { display: inline-block; }
.favorite-recipe { width: 44px; height: 44px; min-height: 44px; }
.selection-purpose small, .selection-dialog-copy, .choice-byline, .selected-recipe-chip small, .collection-empty { font-size: .875rem; }
.catalog-more p { font-size: .875rem; }
.more-grid b, .more-grid button { font-size: .875rem; }
.form-grid label, fieldset legend, .recipe-source p, .family-quantity-notice { font-size: .875rem; }
.recipe-hero p, .ingredient-list, .step-list { font-size: 1rem; }
#recipe-dialog { background: white; }
.recipe-source small { font-size: .75rem; }
@media (max-width: 1000px) {
  .collection-shelf { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .meal-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .week-context .hero-stats { gap: 14px; }
  .week-context .button { max-width: 150px; }
}
@media (max-width: 700px) and (min-width: 581px) {
  .app-shell { padding: 0 20px 50px; }
  .tabs .tab, .tabs .mobile-more-tab { padding: 10px; font-size: .875rem; }
  .brand small { display: none; }
  .week-context { flex-wrap: wrap; }
}
@media (max-width: 580px) {
  .app-shell { padding: 0 16px calc(var(--phone-nav-height) + var(--phone-safe-bottom) + 24px); }
  .topbar { height: calc(62px + env(safe-area-inset-top)); margin-bottom: 12px; }
  .brand strong { font-size: 1.25rem; }
  .account-button strong { font-size: .875rem; }
  .hero.week-context { display: grid; grid-template-columns: 1fr auto; gap: 12px; padding: 16px; margin-bottom: 18px; }
  .week-context h1 { font-size: 1.25rem; }
  .week-context .eyebrow { font-size: .75rem; }
  .week-context .hero-stats { grid-column: 1 / -1; grid-row: 2; gap: 16px; min-width: 0; }
  .week-context .hero-stats div { text-align: left; }
  .week-context .hero-stats strong { font-size: 1.125rem; }
  .week-context .hero-stats span { font-size: .75rem; white-space: normal; }
  .week-context .button { font-size: .875rem; max-width: 130px; padding: 6px 10px; }
  .tabs { margin: 0; padding: 5px 8px calc(5px + var(--phone-safe-bottom)); overflow: visible; gap: 3px; }
  .tabs .tab, .tabs .mobile-more-tab { min-width: 0; padding: 4px 2px; font-size: .75rem; }
  .tabs .mobile-more-tab { display: flex; flex-direction: column; align-items: center; justify-content: center; }
  .tabs .count { font-size: .75rem; min-width: 18px; height: 18px; line-height: 16px; }
  .section-heading { flex-wrap: wrap; align-items: start; gap: 12px; }
  .section-heading h2, #catalog-view .section-heading h2 { font-size: 1.5rem; }
  #week-view > .section-heading .actions { width: 100%; display: grid; grid-template-columns: 1fr 1fr; }
  #week-view > .section-heading .actions .button { min-height: 46px; padding: 10px 8px; }
  .meal-grid { grid-template-columns: 1fr; gap: 14px; }
  .meal-card { display: grid; grid-template-columns: 104px minmax(0, 1fr); }
  .meal-art.has-photo { height: 100%; min-height: 156px; }
  .meal-art .day { top: 10px; left: 8px; padding: 4px 7px; font-size: .75rem; }
  .meal-body { padding: 14px 12px; min-width: 0; }
  .meal-body h3 { font-size: 1rem; margin-bottom: 8px; }
  .meal-description { display: none; }
  .metadata { font-size: .875rem; gap: 3px 8px; }
  .metadata span:last-child { display: none; }
  .meal-actions { margin-top: 12px; gap: 6px; }
  .meal-actions .small-button { padding: 6px 9px; font-size: .875rem; }
  .meal-finished-label { grid-column: 1 / -1; grid-row: 2; }
  .cooked-meal-card .meal-body { grid-column: 2; grid-row: 1; }
  .week-prompt { flex-wrap: wrap; padding: 14px; }
  .week-prompt-actions { flex-wrap: wrap; }
  .discovery-actions { gap: 6px; }
  .discovery-actions .button, .discovery-actions .small-button { padding: 8px 12px; font-size: .875rem; }
  .choice-guide { padding: 0; }
  .choice-guide-intro h3 { font-size: 1rem; }
  .collection-shelf { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 82%; gap: 12px; }
  .collection-heading h3 { font-size: 1.125rem; }
  .catalog-photo { height: 172px; }
  .catalog-card-body { padding: 14px; }
  .catalog-card-body h3 { font-size: 1.125rem; }
  .catalog-description, .catalog-at-a-glance, .catalog-rating { font-size: .875rem; }
  .catalog-card .catalog-card-actions { grid-template-columns: 1fr 1fr; }
  .catalog-card .photo-select { display: none; }
  .catalog-card .catalog-card-actions .course-recipe { display: inline-block; }
  .choice-mobile-actions button, .shopping-finish-dock .button { font-size: .875rem; }
  dialog { background: #fff; }
  dialog .dialog-head, #recipe-dialog .dialog-back { background: #fff; }
  dialog .dialog-head h2, #recipe-dialog h2 { font-size: 1.5rem; }
  .shopping-item .item-name b { font-size: 1rem; }
  .shopping-item .item-qty { font-size: .875rem; }
  .guide-options { margin-right: -16px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Keep the weekly decision visible without requiring a settings detour. */
.week-settings { display:flex; align-items:center; flex-wrap:wrap; gap:12px 20px; margin:0 0 18px; padding:16px; background:var(--surface, #fff); border:1px solid #dce5df; border-radius:16px; }
.week-settings label { display:flex; align-items:center; gap:10px; font-weight:700; }
.week-settings select { max-width:100%; padding:10px; border:1px solid #cbdad1; border-radius:10px; background:#fff; color:#183e2d; font:inherit; }
.week-settings p { flex:1; margin:0; font-size:.85rem; color:#53665b; }
.pantry-check summary { cursor:pointer; font-weight:700; padding:8px 0; }
.pantry-check p { font-size:.85rem; color:#53665b; }
.pantry-check button { margin:12px 0; }
@media (max-width:600px) { .week-settings { align-items:flex-start; gap:10px; } .week-settings p { flex-basis:100%; } }

.app-disclaimer { margin: 24px auto 0; max-width: 640px; padding: 12px 20px; color: var(--muted); text-align: center; font-size: .72rem; line-height: 1.5; }

.light-access, .light-filters { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; }
.light-access span { color: var(--muted); font-size: .85rem; }
.light-access .small-button { background: #edf4ee; border-color: #bdd1c3; }
.light-access [aria-pressed="true"], .light-filters [aria-pressed="true"] { background: #163e2c; color: white; border-color: #163e2c; }
.light-filters.hidden { display: none; }

/* Home: choose a meal, or open a recipe that is already planned. */
.home-welcome { margin: 6px 0 24px; }
.home-welcome h1 { margin: 4px 0 8px; font-size: clamp(2rem, 4vw, 2.75rem); letter-spacing: -.045em; line-height: 1.1; }
.home-welcome > p:last-child { color: var(--muted); margin: 0; line-height: 1.5; }
.home-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.home-intent { display: grid; grid-template-columns: 42% minmax(0, 1fr); width: 100%; padding: 0; overflow: hidden; border: 0; border-radius: 24px; text-align: left; font: inherit; cursor: pointer; box-shadow: 0 6px 22px #173d2710; transition: transform .15s; }
.home-intent:hover { transform: translateY(-2px); }
.home-intent > img { display: block; width: 100%; height: 100%; min-height: 220px; object-fit: cover; }
.home-choose { background: #f2e7d8; color: #3d3022; }
.home-cook { background: #173f30; color: #fff; }
.home-intent-copy { padding: 26px 20px; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 9px; min-width: 0; }
.home-intent-copy > small { font-size: .75rem; font-weight: 600; opacity: .8; }
.home-intent-copy > strong { font-size: 1.9rem; letter-spacing: -.035em; line-height: 1.05; }
.home-intent-copy > span { font-size: .9rem; line-height: 1.45; opacity: .9; }
.home-intent-copy > b { display: block; margin-top: 8px; font-size: .875rem; line-height: 1.4; }
.home-shortcuts { display: flex; gap: 8px; flex-wrap: wrap; margin: 16px 0 32px; }
.home-shortcuts .small-button { background: transparent; border: 1px solid var(--line); border-radius: 20px; padding: 8px 14px; }
.home-meals, .home-next-meals { scroll-margin-top: 20px; }
.home-meals > .section-heading, .home-next-meals > .section-heading { margin-bottom: 18px; align-items: center; }
.home-next-meals .section-heading p:last-child { color: var(--muted); font-size: .9rem; margin: 8px 0 0; }
.home-next-meals { margin-top: 28px; }
.home-next-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.home-recipe { padding: 0; border: 1px solid var(--line); border-radius: 20px; background: white; overflow: hidden; font: inherit; color: var(--ink); text-align: left; cursor: pointer; }
.home-recipe > img { width: 100%; aspect-ratio: 1.45; display: block; object-fit: cover; }
.home-recipe > span { display: flex; flex-direction: column; align-items: flex-start; padding: 16px; gap: 8px; }
.home-recipe small { border-radius: 20px; padding: 4px 9px; font-size: .75rem; background: #eef3ed; }
.home-recipe strong { font-size: 1.05rem; line-height: 1.3; }
.home-recipe b { font-size: .8rem; color: #25664b; margin-top: 3px; }
.home-shopping-note { display: flex; gap: 14px; justify-content: space-between; align-items: center; border-radius: 16px; padding: 12px 16px; background: #e9f0e9; margin-bottom: 18px; font-size: .9rem; }
.home-shopping-note .small-button { flex: none; }
.home-empty { padding: 22px; border-radius: 20px; background: #eeeae1; }
.home-empty h3 { margin: 0 0 8px; }
.home-empty p { margin: 0; color: var(--muted); line-height: 1.5; }
.home-preferences { margin-top: 32px; border-top: 1px solid var(--line); padding-top: 18px; color: var(--muted); }
.home-preferences > summary { cursor: pointer; font-size: .875rem; min-height: 44px; }
.home-preferences .week-settings { margin-top: 12px; }
#home-meals .meal-card { display: flex; flex-direction: column; }
#home-meals .meal-art.has-photo { min-height: 0; height: auto; aspect-ratio: 1.6; width: 100%; background-size: cover; background-position: center; }
#home-meals .meal-body { padding: 18px; }
#home-meals .meal-body h3 { font-size: 1.2rem; }
#home-meals .meal-actions { flex-wrap: wrap; }
#home-meals .meal-actions .cooking-detail { min-width: 100px; }
#home-meals .meal-finished-label { order: 3; }
#home-meals .meal-cook-button { background: #edf3ed; color: #25664b; }
@media (max-width: 760px) {
  .home-actions { grid-template-columns: 1fr; gap: 14px; }
  .home-intent { grid-template-columns: 38% minmax(0, 1fr); border-radius: 20px; }
  .home-intent > img { min-height: 160px; }
  .home-intent-copy { padding: 18px; gap: 7px; }
  .home-intent-copy > strong { font-size: 1.6rem; }
  .home-intent-copy > span { font-size: .825rem; }
  .home-intent-copy > b { margin-top: 4px; font-size: .8rem; }
  .home-next-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .home-recipe > span { padding: 12px; }
  .home-recipe strong { font-size: .95rem; }
  .home-shopping-note { align-items: flex-start; flex-direction: column; gap: 8px; }
  .home-welcome { margin-top: 0; margin-bottom: 20px; }
  .home-welcome > p:last-child { font-size: .9rem; }
  .home-shortcuts { margin-bottom: 26px; gap: 6px; }
  .home-shortcuts .small-button { padding: 8px 11px; font-size: .8rem; }
  #home-meals .meal-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { .home-intent { transition: none; } }
.home-photo-missing { display: flex; align-items: center; justify-content: center; background: #285440; padding: 20px; font-size: .9rem; text-align: center; }
.week-workflow:empty { display: none; }
.recipe-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 8px; }
.recipe-chip { font: inherit; font-size: .875rem; min-height: 44px; padding: 9px 15px; border: 1px solid #cbd8ce; border-radius: 999px; background: white; color: #214c36; cursor: pointer; }
.recipe-chip[aria-pressed="true"] { background: #173f30; color: #fff; border-color: #173f30; box-shadow: inset 0 0 0 1px #fff3; }
.recipe-chip[aria-pressed="true"]::after { content: " ×"; margin-left: 5px; }
.chip-clear { border-style: dashed; background: transparent; }
.chip-help { font-size: .8rem; color: var(--muted); margin: 0 0 22px; }

/* Photographier et retrouver les livres familiaux. */
.book-import-panel { background:var(--card, #fff); border:1px solid #d7dfda; border-radius:22px; padding:24px; margin:20px 0; }
.book-import-panel > label { display:grid; gap:8px; margin:18px 0; }
.book-photo-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:18px; margin:22px 0; }
.book-photo-slot { display:grid; align-content:start; gap:10px; min-width:0; }
.book-photo-slot h4 { margin:0; }
.book-photo-preview { display:grid; place-items:center; height:210px; background:#edf2ef; border:1px dashed #a5b9ae; border-radius:12px; overflow:hidden; }
.book-photo-preview span { font-size:42px; }
.book-photo-preview img { width:100%; height:100%; object-fit:contain; }
.book-warnings { padding:16px; background:#fff6d9; border-radius:12px; margin:18px 0; }
.book-ingredient { display:grid; grid-template-columns:2fr 1fr 1fr 1.3fr auto; gap:10px; align-items:end; margin:16px 0; }
.book-ingredient label { display:grid; gap:6px; font-size:.875rem; min-width:0; }
.book-ingredient input { width:100%; min-width:0; }
.book-import-panel .book-confirm { display:flex; align-items:flex-start; gap:12px; }
.book-confirm input { flex:0 0 auto; width:22px; height:22px; margin-top:2px; }
.book-library { display:grid; gap:16px; }
.book-library-card { display:flex; gap:20px; background:#fff; border:1px solid #d7dfda; border-radius:18px; padding:18px; }
.book-library-card > img { width:90px; height:125px; object-fit:contain; }
.book-library-card h3 { margin:0 0 8px; }
.book-source { display:flex; gap:18px; align-items:start; }
.book-cover { width:95px; height:130px; object-fit:contain; }
.book-source p { max-width:650px; }
.book-camera-dialog { width:min(760px,95vw); max-height:95dvh; overflow:auto; }
.book-camera-stage { position:relative; background:#111; overflow:hidden; border-radius:14px; }
.book-camera-stage video { display:block; width:100%; max-height:60dvh; object-fit:contain; }
.book-camera-mask { position:absolute; inset:5%; border:3px solid #fff; border-radius:8px; box-shadow:0 0 0 100vmax #0005; pointer-events:none; display:flex; align-items:end; justify-content:center; }
.book-camera-mask span { background:#163e2f; color:#fff; padding:6px 12px; font-size:.875rem; border-radius:6px; margin-bottom:8px; }
@media(max-width:700px) {
  .tabs .tab[data-tab="books"] { display:none; }
  .book-import-panel { padding:16px; }
  .book-photo-grid { grid-template-columns:1fr; }
  .book-photo-slot { grid-template-columns:1fr 1fr; }
  .book-photo-slot h4,.book-photo-preview { grid-column:1/-1; }
  .book-photo-preview { height:190px; }
  .book-ingredient { grid-template-columns:1fr 1fr; border-bottom:1px solid #d7dfda; padding-bottom:16px; }
  .book-ingredient label:first-child { grid-column:1/-1; }
  .book-library-card { gap:12px; }
  .book-library-card > img { width:65px; height:95px; }
  .book-library-card .actions { flex-wrap:wrap; }
  .book-source { flex-wrap:wrap; }
}

.book-source > div { min-width:0; flex:1; }
.book-source .small-button { display:inline-flex; align-items:center; white-space:normal; max-width:100%; margin:4px 0; overflow-wrap:anywhere; }
@media(max-width:700px) { .book-source > div { flex-basis:100%; } }
.book-category-review { border: 1px solid var(--border, #d7dfd7); border-radius: 16px; padding: 16px; margin: 18px 0; min-width: 0; }
.book-category-review legend { font-weight: 700; padding: 0 6px; }
.book-category-options, .book-category-badges { display: flex; flex-wrap: wrap; gap: 8px; }
.book-category-options label { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border: 1px solid var(--border, #d7dfd7); border-radius: 20px; cursor: pointer; }
.book-category-options input { width: 18px; height: 18px; margin: 0; }
.book-category-options label:has(input:checked), .book-category-badges span { background: #e9f1e4; color: #294a33; }
.book-category-badges { margin: 8px 0 12px; }
.book-category-badges span { padding: 5px 10px; border-radius: 20px; font-size: .85rem; }
