:root { font-family: ui-rounded, "SF Pro Rounded", system-ui, sans-serif; color: #27251f; background: #f6f4ed; }
html { touch-action: manipulation; -webkit-text-size-adjust: 100%; }
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
.shell { display: flex; flex-direction: column; width: min(100%, 680px); margin: auto; padding: 52px 22px 72px; }
header { order: 1; }
.brand-lockup { display: inline-flex; align-items: center; gap: 9px; margin: 0 0 13px; }
.brand-mark { display: grid; width: 28px; height: 28px; place-items: center; border-radius: 9px; background: #386a2e; color: #d8f4c3; font-size: .9rem; box-shadow: 0 5px 14px #386a2e33; }
.brand-name { margin: 0; color: #1c3120; font-size: 1.08rem; font-weight: 950; letter-spacing: -.055em; line-height: 1; }
.brand-name span { color: #5e9d43; }
h1 { margin: 0; font-size: clamp(2rem, 8vw, 3.35rem); line-height: 1.02; letter-spacing: -.055em; }
.intro { margin: 18px 0 35px; color: #67645b; font-size: 1.05rem; }
h2 { margin: 0; font-size: 1.05rem; }
.food-dialog { width: min(calc(100% - 28px), 620px); max-height: min(88dvh, 760px); padding: 0; border: 0; border-radius: 24px; background: transparent; }
.food-dialog::backdrop { background: #1c2a1ecc; backdrop-filter: blur(4px); }
.add-card { padding: 22px; border: 1px solid #dbe9d1; border-radius: 24px; background: #f0f6eb; box-shadow: 0 18px 60px #0b170d66; }
.dialog-heading { display: flex; align-items: start; justify-content: space-between; gap: 18px; }
.dialog-close { width: 36px; min-height: 36px; padding: 0; border-radius: 50%; background: #dfead8; color: #315d2c; font-size: 1.45rem; line-height: 1; }
.dialog-close:hover { background: #cfe0c5; }
.auth-card { order: 2; margin-bottom: 18px; padding: 22px; border-radius: 22px; background: #e7f1e0; }
.auth-card > p { margin: 9px 0 0; color: #596653; line-height: 1.4; }
.auth-form { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 10px; margin-top: 17px; }
.auth-form button { padding: 0 16px; }
.auth-code-row { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 10px; margin-top: 12px; }
.auth-code-row[hidden] { display: none; }
.auth-code-row button { padding: 0 16px; }
.calendar-setup { margin: 16px 0; padding: 14px; border-radius: 13px; background: #fffdf8; }
.calendar-panel { order: 6; margin-top: 20px; border: 1px solid #dedbd1; }
.calendar-setup > p { margin: 6px 0 10px; }
.calendar-link-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.calendar-link-row input { min-width: 0; font-size: .78rem; }
form { display: grid; gap: 15px; margin-top: 18px; }
label { display: grid; gap: 7px; font-size: .87rem; font-weight: 700; }
.optional { color: #857f73; font-weight: 500; }
input, select { width: 100%; min-width: 0; min-height: 48px; border: 1px solid #dedbd1; border-radius: 11px; padding: 0 13px; background: #fff; color: inherit; font: inherit; }
input:focus { outline: 3px solid #d8ebc9; border-color: #77a358; }
button { min-height: 48px; border: 0; border-radius: 11px; background: #386a2e; color: white; font: inherit; font-weight: 800; cursor: pointer; }
button:hover { background: #285321; }
.secondary-button { width: 100%; background: #e6efdf; color: #315d2c; }
.secondary-button:hover { background: #d8e7ce; }
.barcode-row { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 10px; }
.lookup-button { min-height: 48px; padding: 0 16px; background: #ebe8df; color: #39362e; }
.lookup-button:hover { background: #ddd8cc; }
.details-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.quantity-inputs { display: grid; grid-template-columns: minmax(0, 1fr) 82px; gap: 7px; }
.quantity-inputs select { padding: 0 8px; }
.hint { margin: 8px 0 0; color: #7a7569; font-size: .82rem; line-height: 1.35; }
.section-kicker { margin: 0 0 5px; color: #838074; letter-spacing: .11em; font-size: .68rem; font-weight: 850; }
#scanner { overflow: hidden; margin-top: 13px; border-radius: 13px; background: #20241e; }
#scanner video { display: block; width: 100%; }
.scan-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; margin-top: 10px; }
.scan-control-button { min-height: 36px; padding: 0 12px; background: #2e312c; font-size: .8rem; }
.scan-control-button:hover, .scan-control-button.active { background: #151714; }
.food-list { order: 3; margin-top: 24px; }
.list-heading { display: flex; justify-content: space-between; align-items: center; }
.food-list #list-title { font-size: clamp(1.55rem, 6vw, 2.05rem); letter-spacing: -.04em; }
.food-list #food-count { display: inline-block; margin-left: 5px; color: #8a867c; font-size: .82rem; font-weight: 700; letter-spacing: 0; vertical-align: middle; }
.add-trigger { order: 4; display: inline-flex; width: 100%; min-height: 54px; align-items: center; justify-content: center; gap: 7px; margin-top: 24px; border-radius: 15px; background: #386a2e; box-shadow: 0 7px 18px #386a2e29; font-size: .95rem; white-space: nowrap; }
.add-trigger[hidden] { display: none; }
.add-trigger span { font-size: 1.15rem; font-weight: 500; line-height: 1; }
.priority-section { margin: 16px 0; padding: 15px 16px; border: 1px solid #f0d7ad; border-radius: 15px; background: #fff6e6; }
.priority-heading { display: flex; align-items: center; gap: 8px; color: #985d12; }
.priority-heading span { font-size: 1.1rem; }
.priority-heading h3 { margin: 0; font-size: .95rem; }
.priority-section p { margin: 7px 0 0; color: #6c5b41; line-height: 1.4; font-size: .9rem; }
.location-filters { display: flex; flex-wrap: wrap; gap: 7px; margin: 16px 0 4px; }
.filter-button { min-height: 36px; padding: 0 12px; border: 1px solid #dedbd1; background: #fffdf8; color: #625e55; font-size: .82rem; }
.filter-button:hover { background: #f1ede4; }
.filter-button.active { border-color: #386a2e; background: #386a2e; color: #fff; }
.text-button { min-height: auto; padding: 0; background: none; color: #7a7569; font-size: .85rem; }
.text-button:hover { background: none; color: #27251f; }
.empty { color: #7a7569; line-height: 1.5; }
ul { display: grid; gap: 10px; margin: 16px 0 0; padding: 0; list-style: none; }
.food-item { position: relative; display: grid; grid-template-columns: 12px 1fr auto; align-items: center; gap: 13px; overflow: hidden; padding: 17px; border: 1px solid #ebe7dd; border-radius: 17px; background: transparent; box-shadow: 0 4px 14px #413b2c08; touch-action: pan-y; --swipe-x: 0px; --swipe-opacity: 1; transition: border-color .18s ease, box-shadow .18s ease; }
.food-item::before { position: absolute; z-index: 0; inset: 0; border-radius: inherit; background: #fffdf8; content: ''; transition: background .14s ease; }
.food-item::after { position: absolute; z-index: 0; inset: 0; display: flex; align-items: center; padding: 0 20px; color: transparent; content: ''; font-size: .78rem; font-weight: 850; opacity: 0; pointer-events: none; transition: opacity .14s ease; }
.food-item > * { position: relative; z-index: 1; opacity: var(--swipe-opacity); transform: translate3d(var(--swipe-x), 0, 0); transition: transform .24s cubic-bezier(.22, .8, .25, 1), opacity .18s ease; will-change: transform; }
.food-item.is-dragging > * { transition: none; }
.food-item.is-swiping-left::before { background: #fff0ed; }
.food-item.is-swiping-left::after { justify-content: flex-end; color: #9a3d31; content: 'Dans le bid’'; opacity: 1; }
.food-item.is-swiping-right::before { background: #fff7e7; }
.food-item.is-swiping-right::after { justify-content: flex-start; color: #91580f; content: 'À acheter'; opacity: 1; }
.food-item.is-swipe-committing { pointer-events: none; }
.status-dot { width: 11px; height: 11px; border-radius: 50%; background: #77a358; }
.food-item.soon .status-dot { background: #e69d35; }
.food-item.today .status-dot, .food-item.expired .status-dot { background: #cf4d3d; }
.food-copy { display: grid; gap: 3px; }
.food-title-row { display: flex; min-width: 0; align-items: center; gap: 8px; }
.food-title-row strong { min-width: 0; flex: 1 1 auto; }
.edit-button { flex: 0 0 auto; min-height: 29px; padding: 0 9px; border: 1px solid #d8e7d0; border-radius: 9px; background: #f1f7ed; color: #386a2e; font-size: .7rem; font-weight: 850; }
.edit-button:hover { background: #e2eedb; }
.food-copy span { color: #716d63; font-size: .87rem; }
.food-copy .food-meta { color: #386a2e; font-size: .8rem; font-weight: 750; }
.item-actions { display: flex; align-items: center; gap: 9px; }
.quantity-control { display: grid; grid-template-columns: 30px auto 30px; align-items: center; overflow: hidden; min-height: 34px; border: 1px solid #dedbd1; border-radius: 9px; background: #fff; }
.quantity-control span { min-width: 46px; padding: 0 5px; color: #625e55; text-align: center; font-size: .76rem; font-weight: 750; white-space: nowrap; }
.quantity-button { min-height: 32px; border-radius: 0; background: #f3f0e8; color: #4b473d; font-size: 1.05rem; }
.quantity-button:hover { background: #e7e1d6; }
.food-buttons { display: flex; align-items: center; gap: 7px; }
.consume-button { min-height: 36px; padding: 0 12px; border-radius: 10px; background: #386a2e; color: #fff; font-size: .78rem; }
.consume-button:hover { background: #285321; }
.shop-button { min-height: 36px; padding: 0 11px; border: 1px solid #ecd6ad; border-radius: 10px; background: #fffaf0; color: #91580f; font-size: .78rem; }
.shop-button:hover { background: #fff1d8; }
.delete-button { width: 34px; min-height: 34px; padding: 0; border-radius: 50%; background: #eeeae0; color: #777268; font-size: 1.45rem; line-height: 1; }
.delete-button:hover { background: #e3ded3; color: #342f27; }
.shopping-card { order: 5; margin-top: 16px; padding: 22px; border: 1px solid #ebe7dd; border-radius: 22px; background: #fffdf8; box-shadow: 0 8px 30px #413b2c08; }
.shopping-form { display: grid; grid-template-columns: 1fr 48px; align-items: end; gap: 9px; margin-top: 14px; }
.shopping-form button { min-height: 48px; padding: 0; font-size: 1.15rem; font-weight: 500; line-height: 1; }
.shopping-items { margin-top: 13px; }
.shopping-item { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid #ece8de; }
.shopping-item:last-child { border-bottom: 0; }
.shopping-item label { display: flex; grid-template-columns: none; align-items: center; gap: 10px; font-size: .94rem; font-weight: 650; }
.shopping-item input { width: 20px; min-height: 20px; accent-color: #386a2e; }
.shopping-item.done .shopping-label { color: #928d82; text-decoration: line-through; }
.shopping-delete { flex: 0 0 auto; }
.account-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: -14px 0 26px; padding: 10px 12px; border: 1px solid #d9e7d1; border-radius: 12px; background: #f0f6eb; color: #486443; font-size: .78rem; font-weight: 750; }
.account-bar[hidden] { display: none; }
.account-bar > div { display: flex; gap: 13px; }
.account-bar .text-button { color: #486443; font-size: .76rem; }
.danger-button { color: #9a3d31 !important; }
.app-footer { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 6px; padding: 0 22px 30px; color: #908b80; text-align: center; font-size: .78rem; }
.app-footer .text-button { color: #777268; font-size: inherit; text-decoration: underline; text-underline-offset: 2px; }
.privacy-dialog { width: min(calc(100% - 28px), 650px); max-height: min(82dvh, 760px); padding: 0; border: 0; border-radius: 24px; background: transparent; }
.privacy-dialog::backdrop { background: #1c2a1ecc; backdrop-filter: blur(4px); }
.privacy-card { max-height: min(82dvh, 760px); overflow: auto; padding: 23px; border: 1px solid #dbe9d1; border-radius: 24px; background: #fffdf8; box-shadow: 0 18px 60px #0b170d66; }
.privacy-card > p { margin: 10px 0 18px; color: #6f6a60; line-height: 1.5; }
.privacy-card h3 { margin: 20px 0 6px; color: #315d2c; font-size: .92rem; }
.privacy-card h3 + p { margin: 0; color: #59564d; font-size: .91rem; line-height: 1.52; }
.privacy-card a { color: #315d2c; font-weight: 750; }
@media (max-width: 480px) {
  .barcode-row, .auth-form, .auth-code-row, .calendar-link-row { grid-template-columns: 1fr; }
  .barcode-row { grid-template-columns: minmax(0, 1fr) 112px; }
  .barcode-row .lookup-button { width: auto; padding: 0 12px; }
  .details-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
  .details-row label { min-width: 0; }
  .shopping-form { grid-template-columns: 1fr 44px; gap: 8px; }
  .shopping-form input, .shopping-form button { min-height: 44px; }
  .shopping-form button { font-size: 1.15rem; font-weight: 500; }
  .lookup-button { width: 100%; }
  .food-dialog { width: calc(100% - 20px); max-height: calc(100dvh - 16px); overflow: visible; }
  .add-card { padding: 18px; overflow-x: hidden; }
  #food-form { gap: 10px; margin-top: 12px; }
  .food-dialog input, .food-dialog select { min-height: 44px; }
  .food-dialog #food-form > button[type="submit"] { min-height: 46px; }
  .scan-area .hint { margin-top: 6px; }
  .food-dialog label { min-width: 0; }
  input[type="date"] { width: 100% !important; min-width: 0 !important; max-width: 100% !important; }
  input[type="date"]::-webkit-date-and-time-value { min-width: 0; text-align: left; }
  .food-item { grid-template-columns: 12px minmax(0, 1fr); align-items: start; padding: 16px; }
  .food-copy { min-width: 0; }
  .food-copy strong { overflow-wrap: anywhere; }
  .item-actions { grid-column: 2; display: grid; width: 100%; grid-template-columns: 40px 40px minmax(0, 1fr) minmax(0, 1fr); align-items: stretch; gap: 8px; }
  .quantity-control { display: contents; }
  .quantity-control span { display: none; }
  .quantity-button { min-height: 44px; border-radius: 10px; }
  .food-buttons { grid-column: 3 / -1; display: grid; width: 100%; grid-template-columns: 1fr 1fr; gap: 8px; }
  .food-buttons button { min-width: 0; padding: 0 8px; }
  .consume-button { min-width: 0; }
  .account-bar { align-items: flex-start; flex-direction: column; margin-top: -20px; }
  .account-bar > div { flex-wrap: wrap; gap: 8px 13px; }
  .privacy-dialog { width: calc(100% - 20px); max-height: calc(100dvh - 20px); }
  .privacy-card { max-height: calc(100dvh - 20px); padding: 19px; }
}

/* Application à onglets : la même base Frigo Solo, pensée comme une app mobile. */
[hidden] { display: none !important; }
body { min-height: 100dvh; background: #f6f4ed; }
.shell { min-height: 100dvh; padding: 52px 22px calc(112px + env(safe-area-inset-bottom)); }
body.is-authenticated .shell { padding-top: 26px; }
.landing-header[hidden] { display: none; }
.app-shell { width: 100%; }
.app-page { width: 100%; min-width: 0; animation: page-in .22s ease-out; }
.app-page:focus { outline: none; }
@keyframes page-in { from { opacity: .01; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }

.app-page-header { margin-bottom: 18px; }
.app-page-header h1 { margin: 0; color: #1c3120; letter-spacing: -.055em; }
.home-page-header { margin-bottom: 20px; }
.home-page-header h1 { max-width: 500px; font-size: clamp(2rem, 8vw, 3.1rem); line-height: 1; }
.home-page-header > p { margin: 10px 0 0; color: #67645b; font-size: .95rem; line-height: 1.45; }
.compact-page-header { margin-bottom: 14px; }
.compact-page-header h1 { font-size: clamp(2rem, 8vw, 2.8rem); line-height: 1; }
.compact-page-header #food-count { display: block; margin-top: 6px; color: #8a867c; font-size: .78rem; font-weight: 760; letter-spacing: 0; }

.home-sync-card { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; padding: 15px 16px; border: 1px solid #d9e7d1; border-radius: 18px; background: #eef6e9; box-shadow: 0 5px 15px #386a2e0a; }
.sync-icon { display: grid; flex: 0 0 30px; width: 30px; height: 30px; place-items: center; border-radius: 50%; background: #386a2e; color: #e5f7d9; font-size: .88rem; font-weight: 950; }
.home-sync-card strong { display: block; overflow: hidden; color: #315d2c; font-size: .88rem; text-overflow: ellipsis; white-space: nowrap; }
.home-sync-card .section-kicker { margin: 0 0 3px; color: #64815d; }

.home-brief { margin: 0 0 12px; padding: 17px; border: 1px solid #d9e7d1; border-radius: 19px; background: #f0f6eb; }
.home-brief strong { display: block; color: #1c3120; font-size: 1.25rem; letter-spacing: -.03em; }
.home-brief > p:not(.section-kicker) { margin: 6px 0 0; color: #596653; font-size: .9rem; }
.home-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 18px; }
.home-stats article { display: grid; gap: 2px; min-height: 106px; padding: 15px; border: 1px solid #ebe7dd; border-radius: 18px; background: #fffdf8; box-shadow: 0 5px 17px #413b2c08; }
.home-stats article > span { color: #858074; font-size: .65rem; font-weight: 900; letter-spacing: .095em; }
.home-stats strong { color: #1c3120; font-size: 2rem; line-height: 1; letter-spacing: -.06em; }
.home-stats small { color: #716d63; font-size: .75rem; font-weight: 700; }
.home-stats .urgent-stat { border-color: #f0d7ad; background: #fff9ed; }
.home-stats .urgent-stat strong { color: #985d12; }

.home-priority-section { margin: 0 0 18px; padding: 17px; border-radius: 19px; }
.home-priority-section .priority-heading { align-items: flex-start; }
.home-priority-section .priority-heading > span { margin-top: 2px; }
.priority-heading .section-kicker { margin: 0 0 2px; color: #a77125; }
.priority-heading h2 { color: #754806; font-size: 1.05rem; }
.home-priority-section > p { margin: 7px 0 0; }
.home-priority-items { gap: 8px; margin: 13px 0 12px; }
.food-item-compact { grid-template-columns: 10px minmax(0, 1fr); gap: 10px; padding: 12px; border-radius: 13px; cursor: pointer; box-shadow: none; }
.food-item-compact .status-dot { width: 9px; height: 9px; }
.food-item-compact .food-copy { min-width: 0; }
.food-item-compact .food-copy strong { overflow: hidden; font-size: .9rem; text-overflow: ellipsis; white-space: nowrap; }
.food-item-compact .food-copy span { font-size: .78rem; }
.priority-link { min-height: 38px; padding: 0; background: transparent; color: #91580f; font-size: .82rem; text-align: left; }
.priority-link:hover { background: transparent; color: #6b3e03; }

.stock-page .food-list { margin-top: 0; }
.stock-page .location-filters { margin-top: 16px; }
.stock-page .empty { margin-top: 21px; }
.stock-page #foods { padding-bottom: 4px; }
.stock-clear-zone { margin: 21px 0 4px; padding: 16px 0 2px; border-top: 1px solid #e7e3d9; }
.stock-clear-button { width: 100%; min-height: 44px; border: 1px solid #e4d2cd; background: #fffaf8; color: #9a4b40; font-size: .82rem; }
.stock-clear-button:hover { background: #fff1ed; }

.shopping-card { margin-top: 0; padding: 18px; border-radius: 20px; }
.shopping-subtitle { max-width: 280px; margin: 0; color: #716d63; font-size: .87rem; line-height: 1.4; }
.shopping-page .shopping-form { margin-top: 18px; }

.account-page .account-bar { display: flex; margin: 0; padding: 17px; border: 1px solid #d9e7d1; border-radius: 20px; background: #eff6ea; color: #315d2c; box-shadow: 0 5px 16px #386a2e0a; }
.account-status { display: flex; min-width: 0; align-items: center; gap: 11px; }
.account-status > div { min-width: 0; }
.account-status .section-kicker { margin: 0 0 3px; color: #64815d; }
.account-status strong { display: block; overflow: hidden; color: #315d2c; font-size: .92rem; text-overflow: ellipsis; white-space: nowrap; }
.account-insights { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 12px 0; }
.account-insights article { display: grid; gap: 3px; padding: 15px; border: 1px solid #ebe7dd; border-radius: 17px; background: #fffdf8; }
.account-insights span { color: #1c3120; font-size: 1.65rem; font-weight: 900; letter-spacing: -.055em; }
.account-insights small { color: #716d63; font-size: .76rem; font-weight: 650; }
.account-section { margin-top: 22px; }
.account-section > .section-kicker { margin: 0 0 8px; }
.account-action-list { display: grid; gap: 9px; }
.account-row { display: flex; width: 100%; min-height: 68px; align-items: center; gap: 12px; padding: 11px 13px; border: 1px solid #ebe7dd; border-radius: 17px; background: #fffdf8; color: #27251f; text-align: left; box-shadow: 0 4px 14px #413b2c06; }
.account-row:hover { background: #f9f7f0; }
.account-row:disabled { cursor: not-allowed; border-color: #e6e4dd; background: #f4f4ef; color: #929087; box-shadow: none; }
.account-row-icon { display: grid; flex: 0 0 34px; width: 34px; height: 34px; place-items: center; border-radius: 11px; background: #e8f1e2; color: #386a2e; font-size: 1.05rem; line-height: 1; }
.account-row-copy { display: grid; min-width: 0; flex: 1; gap: 3px; }
.account-row-copy strong { overflow: hidden; color: inherit; font-size: .9rem; text-overflow: ellipsis; white-space: nowrap; }
.account-row-copy small { overflow: hidden; color: #777269; font-size: .76rem; font-weight: 650; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; }
.account-row:disabled .account-row-icon { background: #e8e8e2; color: #96958d; }
.account-row:disabled .account-row-copy small { color: #98968d; }
.account-row-chevron { color: #928d82; font-size: 1.45rem; font-weight: 500; line-height: 1; }
.account-page .calendar-panel { margin: 12px 0 0; border-radius: 17px; }
.account-session { margin-top: 22px; }
.account-danger-zone { margin-top: 26px; padding: 17px; border: 1px solid #f0d4ce; border-radius: 20px; background: #fff7f5; }
.account-danger-zone .section-kicker { margin: 0 0 5px; color: #a66056; }
.account-danger-zone > strong { color: #7e352c; font-size: .95rem; }
.account-danger-zone > p:not(.section-kicker) { margin: 5px 0 13px; color: #875e57; font-size: .8rem; line-height: 1.4; }
.account-danger-zone .danger-button { width: 100%; min-height: 43px; border: 1px solid #edc2bb; background: #fffdfb; color: #9a3d31 !important; font-size: .82rem; }
.account-danger-zone .danger-button:hover { background: #fff0ed; }
.privacy-entry { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 14px; padding: 16px; border: 1px solid #ebe7dd; border-radius: 17px; background: #fffdf8; }
.privacy-entry strong { color: #27251f; font-size: .93rem; }
.privacy-entry p:not(.section-kicker) { margin: 4px 0 0; color: #716d63; font-size: .8rem; line-height: 1.35; }
.privacy-entry .text-button { flex: 0 0 auto; color: #386a2e; font-weight: 850; }
.app-footer { justify-content: flex-start; padding: 20px 2px 6px; color: #908b80; text-align: left; }

.app-message { position: fixed; z-index: 60; left: 50%; bottom: calc(91px + env(safe-area-inset-bottom)); width: min(calc(100% - 36px), 560px); margin: 0; padding: 11px 14px; transform: translateX(-50%); border: 1px solid #dbe9d1; border-radius: 13px; background: #fffdf8; box-shadow: 0 10px 26px #413b2c26; color: #315d2c; font-size: .84rem; font-weight: 750; line-height: 1.35; }

.bottom-nav { position: fixed; z-index: 50; right: 0; bottom: 0; left: 0; padding: 8px max(16px, env(safe-area-inset-right)) calc(8px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); border-top: 1px solid #ebe7dd; background: rgba(255, 253, 248, .94); box-shadow: 0 -7px 22px #413b2c0a; backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
.bottom-nav-inner { display: grid; width: min(100%, 680px); grid-template-columns: 1fr 1fr 64px 1fr 1fr; align-items: end; margin: auto; }
.nav-tab { display: grid; min-height: 52px; place-items: center; gap: 3px; padding: 4px; border-radius: 12px; background: transparent; color: #817c71; font-size: .66rem; font-weight: 780; touch-action: manipulation; }
.nav-tab:hover { background: #f4f1e9; color: #386a2e; }
.nav-tab.active { color: #386a2e; }
.nav-tab svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.nav-tab:first-child svg path { fill: currentColor; stroke: none; }
.nav-add { width: 56px; min-height: 56px; margin: 0 auto; padding: 0; transform: translateY(-18px); border: 4px solid #f6f4ed; border-radius: 50%; background: #386a2e; box-shadow: 0 8px 20px #386a2e42; color: #fff; font-size: 2rem; font-weight: 400; line-height: 1; touch-action: manipulation; }
.nav-add:hover { background: #285321; }
.nav-add:disabled { cursor: not-allowed; background: #9eb696; box-shadow: none; }
body.is-modal-open .bottom-nav { visibility: hidden; }
button:focus-visible, .food-item-compact:focus-visible { outline: 3px solid #b8dca9; outline-offset: 2px; }

@media (max-width: 480px) {
  input, select, textarea { font-size: 16px; }
  .shell { padding-right: 16px; padding-left: 16px; }
  body.is-authenticated .shell { padding-top: 20px; }
  .home-page-header h1 { font-size: 2.18rem; }
  .compact-page-header h1 { font-size: 2.12rem; }
  .home-stats article { min-height: 98px; padding: 13px; }
  .home-stats strong { font-size: 1.8rem; }
  .food-item-compact { padding: 11px; }
  .account-page .account-bar { padding: 16px; }
  .account-row { min-height: 64px; padding: 10px 12px; }
  .account-row-copy small { font-size: .73rem; }
  .edit-button { min-height: 28px; padding: 0 8px; }
  .privacy-entry { padding: 14px; }
  .bottom-nav { padding-right: max(10px, env(safe-area-inset-right)); padding-left: max(10px, env(safe-area-inset-left)); }
  .bottom-nav-inner { grid-template-columns: 1fr 1fr 60px 1fr 1fr; }
  .nav-tab { min-height: 50px; font-size: .63rem; }
  .nav-add { width: 55px; min-height: 55px; }
}


/* Formulaire d’ajout : une seule règle mobile cohérente */
.barcode-row > label { display: block; }
.barcode-row > label > input { display: block; margin-top: 7px; }
.details-row { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.details-row label, #food-form > label { min-width: 0; max-width: 100%; }
.details-row input, .details-row select { padding-inline: 10px; }
.food-dialog, .add-card, #food-form { min-width: 0; max-width: 100%; }
#food-date {
  display: block;
  box-sizing: border-box;
  inline-size: 100%;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  height: 48px;
  min-height: 48px;
  margin: 0;
  padding-inline: 13px;
  text-align: center;
}

@media (max-width: 480px) {
  .food-dialog { width: calc(100vw - 20px); max-width: calc(100vw - 20px); }
  .add-card { padding: 16px; }
  .details-row { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .details-row label { font-size: .78rem; }
  .details-row input, .details-row select { min-width: 0; height: 44px; min-height: 44px; padding-inline: 8px; font-size: 16px; }
  #food-date {
    height: 44px;
    min-height: 44px;
    padding-inline: 10px;
    font-size: 16px;
    text-align: center;
  }
  #food-date::-webkit-date-and-time-value,
  #food-date::-webkit-datetime-edit {
    min-width: 0;
    padding: 0;
    text-align: center;
  }
}
