[hidden] { display: none !important; }
@font-face { font-family: 'Raleway'; src: url('fonts/raleway.woff') format('woff'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: 'Calistoga'; src: url('fonts/calistoga.woff') format('woff'); font-weight: 400; font-display: swap; }
:root {
  --bg: #fbf9f3; --card: #ffffff; --ink: #23211c; --ink2: #4a463d; --muted: #77736a; --line: #ece5d8;
  --coral: #e8524a; --coral-d: #c23c35; --coral-l: #fde4e1; --orange: #f67700; --orange-d: #b45500; --orange-l: #fff1e3;
  --green: #4f8a3a; --green-l: #e8f3e1; --gold-l: #fdf3d6; --red-l: #fde8e6;
  --r: 16px; --sh: 0 1px 2px rgba(60,40,20,.06), 0 4px 14px rgba(60,40,20,.06);
  --safe-b: env(safe-area-inset-bottom, 0px); --safe-t: env(safe-area-inset-top, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 500 16px/1.5 'Raleway', system-ui, -apple-system, 'Segoe UI', sans-serif; }
img { max-width: 100%; display: block; }
a { color: var(--coral-d); }
button { font: inherit; color: inherit; }
h1, h2, h3 { font-family: 'Calistoga', Georgia, serif; font-weight: 400; line-height: 1.2; margin: 0 0 .4em; letter-spacing: .1px; }
h1 { font-size: 27px; } h2 { font-size: 22px; } h3 { font-size: 18px; }
p { margin: 0 0 .7em; }
.boot { min-height: 70vh; display: grid; place-items: center; text-align: center; color: var(--muted); }
.boot img { width: 72px; border-radius: 18px; margin: 0 auto 12px; }
#app { max-width: 720px; margin: 0 auto; padding: calc(var(--safe-t) + 8px) 16px calc(92px + var(--safe-b)); min-height: 100vh; }
#app.no-nav { padding-bottom: calc(32px + var(--safe-b)); }

/* barra in alto */
.top { display: flex; align-items: center; gap: 10px; min-height: 52px; margin-bottom: 6px; }
.top h1 { font-size: 22px; margin: 0; flex: 1; min-width: 0; }
.back { border: 0; background: var(--card); box-shadow: var(--sh); width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; flex: none; cursor: pointer; }
.back svg { width: 20px; height: 20px; }
.icon-btn { border: 0; background: transparent; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; flex: none; }
.icon-btn svg { width: 24px; height: 24px; }
.icon-btn.on svg { fill: var(--coral); stroke: var(--coral); }

/* navigazione */
.nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: rgba(255,255,255,.97); border-top: 1px solid var(--line); display: flex; justify-content: center; padding: 6px 4px calc(6px + var(--safe-b)); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.nav a { flex: 1; max-width: 140px; display: flex; flex-direction: column; align-items: center; gap: 2px; text-decoration: none; color: var(--muted); font-size: 11.5px; font-weight: 700; padding: 4px 0; border-radius: 12px; }
.nav a svg { width: 24px; height: 24px; }
.nav a.on { color: var(--coral); }

/* elementi comuni */
.card { background: var(--card); border-radius: var(--r); box-shadow: var(--sh); padding: 16px; margin-bottom: 14px; }
.muted { color: var(--muted); } .small { font-size: 14px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1.5px solid var(--line); background: var(--card); border-radius: 999px; padding: 11px 18px; font-weight: 700; cursor: pointer; text-decoration: none; color: var(--ink); min-height: 46px; }
.btn.primary { background: var(--coral); border-color: var(--coral); color: #fff; }
.btn.block { display: flex; width: 100%; }
.btn.big { font-size: 17px; min-height: 52px; }
.btn:disabled { opacity: .55; }
.link-btn { border: 0; background: none; padding: 0; color: var(--coral-d); font-weight: 700; text-decoration: underline; cursor: pointer; }
.row { display: flex; gap: 10px; align-items: center; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.sec-title { font-family: 'Calistoga', Georgia, serif; font-size: 19px; margin: 22px 0 10px; }
.pill { display: inline-flex; align-items: center; gap: 6px; background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px 4px 5px; font-size: 13px; font-weight: 700; color: var(--ink2); }
.pill img, .pill svg { width: 22px; height: 22px; }
.pill.age { background: var(--coral); color: #fff; border-color: var(--coral); }
.pill.warn { background: var(--gold-l); border-color: #f2dc9a; }
.pill.iron { background: var(--red-l); border-color: #f5c7c1; }
.pills { display: flex; flex-wrap: wrap; gap: 6px; }
.empty { text-align: center; color: var(--muted); padding: 30px 10px; }

/* sblocco */
.lock { text-align: center; padding-top: 18px; }
.lock .logo { width: 92px; height: 92px; border-radius: 24px; margin: 0 auto 14px; box-shadow: var(--sh); }
.lock h1 { font-size: 26px; }
.lock .lead { color: var(--ink2); max-width: 420px; margin: 0 auto 18px; }
.code-input { width: 100%; font: 700 20px/1 'Raleway', sans-serif; letter-spacing: 1.5px; text-align: center; text-transform: uppercase; padding: 15px 12px; border: 2px solid var(--line); border-radius: 14px; background: #fff; color: var(--ink); }
.code-input:focus { outline: none; border-color: var(--coral); }
.err { color: var(--coral-d); font-weight: 700; min-height: 1.4em; margin: 8px 0; }
.lock-links { margin-top: 18px; display: grid; gap: 10px; }
.legal { margin-top: 26px; font-size: 13px; color: var(--muted); }

/* home */
.hello { background: linear-gradient(135deg, #fde4e1, #fff1e3); border-radius: 22px; padding: 18px; margin-bottom: 16px; display: flex; gap: 14px; align-items: center; }
.hello img { width: 58px; height: 58px; border-radius: 16px; flex: none; }
.hello h1 { font-size: 22px; margin: 0 0 2px; }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tile { background: var(--card); border-radius: var(--r); box-shadow: var(--sh); padding: 14px; text-decoration: none; color: var(--ink); display: flex; flex-direction: column; gap: 8px; min-height: 112px; }
.tile .ti { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--orange-l); }
.tile .ti img, .tile .ti svg { width: 28px; height: 28px; }
.tile b { font-size: 15.5px; line-height: 1.25; }
.tile small { color: var(--muted); font-size: 13px; line-height: 1.3; }
.offline-note { font-size: 13.5px; color: var(--ink2); background: var(--green-l); border-radius: 12px; padding: 10px 12px; margin-bottom: 14px; }
.offline-note.wait { background: var(--orange-l); }
.install-note { background: #fff; border: 1.5px dashed #f2b8a6; border-radius: 14px; padding: 12px 14px; margin-bottom: 14px; font-size: 14px; }

/* elenco ricette */
.search { position: relative; margin-bottom: 10px; }
.search input { width: 100%; padding: 13px 14px 13px 42px; border-radius: 14px; border: 1.5px solid var(--line); background: #fff; font: 600 16px 'Raleway', sans-serif; color: var(--ink); }
.search svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; color: var(--muted); }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 10px; margin: 0 -16px; padding-left: 16px; padding-right: 16px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; border: 1.5px solid var(--line); background: #fff; border-radius: 999px; padding: 8px 14px; font-weight: 700; font-size: 14px; cursor: pointer; white-space: nowrap; }
.chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.chip.filter { display: inline-flex; gap: 6px; align-items: center; }
.chip .dot { background: var(--coral); color: #fff; border-radius: 999px; font-size: 12px; padding: 0 7px; }
.rlist { display: grid; gap: 12px; }
.rcard { display: flex; gap: 12px; background: var(--card); border-radius: var(--r); box-shadow: var(--sh); padding: 10px; text-decoration: none; color: var(--ink); align-items: center; }
.rcard .th { width: 92px; height: 92px; border-radius: 12px; flex: none; background: var(--line) center/cover no-repeat; overflow: hidden; }
.rcard .th img { width: 100%; height: 100%; object-fit: cover; }
.rcard b { display: block; font-size: 16px; line-height: 1.25; margin-bottom: 4px; }
.rcard .meta { font-size: 13px; color: var(--muted); }
.rcard .fav { color: var(--coral); }
.count { font-size: 14px; color: var(--muted); margin: 0 0 10px; }

/* ricetta */
.hero { margin: 0 -16px 14px; position: relative; aspect-ratio: 3/2; background: var(--line); overflow: hidden; }
.hero img { width: 100%; height: 100%; object-fit: cover; }
.hero .top-over { position: absolute; top: calc(var(--safe-t) + 8px); left: 12px; right: 12px; display: flex; justify-content: space-between; }
.hero .top-over .back, .hero .top-over .icon-btn { background: rgba(255,255,255,.95); box-shadow: var(--sh); }
.rhead small { color: var(--coral-d); font-weight: 800; text-transform: uppercase; letter-spacing: .6px; font-size: 12.5px; }
.rhead h1 { font-size: 26px; margin: 4px 0 10px; }
.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border-radius: 14px; overflow: hidden; margin: 14px 0; box-shadow: var(--sh); }
.facts div { background: #fff; padding: 9px 6px; text-align: center; }
.facts span { display: block; font-size: 11px; font-weight: 800; letter-spacing: .5px; color: var(--orange-d); text-transform: uppercase; }
.facts b { font-size: 14px; font-weight: 700; }
.ings { display: grid; gap: 8px; }
.ing { display: flex; gap: 12px; align-items: center; background: #fff; border-radius: 14px; padding: 8px 12px 8px 8px; box-shadow: var(--sh); }
.ing .ii { width: 56px; height: 52px; flex: none; border-radius: 10px; background: #fbf9f3 center/contain no-repeat; }
.ing .ii img { width: 100%; height: 100%; object-fit: contain; }
.note { border-radius: 14px; padding: 12px 14px; margin: 12px 0; font-size: 15px; }
.note.var { background: var(--orange-l); }
.note.safe { background: var(--red-l); border-left: 4px solid var(--coral); font-weight: 700; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.steps li { display: flex; gap: 12px; background: #fff; border-radius: 14px; padding: 12px; box-shadow: var(--sh); }
.steps .n { width: 30px; height: 30px; flex: none; border-radius: 50%; background: var(--orange); color: #fff; display: grid; place-items: center; font-weight: 800; }
.stages { display: grid; gap: 10px; }
.stage { background: #fff; border-radius: 14px; padding: 12px 14px; box-shadow: var(--sh); border-top: 4px solid var(--orange); }
.stage b { color: var(--orange-d); }
.boxes { display: grid; gap: 12px; margin-top: 14px; }
.box { border-radius: 16px; padding: 14px; border: 2px dashed; }
.box h3 { display: flex; align-items: center; gap: 8px; font-size: 17px; }
.box h3 img { width: 30px; height: 30px; }
.box.fam { border-color: #f0a9a0; background: #fff8f6; }
.box.tip { border-color: #f6c66b; background: #fffbef; }
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 18px 0 6px; }
.rating { display: flex; gap: 8px; }
.rating button { flex: 1; border: 1.5px solid var(--line); background: #fff; border-radius: 12px; padding: 10px 4px; font-weight: 700; cursor: pointer; font-size: 14px; }
.rating button.on { border-color: var(--coral); background: var(--coral-l); }
.bookref { font-size: 13px; color: var(--muted); text-align: center; margin-top: 16px; }

/* cucina */
.cook { position: fixed; inset: 0; background: var(--bg); z-index: 40; display: flex; flex-direction: column; padding: calc(var(--safe-t) + 10px) 18px calc(18px + var(--safe-b)); }
.cook .ct { display: flex; align-items: center; gap: 10px; }
.cook .ct b { flex: 1; font-size: 15px; }
.cook .prog { height: 6px; background: var(--line); border-radius: 9px; margin: 12px 0 18px; overflow: hidden; }
.cook .prog i { display: block; height: 100%; background: var(--orange); border-radius: 9px; transition: width .25s; }
.cook .body { flex: 1; overflow: auto; }
.cook .stepn { color: var(--orange-d); font-weight: 800; letter-spacing: .5px; text-transform: uppercase; font-size: 14px; }
.cook .stept { font-size: 25px; line-height: 1.4; font-weight: 600; margin: 8px 0 18px; }
.cook .nav2 { display: grid; grid-template-columns: 1fr 1.4fr; gap: 10px; }
.timer { display: flex; align-items: center; gap: 12px; background: #fff; border-radius: 16px; padding: 12px 14px; box-shadow: var(--sh); margin-bottom: 14px; }
.timer .tv { font: 700 30px/1 'Raleway', sans-serif; font-variant-numeric: tabular-nums; flex: 1; }
.timer.done { background: var(--coral-l); }

/* tagli */
.cgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ccard { background: #fff; border-radius: var(--r); box-shadow: var(--sh); overflow: hidden; text-decoration: none; color: var(--ink); }
.ccard .cimg { aspect-ratio: 5/3; background: var(--line); }
.ccard .cimg img { width: 100%; height: 100%; object-fit: cover; }
.ccard b { display: block; padding: 9px 11px 11px; font-size: 15px; }
.cphoto { border-radius: 16px; overflow: hidden; box-shadow: var(--sh); margin-bottom: 12px; background: var(--line); aspect-ratio: 1393/843; }
.cphoto img { width: 100%; height: 100%; object-fit: cover; }
.crow { background: #fff; border-radius: 14px; box-shadow: var(--sh); padding: 12px 14px; margin-bottom: 10px; }
.crow span { display: block; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .5px; color: var(--orange-d); }

/* guida e articoli */
.glist { display: grid; gap: 10px; }
.gitem { display: flex; gap: 12px; align-items: center; background: #fff; border-radius: 14px; box-shadow: var(--sh); padding: 13px 14px; text-decoration: none; color: var(--ink); }
.gitem b { flex: 1; font-size: 15.5px; }
.gitem .pg { font-size: 12.5px; color: var(--muted); }
.gitem svg { width: 18px; height: 18px; color: var(--muted); flex: none; }
.art h2 { font-size: 19px; margin-top: 20px; }
.art ul { padding-left: 22px; margin: 0 0 12px; }
.art li { margin-bottom: 5px; }
.art p { margin-bottom: 10px; }
.tbl { overflow-x: auto; margin: 10px -16px 14px; padding: 0 16px; }
.tbl table { border-collapse: collapse; width: 100%; min-width: 100%; background: #fff; border-radius: 12px; overflow: hidden; box-shadow: var(--sh); font-size: 14px; }
.tbl th { background: var(--orange); color: #fff; text-align: left; padding: 8px 10px; font-weight: 800; font-size: 13px; }
.tbl td { padding: 8px 10px; border-top: 1px solid var(--line); vertical-align: top; }
.tbl tr.sub td { background: var(--orange-l); font-weight: 800; }
.tbl.wide table { min-width: 620px; }
.rlink { color: var(--coral-d); font-weight: 700; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; }
.pagetag { display: inline-block; font-size: 12.5px; color: var(--muted); margin-bottom: 8px; }

/* piani */
.tabs { display: flex; gap: 6px; background: #efe8db; padding: 4px; border-radius: 14px; margin-bottom: 14px; }
.tabs button { flex: 1; border: 0; background: transparent; padding: 9px 6px; border-radius: 11px; font-weight: 800; font-size: 13.5px; cursor: pointer; color: var(--ink2); }
.tabs button.on { background: #fff; color: var(--ink); box-shadow: var(--sh); }
.day { background: #fff; border-radius: 16px; box-shadow: var(--sh); padding: 12px 14px; margin-bottom: 10px; }
.day h3 { font-size: 17px; margin-bottom: 6px; color: var(--coral-d); }
.meal { display: flex; gap: 10px; padding: 6px 0; border-top: 1px solid var(--line); font-size: 15px; }
.meal:first-of-type { border-top: 0; }
.meal span { flex: none; width: 104px; font-size: 12.5px; font-weight: 800; color: var(--orange-d); text-transform: uppercase; letter-spacing: .3px; padding-top: 2px; }

/* lista primi cibi */
.chk { display: grid; gap: 8px; }
.chk-h { font-family: 'Calistoga', Georgia, serif; font-size: 17px; margin: 14px 0 4px; }
.chk-row { background: #fff; border-radius: 14px; box-shadow: var(--sh); padding: 10px 12px; }
.chk-top { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.chk-top .box2 { width: 28px; height: 28px; border-radius: 8px; border: 2px solid #d7cfc0; flex: none; display: grid; place-items: center; }
.chk-row.done .box2 { background: var(--green); border-color: var(--green); color: #fff; }
.chk-top b { flex: 1; font-size: 15px; }
.chk-top small { color: var(--muted); font-size: 12.5px; }
.chk-more { display: grid; gap: 8px; margin-top: 10px; }
.chk-more input[type=date], .chk-more textarea { width: 100%; font: 600 15px 'Raleway', sans-serif; border: 1.5px solid var(--line); border-radius: 10px; padding: 9px 10px; background: #fff; color: var(--ink); }
.chk-more textarea { min-height: 64px; resize: vertical; }

/* sheet e toast */
.sheet { position: fixed; inset: 0; z-index: 60; display: flex; align-items: flex-end; justify-content: center; }
.sheet-bg { position: absolute; inset: 0; background: rgba(35,33,28,.42); }
.sheet-box { position: relative; background: var(--bg); width: 100%; max-width: 620px; max-height: 88vh; overflow: auto; border-radius: 22px 22px 0 0; padding: 22px 18px calc(22px + var(--safe-b)); animation: up .22s ease-out; }
@keyframes up { from { transform: translateY(40px); opacity: .4; } to { transform: none; opacity: 1; } }
.sheet-x { position: absolute; right: 12px; top: 10px; border: 0; background: #fff; width: 36px; height: 36px; border-radius: 50%; font-size: 24px; line-height: 1; cursor: pointer; box-shadow: var(--sh); }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(86px + var(--safe-b)); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 999px; font-weight: 700; font-size: 14px; z-index: 80; max-width: 92vw; text-align: center; }
.faq details { background: #fff; border-radius: 14px; box-shadow: var(--sh); padding: 12px 14px; margin-bottom: 10px; }
.faq summary { font-weight: 800; cursor: pointer; }
.faq details p { margin: 8px 0 0; }
.quiz-top { display: flex; justify-content: space-between; align-items: center; font-weight: 800; color: var(--muted); font-size: 14px; margin-bottom: 12px; }
.quiz-q { background: #fff; border-radius: 16px; box-shadow: var(--sh); padding: 14px; margin-bottom: 12px; }
.quiz-q .pg { font-size: 26px; font-family: 'Calistoga', Georgia, serif; color: var(--coral-d); }
.quiz-opts { display: grid; gap: 8px; }
.ed-choice { display: grid; gap: 10px; }
.ed-choice button { text-align: left; border: 2px solid var(--line); background: #fff; border-radius: 16px; padding: 14px; cursor: pointer; }
.ed-choice button b { display: block; font-family: 'Calistoga', Georgia, serif; font-weight: 400; font-size: 19px; margin-bottom: 2px; }
.set-list { display: grid; gap: 10px; }
.setrow { display: flex; align-items: center; gap: 12px; background: #fff; border-radius: 14px; box-shadow: var(--sh); padding: 13px 14px; text-decoration: none; color: var(--ink); border: 0; width: 100%; text-align: left; cursor: pointer; font-weight: 700; }
.setrow img { width: 30px; height: 30px; }
.setrow span { flex: 1; }
@media (min-width: 560px) { .cgrid { grid-template-columns: 1fr 1fr 1fr; } .tiles { grid-template-columns: 1fr 1fr 1fr; } }
@media (prefers-reduced-motion: reduce) { .sheet-box { animation: none; } }
