:root {
  --bg: #ffffff;
  --soft: #f5f5f7;
  --line: #e8e8ed;
  --text: #1d1d1f;
  --muted: #86868b;
  --blue: #0071e3;
  --blue-soft: #e3effd;
  --red: #d70015;
  --red-soft: #ffe5e5;
  --orange-soft: #ffeed6;
  --green-soft: #dff5e3;
  --radius: 18px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 8px 24px rgba(0, 0, 0, .05);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased; letter-spacing: -.022em;
}
h1, h2, h3, p { margin: 0; }
h1 { font-size: 34px; font-weight: 700; letter-spacing: -.03em; line-height: 1.1; }
h2 { font-size: 19px; font-weight: 600; letter-spacing: -.02em; }
h3 { font-size: 13px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin: 14px 0 4px; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; text-align: inherit; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 3px solid rgba(0, 113, 227, .35); outline-offset: 2px; }
.grow { flex: 1; }
.muted { color: var(--muted); font-size: 14px; }
.red { color: var(--red); }
.pos { color: #1a8f3c; }
.neg { color: var(--red); }
.big { font-size: 40px; font-weight: 700; letter-spacing: -.03em; line-height: 1; }

/* cornice */
.shell { display: flex; min-height: 100vh; }
.side {
  width: 240px; flex: none; padding: 24px 14px; position: sticky; top: 0; height: 100vh; overflow-y: auto;
  background: #fbfbfd; border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px;
}
.brand { font-size: 22px; font-weight: 700; letter-spacing: -.03em; padding: 4px 10px 18px; }
.nav-link { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 12px; font-weight: 500; }
.nav-link:hover { background: rgba(0, 0, 0, .04); }
.nav-link.on { background: #fff; box-shadow: var(--shadow); }
.ico {
  width: 32px; height: 32px; border-radius: 9px; background: var(--c); flex: none;
  display: grid; place-items: center; font-size: 17px;
}
main { flex: 1; min-width: 0; padding: 40px clamp(16px, 4vw, 48px) 80px; max-width: 1100px; margin: 0 auto; display: flex; flex-direction: column; gap: 18px; }
.bottom { display: none; }

.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 4px; }
.head-actions { display: flex; gap: 8px; }
.kicker { color: var(--muted); font-weight: 600; text-transform: capitalize; margin-bottom: 4px; }

/* schede */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 18px; align-items: start; }
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); display: block; width: 100%; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.card-foot { display: flex; gap: 16px; align-items: center; margin-top: 12px; flex-wrap: wrap; }
.link { color: var(--blue); font-size: 15px; font-weight: 500; }
.link:hover { text-decoration: underline; }
.empty { color: var(--muted); padding: 10px 0; }
.pair { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 7px 0; }
.pair > span { color: var(--muted); }
.note { background: color-mix(in srgb, var(--c) 45%, #fff); border-color: transparent; min-height: 120px; }
.note p { white-space: pre-wrap; margin-top: 6px; color: #424245; overflow-wrap: anywhere; }
.scroll-x { overflow-x: auto; }

/* righe */
.row { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); width: 100%; }
.row:last-child, .card > div:last-child > .row:last-child { border-bottom: 0; }
.row-main { flex: 1; min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.row-main:disabled { cursor: default; color: inherit; }
.row-title { font-weight: 500; overflow-wrap: anywhere; display: flex; align-items: center; gap: 10px; }
.row-sub { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; color: var(--muted); font-size: 14px; }
.row.done .row-title { color: var(--muted); text-decoration: line-through; }
.past { opacity: .55; }
.event { border-left: 4px solid var(--c); padding-left: 12px; border-radius: 2px; }
.amount { font-size: 15px; color: var(--text); }
.attach { display: inline-block; margin: -4px 0 10px 36px; font-size: 14px; }
input[type=checkbox] {
  appearance: none; -webkit-appearance: none; width: 24px; height: 24px; flex: none; margin: 0; cursor: pointer;
  border: 2px solid #c7c7cc; border-radius: 50%; background: #fff; display: grid; place-items: center;
}
input[type=checkbox]:checked { background: var(--blue); border-color: var(--blue); }
input[type=checkbox]:checked::after { content: "✓"; color: #fff; font-size: 14px; font-weight: 700; }

.chip, .tag { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 13px; font-weight: 500; white-space: nowrap; }
.chip { background: color-mix(in srgb, var(--c) 55%, #fff); color: var(--text); }
.tag { background: var(--soft); color: #6e6e73; }
.tag.red { background: var(--red-soft); color: var(--red); }
.tag.orange { background: var(--orange-soft); color: #a05a00; }
.tag.green { background: var(--green-soft); color: #1a7a34; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--c); display: inline-grid; place-items: center; font-weight: 600; flex: none; }
.avatar.xl { width: 84px; height: 84px; font-size: 34px; }

/* bottoni e campi */
.btn { padding: 9px 18px; border-radius: 999px; background: var(--soft); font-weight: 500; font-size: 15px; white-space: nowrap; text-align: center; display: inline-block; }
.btn:hover { background: #ececf0; }
.btn.primary { background: var(--blue); color: #fff; }
.btn.primary:hover { background: #0077ed; }
.btn.primary:disabled { opacity: .5; }
.btn.danger { color: var(--red); background: var(--red-soft); }
.btn.round { width: 36px; height: 36px; padding: 0; display: inline-grid; place-items: center; font-size: 18px; flex: none; }
.btn.wide { width: 100%; padding: 13px; font-size: 17px; }
input:not([type=checkbox]):not([type=file]), select, textarea {
  width: 100%; padding: 11px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--soft); min-height: 46px;
}
input:focus, select:focus, textarea:focus { outline: 3px solid rgba(0, 113, 227, .25); border-color: var(--blue); background: #fff; }
textarea { resize: vertical; }
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.field > span { font-size: 13px; font-weight: 600; color: var(--muted); }
.field small { color: var(--muted); font-size: 13px; }
.err { color: var(--red); font-size: 14px; min-height: 1em; }
.swatches { display: flex; gap: 10px; flex-wrap: wrap; }
.swatch { width: 34px; height: 34px; border-radius: 50%; background: var(--c); border: 3px solid #fff; box-shadow: 0 0 0 1px var(--line); }
.swatch.on { box-shadow: 0 0 0 2px var(--blue); }
.quick { display: flex; gap: 8px; margin-bottom: 6px; }

.tabs { display: flex; gap: 4px; padding: 4px; background: var(--soft); border-radius: 12px; overflow-x: auto; align-self: flex-start; max-width: 100%; }
.tabs:empty { display: none; }
.tab { padding: 6px 16px; border-radius: 9px; font-size: 14px; font-weight: 500; white-space: nowrap; color: #424245; }
.tab.on { background: #fff; color: var(--text); box-shadow: 0 1px 4px rgba(0, 0, 0, .12); }
.stepper { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.stepper strong { text-transform: capitalize; font-size: 17px; }

/* calendario */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal > b { text-align: center; font-size: 12px; color: var(--muted); font-weight: 600; padding-bottom: 4px; }
.day { min-height: 78px; border-radius: 12px; padding: 6px; display: flex; flex-direction: column; gap: 3px; background: #fff; border: 1px solid var(--line); min-width: 0; }
.day.out { border-color: transparent; color: #c7c7cc; }
.day.sel { border-color: var(--blue); box-shadow: inset 0 0 0 1px var(--blue); }
.day .num { font-size: 14px; font-weight: 600; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; }
.day.today .num { background: var(--blue); color: #fff; }
.marks { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.marks i { font-style: normal; font-size: 11px; background: color-mix(in srgb, var(--c) 60%, #fff); color: var(--text); border-radius: 5px; padding: 1px 5px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.marks em { font-style: normal; font-size: 11px; color: var(--muted); }

/* spese */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat { background: var(--soft); border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; min-width: 0; }
.stat span { color: var(--muted); font-size: 13px; font-weight: 600; }
.stat strong { font-size: clamp(16px, 3.4vw, 24px); letter-spacing: -.02em; }
.bar-row { padding: 4px 0 10px; }
.bar { height: 8px; border-radius: 99px; background: var(--soft); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 99px; background: #a8dcd9; }
.bar.over i { background: #f5a3a3; }

/* orario e pasti */
.orario { border-collapse: separate; border-spacing: 4px; width: 100%; min-width: 520px; table-layout: fixed; }
.orario th { font-size: 12px; color: var(--muted); font-weight: 600; }
.orario th:first-child { width: 34px; }
.slot { width: 100%; min-height: 44px; border-radius: 10px; background: var(--soft); color: #c7c7cc; text-align: center; padding: 6px; font-size: 14px; overflow-wrap: anywhere; }
.slot.on { background: #e6dcff; color: var(--text); font-weight: 500; }
.meals { display: grid; grid-template-columns: 76px 1fr 1fr; gap: 6px; align-items: stretch; }
.meals > b { font-size: 12px; color: var(--muted); text-align: center; }
.meals .slot.on { background: #ffe3cc; }
.meal-day { align-self: center; font-weight: 600; font-size: 14px; text-transform: capitalize; }
.meal-day.today { color: var(--blue); }

/* altro */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.tile { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 10px; font-weight: 600; box-shadow: var(--shadow); }
.tile .ico { width: 44px; height: 44px; border-radius: 12px; font-size: 23px; }
.url { font: 600 17px ui-monospace, "SF Mono", Menlo, monospace; background: var(--soft); border-radius: 12px; padding: 10px 14px; margin: 8px 0; overflow-wrap: anywhere; user-select: all; }

/* finestre */
.dlg { border: 0; border-radius: 22px; padding: 24px; width: min(460px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); box-shadow: 0 24px 80px rgba(0, 0, 0, .25); color: var(--text); }
.dlg::backdrop { background: rgba(0, 0, 0, .25); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.dlg h2 { font-size: 22px; margin-bottom: 16px; }
.dlg-actions { display: flex; gap: 8px; align-items: center; margin-top: 6px; }
.toast { position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%); background: rgba(29, 29, 31, .92); color: #fff; padding: 10px 18px; border-radius: 999px; font-size: 14px; z-index: 50; max-width: 90vw; }

/* accesso */
.gate { min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 24px; text-align: center; }
.gate-ico { font-size: 56px; }
.gate-form { display: flex; flex-direction: column; gap: 10px; width: min(320px, 100%); margin-top: 8px; align-items: center; }
.gate-form input { text-align: center; }
.who { display: flex; gap: 22px; flex-wrap: wrap; justify-content: center; margin-top: 12px; }
.who-btn { display: flex; flex-direction: column; align-items: center; gap: 8px; font-weight: 500; padding: 8px; border-radius: 18px; }
.who-btn:hover .avatar { transform: scale(1.05); }
.avatar { transition: transform .15s; }

/* telefono */
@media (max-width: 800px) {
  .side { display: none; }
  h1 { font-size: 30px; }
  main { padding: 22px 16px calc(96px + env(safe-area-inset-bottom)); }
  .bottom {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; justify-content: space-around;
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, .8); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-top: 1px solid var(--line);
  }
  .bottom .nav-link { flex-direction: column; gap: 2px; font-size: 11px; padding: 4px 6px; flex: 1; min-width: 0; color: var(--muted); }
  .bottom .nav-link.on { background: none; box-shadow: none; color: var(--blue); }
  .bottom .ico { width: 30px; height: 30px; font-size: 16px; }
  .day { min-height: 54px; padding: 4px 2px; align-items: center; }
  .marks { flex-direction: row; flex-wrap: wrap; justify-content: center; gap: 3px; }
  .marks i { width: 7px; height: 7px; padding: 0; border-radius: 50%; font-size: 0; background: var(--c); filter: saturate(1.6) brightness(.92); }
  .marks em { display: none; }
  .meals { grid-template-columns: 58px 1fr 1fr; }
}

/* moduli e accesso: aggiunte */
.field.check { flex-direction: row; align-items: center; gap: 12px; margin-bottom: 0; padding: 9px 0; border-bottom: 1px solid var(--line); }
.field.check > span { font-size: 16px; font-weight: 500; color: var(--text); display: flex; flex-direction: column; }
.intro { margin: -8px 0 16px; }
.dlg form { display: block; }
.narrow { max-width: 360px; }
.gate-links { display: flex; flex-direction: column; gap: 10px; align-items: center; margin-top: 6px; }
.side-me { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 12px; font-weight: 500; margin-top: 12px; }
.side-me:hover { background: rgba(0, 0, 0, .04); }
.btn:disabled { opacity: .5; cursor: default; }
.plan { background: linear-gradient(135deg, #f3f8ff, #f7f2ff 55%, #fff3f8); border-color: transparent; }

/* pagina di presentazione */
.land { max-width: 1080px; margin: 0 auto; padding: 0 20px 40px; }
.land-nav { display: flex; align-items: center; gap: 18px; padding: 14px 0; position: sticky; top: 0; z-index: 5;
  background: rgba(255, 255, 255, .8); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px); }
.land-nav .brand { padding: 0; }
.land-hero { text-align: center; padding: clamp(40px, 9vw, 96px) 0 36px; display: flex; flex-direction: column; align-items: center; gap: 18px; }
.land-hero h1 { font-size: clamp(40px, 8vw, 80px); letter-spacing: -.045em; line-height: 1.02; }
.land-hero h1 span { background: linear-gradient(90deg, #7fb0ee, #b79cf0 50%, #f29ab8); -webkit-background-clip: text; background-clip: text; color: transparent; }
.land-hero p { font-size: clamp(18px, 2.4vw, 23px); color: #6e6e73; max-width: 620px; line-height: 1.35; }
.land-cta { display: flex; flex-direction: column; align-items: center; gap: 14px; margin-top: 8px; }
.big-btn { padding: 15px 30px; font-size: 18px; }
.land-demo { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 18px; padding: 28px; border-radius: 32px;
  background: linear-gradient(135deg, #e8f1ff, #efe8ff 50%, #ffe9f2); align-items: start; }
.land-demo .row-main { cursor: default; }
.land-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; padding: 64px 0 24px; }
.feat { background: var(--soft); border-radius: 24px; padding: 24px; display: flex; flex-direction: column; gap: 8px; }
.feat .ico { width: 48px; height: 48px; border-radius: 14px; font-size: 25px; margin-bottom: 6px; }
.feat h3 { font-size: 19px; color: var(--text); text-transform: none; letter-spacing: -.02em; margin: 0; }
.feat p { color: #6e6e73; font-size: 15px; }
.land-prices { padding: 48px 0; text-align: center; }
.land-prices > h2 { font-size: clamp(28px, 5vw, 44px); letter-spacing: -.035em; margin-bottom: 28px; }
.prices { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 340px)); gap: 18px; justify-content: center; text-align: left; }
.price { display: flex; flex-direction: column; gap: 6px; padding: 26px; }
.price h2 { font-size: 26px; }
.price ul { list-style: none; padding: 0; margin: 14px 0 20px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.price li::before { content: "✓"; color: #1a8f3c; font-weight: 700; margin-right: 10px; }
.land-foot { text-align: center; color: var(--muted); font-size: 13px; padding: 24px 0; border-top: 1px solid var(--line); }
@media (max-width: 800px) { .land-demo { padding: 16px; border-radius: 24px; } .land-nav .link { display: none; } }

/* --- seconda notte: aggiunta rapida, punti, bacheca, ricette, ricerca, parete --- */
.rapida { padding: 14px; border-color: transparent; background: linear-gradient(135deg, #eef5ff, #f4eeff 55%, #fff0f6); }
.rapida .quick { margin: 0; }
.rapida input { background: #fff !important; font-size: 17px; }
.quick-hint { font-size: 13px; color: var(--muted); padding: 8px 6px 0; min-height: 28px; }
.quick-hint.on { color: var(--text); font-weight: 500; }
.btn.mini { padding: 5px 12px; font-size: 13px; }
.tag.gold { background: #fff3cf; color: #8a6100; }
.link.small { font-size: 13px; }
.foot-note { margin-top: 10px; font-size: 13px; }
.stack { display: flex; flex-direction: column; gap: 18px; }
.side-search { display: block; padding: 9px 12px; border-radius: 12px; background: #fff; border: 1px solid var(--line); color: var(--muted); font-size: 15px; margin-bottom: 10px; }
.side-search.on { border-color: var(--blue); color: var(--text); }
.demo-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 10px 16px; border-radius: 16px; background: #fff6d6; font-size: 14px; font-weight: 500; }
.cta-row { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.rank { display: flex; align-items: center; gap: 12px; padding: 10px 0; }
.rank .pos { width: 26px; text-align: center; font-weight: 700; color: var(--muted); }
.rank .pair { padding: 0 0 5px; }
.rank .pair span { font-size: 13px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin: 4px 0 10px; }
.chip-btn { padding: 4px 12px; border-radius: 999px; background: var(--blue-soft); color: #0058b0; font-size: 13px; font-weight: 500; }
.chip-btn:hover { background: #d3e5fb; }
.ingr { margin: 8px 0; padding-left: 20px; color: #424245; font-size: 15px; }
.prep { font-size: 14px; color: #6e6e73; white-space: pre-wrap; }
.goal { display: block; width: 100%; padding: 10px 14px; border-radius: 12px; background: #f4eeff; font-size: 14px; font-weight: 500; margin-bottom: 6px; }
.goal-card { text-align: left; display: flex; flex-direction: column; gap: 8px; }
.goal-card .bar i { background: #b8e0c2; }
.spark { stroke: #a48be0; fill: #a48be0; flex: none; }
.msg { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); align-items: flex-start; }
.msg:last-child { border-bottom: 0; }
.msg.small { padding: 4px 0; border: 0; }
.msg-text { font-size: 16px; white-space: pre-wrap; overflow-wrap: anywhere; }
.reazioni { display: flex; gap: 6px; align-items: center; margin-top: 6px; }
.reaz { padding: 2px 9px; border-radius: 999px; background: var(--soft); font-size: 14px; filter: grayscale(.6); opacity: .75; }
.reaz.on { background: var(--blue-soft); filter: none; opacity: 1; }
.card:disabled { cursor: default; color: inherit; }
button.card { text-align: left; }
input[type=search] { background: #fff !important; font-size: 17px; }
.dlg h3 { margin-top: 20px; }

.wall { min-height: 100dvh; padding: clamp(16px, 3vw, 40px); background: linear-gradient(135deg, #eef5ff, #f4eeff 50%, #fff0f6); display: flex; flex-direction: column; gap: 24px; }
.wall header { display: flex; justify-content: space-between; align-items: flex-start; }
.w-clock { font-size: clamp(56px, 10vw, 120px); font-weight: 700; letter-spacing: -.05em; line-height: .95; }
.w-date { font-size: clamp(18px, 2.6vw, 30px); color: #6e6e73; text-transform: capitalize; font-weight: 500; margin-top: 6px; }
.w-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; flex: 1; align-content: start; }
.w-card { background: rgba(255, 255, 255, .85); border-radius: 26px; padding: 22px 24px; box-shadow: var(--shadow); }
.w-card h2 { font-size: 15px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 12px; }
.w-card h2.w-sub { margin-top: 18px; }
.w-row { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; padding: 8px 0 8px 14px; border-left: 5px solid var(--c); margin-bottom: 8px; font-size: clamp(18px, 2vw, 24px); font-weight: 500; }
.w-row small { color: var(--muted); font-size: .7em; font-weight: 400; }
.w-empty { color: var(--muted); font-size: 18px; }
.w-meal { display: flex; flex-direction: column; margin-bottom: 12px; font-size: clamp(20px, 2.2vw, 26px); font-weight: 600; }
.w-meal small { font-size: 13px; color: var(--muted); font-weight: 500; text-transform: uppercase; letter-spacing: .05em; }
.w-list { font-size: clamp(17px, 1.8vw, 22px); line-height: 1.5; }
.rank .pair { flex-wrap: wrap; gap: 0 10px; }
.rank .pair span { white-space: nowrap; }
