:root {
  --forest: #143f35;
  --forest-2: #1d5546;
  --green: #2f7d62;
  --green-d: #205f4d;
  --green-l: #dcefe7;
  --sun: #f3bd52;
  --sun-l: #fff4d8;
  --berry: #ad4d5f;
  --berry-l: #fae7e9;
  --ink: #172721;
  --muted: #62736c;
  --line: #d8e2dc;
  --line-strong: #c5d3cb;
  --bg: #edf3ef;
  --card: #ffffff;
  --paper: #f9fbf8;
  --radius: 18px;
  --radius-sm: 12px;
  --tap: 44px;
  --shadow-soft: 0 14px 34px rgba(20, 63, 53, .08);
  --shadow-float: 0 20px 56px rgba(20, 63, 53, .16);
  --display: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
  --sans: "Avenir Next", Avenir, "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { margin: 0; background: var(--forest); }
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 4%, rgba(47, 125, 98, .14), transparent 28rem),
    var(--bg);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.45;
  min-height: 100vh;
  min-height: 100svh;
  padding-bottom: env(safe-area-inset-bottom);
}
#app { width: 100%; max-width: 760px; min-height: 100vh; margin: 0 auto; background: var(--paper); box-shadow: 0 0 70px rgba(20, 63, 53, .12); }
button, input { font: inherit; }
button { color: inherit; }
button, label, input { touch-action: manipulation; }
button:focus-visible, input:focus-visible {
  outline: 3px solid rgba(243, 189, 82, .72);
  outline-offset: 2px;
}

.app-footer {
  display: flex;
  justify-content: center;
  gap: 8px;
  max-width: 760px;
  margin: 0 auto;
  padding: 18px 20px calc(18px + env(safe-area-inset-bottom));
  background: var(--forest);
  color: rgba(255,255,255,.78);
  font-size: .74rem;
}
.app-footer a { color: #fff; text-underline-offset: 3px; }

/* Pages juridiques */
.legal-page { background: var(--paper); }
.legal-shell { width: 100%; max-width: 760px; min-height: 100vh; margin: 0 auto; background: var(--paper); box-shadow: 0 0 70px rgba(20,63,53,.12); }
.legal-header { padding: calc(25px + env(safe-area-inset-top)) 22px 26px; background: var(--forest); color: #fff; }
.legal-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.legal-header a { color: #fff; font-size: .82rem; text-underline-offset: 3px; }
.legal-header h1 { max-width: 620px; margin: 28px 0 8px; font-family: var(--display); font-size: clamp(2rem, 8vw, 3.2rem); font-weight: 600; line-height: 1; letter-spacing: -.045em; }
.legal-header p { margin: 0; color: rgba(255,255,255,.76); font-size: .84rem; }
.legal-content { padding: 26px 22px 52px; }
.legal-content section { padding: 5px 0 19px; border-bottom: 1px solid var(--line); }
.legal-content section:last-child { border-bottom: 0; }
.legal-content h2 { margin: 18px 0 8px; color: var(--forest); font-family: var(--display); font-size: 1.35rem; line-height: 1.15; }
.legal-content p, .legal-content ul { margin: 8px 0; }
.legal-content ul { padding-left: 21px; }
.legal-content li { margin: 6px 0; }
.legal-content a { color: var(--green-d); }
.legal-note { padding: 12px 14px; border-left: 3px solid var(--sun); border-radius: 3px var(--radius-sm) var(--radius-sm) 3px; background: var(--sun-l); }

/* Header */
.app-header {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  min-height: 112px;
  padding: calc(18px + env(safe-area-inset-top)) 20px 16px;
  overflow: hidden;
  color: #fff;
  background: var(--forest);
}
.app-header::before,
.app-header::after {
  position: absolute;
  content: "";
  border-radius: 50%;
  pointer-events: none;
}
.app-header::before { width: 190px; height: 190px; top: -118px; right: -48px; border: 1px solid rgba(255,255,255,.16); box-shadow: 0 0 0 30px rgba(255,255,255,.035), 0 0 0 62px rgba(255,255,255,.025); }
.app-header::after { width: 9px; height: 9px; right: 86px; bottom: 25px; background: var(--sun); box-shadow: 19px -15px 0 rgba(255,255,255,.28), 36px 2px 0 rgba(255,255,255,.14); }
.header-row { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 12px; min-width: 0; }
.header-sub { min-height: 28px; }
.header-sub[hidden] { display: none; }
.app-header h1 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-family: var(--display);
  font-size: clamp(1.45rem, 6vw, 1.85rem);
  font-weight: 600;
  letter-spacing: -.035em;
  line-height: 1;
  white-space: nowrap;
}
.brand-icon { width: 31px; height: 31px; flex: none; overflow: visible; filter: drop-shadow(0 3px 5px rgba(6,28,22,.18)); }
.brand-spoon { fill: none; stroke: var(--sun); stroke-width: 3; stroke-linecap: round; }
.brand-puree { fill: var(--sun); }
.brand-bowl { fill: var(--green-l); }
.brand-rim { fill: none; stroke: #fff; stroke-linecap: round; stroke-width: 2.2; }
.brand-eye { fill: var(--forest); }
.brand-smile { fill: none; stroke: var(--forest); stroke-linecap: round; stroke-width: 1.35; }
.header-actions { display: flex; flex: none; align-items: center; gap: 7px; }
.language-toggle {
  width: var(--tap);
  min-width: var(--tap);
  min-height: var(--tap);
  padding: 0;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 50%;
  background: transparent;
  color: #fff;
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .04em;
  cursor: pointer;
}
.language-toggle:hover { background: rgba(255,255,255,.12); }
.status { display: inline-flex; align-items: center; max-width: 50%; padding: 4px 9px; border: 1px solid rgba(255,255,255,.12); border-radius: 999px; background: rgba(255,255,255,.1); font-size: .68rem; font-weight: 650; letter-spacing: .015em; white-space: nowrap; }
.status::before { content: ""; width: 6px; height: 6px; flex: none; margin-right: 6px; border-radius: 50%; background: currentColor; opacity: .85; }
.status.online { color: #d4f4e6; }
.status.offline, .status.local { color: #f0eee5; }
.status.pending { border-color: transparent; background: var(--sun); color: #4a3509; }
.share {
  min-height: var(--tap);
  padding: 8px 15px;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 999px;
  background: rgba(255,255,255,.1);
  color: #fff;
  font-size: .86rem;
  font-weight: 700;
  cursor: pointer;
  backdrop-filter: blur(10px);
  transition: background .2s ease, transform .2s ease, border-color .2s ease;
}
.share:hover { background: rgba(255,255,255,.18); border-color: rgba(255,255,255,.35); }
.share:active { transform: scale(.97); }

.child-name {
  max-width: 66vw;
  min-height: 30px;
  padding: 4px 10px;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  background: rgba(255,255,255,.11);
  color: #fff;
  font-size: .78rem;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}
.child-name:not(.named) { color: rgba(255,255,255,.75); font-weight: 500; }
.child-input { flex: 1 1 auto; max-width: 72vw; min-height: 34px; padding: 5px 11px; border: 1px solid rgba(255,255,255,.34); border-radius: 999px; background: #fff; color: var(--ink); font-size: .82rem; }

.banner { padding: 10px 18px; border-bottom: 1px solid #eddba6; background: var(--sun-l); color: #6a4a00; font-size: .82rem; }

/* Navigation */
.tabs {
  position: sticky;
  top: 0;
  z-index: 9;
  display: flex;
  padding: 0 8px;
  border-bottom: 1px solid rgba(216, 226, 220, .86);
  background: rgba(249,251,248,.94);
  box-shadow: 0 8px 22px rgba(20,63,53,.04);
  backdrop-filter: blur(16px);
}
.tab {
  position: relative;
  flex: 1;
  min-height: 52px;
  padding: 13px 3px;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: .8rem;
  font-weight: 650;
  letter-spacing: -.01em;
  cursor: pointer;
  transition: color .2s ease;
}
.tab::after { position: absolute; right: 22%; bottom: -1px; left: 22%; height: 3px; border-radius: 999px 999px 0 0; background: var(--green); content: ""; opacity: 0; transform: scaleX(.45); transition: opacity .2s ease, transform .25s ease; }
.tab.active { color: var(--forest); }
.tab.active::after { opacity: 1; transform: scaleX(1); }
.tabs[hidden] { display: none; }

main { padding: 16px 14px 40px; }

/* Checklist controls */
.toolbar { position: sticky; top: 52px; z-index: 7; margin: -4px -2px 14px; padding: 8px 2px 10px; background: linear-gradient(var(--paper) 78%, rgba(249,251,248,0)); }
.search-wrap { position: relative; }
.search-icon { position: absolute; top: 50%; left: 15px; width: 16px; height: 16px; border: 1.8px solid var(--muted); border-radius: 50%; pointer-events: none; transform: translateY(-56%); opacity: .72; }
.search-icon::after { position: absolute; right: -5px; bottom: -3px; width: 7px; height: 2px; border-radius: 2px; background: var(--muted); content: ""; transform: rotate(45deg); transform-origin: left center; }
#search { width: 100%; min-height: 48px; padding: 11px 42px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); color: var(--ink); box-shadow: 0 8px 22px rgba(20,63,53,.05); transition: border-color .2s ease, box-shadow .2s ease; }
#search::placeholder { color: #82908a; }
#search:focus { border-color: var(--green); box-shadow: 0 9px 26px rgba(20,63,53,.1); }
.chips { display: flex; gap: 7px; padding: 10px 0 8px; overflow-x: auto; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; min-height: 36px; padding: 7px 13px; border: 1px solid var(--line); border-radius: 999px; background: transparent; color: var(--muted); font-size: .78rem; font-weight: 650; white-space: nowrap; cursor: pointer; transition: color .2s ease, background .2s ease, border-color .2s ease, transform .2s ease; }
.chip:hover { border-color: var(--line-strong); color: var(--forest); }
.chip:active { transform: scale(.97); }
.chip.on { border-color: var(--forest); background: var(--forest); color: #fff; box-shadow: 0 5px 12px rgba(20,63,53,.14); }
.overall {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas: "label score" "caption score" "track track";
  align-items: end;
  gap: 0 12px;
  padding: 14px 15px 12px;
  overflow: hidden;
  border: 1px solid rgba(47,125,98,.16);
  border-radius: var(--radius);
  background: var(--green-l);
}
.overall::after { position: absolute; top: -24px; right: 58px; width: 54px; height: 54px; border: 1px solid rgba(47,125,98,.17); border-radius: 50%; content: ""; box-shadow: 0 0 0 13px rgba(255,255,255,.18); }
.overall-label { grid-area: label; color: var(--forest); font-family: var(--display); font-size: 1rem; font-weight: 700; letter-spacing: -.02em; }
.overall-score { z-index: 1; grid-area: score; color: var(--green-d); font-size: .82rem; font-weight: 650; white-space: nowrap; }
.overall-score strong { color: var(--forest); font-family: var(--display); font-size: 2.15rem; font-weight: 600; line-height: .9; letter-spacing: -.06em; }
.overall-caption { grid-area: caption; color: var(--muted); font-size: .7rem; }
.overall-track { grid-area: track; height: 5px; margin-top: 11px; overflow: hidden; border-radius: 999px; background: rgba(47,125,98,.15); }
.overall-track > span { display: block; height: 100%; border-radius: inherit; background: var(--green); transition: width .55s cubic-bezier(.2,.8,.2,1); }

/* Categories and food rows */
.cat { margin-bottom: 12px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); box-shadow: 0 9px 24px rgba(20,63,53,.045); animation: section-in .38s both; }
.cat:nth-of-type(2) { animation-delay: .035s; }
.cat:nth-of-type(3) { animation-delay: .07s; }
.cat:nth-of-type(4) { animation-delay: .105s; }
.cat-head { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 64px; padding: 10px 13px; border: 0; background: none; text-align: left; cursor: pointer; transition: background .2s ease; }
.cat-head:hover { background: var(--paper); }
.cat-title { display: flex; flex: 1; align-items: center; gap: 11px; min-width: 0; color: var(--ink); font-weight: 700; letter-spacing: -.015em; }
.cat-emoji { display: grid; width: 38px; height: 38px; flex: none; place-items: center; border: 1px solid rgba(47,125,98,.12); border-radius: 13px 13px 13px 5px; background: var(--green-l); font-size: 1.2rem; box-shadow: inset 0 1px rgba(255,255,255,.7); }
.cat-progress { display: flex; align-items: center; gap: 7px; }
.bar { width: 56px; height: 5px; overflow: hidden; border-radius: 999px; background: var(--green-l); }
.bar > span { display: block; height: 100%; border-radius: inherit; background: var(--green); transition: width .45s ease; }
.count { min-width: 34px; color: var(--muted); font-size: .7rem; font-variant-numeric: tabular-nums; text-align: right; }
.chev { width: 17px; color: var(--muted); font-size: .8rem; text-align: center; transition: transform .2s ease; }
.foods { border-top: 1px solid var(--line); }
.food { border-bottom: 1px solid var(--line); background: var(--card); transition: background .25s ease; }
.food:last-child { border-bottom: 0; }
.food.is-tasted { background: linear-gradient(90deg, rgba(220,239,231,.72), rgba(255,255,255,0) 42%); }
.food-main { display: flex; align-items: center; gap: 11px; min-height: 50px; padding: 10px 13px; cursor: pointer; }
.food-main input[type=checkbox] {
  width: 23px;
  height: 23px;
  flex: none;
  margin: 0;
  appearance: none;
  border: 1.5px solid #a9b9b1;
  border-radius: 8px 8px 8px 3px;
  background: #fff;
  cursor: pointer;
  transition: background .2s ease, border-color .2s ease, transform .16s ease, box-shadow .2s ease;
}
.food-main input[type=checkbox]:checked { border-color: var(--green); background: var(--green); box-shadow: inset 0 0 0 5px var(--green), inset 0 0 0 7px #fff, 0 4px 9px rgba(47,125,98,.2); transform: rotate(-3deg); }
.food-main input[type=checkbox]:active { transform: scale(.88); }
.food-name { flex: 1; min-width: 0; font-size: .93rem; font-weight: 550; }
.food.is-tasted .food-name { color: var(--green-d); }
.tag { flex: none; padding: 3px 7px; border-radius: 999px; font-size: .6rem; font-weight: 750; letter-spacing: .01em; }
.tag.allergen { background: var(--berry-l); color: #913c4d; }
.tag.season { background: var(--green-l); color: var(--green-d); }
.del { margin-left: auto; padding: 7px 8px; border: 0; background: none; color: var(--muted); font-size: 1.25rem; line-height: 1; cursor: pointer; }
.detail { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 0 13px 13px 47px; animation: detail-in .22s ease both; }
.detail input[type=date], .detail .note { min-height: 40px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; color: var(--ink); }
.detail input[type=date] { padding: 7px 9px; }
.detail .note { flex: 1 1 100%; padding: 8px 10px; }
.by { display: flex; gap: 5px; }
.by button { min-height: 38px; padding: 6px 11px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--muted); font-size: .78rem; cursor: pointer; }
.by button.on { border-color: var(--sun); background: var(--sun); color: #4a3509; font-weight: 700; }
.add-open { width: 100%; min-height: var(--tap); padding: 11px; border: 0; border-top: 1px dashed var(--line-strong); background: none; color: var(--green-d); font-size: .82rem; font-weight: 700; cursor: pointer; }
.add-open:hover { background: var(--paper); }
.add-form { display: flex; flex-wrap: wrap; gap: 8px; padding: 11px 13px; border-top: 1px dashed var(--line-strong); }
.add-form input { flex: 1 1 150px; min-height: 42px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; }
.add-form button { min-height: 42px; padding: 8px 13px; border: 0; border-radius: var(--radius-sm); cursor: pointer; }
.add-form button[type=submit] { background: var(--forest); color: #fff; font-weight: 700; }
.add-form button[type=button] { background: #edf1ee; color: var(--ink); }
.empty { padding: 14px; color: var(--muted); }

/* Allergens */
.info-intro { margin: 2px 3px 14px; color: var(--muted); font-size: .86rem; }
.info-intro a { color: var(--green-d); font-weight: 700; }
table.allergens { width: 100%; overflow: hidden; border: 1px solid var(--line); border-collapse: separate; border-spacing: 0; border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow-soft); }
.allergens th, .allergens td { padding: 9px 7px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.allergens tr:last-child th, .allergens tr:last-child td { border-bottom: 0; }
.allergens thead th { background: var(--forest); color: #fff; font-size: .72rem; font-weight: 700; }
.allergens thead th:first-child { border-radius: calc(var(--radius) - 1px) 0 0 0; }
.allergens thead th:last-child { border-radius: 0 calc(var(--radius) - 1px) 0 0; }
.allergens tbody th { font-size: .82rem; font-weight: 650; }
.allergens td input[type=date] { width: 100%; min-height: 38px; padding: 5px; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--ink); font-size: .72rem; }
.anote { display: block; color: var(--muted); font-size: .66rem; font-weight: 400; }
.todo { display: inline-block; margin-top: 3px; padding: 2px 6px; border-radius: 999px; background: var(--sun-l); color: #725308; font-size: .6rem; }

/* Calendar */
.cal-head { display: flex; align-items: center; gap: 8px; margin: 2px 0 16px; }
.cal-nav { width: 44px; height: 44px; flex: none; border: 1px solid var(--line); border-radius: 50%; background: #fff; color: var(--green-d); box-shadow: 0 6px 16px rgba(20,63,53,.06); font-size: 1.5rem; line-height: 1; cursor: pointer; transition: transform .18s ease, box-shadow .18s ease; }
.cal-nav:hover { box-shadow: 0 9px 20px rgba(20,63,53,.11); }
.cal-nav:active { transform: scale(.94); }
.cal-title { flex: 1; color: var(--forest); font-family: var(--display); font-size: 1.25rem; font-weight: 700; line-height: 1.15; text-align: center; text-transform: capitalize; }
.cal-sub { display: block; margin-top: 3px; color: var(--muted); font-family: var(--sans); font-size: .68rem; font-weight: 500; text-transform: none; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.cal-wd { margin-bottom: 4px; }
.cal-wdlabel { padding: 2px 0; color: var(--muted); font-size: .66rem; font-weight: 700; text-align: center; }
.cal-cell { position: relative; display: flex; aspect-ratio: 1 / 1; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 0; border: 1px solid var(--line); border-radius: 13px 13px 13px 5px; background: #fff; cursor: default; transition: transform .18s ease, border-color .18s ease, background .18s ease; }
.cal-cell.empty { border: 0; background: none; }
.cal-num { color: var(--ink); font-size: .8rem; }
.cal-cell[disabled] .cal-num { color: var(--muted); }
.cal-cell.has { border-color: #a7cabb; background: var(--green-l); cursor: pointer; }
.cal-cell.has:hover { transform: translateY(-2px); }
.cal-cell.has .cal-num { color: var(--green-d); font-weight: 750; }
.cal-cell.today { box-shadow: inset 0 0 0 2px var(--sun); }
.cal-cell.sel { border-color: var(--forest); background: var(--forest); transform: translateY(-2px); }
.cal-cell.sel .cal-num { color: #fff; }
.cal-dot { min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px; background: var(--green); color: #fff; font-size: .6rem; font-weight: 750; line-height: 16px; }
.cal-cell.sel .cal-dot { background: #fff; color: var(--green-d); }
.cal-clear { display: block; min-height: 40px; margin: 13px auto 0; padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--green-d); font-size: .8rem; font-weight: 700; cursor: pointer; }
.agenda { margin-top: 16px; }
.agenda-day { margin-bottom: 10px; padding: 11px 14px; border-left: 3px solid var(--green); border-radius: 3px var(--radius-sm) var(--radius-sm) 3px; background: var(--card); box-shadow: 0 6px 18px rgba(20,63,53,.05); }
.agenda-date { margin-bottom: 5px; color: var(--green-d); font-family: var(--display); font-size: .95rem; font-weight: 700; }
.agenda-list { margin: 0; padding: 0; list-style: none; }
.agenda-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 7px 0; border-top: 1px solid var(--line); }
.agenda-list li:first-child { border-top: 0; }
.agenda-food { font-size: .9rem; font-weight: 600; }
.by-tag { padding: 2px 8px; border-radius: 999px; background: var(--sun); color: #4a3509; font-size: .62rem; font-weight: 700; text-transform: capitalize; }
.agenda-note { flex: 1 1 100%; color: var(--muted); font-size: .78rem; }

/* Information */
.disclaimer { margin: 0 0 18px; padding: 12px 14px; border-left: 3px solid var(--green); border-radius: 3px var(--radius-sm) var(--radius-sm) 3px; background: var(--green-l); color: var(--green-d); font-size: .82rem; }
.info { margin-top: 0; padding: 5px 2px 18px; border-bottom: 1px solid var(--line); }
.info + .info { padding-top: 16px; }
.info:last-child { border-bottom: 0; }
.info h2 { margin: 8px 0 12px; color: var(--forest); font-family: var(--display); font-size: 1.35rem; line-height: 1.1; letter-spacing: -.025em; }
.info h3 { margin: 16px 0 5px; color: var(--ink); font-size: .9rem; }
.info p { margin: 7px 0; }
.info ul { margin: 8px 0; padding-left: 21px; }
.info li { margin: 5px 0; }
.callout { padding: 11px 13px; border-left: 3px solid var(--sun); border-radius: 3px var(--radius-sm) var(--radius-sm) 3px; background: var(--sun-l); }
.official-links { display: grid; gap: 9px; padding: 0 !important; list-style: none; }
.official-links a { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; color: var(--green-d); text-decoration: none; }
.official-links a:hover { border-color: var(--green); }
.official-links span { color: var(--muted); font-size: .74rem; }

/* Toast and confirmation */
.toast { position: fixed; bottom: calc(22px + env(safe-area-inset-bottom)); left: 50%; z-index: 120; max-width: 92vw; padding: 11px 17px; border: 1px solid rgba(255,255,255,.13); border-radius: 999px; background: var(--forest); color: #fff; box-shadow: var(--shadow-float); font-size: .84rem; text-align: center; opacity: 0; pointer-events: none; transform: translateX(-50%) translateY(18px) scale(.97); transition: opacity .25s ease, transform .3s cubic-bezier(.2,.8,.2,1); }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
.modal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 24px; background: rgba(10, 32, 26, .68); backdrop-filter: blur(7px); }
.modal[hidden] { display: none; }
.modal-card { width: 100%; max-width: 370px; padding: 24px 21px 19px; border: 1px solid rgba(255,255,255,.5); border-radius: 24px; background: #fff; box-shadow: 0 26px 70px rgba(8,30,24,.35); animation: modal-in .25s cubic-bezier(.2,.8,.2,1) both; }
.modal-card p { margin: 2px 0 22px; color: var(--ink); font-family: var(--display); font-size: 1.18rem; line-height: 1.35; }
.modal-actions { display: flex; gap: 10px; }
.modal-actions button { flex: 1; min-height: 50px; border: 0; border-radius: 14px; font-size: .94rem; font-weight: 750; cursor: pointer; }
#modal-cancel { background: #edf1ee; color: var(--ink); }
#modal-confirm { background: var(--berry); color: #fff; }

/* First launch */
.welcome { position: relative; max-width: 510px; margin: 8px auto; padding: 30px 22px 22px; overflow: hidden; border: 1px solid var(--line); border-radius: 28px; background: var(--card); box-shadow: var(--shadow-soft); animation: section-in .45s ease both; }
.welcome::before { display: block; width: 78px; height: 78px; margin: -4px 0 24px; border: 1px solid rgba(47,125,98,.18); border-radius: 50% 50% 44% 56%; background: var(--green-l); box-shadow: inset 0 0 0 12px rgba(255,255,255,.38), 33px 13px 0 -22px var(--sun), 52px -5px 0 -28px var(--berry); content: ""; transform: rotate(-8deg); }
.welcome h2 { max-width: 390px; margin: 0 0 12px; color: var(--forest); font-family: var(--display); font-size: clamp(1.7rem, 7vw, 2.25rem); font-weight: 600; line-height: 1.04; letter-spacing: -.045em; }
.welcome p { margin: 0 0 15px; color: var(--ink); }
.welcome ul { margin: 4px 0 22px; padding: 0; color: var(--ink); list-style: none; }
.welcome li { position: relative; margin: 10px 0; padding-left: 28px; }
.welcome li::before { position: absolute; top: .32em; left: 2px; width: 12px; height: 12px; border: 2px solid var(--green); border-radius: 50% 50% 50% 20%; content: ""; transform: rotate(-18deg); }
.welcome-start { width: 100%; min-height: 52px; padding: 14px; border: 0; border-radius: 16px; background: var(--forest); color: #fff; box-shadow: 0 10px 24px rgba(20,63,53,.2); font-size: 1rem; font-weight: 750; cursor: pointer; transition: background .2s ease, transform .2s ease, box-shadow .2s ease; }
.welcome-start:hover { background: var(--forest-2); box-shadow: 0 13px 28px rgba(20,63,53,.24); }
.welcome-start:active { transform: scale(.985); }
.welcome-note { margin: 14px 0 0 !important; color: var(--muted) !important; font-size: .75rem; text-align: center; }

@keyframes section-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes detail-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }
@keyframes modal-in { from { opacity: 0; transform: translateY(10px) scale(.97); } to { opacity: 1; transform: translateY(0) scale(1); } }

@media (min-width: 620px) {
  .app-header { min-height: 122px; padding-right: 28px; padding-left: 28px; }
  .app-header h1 { font-size: 2rem; }
  main { padding: 22px 28px 52px; }
  .tabs { padding-right: 20px; padding-left: 20px; }
  .tab { font-size: .85rem; }
  .toolbar { margin-right: -4px; margin-left: -4px; padding-right: 4px; padding-left: 4px; }
  .cat-head { padding-right: 17px; padding-left: 17px; }
  .food-main { padding-right: 17px; padding-left: 17px; }
  .detail { padding-right: 17px; padding-left: 52px; }
  .bar { width: 76px; }
  .allergens th, .allergens td { padding: 10px; }
  .allergens td input[type=date] { font-size: .78rem; }
}

@media (max-width: 380px) {
  .app-header { padding-right: 15px; padding-left: 15px; }
  .app-header h1 { font-size: 1.35rem; }
  .brand-icon { width: 28px; height: 28px; }
  .header-actions { gap: 5px; }
  .language-toggle { width: 40px; min-width: 40px; min-height: 40px; }
  .share { min-height: 40px; padding-right: 10px; padding-left: 10px; font-size: .78rem; }
  .tab { padding-right: 1px; padding-left: 1px; font-size: .72rem; }
  main { padding-right: 10px; padding-left: 10px; }
  .bar { display: none; }
  .cat-head { padding-right: 10px; padding-left: 10px; }
  .tag { padding-right: 5px; padding-left: 5px; font-size: .56rem; }
  .detail { padding-left: 44px; }
}

@media (max-width: 560px) {
  table.allergens { display: block; overflow: hidden; border: 0; background: transparent; box-shadow: none; }
  .allergens thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .allergens tbody { display: grid; gap: 10px; }
  .allergens tbody tr { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; padding: 11px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--card); box-shadow: 0 5px 15px rgba(20,63,53,.04); }
  .allergens tbody th { grid-column: 1 / -1; padding: 0 2px 3px; border: 0; color: var(--forest); font-size: .88rem; }
  .allergens tbody td { display: flex; min-width: 0; flex-direction: column; gap: 4px; padding: 0; border: 0; }
  .allergens tbody td::before { color: var(--muted); font-size: .61rem; font-weight: 700; content: attr(data-label); }
  .allergens td input[type=date] { width: 100%; min-width: 0; min-height: 39px; padding: 4px 3px; font-size: .68rem; }
  .anote { margin-top: 2px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
