:root {
  color-scheme: light;
  --ink: #22342b;
  --muted: #53665b;
  --pine: #28523f;
  --pine-dark: #1d3d30;
  --line: #dce1d7;
  --paper: #f6f5ee;
  --glass: rgba(255, 255, 250, .85);
  --ui: "Segoe UI Variable", "Segoe UI", sans-serif;
  --display: Georgia, "Times New Roman", serif;
  font: 15px/1.45 var(--ui);
  color: var(--ink);
  background: var(--paper);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; min-height: 100dvh; background: radial-gradient(ellipse at 12% 9%, #e8eee1 0, transparent 53%), radial-gradient(ellipse at 98% 73%, #efeadb 0, transparent 47%), var(--paper); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; color: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 2px solid #47745b;
  outline-offset: 3px;
}
button, a { -webkit-tap-highlight-color: transparent; }
button svg { flex: 0 0 auto; vertical-align: middle; }
a { color: inherit; }
h1, h2, h3, p { margin: 0; }
.skip { position: fixed; top: -4rem; left: 1rem; z-index: 20; padding: 8px 14px; border-radius: 8px; background: white; }
.skip:focus { top: 1rem; }

.shell { display: grid; grid-template-columns: 220px minmax(0, 1fr); min-height: 100vh; min-height: 100dvh; align-items: start; }
.sidebar {
  height: 100vh; height: 100dvh; position: sticky; top: 0; display: flex; flex-direction: column; padding: 33px 17px 19px;
  background: rgba(251, 252, 245, .67); border-right: 1px solid rgba(123, 144, 126, .23);
  backdrop-filter: blur(26px) saturate(115%);
}
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; margin: 0 0 49px 9px; width: fit-content; font: bold 31px/1 var(--display); letter-spacing: -.06em; }
.brand-icon {
  width: 43px; height: 43px; flex: 0 0 43px; display: grid; place-items: center; border-radius: 15px;
  color: #fbf8e9; background: linear-gradient(145deg, #46755a, #244c3a); box-shadow: inset 0 1px 1px #ffffff57, 0 4px 8px #284a3831;
}
.brand-icon svg { width: 23px; height: 23px; }
.brand-period { color: #678746; }
.nav { display: grid; gap: 5px; }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 11px; min-height: 45px; width: 100%; text-align: left;
  background: transparent; border: 1px solid transparent; border-radius: 12px; color: #354d40; font-weight: 600; white-space: nowrap;
}
.nav-item > span { display: inline-flex; }
.nav-item:hover { background: #e8eee3; }
.nav-item.active { background: linear-gradient(135deg, #e1ebdf, #dce8df); border-color: #cfdfd1; box-shadow: inset 0 1px 0 #ffffff9e; color: #204632; }
.sidebar-end { margin-top: auto; }
.local-status { display: flex; align-items: center; gap: 7px; color: #526457; font-size: .75rem; margin: 13px 0 0; padding: 13px 5px 0 10px; border-top: 1px solid #dfe5da; }
.local-status span { width: 7px; height: 7px; border-radius: 50%; background: #67936d; flex: 0 0 7px; }

.content { width: 100%; max-width: 1540px; margin: 0 auto; padding: 26px clamp(22px, 3vw, 58px) 34px; min-width: 0; }
.content:focus { outline: none; }
.page-header { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 22px; }
.page-header h1 { font: 400 clamp(36px, 4vw, 53px)/1.07 var(--display); letter-spacing: -.054em; }
.page-header p { color: var(--muted); margin-top: 7px; }
.button, .icon-button {
  display: inline-flex; justify-content: center; align-items: center; gap: 7px; font-weight: 650; text-decoration: none;
  border: 1px solid transparent; border-radius: 11px; background: transparent; min-height: 39px; padding: 7px 13px;
  transition: background-color .16s, color .16s, border-color .16s, box-shadow .16s;
}
.button svg { width: 17px; height: 17px; }
.primary { color: #fffdf4; background: linear-gradient(150deg, #3b674f, #254a39 85%); border-color: #2b503e; box-shadow: inset 0 1px 0 #ffffff43, 0 4px 10px #253d3125; }
.primary:hover { background: #224733; box-shadow: inset 0 1px 0 #ffffff39, 0 4px 12px #253d3140; }
.new-recipe { border-radius: 14px; min-height: 44px; padding: 9px 15px; flex: 0 0 auto; }
.secondary, .subtle { background: #fbfcf8; border-color: #d8e1d7; color: #365341; }
.secondary:hover, .subtle:hover { background: #e9f0e7; border-color: #c4d5c6; }
.text-button { color: #345941; }
.text-button:hover { background: #e7eee4; color: #244b35; }
.icon-button { min-width: 40px; min-height: 40px; padding: 7px; }
.icon-button:hover { background: #e6eee4; }
.danger { background: #9c3d37; border-color: #9c3d37; color: white; }
.danger:hover { background: #81312c; }
.danger-text { color: #963d36; }
.danger-text:hover { color: #84322c; background: #f6e8e4; }

.hero {
  position: relative; overflow: hidden; min-height: 150px; display: grid; align-items: center; margin-bottom: 22px; border-radius: 24px;
  color: #fffdf2; background: linear-gradient(90deg, #14342780, #1d3c300c 67%), #1d3c30 url("assets/hero.jpg") center 52% / cover no-repeat;
  border: 1px solid #274939; box-shadow: inset 0 1px 1px #ffffff2a, 0 7px 24px #39534124;
}
.hero-content { padding: 18px 32px; }
.hero h2 { font: 400 clamp(40px, 4.6vw, 58px)/.95 var(--display); letter-spacing: -.07em; }
.hero p { color: #eef4e8; font-size: 1rem; margin: 8px 0 12px; }
.hero-button {
  min-height: 37px; border-radius: 10px; border-color: #ffffff65; color: #fffdf2; background: #57766080;
  box-shadow: inset 0 1px 0 #ffffff34; backdrop-filter: blur(16px) saturate(125%); font-size: .9rem;
}
.hero-button:hover { color: white; background: #628873; border-color: #ffffff80; }
.hero-button:focus-visible { outline-color: #fffdf2; }

.glass { background: var(--glass); border: 1px solid #dce3d8; box-shadow: inset 0 1px 0 #fff, 0 7px 26px #3c583411; backdrop-filter: blur(23px) saturate(115%); }
.calendar-panel { padding: 16px 16px 10px; border-radius: 22px; }
.calendar-top { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: 14px; gap: 12px; }
.period, .calendar-actions, .date-arrows { display: flex; align-items: center; gap: 9px; }
.period { gap: 12px; }
.date-arrows { gap: 4px; }
.date-arrows .icon-button { min-width: 34px; min-height: 34px; border-color: #dde4db; border-radius: 9px; padding: 5px; background-color: #f7faf4; }
.date-arrows .icon-button:hover { background: #e5eee4; }
.date-arrows svg { width: 16px; height: 16px; }
.period-copy h2 { font-size: 1.12rem; line-height: 1.25; letter-spacing: -.016em; }
.period-copy p { margin-top: 3px; color: var(--muted); font-size: .79rem; }
.today-button { min-height: 34px; font-size: .83rem; }
.toggle { display: flex; align-items: center; justify-content: center; border: 1px solid #dfe7dd; background: #eaf0e8; border-radius: 10px; padding: 2px; }
.toggle button { min-width: 62px; border: 1px solid transparent; border-radius: 7px; background: transparent; padding: 5px 9px; color: #4b6254; font-weight: 650; font-size: .83rem; }
.toggle button[aria-pressed="true"] { border-color: #dae4da; background: #fff; box-shadow: 0 1px 3px #2c543122; color: #284a34; }
.toggle button:hover { color: #204631; }
.week-grid, .month-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 7px; }
.week-day { min-width: 0; border: 1px solid #e8ece4; border-radius: 12px; padding: 7px; display: grid; align-content: start; gap: 6px; background: #f9faf7; }
.weekend { background: #f8f6ee; border-color: #ece9dd; }
.week-day.is-today { background: #eef5eb; border-color: #bfd1c0; }
.day-header { display: flex; align-items: center; gap: 5px; justify-content: space-between; font-weight: 650; font-size: .86rem; padding: 0 2px; }
.day-header strong, .month-day strong { min-width: 25px; height: 25px; display: inline-grid; place-items: center; border-radius: 50%; font-size: .87rem; }
.is-today strong { color: #fff; background: #37654c; }
.day-meal { min-width: 0; display: grid; gap: 4px; }
.slot-label { display: flex; gap: 4px; align-items: center; width: 100%; font-size: .71rem; color: #516457; padding: 1px 3px; border: 0; border-radius: 5px; background: transparent; text-align: left; }
.slot-label:hover { background: #e9f0e6; color: #214a33; }
.meal-people { display: inline-flex; align-items: center; gap: 2px; margin-left: auto; padding: 0 4px; border-radius: 8px; background: #e3ece1; color: #2f5a41; font-weight: 700; }
.slot-label .meal-people svg { width: 11px; height: 11px; color: inherit; }
.meal-note { display: flex; align-items: center; gap: 4px; width: 100%; min-width: 0; min-height: 27px; padding: 3px 6px; border: 1px solid #e5dcc4; border-radius: 7px; background: #fbf5e4; color: #6a5426; font-size: .72rem; font-weight: 650; font-style: italic; text-align: left; }
.meal-note svg { width: 12px; height: 12px; }
.meal-note span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.meal-note:hover { border-color: #cdbb8c; }
.slot-label svg { width: 13px; height: 13px; }
.slot-label.lunch svg { color: #85642b; }
.slot-label.dinner svg { color: #567365; }
.slot { width: 100%; min-width: 0; min-height: 31px; border-radius: 7px; padding: 4px 5px; display: flex; align-items: center; justify-content: center; gap: 3px; font-size: .74rem; }
.slot.empty, .slot.add-dish { background: #ffffff70; border: 1px dashed #cbd9cc; color: #476253; }
.slot:is(.empty, .add-dish) svg { width: 12px; height: 12px; }
.slot:is(.empty, .add-dish):hover { border-color: #88aa90; background: #e5f1e5; color: #214a33; }
.slot.add-dish { background: transparent; }
.slot.filled { justify-content: start; background: var(--meal-bg); color: var(--meal-ink); border: 1px solid var(--meal-line); font-weight: 650; text-align: left; }
.slot.filled span { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.14; }
.slot.filled:hover { box-shadow: inset 0 0 0 1px var(--meal-ink); }
.slot.filled[draggable="true"] { cursor: grab; }
.slot.filled.dragging { opacity: .45; }
.day-meal { border-radius: 9px; transition: background-color .12s, box-shadow .12s; }
.day-meal.drop-target { background: #e1efe0; box-shadow: 0 0 0 2px #88aa90; }
.calendar-foot { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; padding-top: 7px; }
.calendar-foot .shop-button { margin-left: auto; }
.calendar-foot .button { min-height: 32px; font-size: .83rem; }
.month-grid { row-gap: 5px; }
.month-label { padding: 0 6px 4px; color: var(--muted); font-size: .82rem; font-weight: 650; }
.month-day { min-width: 0; text-align: left; min-height: 76px; display: flex; flex-direction: column; gap: 3px; background: #f8faf5; border: 1px solid #e2e8de; border-radius: 8px; padding: 3px 4px 5px; }
.month-day strong { align-self: flex-start; }
.month-day:hover, .month-day.is-today { background: #eaf3e9; border-color: #bacfba; }
.month-day.other-month { background: #f1f0eb; color: #686e64; }
.month-meal { width: 100%; min-width: 0; display: flex; align-items: center; gap: 3px; font-size: .7rem; font-weight: 650; color: var(--meal-ink); background: var(--meal-bg); border-radius: 4px; padding: 1px 3px; }
.month-meal svg { width: 11px; height: 11px; }
.month-meal span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.month-meal.month-note { background: #fbf5e4; color: #6a5426; font-style: italic; }
.month-more { padding: 0 3px; font-size: .68rem; color: var(--muted); }
.month-more svg { width: 11px; height: 11px; }

.theme-classiques { --meal-bg: #f1ead7; --meal-line: #e4d7b8; --meal-ink: #675328; --wash: #e9dcb6; }
.theme-rapide { --meal-bg: #f5e6db; --meal-line: #ead4c7; --meal-ink: #783f2c; --wash: #edcdbb; }
.theme-poisson { --meal-bg: #e2edf0; --meal-line: #c7dce4; --meal-ink: #31555f; --wash: #bdd9e4; }
.theme-vegetarien { --meal-bg: #e5f0e2; --meal-line: #d2e3cc; --meal-ink: #376141; --wash: #bed6b5; }
.theme-monde { --meal-bg: #eee7f0; --meal-line: #dfd1e2; --meal-ink: #64476a; --wash: #d8c6e0; }
.theme-libre { --meal-bg: #e7efec; --meal-line: #cdded7; --meal-ink: #365b51; }
.featured { margin-top: 20px; }
.section-header { display: flex; align-items: center; justify-content: space-between; gap: 9px; margin: 0 0 10px; }
.section-header h2 { font: 400 clamp(25px, 3vw, 35px)/1.05 var(--display); letter-spacing: -.045em; }
.section-header .button { font-size: .86rem; min-height: 34px; }
.recipe-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; }
.recipe-card { position: relative; min-width: 0; border: 1px solid #e1e4da; border-radius: 15px; background: #fffffa; box-shadow: 0 4px 15px #3d4a2d0b; overflow: hidden; }
.recipe-card:hover { border-color: #becdbf; box-shadow: 0 4px 15px #3d4a2d20; }
.recipe-card-open { background: transparent; border: 0; display: flex; flex-direction: column; width: 100%; height: 100%; padding: 0; text-align: left; }
.recipe-card-open:focus-visible { outline-offset: -3px; }
.recipe-cover { display: block; flex: 0 0 auto; width: 100%; height: 110px; background: var(--meal-bg); overflow: hidden; }
.recipe-cover img, .detail-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cover-illustration { display: grid; width: 100%; height: 100%; place-items: center; background: radial-gradient(ellipse at 62% 116%, var(--wash), transparent 76%), linear-gradient(135deg, #ffffff70, transparent); color: var(--meal-ink); }
.cover-illustration svg { width: 39px; height: 39px; stroke-width: 1.13; }
.recipe-info { display: grid; grid-template-rows: auto 1fr auto; flex: 1; gap: 4px; width: 100%; padding: 10px 11px 12px; }
.recipe-category { color: var(--meal-ink); font-size: .67rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 750; }
.recipe-title { font-weight: 700; line-height: 1.25; letter-spacing: -.015em; overflow-wrap: anywhere; }
.recipe-time { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: .77rem; }
.recipe-time svg { width: 13px; height: 13px; }
.recipe-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-height: 1px; }
.recipe-rating { color: #b5832a; font-size: .8rem; letter-spacing: .04em; }
.recipe-badge { justify-self: start; margin-top: 2px; padding: 1px 8px; border-radius: 10px; background: #e3ece1; color: #2f5a41; font-size: .72rem; font-weight: 700; }
.filters .rating-filter { color: #8a6420; }
.filters .rating-filter[aria-pressed="true"] { background: #f6ecd2; border-color: #e2cf9f; color: #6e4f15; }
.favorite { background: rgba(255, 254, 250, .88); border: 1px solid #fefef9e3; backdrop-filter: blur(14px); border-radius: 50%; color: #2e4a39; }
.favorite:hover { background: #fff; color: #a54142; }
.favorite[aria-pressed="true"] { color: #a33e40; }
.favorite[aria-pressed="true"] svg { fill: #a33e40; }
.card-favorite { position: absolute; top: 7px; right: 7px; min-width: 34px; min-height: 34px; padding: 5px; box-shadow: 0 2px 6px #24382720; }
.card-favorite svg { width: 18px; height: 18px; }

.library-toolbar { border-radius: 18px; display: grid; gap: 12px; padding: 14px; }
.search { display: flex; align-items: center; gap: 8px; padding: 0 11px; min-height: 43px; border: 1px solid #d6e0d5; border-radius: 10px; background: #fbfdf8; color: #486454; }
.search:focus-within { outline: 2px solid #47745b; outline-offset: 2px; }
.search input { min-width: 0; width: 100%; border: 0; background: transparent; color: var(--ink); padding: 7px 0; outline: none; }
.search input:focus-visible { outline: none; }
.filters { display: flex; flex-wrap: wrap; gap: 7px; }
.filters button { font-size: .83rem; min-height: 35px; border: 1px solid #dbe5d9; border-radius: 25px; background: #fbfcf8; padding: 5px 13px; color: #3a5546; }
.filters button:hover { background: #edf2eb; }
.filters button[aria-pressed="true"] { background: #dfece0; border-color: #c2d7c4; color: #274c36; font-weight: 700; }
.result-count { margin: 15px 3px 10px; font-size: .85rem; color: var(--muted); }
.library-grid .recipe-cover { height: 122px; }
.library-grid .recipe-info { min-height: 86px; }
.empty-state { text-align: center; border-radius: 17px; padding: 30px 15px; }
.empty-state h2 { margin: 4px 0 8px; font-size: 1.1rem; }
.empty-state p { margin-bottom: 12px; color: var(--muted); }
.loading { color: var(--muted); padding: 24px 2px; }

dialog { padding: 0; color: var(--ink); width: min(94vw, 526px); max-height: 90vh; overflow-y: auto; border: 1px solid #d4dfd3; border-radius: 20px; background: #fcfcf7; box-shadow: 0 16px 60px #102e2454; }
dialog.wide { width: min(94vw, 749px); }
dialog::backdrop { background: #1a332770; backdrop-filter: blur(4px); }
.dialog-header { display: flex; align-items: start; justify-content: space-between; padding: 19px 21px 13px; gap: 10px; }
.dialog-header h2 { font: 400 clamp(26px, 4vw, 37px)/1.1 var(--display); letter-spacing: -.045em; overflow-wrap: anywhere; }
.dialog-header p { color: var(--muted); margin-top: 4px; }
.dialog-close { min-width: 35px; min-height: 35px; border-color: #dfe7dc; flex: 0 0 35px; background: #f3f6ef; }
.dialog-close svg { width: 18px; height: 18px; }
.dialog-body { padding: 0 21px 17px; }
.dialog-footer { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 11px 21px; border-top: 1px solid #e0e7dc; background: #f2f6ee; }
.dialog-footer .end { margin-left: auto; }
.dialog-notice { color: #40574a; padding-top: 5px; }
.detail-cover { position: relative; border-radius: 13px; overflow: hidden; height: 132px; background: var(--meal-bg); }
.detail-cover:has(.cover-illustration) { height: 80px; }
.detail-cover img { object-position: center 49%; }
.detail-favorite { position: absolute; top: 8px; right: 8px; }
.detail-meta { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; color: var(--muted); font-size: .86rem; margin: 13px 0 16px; }
.detail-meta svg { vertical-align: middle; width: 16px; height: 16px; }
.pill { color: var(--meal-ink); background: var(--meal-bg); border: 1px solid var(--meal-line); border-radius: 14px; padding: 4px 9px; font-weight: 690; }
.detail-grid { display: grid; grid-template-columns: .8fr 1.4fr; gap: 16px; }
.detail-grid section { border: 1px solid #e2e8dd; border-radius: 12px; background: #f7f9f3; padding: 12px; min-width: 0; overflow-wrap: anywhere; }
.detail-grid h3 { font-size: 1rem; }
.ingredient-list, .steps { padding-left: 20px; margin: 7px 0 2px; color: #3e5548; font-size: .91rem; }
.ingredient-list li + li, .steps li + li { margin-top: 5px; }
.quantity-check { display: block; color: #825a29; }
.steps li::marker { color: #2c5e43; font-weight: 720; }
.detail-extra { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px 16px; margin: -6px 0 14px; }
.stars { display: inline-flex; align-items: center; gap: 1px; }
.star { border: 0; background: transparent; padding: 0 2px; font-size: 1.45rem; line-height: 1; color: #d3d8cd; border-radius: 6px; }
.star[aria-pressed="true"] { color: #c8922e; }
.stars:hover .star { color: #e2bf72; }
.stars .star:hover ~ .star { color: #d3d8cd; }
.stars-label { margin-left: 7px; color: var(--muted); font-size: .84rem; }
.recipe-history { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: .84rem; }
.recipe-history svg { width: 15px; height: 15px; }
.recipe-history span:empty::before { content: "…"; }
.detail-notes { margin-top: 14px; display: grid; gap: 5px; }
.detail-notes label { display: flex; align-items: baseline; gap: 9px; flex-wrap: wrap; }
.detail-notes h3 { font-size: 1rem; }
.detail-notes small { color: var(--muted); font-size: .77rem; }
.detail-notes textarea { width: 100%; resize: vertical; border: 1px solid #e2dcc4; border-radius: 10px; background: #fffdf5; padding: 8px 10px; color: var(--ink); }
.notes-status { min-height: 1em; color: var(--muted); font-size: .76rem; }
.source-button { margin-top: 10px; font-size: .84rem; text-align: left; overflow-wrap: anywhere; max-width: 100%; }
.missing { padding: 8px 0; color: var(--muted); font-size: .88rem; }

.form-grid { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 12px; }
.form-grid .full { grid-column: 1 / -1; }
.recipe-numbers { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr) minmax(0, .65fr); gap: 10px; }
.field { display: flex; flex-direction: column; gap: 5px; font-size: .89rem; font-weight: 660; min-width: 0; }
.field small { color: var(--muted); font-size: .77rem; font-weight: 400; }
.field input, .field select, .field textarea { width: 100%; min-width: 0; border: 1px solid #d6e1d5; border-radius: 9px; background: #fff; padding: 8px 10px; color: var(--ink); font-weight: 400; }
.field textarea { resize: vertical; min-height: 90px; }
.form-error { color: #8d302a; font-size: .85rem; }
.import-box { display: flex; flex-direction: column; gap: 7px; padding: 11px 12px; border: 1px dashed #bfd1c0; border-radius: 11px; background: #f4f8f2; }
.import-line { display: flex; gap: 8px; }
.import-line input { flex: 1; min-width: 0; border: 1px solid #d6e1d5; border-radius: 9px; background: #fff; padding: 8px 10px; color: var(--ink); }
.import-line .button { flex: none; }
.picker-favorite { display: flex; gap: 5px; align-items: center; margin: 8px 0; font-size: .86rem; color: #415a4b; }
.picker-favorite input { accent-color: var(--pine); }
.import-photo { font-size: .86rem; }
.photo-row { display: flex; align-items: center; gap: 11px; flex-wrap: wrap; padding: 8px; border: 1px solid #e1e8dc; border-radius: 11px; background: #f7f9f3; }
.photo-thumb { flex: 0 0 72px; width: 72px; height: 52px; border-radius: 8px; overflow: hidden; background: var(--meal-bg); }
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-thumb .cover-illustration svg { width: 24px; height: 24px; }
.photo-text { flex: 1 1 140px; font-size: .89rem; font-weight: 660; }
.photo-text small { display: block; color: var(--muted); font-weight: 400; font-size: .77rem; }
.free-dish-hint { margin: 8px 1px 0; color: var(--muted); font-size: .82rem; }
.quick-dish { width: 100%; justify-content: flex-start; margin-top: 8px; text-align: left; }
.quick-dish span { min-width: 0; overflow-wrap: anywhere; }
.quick-dish:disabled { cursor: default; opacity: .7; }
#free-dish-error, #free-dish-form .form-error { margin-top: 6px; }
.picked-dishes { display: flex; flex-wrap: wrap; gap: 5px; max-height: 84px; overflow: auto; margin: 0 0 7px; padding: 3px; }
.picked-dish { display: inline-flex; align-items: center; gap: 6px; min-height: 29px; max-width: 100%; padding: 4px 8px; border: 1px solid #c5d8c6; border-radius: 20px; background: #e8f1e7; color: #254c36; font-size: .77rem; }
.picked-dish:hover { background: #dcebdd; border-color: #aac6ad; }
.picked-dish span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.picked-dish svg { width: 13px; height: 13px; }
.picker-results { display: grid; gap: 5px; padding: 4px; max-height: min(44vh, 378px); overflow: auto; }
.pick-row { display: flex; gap: 9px; align-items: center; width: 100%; text-align: left; color: var(--ink); background: #f7f9f3; border: 1px solid #e1e8dc; border-radius: 9px; padding: 6px; }
.pick-row:hover { background: #eaf2e8; border-color: #caddc9; }
.dish-choice { display: grid; place-items: center; flex: 0 0 22px; height: 22px; margin-left: auto; border: 1px solid #9aaf9e; border-radius: 6px; background: #fff; }
.dish-choice svg { display: none; width: 15px; height: 15px; }
.pick-row[aria-pressed="true"] { background: #e1eee0; border-color: #aac6ad; }
.pick-row[aria-pressed="true"] .dish-choice { color: #fff; background: var(--pine); border-color: var(--pine); }
.pick-row[aria-pressed="true"] .dish-choice svg { display: block; }
.pick-row:disabled { cursor: default; background: #f1f3eb; }
.pick-row:disabled .dish-choice { visibility: hidden; }
#apply-dishes:disabled { cursor: default; opacity: .63; box-shadow: none; }
.pick-icon { display: grid; place-items: center; flex: 0 0 36px; width: 36px; height: 36px; border-radius: 8px; background: var(--meal-bg); color: var(--meal-ink); }
.pick-name { font-weight: 670; overflow-wrap: anywhere; }
.pick-name small { display: block; color: var(--muted); font-weight: 400; }
.field-hint { color: var(--muted); font-size: .8rem; margin-top: 4px; }
.restore-error { margin-top: 10px; }
.backup-body { display: grid; gap: 7px; }
.backup-body .dialog-notice { margin-bottom: 4px; }
.backup-row { display: flex; gap: 11px; align-items: center; width: 100%; text-align: left; background: #f7f9f3; border: 1px solid #e1e8dc; border-radius: 11px; padding: 9px; }
.backup-row:hover { background: #eaf2e8; border-color: #caddc9; }
.backup-row .pick-icon { --meal-bg: #e3ede1; --meal-ink: #2f5a41; }
.backup-row .pick-icon svg { width: 19px; height: 19px; }
.backup-row .pick-name small { overflow-wrap: anywhere; }
.backup-folder { display: grid; gap: 2px; padding: 4px; border: 1px solid #cfe0cd; border-radius: 13px; background: #eef5ec; }
.backup-folder .backup-row { border-color: transparent; background: transparent; }
.backup-folder-actions { display: flex; gap: 4px; padding: 0 6px 2px 54px; }
.backup-folder-actions .button { min-height: 30px; font-size: .82rem; }
.servings { display: inline-flex; align-items: center; gap: 3px; }
.servings .step { min-width: 28px; min-height: 28px; padding: 4px; border: 1px solid #dde4db; border-radius: 8px; background: #f7faf4; }
.servings .step svg { width: 14px; height: 14px; }
.servings .step:disabled { opacity: .4; cursor: default; }
.servings-value { display: inline-flex; align-items: center; gap: 4px; min-width: 104px; justify-content: center; }
.shop-options { display: flex; align-items: end; flex-wrap: wrap; gap: 8px 20px; margin-bottom: 12px; }
.shop-options .field { max-width: 260px; }
.shop-options .picker-favorite { margin: 0 0 9px; }
#shop-list { display: grid; gap: 12px; }
#shop-list section { border: 1px solid #e2e8dd; border-radius: 12px; background: #f7f9f3; padding: 10px 12px; }
#shop-list h3 { font-size: 1rem; margin-bottom: 6px; }
#shop-list h3 small { color: var(--muted); font-weight: 400; font-size: .8rem; margin-left: 4px; }
.shop-list { list-style: none; margin: 0; padding: 0; columns: 2 230px; column-gap: 20px; }
.shop-list li { break-inside: avoid; }
.shop-item { display: flex; gap: 8px; align-items: start; padding: 4px 2px; font-size: .91rem; cursor: pointer; }
.shop-item input { margin-top: 3px; accent-color: var(--pine); }
.shop-item small { display: block; color: var(--muted); font-size: .74rem; }
.shop-item:has(input:checked) span { text-decoration: line-through; color: var(--muted); }
.shop-free { font-size: .91rem; }
.shop-hint { margin: -2px 2px 0; }
.shop-qr { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 12px; padding: 12px; border: 1px solid #cfe0cd; border-radius: 12px; background: #fff; }
.shop-qr p { flex: 1 1 200px; color: #40574a; font-size: .9rem; }
.qr-image { flex: 0 0 auto; width: min(260px, 70vw); }
.qr-image svg { display: block; width: 100%; height: auto; }

.menu-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .92rem; }
.menu-table th, .menu-table td { padding: 8px 10px; border-bottom: 1px solid #e2e8dd; text-align: left; vertical-align: top; }
.menu-table thead th { color: var(--muted); font-size: .82rem; font-weight: 650; }
.menu-table thead svg { width: 15px; height: 15px; vertical-align: -2px; }
.menu-table tbody th { width: 24%; font-weight: 700; }
.menu-table tbody th small { display: block; color: var(--muted); font-weight: 400; }
.menu-table td { width: 38%; }
.menu-table td > * { display: block; }
.menu-table td em { color: #6a5426; }
.menu-table td small { color: var(--muted); font-size: .78rem; }
.menu-empty { color: #aab6ab; }

dialog.cook { width: min(96vw, 1100px); height: min(92vh, 820px); max-height: none; display: flex; flex-direction: column; }
dialog.cook:not([open]) { display: none; }
.cook-body { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(200px, .7fr) 2fr; gap: 18px; }
.cook-ingredients { overflow-y: auto; border: 1px solid #e2e8dd; border-radius: 12px; background: #f7f9f3; padding: 12px; }
.cook-ingredients h3 { font-size: 1rem; }
.cook-ingredients h3 small { color: var(--muted); font-weight: 400; font-size: .8rem; }
.cook-main { min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }
.cook-timers { display: flex; flex-wrap: wrap; gap: 8px; }
.cook-timers:empty { display: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.cook-timer { display: inline-flex; align-items: center; gap: 7px; padding: 3px 3px 3px 11px; border: 1px solid #c2d7c4; border-radius: 22px; background: #e8f2e6; color: #234b33; font-size: .92rem; }
.cook-timer > svg { width: 17px; height: 17px; }
.cook-timer strong { font-variant-numeric: tabular-nums; font-size: 1.05rem; min-width: 3.2em; }
.cook-timer .icon-button { min-width: 32px; min-height: 32px; padding: 6px; }
.cook-timer.done { border-color: #d99a8f; background: #fde9e3; color: #8a2f27; animation: ring 1s ease-in-out infinite; }
@keyframes ring { 50% { box-shadow: 0 0 0 5px #f2b8ab66; } }
.cook-step { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 18px; padding: 8px 6px 20px; }
.cook-number { color: #2c5e43; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; font-size: .86rem; }
.cook-text { font: 400 clamp(22px, 2.6vw, 34px)/1.35 var(--display); letter-spacing: -.02em; overflow-wrap: anywhere; }
.cook-timer-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.cook-footer .button { min-height: 46px; padding-inline: 18px; font-size: 1rem; }
.cook-progress { flex: 1; text-align: center; color: var(--muted); font-weight: 650; }
.toast { z-index: 30; display: flex; align-items: center; gap: 7px; position: fixed; bottom: max(17px, env(safe-area-inset-bottom)); right: max(18px, env(safe-area-inset-right)); max-width: min(390px, 88vw); background: #e6f0e5; color: #254c36; border: 1px solid #becec0; border-radius: 12px; padding: 11px 14px; box-shadow: 0 5px 16px #2a473429; }
.toast.error { color: #7e2e2b; background: #feece7; border-color: #dfbdb7; }
.toast svg { flex: 0 0 auto; }

@media (min-width: 1450px) {
  .hero { min-height: 180px; }
  .recipe-cover { height: 148px; }
  .slot { min-height: 36px; }
}
@media (max-width: 1130px) {
  .shell { grid-template-columns: 184px minmax(0, 1fr); }
  .sidebar { padding-inline: 12px; }
  .content { padding-inline: 20px; }
  .week-day { padding-inline: 4px; }
  .day-header { padding-inline: 1px; }
  .recipe-grid { gap: 9px; }
}
@media (max-width: 970px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: sticky; top: 0; flex-direction: row; align-items: center; gap: 12px; height: auto; z-index: 2; border: 0; border-bottom: 1px solid #d5ded2; padding: 7px 14px; }
  .brand { margin: 0; gap: 7px; font-size: 24px; }
  .brand-icon { width: 34px; height: 34px; flex-basis: 34px; border-radius: 11px; }
  .brand-icon svg { width: 18px; height: 18px; }
  .local-status { display: none; }
  .nav { display: flex; gap: 1px; }
  .nav-item { width: auto; gap: 5px; padding: 6px 8px; min-height: 35px; font-size: .82rem; }
  .nav-item svg { width: 16px; height: 16px; }
  .sidebar-end { margin: 0 0 0 auto; }
  .content { padding-top: 17px; }
}
@media (max-width: 670px) {
  .content { padding-inline: 12px; }
  .hero { min-height: 140px; background-position: 58% center; }
  .hero-content { padding-inline: 17px; }
  .hero p { font-size: .87rem; }
  .calendar-panel { padding: 11px 9px 8px; }
  .week-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .recipe-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sidebar { padding-inline: 8px; gap: 8px; }
  .nav-item { padding-inline: 5px; }
  .page-header h1 { font-size: 34px; }
  .new-recipe { font-size: .84rem; padding-inline: 8px; }
  .detail-grid { grid-template-columns: 1fr; gap: 8px; }
  .cook-body { grid-template-columns: 1fr; }
  .cook-ingredients { max-height: 30vh; }
}
@media (max-width: 460px) {
  .sidebar { flex-wrap: wrap; }
  .nav { order: 2; width: 100%; justify-content: space-between; }
  .period { gap: 6px; }
  .period-copy h2 { font-size: .97rem; }
  .calendar-actions { flex: 1 1 100%; justify-content: space-between; }
  .month-day { padding-inline: 2px; }
  .month-meal { padding: 2px; }
  .month-meal svg, .month-more svg { display: none; }
  .page-header { align-items: start; }
  .page-header h1 { font-size: 29px; }
  .section-header .button { padding-inline: 3px; }
  .form-grid { grid-template-columns: 1fr; }
}
@media print {
  .shell, .toast, .skip, .dialog-footer, .dialog-close, .shop-options, .field-hint { display: none !important; }
  body { background: none; }
  dialog { position: static; width: auto; max-height: none; overflow: visible; border: 0; box-shadow: none; background: none; }
  dialog::backdrop { display: none; }
  #shop-list section { border: 0; background: none; padding: 0; }
  .shop-item small { display: none; }
  .shop-qr, .shop-item:has(input:checked), .shop-list li:has(input:checked) { display: none !important; }
  .shop-item input { display: none; }
  #shop-list section:has(.shop-list):not(:has(input:not(:checked))) { display: none !important; }
  .shop-item::before { content: "☐"; margin-right: 4px; }
  dialog.printable .dialog-header { padding-inline: 0; }
  .menu-print .dialog-body { padding: 0; }
  .menu-table { font-size: 12pt; }
  .menu-table th, .menu-table td { border-bottom: 1px solid #999; padding: 10px 8px; }
  .menu-table svg { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}

/* Écran du code d’accès (navigateur) */
.keypad-screen {
  position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; border: 0; color: inherit; overflow-y: auto;
  display: flex; align-items: center; justify-content: center;
  padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  background: radial-gradient(ellipse at 12% 9%, #e8eee1 0, transparent 53%), radial-gradient(ellipse at 98% 73%, #efeadb 0, transparent 47%), var(--paper);
}
.keypad-screen:not([open]) { display: none; }
.keypad-screen::backdrop { background: transparent; }
.keypad-card { width: 100%; max-width: 320px; margin: auto; text-align: center; color: var(--ink); }
.keypad-brand { margin: 0; font: 700 28px/1.2 var(--display); color: var(--pine); }
.keypad-title { margin: 8px 0 18px; font: 600 18px/1.3 var(--ui); }
.keypad-dots { display: flex; justify-content: center; gap: 18px; margin-bottom: 12px; }
.keypad-dot { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--pine); background: transparent; transition: background .12s; }
.keypad-dot.filled { background: var(--pine); }
.keypad-message { min-height: 3em; margin: 0 0 8px; color: var(--muted); font-size: 14px; }
.keypad-message.error { color: #a1332a; font-weight: 600; }
.keypad-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.keypad-key {
  min-height: 68px; border-radius: 18px; border: 1px solid var(--line); background: var(--glass);
  color: var(--ink); font: 600 26px/1 var(--ui); touch-action: manipulation;
}
.keypad-key:active:not(:disabled) { background: var(--pine); color: #fff; border-color: var(--pine); }
.keypad-key:disabled { opacity: .45; cursor: default; }
.keypad-erase { font-size: 22px; }
.keypad-note { margin: 20px 0 0; color: var(--muted); font-size: 12.5px; }

/* Bandeau hors ligne (navigateur) */
.offline-banner { position: sticky; top: 0; z-index: 25; text-align: center; padding: 8px 14px; background: #fbefd5; color: #6b4a12; border-bottom: 1px solid #e5cf9d; font-size: .88rem; }
.desktop-only-note { color: #526457; font-size: .85rem; margin: 6px 0 0; }

/* Appli sur téléphone : zones sûres (encoche, barre du bas), encart d’installation */
.sidebar { padding-top: max(33px, env(safe-area-inset-top)); padding-left: max(17px, env(safe-area-inset-left)); }
.content { padding-bottom: max(34px, calc(env(safe-area-inset-bottom) + 20px)); padding-right: max(clamp(22px, 3vw, 58px), env(safe-area-inset-right)); padding-left: max(clamp(22px, 3vw, 58px), env(safe-area-inset-left)); }
.installer { display: flex; align-items: center; gap: 10px; padding: 7px max(14px, env(safe-area-inset-right)) 7px max(14px, env(safe-area-inset-left)); background: #e6f0e5; color: #254c36; border-bottom: 1px solid #becec0; font-size: .85rem; }
.installer p { flex: 1; min-width: 0; line-height: 1.3; }
.installer-button { min-height: 34px; padding: 4px 12px; font-size: .85rem; flex: 0 0 auto; }
.installer-close { flex: 0 0 auto; width: 34px; height: 34px; border: 0; border-radius: 50%; background: transparent; font-size: 22px; line-height: 1; color: inherit; }
@media (max-width: 970px) {
  .sidebar { padding-top: max(7px, env(safe-area-inset-top)); padding-left: max(14px, env(safe-area-inset-left)); padding-right: max(14px, env(safe-area-inset-right)); }
  .content { padding-left: max(20px, env(safe-area-inset-left)); padding-right: max(20px, env(safe-area-inset-right)); }
}
@media (max-width: 670px) {
  .content { padding-left: max(12px, env(safe-area-inset-left)); padding-right: max(12px, env(safe-area-inset-right)); }
  .cook-ingredients { max-height: 30dvh; }
}
@media (max-width: 460px) {
  .sidebar { padding-left: max(8px, env(safe-area-inset-left)); padding-right: max(8px, env(safe-area-inset-right)); }
}
dialog { max-height: 90vh; max-height: 90dvh; }
dialog.cook { height: min(92vh, 820px); height: min(92dvh, 820px); max-height: none; }
@media (max-width: 670px) {
  dialog.cook { width: 100vw; max-width: none; height: 100dvh; max-height: none; border-radius: 0; }
  .dialog-footer { padding-bottom: max(11px, env(safe-area-inset-bottom)); }
}
@media print { dialog { max-height: none; } }

.online-block { display: grid; gap: 8px; padding: 10px; border: 1px solid #cfe0cd; border-radius: 13px; background: #f4f8f2; }
.online-block h3 { margin: 0; }
.online-block .field { margin: 0; }
.session-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.session-list small { color: #526457; display: block; }
