/* Calcolatore food cost – mobile-first */
.calc { padding: 8px 0 10px; }
.grid { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
.col-in { display: grid; gap: 16px; min-width: 0; grid-template-columns: minmax(0, 1fr); }
.step-h { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.step-h .n { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--dark); color: #fff; font-weight: 800; }
.step-h h2 { font-size: 1.45rem; letter-spacing: -.03em; }
.lbl { display: block; font-weight: 700; font-size: .92rem; color: var(--brown-ink); margin: 0 0 6px; }
.hint { font-size: .9rem; color: var(--muted); margin: 10px 0; }
.inp { width: 100%; min-height: 48px; padding: 10px 14px; border-radius: 14px; border: 1.5px solid rgba(31,26,21,.14); background: #fff; font-size: 16px; font-weight: 700; color: var(--ink); outline: none; transition: border-color .2s, box-shadow .2s; -webkit-appearance: none; appearance: none; }
.inp:focus { border-color: var(--orange); box-shadow: 0 0 0 4px rgba(224,106,27,.15); }
.inp.big { font-size: 1.2rem; }
.f { display: grid; gap: 5px; }
.f > span { font-size: .78rem; font-weight: 700; color: var(--muted); }

.presets { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin: 0 -18px; padding-left: 18px; padding-right: 18px; scrollbar-width: none; }
.presets::-webkit-scrollbar { display: none; }
.presets button { flex: none; min-height: 42px; padding: 0 14px; border-radius: 999px; border: 1.5px solid rgba(31,26,21,.14); background: #fff; font-weight: 700; cursor: pointer; white-space: nowrap; }
.presets button.on { background: var(--dark); color: #fff; border-color: var(--dark); }

.ings { display: grid; gap: 10px; }
.ing { display: grid; grid-template-columns: 1fr 1fr 1fr; grid-template-areas: "n n x" "g p c"; gap: 8px; padding: 12px; border-radius: 16px; background: #fbf6ef; border: 1px solid var(--line); }
.ing .n { grid-area: n; min-height: 42px; font-size: 16px; }
.ing .g-w { grid-area: g; } .ing .p-w { grid-area: p; }
.ing .c { grid-area: c; display: grid; gap: 5px; align-content: end; }
.ing .c span { font-size: .78rem; font-weight: 700; color: var(--muted); }
.ing .c b { min-height: 48px; display: grid; place-items: center; border-radius: 14px; background: #fff3e6; color: var(--brown-ink); font-weight: 800; }
.ing .x { grid-area: x; justify-self: end; width: 42px; height: 42px; border-radius: 12px; border: 0; background: transparent; color: var(--muted); font-size: 1.1rem; cursor: pointer; }
.ing .x:hover { background: var(--red-soft); color: var(--red); }
.add { margin-top: 10px; width: 100%; min-height: 48px; border-radius: 14px; border: 1.5px dashed rgba(154,101,52,.45); background: transparent; color: var(--brown); font-weight: 800; cursor: pointer; }
.add:hover { background: #fff; border-color: var(--orange); color: var(--orange); }
.extras { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }

.price-row { display: flex; gap: 12px; align-items: end; flex-wrap: wrap; margin-bottom: 16px; }
.price-row .grow { flex: 1 1 160px; }
.sw { display: inline-flex; align-items: center; gap: 10px; min-height: 48px; font-weight: 700; font-size: .95rem; cursor: pointer; }
.sw input { position: absolute; opacity: 0; pointer-events: none; }
.sw-ui { width: 48px; height: 28px; border-radius: 999px; background: rgba(31,26,21,.18); position: relative; transition: background .2s; flex: none; }
.sw-ui::after { content: ""; position: absolute; left: 3px; top: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(0,0,0,.2); transition: transform .2s; }
.sw input:checked + .sw-ui { background: var(--green); }
.sw input:checked + .sw-ui::after { transform: translateX(20px); }
.sw input:focus-visible + .sw-ui { box-shadow: 0 0 0 4px rgba(224,106,27,.25); }
.range { width: 100%; accent-color: var(--orange); height: 32px; }

/* risultati */
.col-out { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); align-content: start; min-width: 0; scroll-margin-top: 76px; }
.res { background: var(--dark); color: #d8cbb9; border: 0; }
.res-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.res-name { font-weight: 800; color: #fff; font-size: 1.15rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.badge { flex: none; font-weight: 800; font-size: .8rem; padding: 6px 12px; border-radius: 999px; background: rgba(255,255,255,.1); color: #fff; }
.badge.ok { background: #2a9d6a; } .badge.mid { background: #d99100; color: #1a1410; } .badge.ko { background: var(--red); }
.big-num { display: flex; align-items: baseline; gap: 10px; margin: 10px 0 4px; }
.big-num span { font-size: 5rem; line-height: 1; font-weight: 800; letter-spacing: -.05em; color: #fff; font-variant-numeric: tabular-nums; }
.big-num small { font-size: 1.05rem; font-weight: 700; color: var(--caramel); }
.gauge { position: relative; margin: 14px 0 8px; padding-bottom: 24px; }
.zones { display: flex; height: 12px; border-radius: 99px; overflow: hidden; }
.zones i { display: block; height: 100%; }
.z1 { width: 56%; background: #2a9d6a; } .z2 { width: 14%; background: #d99100; } .z3 { width: 30%; background: var(--red); }
.needle { position: absolute; top: -6px; left: 0; width: 6px; height: 24px; margin-left: -3px; border-radius: 4px; background: #fff; box-shadow: 0 0 0 3px var(--dark); transition: left .45s cubic-bezier(.2,.7,.2,1); }
.ticks-g { position: absolute; left: 0; right: 0; bottom: 0; height: 16px; font-size: .72rem; line-height: 16px; color: #9d907f; }
.ticks-g span { position: absolute; transform: translateX(-50%); }
.ticks-g span:nth-child(1) { left: 0; transform: none; } .ticks-g span:nth-child(2) { left: 56%; } .ticks-g span:nth-child(3) { left: 70%; } .ticks-g span:nth-child(4) { right: 0; left: auto; transform: none; }
.verdict { margin: 8px 0 14px; font-size: .95rem; }
.kv { margin: 0; display: grid; gap: 2px; }
.kv div { display: flex; justify-content: space-between; gap: 10px; padding: 10px 0; border-top: 1px solid rgba(255,255,255,.08); }
.kv dt { color: #b9ab98; } .kv dd { margin: 0; font-weight: 800; color: #fff; font-variant-numeric: tabular-nums; }
.kv .hl dd { color: #7fe0b0; font-size: 1.15rem; }
.sugg { margin-top: 12px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px; border-radius: 16px; background: rgba(224,106,27,.16); border: 1px solid rgba(224,106,27,.4); }
.sugg span { font-size: .92rem; } .sugg b { color: #fff; }
.sugg strong { font-size: 1.6rem; color: #fff; letter-spacing: -.02em; white-space: nowrap; }
.acts { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.acts .pill { flex: 1 1 auto; }
.res .pill--ghost { background: rgba(255,255,255,.08); color: #fff; border-color: rgba(255,255,255,.2); }
.res .pill--ghost:hover { background: #fff; color: var(--dark); }

.menu-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.menu-h h3 { font-size: 1.3rem; }
.link { border: 0; background: none; color: var(--orange); font-weight: 800; cursor: pointer; padding: 8px 0; }
.mrow { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.mrow b { display: block; color: var(--ink); }
.mrow small { color: var(--muted); font-size: .82rem; }
.mrow .pc { font-weight: 800; padding: 5px 10px; border-radius: 999px; font-size: .85rem; }
.pc.ok { background: var(--green-soft); color: var(--green); } .pc.mid { background: var(--amber-soft); color: var(--amber); } .pc.ko { background: var(--red-soft); color: var(--red); }
.mrow .del { border: 0; background: none; color: var(--muted); width: 36px; height: 36px; border-radius: 10px; cursor: pointer; }
.mrow .del:hover { background: var(--red-soft); color: var(--red); }

/* guida */
.narrow { max-width: 780px; }
.formula { margin-bottom: 14px; }
.formula .f1 { font-size: 1.15rem; color: var(--ink); margin: 0 0 6px; }
.formula .f2 { margin: 0; color: var(--muted); font-size: .95rem; }
.faq { display: grid; gap: 10px; }
.faq details { background: rgba(255,255,255,.9); border: 1px solid var(--line); border-radius: 18px; padding: 4px 18px; }
.faq summary { cursor: pointer; font-weight: 800; color: var(--ink); padding: 14px 0; list-style: none; position: relative; padding-right: 26px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 0; top: 10px; font-size: 1.4rem; color: var(--orange); }
.faq details[open] summary::after { content: "–"; }
.faq details p { margin: 0 0 14px; }

/* invito */
.promo { border-radius: var(--r); padding: 28px 20px; color: #fff; background: radial-gradient(120% 140% at 100% 0%, #e06a1b 0%, #9a6534 45%, #1a1410 100%); box-shadow: var(--shadow); }
.promo h2 { color: #fff; font-size: clamp(1.8rem, 7vw, 3rem); line-height: 1; letter-spacing: -.04em; margin: 4px 0 12px; }
.promo h2 em { background: none; color: var(--sand); -webkit-text-fill-color: var(--sand); }
.promo p { color: #f3e6d6; max-width: 620px; }
.chip--dark { background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.2); color: #fff; }
.pill--light { background: #fff; color: var(--dark); }
.pill--light:hover { background: var(--sand); color: var(--dark); }

/* barra fissa (solo telefono) */
.bar { position: fixed; left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 30; transition: transform .3s, opacity .3s; }
.bar.hide { transform: translateY(140%); opacity: 0; pointer-events: none; }
.bar-in { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 18px; background: var(--dark); color: #fff; text-decoration: none; box-shadow: 0 18px 40px -12px rgba(26,20,16,.7); }
.bar-in:hover { color: #fff; }
.dot { width: 14px; height: 14px; border-radius: 50%; background: #888; flex: none; box-shadow: 0 0 12px currentColor; }
.dot.ok { background: #2a9d6a; color: #2a9d6a; } .dot.mid { background: #d99100; color: #d99100; } .dot.ko { background: var(--red); color: var(--red); }
.bar-t { flex: 1; line-height: 1.2; } .bar-t b { font-size: 1.2rem; }
.bar-t small { display: block; color: #b9ab98; font-size: .8rem; }
.bar-go { font-weight: 800; color: var(--caramel); }

@media (min-width: 900px) {
  .calc { padding-top: 14px; }
  .grid { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 24px; align-items: start; }
  .col-out { position: sticky; top: 80px; }
  .card { padding: 26px; }
  .ing { grid-template-columns: 2fr 1fr 1fr 1fr 42px; grid-template-areas: "n g p c x"; align-items: end; }
  .ing .x { align-self: end; }
  .presets { margin: 0; padding: 0 0 4px; flex-wrap: wrap; }
  .bar { display: none; }
  .promo { padding: 44px; }
}

@media print {
  .lava, .top, .hero, .col-in, .res, .guide, .promo, .bar, .foot, .sec { display: none !important; }
  body { background: #fff; }
  .calc, .grid, .col-out { display: block; padding: 0; position: static; }
  .card.menu { box-shadow: none; border: 0; }
  .card.menu::before { content: "Il mio menù – food cost (Ketch Eat Tools)"; display: block; font-weight: 800; font-size: 20px; margin-bottom: 10px; }
  .link, .del, .menu .hint { display: none !important; }
}
.ing .x, .mrow .del { display: grid; place-items: center; }
