/* SAVORA — design system
   Layout: colonna mobile-first (max 560px) con bottom navigation; su desktop resta centrata. */
:root {
  --sage: #7F9C78;          /* verde salvia — colore principale */
  --sage-deep: #5F7D59;
  --sage-soft: #E3EADC;
  --green-ink: #22362A;     /* verde scuro — testi e contrasto */
  --olive: #6E7B3F;         /* verde oliva — dettagli */
  --cream: #F5F0E4;         /* crema — sfondi */
  --surface: #FFFFFF;       /* bianco — card e superfici */
  --gold: #BC9A5C;          /* accento dorato — premium */
  --gold-soft: #F3EAD7;
  --muted: #6B776D;
  --line: #E4DED0;
  --line-strong: #D3CBB8;
  --danger: #B5523F;
  --danger-soft: #F7E3DD;
  --warn: #A9781F;
  --warn-soft: #F8EDD3;
  --ok: #4F7A47;
  --shadow: 0 1px 2px rgba(34, 54, 42, .06), 0 6px 20px rgba(34, 54, 42, .06);
  --shadow-lg: 0 10px 40px rgba(34, 54, 42, .18);
  --radius: 20px;
  --radius-sm: 14px;
  --font-display: 'Fraunces', 'Iowan Old Style', Georgia, serif;
  --font-body: 'Manrope', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --nav-h: 68px;
  --maxw: 560px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --sage: #96B58E; --sage-deep: #A9C6A1; --sage-soft: #24342A; --green-ink: #E8EEE4; --olive: #B5C27E;
    --cream: #121A15; --surface: #1A241E; --gold: #D5B57A; --gold-soft: #2F2A1E; --muted: #9DAA9F;
    --line: #2A372F; --line-strong: #3A4A40; --danger: #E08A76; --danger-soft: #3A221D; --warn: #E0B565; --warn-soft: #362C17; --ok: #9BC48F;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 20px rgba(0,0,0,.25); --shadow-lg: 0 10px 40px rgba(0,0,0,.5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --sage: #96B58E; --sage-deep: #A9C6A1; --sage-soft: #24342A; --green-ink: #E8EEE4; --olive: #B5C27E;
  --cream: #121A15; --surface: #1A241E; --gold: #D5B57A; --gold-soft: #2F2A1E; --muted: #9DAA9F;
  --line: #2A372F; --line-strong: #3A4A40; --danger: #E08A76; --danger-soft: #3A221D; --warn: #E0B565; --warn-soft: #362C17; --ok: #9BC48F;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 20px rgba(0,0,0,.25); --shadow-lg: 0 10px 40px rgba(0,0,0,.5);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--cream); color: var(--green-ink);
  font-family: var(--font-body); font-size: 15.5px; line-height: 1.5;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img { max-width: 100%; display: block; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 560; letter-spacing: -.01em; margin: 0; text-wrap: balance; font-variation-settings: "SOFT" 60, "opsz" 48; }
h1 { font-size: 30px; line-height: 1.12; }
h2 { font-size: 22px; line-height: 1.2; }
h3 { font-size: 18px; line-height: 1.25; }
p { margin: 0; }
a { color: var(--sage-deep); }
.num { font-variant-numeric: tabular-nums; }
:focus-visible { outline: 2.5px solid var(--sage-deep); outline-offset: 2px; border-radius: 8px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ic { flex: none; }

/* ---------- Shell ---------- */
#app { max-width: var(--maxw); margin: 0 auto; min-height: 100%; position: relative; }
.screen { padding: 0 18px calc(var(--nav-h) + 28px + env(safe-area-inset-bottom)); animation: fadeIn .25s ease; }
.screen.no-nav { padding-bottom: 32px; }
@keyframes fadeIn { from { opacity: .4; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

.topbar { display: flex; align-items: center; gap: 10px; padding: 16px 0 10px; position: sticky; top: 0; z-index: 5; background: var(--cream); }
.topbar .title { flex: 1; min-width: 0; }
.topbar .title h1 { font-size: 26px; }
.topbar .title .sub { color: var(--muted); font-size: 13.5px; }
.icon-btn { width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); display: inline-grid; place-items: center; position: relative; flex: none; color: var(--green-ink); }
.icon-btn:hover { border-color: var(--line-strong); }
.icon-btn .dot { position: absolute; top: 7px; right: 8px; width: 9px; height: 9px; border-radius: 50%; background: var(--gold); border: 2px solid var(--surface); }
.logo { display: inline-flex; align-items: center; gap: 9px; }
.logo-word { font-family: var(--font-display); font-weight: 600; letter-spacing: .18em; font-size: 17px; color: var(--green-ink); }

/* ---------- Bottom nav ---------- */
.nav { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: var(--maxw); z-index: 20;
  background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(5, 1fr); padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); }
.nav button { border: 0; background: none; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 2px; font-size: 11px; font-weight: 600; color: var(--muted); border-radius: 14px; }
.nav button.on { color: var(--sage-deep); }
.nav button.on .ic { stroke-width: 2.1; }
.nav .chef-tab .bubble { width: 44px; height: 44px; margin-top: -20px; border-radius: 50%; background: var(--sage); color: #fff; display: grid; place-items: center; box-shadow: 0 6px 16px color-mix(in srgb, var(--sage) 45%, transparent); border: 3px solid var(--cream); }
.nav .chef-tab.on .bubble { background: var(--sage-deep); }

/* ---------- Superfici ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.card.flat { box-shadow: none; }
.section { margin-top: 26px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.section-head h2 { font-size: 20px; }
.link { background: none; border: 0; color: var(--sage-deep); font-weight: 700; font-size: 13.5px; padding: 4px 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.tiny { font-size: 11.5px; letter-spacing: .02em; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.spread { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.divider { height: 1px; background: var(--line); margin: 14px 0; border: 0; }

/* ---------- Pulsanti ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 999px; padding: 12px 18px; font-weight: 700; font-size: 14.5px; border: 1px solid transparent; background: var(--sage-soft); color: var(--green-ink); transition: transform .08s ease, background .15s; min-height: 46px; }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--sage-deep); color: #fff; }
:root[data-theme="dark"] .btn.primary { color: #10170F; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn.primary { color: #10170F; } }
.btn.primary:hover { background: color-mix(in srgb, var(--sage-deep) 88%, #000); }
.btn.ghost { background: var(--surface); border-color: var(--line-strong); }
.btn.gold { background: var(--gold); color: #fff; }
.btn.danger { background: var(--danger-soft); color: var(--danger); }
.btn.block { width: 100%; }
.btn.sm { padding: 8px 13px; min-height: 36px; font-size: 13px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn .ic { margin: -2px 0; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -18px; padding: 0 18px 4px; }
.chips.scroll::-webkit-scrollbar { display: none; }
.chip { border: 1px solid var(--line-strong); background: var(--surface); border-radius: 999px; padding: 7px 13px; font-size: 13.5px; font-weight: 600; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; color: var(--green-ink); }
.chip.on { background: var(--green-ink); color: var(--cream); border-color: var(--green-ink); }
.chip.soft { background: var(--sage-soft); border-color: transparent; }
.chip .x { opacity: .6; }

.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 700; background: var(--sage-soft); color: var(--sage-deep); white-space: nowrap; }
.badge.gold { background: var(--gold-soft); color: color-mix(in srgb, var(--gold) 80%, var(--green-ink)); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.danger { background: var(--danger-soft); color: var(--danger); }
.badge.line { background: transparent; border: 1px solid var(--line-strong); color: var(--muted); }

/* ---------- Form ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .label { font-size: 13px; font-weight: 700; color: var(--muted); }
.input, select.input, textarea.input { width: 100%; border: 1px solid var(--line-strong); background: var(--surface); border-radius: var(--radius-sm); padding: 12px 14px; outline: none; min-height: 46px; }
.input:focus { border-color: var(--sage-deep); box-shadow: 0 0 0 3px color-mix(in srgb, var(--sage) 25%, transparent); }
textarea.input { resize: vertical; min-height: 80px; }
.seg { display: flex; background: var(--sage-soft); border-radius: 999px; padding: 4px; gap: 4px; }
.seg button { flex: 1; border: 0; background: none; border-radius: 999px; padding: 8px 10px; font-weight: 700; font-size: 13.5px; color: var(--muted); }
.seg button.on { background: var(--surface); color: var(--green-ink); box-shadow: var(--shadow); }
.switch { position: relative; width: 48px; height: 28px; flex: none; }
.switch input { opacity: 0; width: 100%; height: 100%; position: absolute; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; background: var(--line-strong); border-radius: 999px; transition: background .15s; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch input:checked + span { background: var(--sage-deep); }
.switch input:checked + span::after { transform: translateX(20px); }
.switch input:focus-visible + span { outline: 2.5px solid var(--sage-deep); outline-offset: 2px; }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface); }
.stepper button { width: 38px; height: 38px; border: 0; background: none; display: grid; place-items: center; border-radius: 50%; }
.stepper .v { min-width: 34px; text-align: center; font-weight: 800; font-variant-numeric: tabular-nums; }
input[type=range] { width: 100%; accent-color: var(--sage-deep); }

/* ---------- Home ---------- */
.hero { margin-top: 6px; border-radius: 26px; padding: 22px 20px 20px; position: relative; overflow: hidden; background: var(--green-ink); color: var(--cream); }
:root[data-theme="dark"] .hero { background: #24372B; color: #EEF2EA; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .hero { background: #24372B; color: #EEF2EA; } }
.hero h1 { font-size: 31px; color: inherit; max-width: 78%; }
.hero p { opacity: .82; margin-top: 6px; max-width: 80%; font-size: 14.5px; }
.hero .btn { margin-top: 18px; background: #F5F0E4; color: #22362A; padding: 14px 22px; letter-spacing: .04em; }
.hero .art { position: absolute; right: -36px; top: -24px; width: 170px; height: 170px; opacity: .95; }
.hero .quick { margin-top: 14px; display: flex; gap: 8px; flex-wrap: wrap; }
.hero .quick button { background: rgba(255,255,255,.1); color: inherit; border: 1px solid rgba(255,255,255,.18); border-radius: 999px; padding: 6px 11px; font-size: 12.5px; font-weight: 600; }
.meals { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.meal-btn { border: 1px solid var(--line); background: var(--surface); border-radius: 18px; padding: 12px 2px 10px; display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: var(--green-ink); }
.meal-btn .ic { color: var(--sage-deep); }
.meal-btn.on { border-color: var(--sage-deep); background: var(--sage-soft); }
.hscroll { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 -18px; padding: 2px 18px 8px; scrollbar-width: none; }
.hscroll::-webkit-scrollbar { display: none; }
.hscroll > * { scroll-snap-align: start; flex: none; }
.insp { width: 150px; border-radius: 20px; padding: 14px; min-height: 120px; display: flex; flex-direction: column; justify-content: space-between; border: 1px solid var(--line); background: var(--surface); text-align: left; }
.insp .ic { color: var(--olive); }
.insp b { font-family: var(--font-display); font-size: 16.5px; font-weight: 560; line-height: 1.2; }
.insp span { font-size: 12.5px; color: var(--muted); }
.insp.dark { background: var(--sage-deep); color: #fff; border-color: transparent; }
.insp.dark span, .insp.dark .ic { color: rgba(255,255,255,.85); }
.quick-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tile { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 18px; border: 1px solid var(--line); background: var(--surface); text-align: left; }
.tile .ib { width: 40px; height: 40px; border-radius: 12px; background: var(--sage-soft); color: var(--sage-deep); display: grid; place-items: center; flex: none; }
.tile b { display: block; font-size: 14.5px; }
.tile small { color: var(--muted); font-size: 12px; }
.resume { display: flex; align-items: center; gap: 12px; }

/* ---------- Card ricetta ---------- */
.cover { position: relative; overflow: hidden; background: var(--sage-soft); }
.cover-svg, .cover-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rcard { width: 220px; border-radius: 20px; overflow: hidden; border: 1px solid var(--line); background: var(--surface); text-align: left; padding: 0; display: flex; flex-direction: column; }
.rcard .cover { height: 132px; }
.rcard .body { padding: 11px 13px 13px; display: flex; flex-direction: column; gap: 5px; flex: 1; }
.rcard .t { font-weight: 750; font-size: 14.5px; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rcard .m { color: var(--muted); font-size: 12.5px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.rcard .tag { position: absolute; left: 10px; top: 10px; }
.rlist { display: flex; flex-direction: column; gap: 10px; }
.rrow { display: flex; gap: 12px; align-items: center; padding: 10px; border-radius: 18px; border: 1px solid var(--line); background: var(--surface); text-align: left; width: 100%; }
.rrow .cover { width: 74px; height: 74px; border-radius: 14px; flex: none; }
.rrow .t { font-weight: 750; font-size: 14.5px; line-height: 1.25; }
.rrow .m { color: var(--muted); font-size: 12.5px; display: flex; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.meta { display: inline-flex; align-items: center; gap: 4px; }

/* ---------- Dettaglio ricetta ---------- */
.detail-cover { height: 260px; margin: 0 -18px; position: relative; }
.detail-cover .bar { position: absolute; top: 14px; left: 14px; right: 14px; display: flex; justify-content: space-between; z-index: 2; }
.detail-cover .bar .icon-btn { background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(6px); }
.detail-head { background: var(--cream); border-radius: 26px 26px 0 0; margin: -26px -18px 0; padding: 22px 18px 0; position: relative; }
.facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 16px; }
.fact { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 10px 6px; text-align: center; }
.fact b { display: block; font-size: 15px; font-variant-numeric: tabular-nums; }
.fact span { font-size: 11.5px; color: var(--muted); }
.actions-bar { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 14px; }
.act { border: 1px solid var(--line); background: var(--surface); border-radius: 16px; padding: 10px 4px; display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 700; color: var(--green-ink); }
.act.on { color: var(--sage-deep); background: var(--sage-soft); border-color: transparent; }
.act.on .ic { fill: currentColor; }
.ing-list { list-style: none; padding: 0; margin: 0; }
.ing-list li { display: flex; gap: 12px; align-items: baseline; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.ing-list li:last-child { border-bottom: 0; }
.ing-list .q { min-width: 82px; font-weight: 800; font-variant-numeric: tabular-nums; }
.ing-list .n { flex: 1; }
.ing-list .note { color: var(--muted); font-size: 13px; }
.have { color: var(--ok); }
.need { color: var(--warn); }
.steps { list-style: none; padding: 0; margin: 0; counter-reset: s; display: flex; flex-direction: column; gap: 14px; }
.steps li { display: grid; grid-template-columns: 34px 1fr; gap: 12px; }
.steps li::before { counter-increment: s; content: counter(s); width: 32px; height: 32px; border-radius: 50%; background: var(--sage-soft); color: var(--sage-deep); display: grid; place-items: center; font-weight: 800; font-size: 14px; }
.steps .tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.nutri { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.nutri div { text-align: center; padding: 10px 4px; border-radius: 14px; background: var(--sage-soft); }
.nutri b { display: block; font-size: 17px; font-variant-numeric: tabular-nums; }
.nutri span { font-size: 11.5px; color: var(--muted); }
.qc { border-radius: 16px; padding: 12px 14px; border: 1px solid var(--line); background: var(--surface); }
.qc-row { display: flex; gap: 8px; align-items: flex-start; font-size: 13.5px; padding: 4px 0; }
.qc-row .ic { margin-top: 2px; }
.qc-row.error { color: var(--danger); }
.qc-row.warn { color: var(--warn); }
.qc-row.info { color: var(--muted); }
.qc-row.ok { color: var(--ok); }
.callout { border-radius: 16px; padding: 12px 14px; background: var(--gold-soft); font-size: 13.5px; display: flex; gap: 10px; align-items: flex-start; }
.callout.sage { background: var(--sage-soft); }
.callout.danger { background: var(--danger-soft); color: var(--danger); }

/* ---------- Chef AI ---------- */
.demo-banner { display: flex; gap: 10px; align-items: flex-start; padding: 11px 13px; border-radius: 16px; background: var(--warn-soft); color: var(--warn); font-size: 13px; font-weight: 600; margin-bottom: 12px; }
.demo-banner button { margin-left: auto; }
.live-banner { display: flex; gap: 8px; align-items: center; padding: 8px 12px; border-radius: 999px; background: var(--sage-soft); color: var(--sage-deep); font-size: 12.5px; font-weight: 700; margin-bottom: 12px; width: fit-content; }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--sage-deep); box-shadow: 0 0 0 0 color-mix(in srgb, var(--sage-deep) 60%, transparent); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.chat { display: flex; flex-direction: column; gap: 10px; margin: 6px 0 14px; }
.msg { max-width: 88%; padding: 11px 14px; border-radius: 18px; font-size: 14.5px; }
.msg.user { align-self: flex-end; background: var(--green-ink); color: var(--cream); border-bottom-right-radius: 6px; }
.msg.chef { align-self: flex-start; background: var(--surface); border: 1px solid var(--line); border-bottom-left-radius: 6px; }
.msg .who { font-size: 11.5px; font-weight: 800; color: var(--sage-deep); margin-bottom: 3px; display: flex; gap: 6px; align-items: center; }
.msg.err { border-color: var(--danger); background: var(--danger-soft); color: var(--danger); }
.composer { position: sticky; bottom: calc(var(--nav-h) + 10px + env(safe-area-inset-bottom)); z-index: 6; display: flex; gap: 8px; align-items: flex-end; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 24px; padding: 6px 6px 6px 16px; box-shadow: var(--shadow-lg); }
.composer textarea { flex: 1; border: 0; outline: none; resize: none; background: none; padding: 9px 0; max-height: 120px; min-height: 22px; line-height: 1.4; }
.composer .send { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--sage-deep); color: #fff; display: grid; place-items: center; flex: none; }
.composer .send[disabled] { opacity: .45; }
.sugg { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -18px 10px; padding: 0 18px; }
.sugg::-webkit-scrollbar { display: none; }
.params summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; font-weight: 750; }
.params summary::-webkit-details-marker { display: none; }
.params[open] summary .chev { transform: rotate(90deg); }
.chev { transition: transform .2s; }
.pgrid { display: grid; gap: 14px; margin-top: 14px; }
.tag-input { display: flex; flex-wrap: wrap; gap: 6px; border: 1px solid var(--line-strong); background: var(--surface); border-radius: var(--radius-sm); padding: 7px 8px; min-height: 46px; align-items: center; }
.tag-input input { border: 0; outline: none; flex: 1; min-width: 110px; background: none; padding: 4px; }
.thinking { display: flex; gap: 10px; align-items: center; color: var(--muted); font-size: 13.5px; }
.dots span { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--sage); margin: 0 2px; animation: b 1.2s infinite; }
.dots span:nth-child(2) { animation-delay: .15s; } .dots span:nth-child(3) { animation-delay: .3s; }
@keyframes b { 0%, 80%, 100% { transform: scale(.6); opacity: .5; } 40% { transform: scale(1); opacity: 1; } }
.tier { display: inline-flex; gap: 4px; align-items: center; font-size: 11px; font-weight: 800; letter-spacing: .03em; text-transform: uppercase; color: var(--olive); }

/* ---------- Liste (dispensa, spesa) ---------- */
.group-title { font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 18px 0 8px; display: flex; justify-content: space-between; }
.lrow { display: flex; align-items: center; gap: 12px; padding: 11px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; }
.lrow + .lrow { margin-top: 8px; }
.lrow .n { flex: 1; min-width: 0; }
.lrow .n b { font-weight: 700; display: block; overflow: hidden; text-overflow: ellipsis; }
.lrow .n small { color: var(--muted); font-size: 12.5px; }
.lrow.done .n b { text-decoration: line-through; color: var(--muted); }
.check { width: 26px; height: 26px; border-radius: 8px; border: 2px solid var(--line-strong); background: var(--surface); display: grid; place-items: center; flex: none; color: transparent; }
.check.on { background: var(--sage-deep); border-color: var(--sage-deep); color: #fff; }
.qty-pill { font-variant-numeric: tabular-nums; font-weight: 800; font-size: 13.5px; background: var(--sage-soft); border-radius: 999px; padding: 4px 10px; border: 0; color: var(--green-ink); white-space: nowrap; }
.add-bar { display: flex; gap: 8px; }
.add-bar .input { flex: 1; }
.suggest-row { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.equip-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.equip { border: 1.5px solid var(--line); background: var(--surface); border-radius: 18px; padding: 14px 6px 12px; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; font-size: 12.5px; font-weight: 700; position: relative; color: var(--green-ink); }
.equip .ic { color: var(--muted); }
.equip.on { border-color: var(--sage-deep); background: var(--sage-soft); }
.equip.on .ic { color: var(--sage-deep); }
.equip .tick { position: absolute; top: 8px; right: 8px; width: 18px; height: 18px; border-radius: 50%; background: var(--sage-deep); color: #fff; display: grid; place-items: center; }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 4px -18px 14px; padding: 0 18px; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { border: 0; background: none; padding: 8px 2px; margin-right: 14px; font-weight: 750; color: var(--muted); border-bottom: 2.5px solid transparent; white-space: nowrap; font-size: 14.5px; }
.tabs button.on { color: var(--green-ink); border-color: var(--sage-deep); }
.tabs .count { font-size: 11.5px; background: var(--sage-soft); color: var(--sage-deep); border-radius: 999px; padding: 1px 7px; margin-left: 4px; }

/* ---------- Sheet & dialog ---------- */
.overlay { position: fixed; inset: 0; background: rgba(18, 26, 21, .45); z-index: 50; display: flex; align-items: flex-end; justify-content: center; animation: fadeIn .2s ease; }
.sheet { background: var(--cream); width: 100%; max-width: var(--maxw); max-height: 92%; overflow-y: auto; border-radius: 26px 26px 0 0; padding: 10px 18px calc(22px + env(safe-area-inset-bottom)); box-shadow: var(--shadow-lg); animation: up .25s cubic-bezier(.2,.8,.2,1); }
@keyframes up { from { transform: translateY(40px); } to { transform: none; } }
.sheet .grab { width: 40px; height: 5px; border-radius: 9px; background: var(--line-strong); margin: 0 auto 12px; }
.sheet-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.sheet-head h2 { flex: 1; font-size: 21px; }
.dialog { background: var(--surface); border-radius: 22px; padding: 20px; max-width: 360px; width: calc(100% - 40px); margin: auto; box-shadow: var(--shadow-lg); }
.overlay.center { align-items: center; }
.toasts { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--nav-h) + 18px + env(safe-area-inset-bottom)); z-index: 60; display: flex; flex-direction: column; gap: 8px; width: calc(100% - 32px); max-width: 520px; pointer-events: none; }
.toast { background: var(--green-ink); color: var(--cream); border-radius: 16px; padding: 12px 14px; font-size: 14px; display: flex; gap: 10px; align-items: center; box-shadow: var(--shadow-lg); pointer-events: auto; animation: up .2s ease; }
.toast.error { background: var(--danger); color: #fff; }
.toast button { margin-left: auto; background: none; border: 0; color: var(--gold); font-weight: 800; }

/* ---------- Cucina guidata ---------- */
.cook { position: fixed; inset: 0; z-index: 40; background: var(--cream); display: flex; flex-direction: column; max-width: var(--maxw); margin: 0 auto; }
.cook-top { padding: 14px 18px 8px; display: flex; align-items: center; gap: 10px; }
.cook-top .t { flex: 1; min-width: 0; font-weight: 750; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.progress { height: 6px; background: var(--line); border-radius: 9px; overflow: hidden; margin: 0 18px; }
.progress i { display: block; height: 100%; background: var(--sage-deep); border-radius: 9px; transition: width .3s; }
.cook-body { flex: 1; overflow-y: auto; padding: 18px; }
.step-no { font-size: 13px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--sage-deep); }
.step-text { font-family: var(--font-display); font-size: 25px; line-height: 1.32; margin-top: 10px; font-weight: 480; text-wrap: pretty; }
.timer { margin-top: 22px; border-radius: 24px; background: var(--surface); border: 1px solid var(--line); padding: 16px; display: flex; align-items: center; gap: 16px; }
.timer .ring { width: 86px; height: 86px; flex: none; position: relative; }
.timer .ring svg { transform: rotate(-90deg); }
.timer .ring b { position: absolute; inset: 0; display: grid; place-items: center; font-size: 19px; font-variant-numeric: tabular-nums; }
.timer.done { border-color: var(--gold); background: var(--gold-soft); }
.cook-foot { padding: 12px 18px calc(14px + env(safe-area-inset-bottom)); display: grid; grid-template-columns: 1fr 1.6fr; gap: 10px; border-top: 1px solid var(--line); background: var(--surface); }

/* ---------- Grafici ---------- */
.bars { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; align-items: end; height: 140px; padding-top: 10px; position: relative; }
.bars .b { display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.bars .b i { width: 100%; max-width: 30px; border-radius: 8px 8px 4px 4px; background: var(--sage); display: block; min-height: 3px; }
.bars .b.today i { background: var(--sage-deep); }
.bars .b.over i { background: var(--gold); }
.bars .b span { font-size: 11px; color: var(--muted); font-weight: 700; }
.bars .goal { position: absolute; left: 0; right: 0; border-top: 1.5px dashed var(--olive); opacity: .6; }
.meter { height: 10px; background: var(--sage-soft); border-radius: 9px; overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--sage-deep); border-radius: 9px; }
.meter.gold i { background: var(--gold); }
.ringstat { display: flex; align-items: center; gap: 16px; }

/* ---------- Varie ---------- */
.empty { text-align: center; padding: 34px 20px; color: var(--muted); }
.empty .ic { color: var(--sage); margin: 0 auto 10px; display: block; }
.empty b { color: var(--green-ink); display: block; font-size: 16px; margin-bottom: 4px; }
.avatar { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 800; font-family: var(--font-display); flex: none; overflow: hidden; background: var(--sage); }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.sm { width: 42px; height: 42px; font-size: 14px; }
.avatar.lg { width: 76px; height: 76px; font-size: 26px; }
.plan-card { border-radius: 22px; padding: 18px; border: 1.5px solid var(--line); background: var(--surface); }
.plan-card.premium { border-color: var(--gold); background: linear-gradient(160deg, var(--gold-soft), var(--surface) 70%); }
.plan-card ul { padding-left: 0; list-style: none; margin: 10px 0 0; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.plan-card li { display: flex; gap: 8px; align-items: flex-start; }
.plan-card li .ic { color: var(--sage-deep); margin-top: 2px; }
.plan-card.premium li .ic { color: var(--gold); }
.price { font-family: var(--font-display); font-size: 30px; font-weight: 600; font-variant-numeric: tabular-nums; }
.setting { display: flex; align-items: center; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); background: none; border-left: 0; border-right: 0; border-top: 0; width: 100%; text-align: left; color: var(--green-ink); }
.setting:last-child { border-bottom: 0; }
.setting .ib { width: 36px; height: 36px; border-radius: 11px; background: var(--sage-soft); color: var(--sage-deep); display: grid; place-items: center; flex: none; }
.setting .grow b { display: block; font-weight: 700; font-size: 14.5px; }
.setting .grow small { color: var(--muted); font-size: 12.5px; }
.splash { position: fixed; inset: 0; display: grid; place-items: center; background: var(--cream); z-index: 100; }
.splash .inner { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.splash .slogan { font-family: var(--font-display); font-style: italic; color: var(--muted); }
.save-ind { font-size: 11.5px; color: var(--muted); display: inline-flex; align-items: center; gap: 5px; }
.save-ind i { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); display: inline-block; }
.save-ind.local i { background: var(--warn); }
.save-ind.saving i { background: var(--gold); }
.save-ind.error i { background: var(--danger); }
.skeleton { background: linear-gradient(90deg, var(--line) 25%, color-mix(in srgb, var(--line) 50%, var(--surface)) 50%, var(--line) 75%); background-size: 200% 100%; animation: sk 1.3s infinite; border-radius: 12px; }
@keyframes sk { to { background-position: -200% 0; } }
.onb { min-height: 100%; display: flex; flex-direction: column; padding: 28px 22px 30px; max-width: var(--maxw); margin: 0 auto; }
.onb .dots-nav { display: flex; gap: 6px; }
.onb .dots-nav i { width: 22px; height: 5px; border-radius: 9px; background: var(--line-strong); }
.onb .dots-nav i.on { background: var(--sage-deep); }
.week-day { border: 1px solid var(--line); border-radius: 18px; background: var(--surface); padding: 12px 14px; }
.week-day + .week-day { margin-top: 10px; }
.kbd { font-family: ui-monospace, Menlo, monospace; font-size: 12px; background: var(--sage-soft); border-radius: 6px; padding: 1px 6px; }
@media (min-width: 700px) {
  body { background: color-mix(in srgb, var(--cream) 80%, var(--sage-soft)); }
  #app { background: var(--cream); box-shadow: 0 0 0 1px var(--line); }
  .topbar { background: var(--cream); }
}
