:root {
  --brand: #2f5d50;
  --bg: #f6f5f1;
  --card: #fff;
  --ink: #1d2320;
  --muted: #6b726e;
  --line: #e3e1da;
  --danger: #a33a2c;
  font: 15px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); }
header {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 24px; background: var(--brand); color: #fff;
}
header img { height: 36px; width: 36px; border-radius: 8px; object-fit: cover; background: #fff; }
header h1 { font-size: 17px; margin: 0; flex: 1; font-weight: 600; }
header button { background: transparent; color: #fff; border-color: rgba(255,255,255,.5); }
main { max-width: 1040px; margin: 0 auto; padding: 24px; }
h2 { font-size: 22px; margin: 0 0 16px; }
h3 { font-size: 16px; margin: 0 0 10px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 18px; margin-bottom: 16px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; }
.muted { color: var(--muted); font-size: 13px; }
.error { color: var(--danger); margin: 8px 0; }
label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 10px; }
label > input, label > textarea, label > select { display: block; width: 100%; margin-top: 4px; }
input, textarea, select {
  font: inherit; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink);
}
input:focus, textarea:focus, select:focus { outline: 2px solid var(--brand); outline-offset: -1px; }
textarea { min-height: 64px; resize: vertical; }
button {
  font: inherit; padding: 8px 14px; border-radius: 8px; border: 1px solid var(--line);
  background: #fff; color: var(--ink); cursor: pointer;
}
button.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
button.link { border: 0; background: none; color: var(--brand); padding: 4px 6px; }
button.danger { color: var(--danger); }
button:disabled { opacity: .5; cursor: default; }
table { width: 100%; border-collapse: collapse; }
td, th { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); }
th { font-size: 12px; color: var(--muted); font-weight: 500; text-transform: uppercase; letter-spacing: .04em; }
tr.click { cursor: pointer; }
tr.click:hover td { background: #faf9f6; }
.pill { display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 99px; background: #e9efe9; }
.code { font: 600 20px ui-monospace, Menlo, monospace; letter-spacing: .08em; }
.login { max-width: 380px; margin: 10vh auto; }
.login img { height: 64px; width: 64px; border-radius: 14px; display: block; margin-bottom: 12px; }
.days { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.days button.on { background: var(--brand); color: #fff; border-color: var(--brand); }
.days button.empty { color: var(--muted); }
.meal { border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin-bottom: 12px; }
.group { background: #faf9f6; border-radius: 8px; padding: 8px 10px; margin: 10px 0; }
.food { display: grid; grid-template-columns: 2fr 80px 70px 80px auto; gap: 6px; margin: 4px 0; align-items: center; }
.food .or { font-size: 12px; color: var(--muted); grid-column: 1 / -1; margin-top: 2px; }
.totals { font-size: 13px; color: var(--muted); }
.sticky { position: sticky; bottom: 0; background: var(--bg); padding: 12px 0; border-top: 1px solid var(--line); }
@media (max-width: 640px) {
  main { padding: 16px; }
  .food { grid-template-columns: 1fr 70px 60px; }
}
.pill.todo { background: #fbe7c6; }
.pill.urgent { background: #f6d3cd; color: var(--danger); }
details > summary { cursor: pointer; font-weight: 500; }
.msg { padding: 10px 12px; border-radius: 10px; background: #f3f2ee; margin: 8px 0; max-width: 80%; }
.msg.mine { background: #e9efe9; margin-left: auto; }
.msg .body { white-space: pre-wrap; margin-top: 2px; }
.agenda-day { margin-bottom: 14px; }
.agenda-day h3 { text-transform: capitalize; }
.appt { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 8px 0; border-bottom: 1px solid var(--line); }
.appt.off { opacity: .5; }
.photo { display: grid; grid-template-columns: 240px 1fr; gap: 18px; align-items: start; }
.photo img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; background: #f3f2ee; }
@media (max-width: 640px) { .photo { grid-template-columns: 1fr; } }
.alert { padding: 10px 0; border-bottom: 1px solid var(--line); }
.alert ul { margin: 4px 0 0; padding-left: 18px; }
.days.wd button { padding: 4px 12px; border-radius: 99px; font-size: 13px; }
input.excluded { border-color: var(--danger); background: #fdf1ef; }
.food .warn { grid-column: 1 / -1; font-size: 12px; color: var(--danger); }
.food .warn:empty { display: none; }
.pp-days { display: flex; gap: 18px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 8px; }
.pp-thumb { display: flex; flex-direction: column; gap: 4px; padding: 4px; font-size: 12px; border-radius: 10px; }
.pp-thumb img { width: 72px; height: 96px; object-fit: cover; border-radius: 6px; background: #f3f2ee; }
.pp-thumb.on { border-color: var(--brand); outline: 2px solid var(--brand); }
.pp-compare { display: grid; gap: 12px; margin-top: 8px; }
.pp-compare figure { margin: 0; }
.pp-compare img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 10px; background: #f3f2ee; }
.pp-compare figcaption { font-size: 13px; color: var(--muted); margin-top: 4px; }
.nudge { display: flex; gap: 16px; align-items: center; border-left: 4px solid var(--brand); }
.nudge h3, .nudge p { margin: 0; }
main.wide { max-width: 1180px; }
.brand-grid { display: grid; grid-template-columns: minmax(0, 1fr) 480px; gap: 28px; align-items: start; }
.brand-grid .pv-logo { border-radius: 22%; object-fit: cover; flex: none; }
.pv-initials { display: grid; place-items: center; background: var(--brand); color: #fff; font-weight: 700; }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; margin: -4px 0 12px; }
.swatch { width: 34px; height: 34px; padding: 0; border-radius: 99px; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line); }
.swatch.on { box-shadow: 0 0 0 2px var(--ink); }
.swatch.custom { position: relative; overflow: hidden; margin: 0; cursor: pointer;
  background: conic-gradient(#e53, #ec3, #3c6, #3ae, #73e, #e3a, #e53); }
.swatch.custom input { position: absolute; inset: 0; opacity: 0; cursor: pointer; margin: 0; }
.warn-box { background: #fbe7c6; border-radius: 8px; padding: 8px 10px; font-size: 13px; margin: 0; }
.pv-wrap { position: sticky; top: 16px; }
.pv { display: flex; gap: 16px; font-family: -apple-system, BlinkMacSystemFont, sans-serif; }
.phone { position: relative; width: 232px; height: 470px; border-radius: 36px; background: #eff3f1; overflow: hidden;
  border: 8px solid #1d2320; box-shadow: 0 24px 48px -20px color-mix(in srgb, var(--c) 45%, transparent); }
.phone-notch { position: absolute; top: 8px; left: 50%; translate: -50% 0; width: 70px; height: 18px; border-radius: 99px; background: #1d2320; }
.pv-body { padding: 44px 16px 16px; height: 100%; display: flex; flex-direction: column; gap: 10px; }
.welcome .pv-body { justify-content: center; align-items: flex-start; background: linear-gradient(180deg, color-mix(in srgb, var(--c) 14%, #fff), #fff 60%); }
.welcome .pv-initials, .home .pv-initials { background: var(--c); }
.pv-title { font-size: 21px; font-weight: 700; line-height: 1.15; margin-top: 8px; color: #1d2320; overflow-wrap: anywhere; }
.pv-text { font-size: 12.5px; color: #5c6460; line-height: 1.45; overflow-wrap: anywhere; }
.pv-btn { margin-top: auto; align-self: stretch; text-align: center; background: var(--c); color: #fff; font-weight: 600; font-size: 14px; padding: 12px; border-radius: 14px; }
.pv-head { display: flex; gap: 8px; align-items: center; }
.pv-hello { font-weight: 700; font-size: 16px; color: #1d2320; }
.pv-sub { font-size: 11px; color: rgba(255,255,255,.8); }
.pv-head .pv-sub, .pv-sub.dark { color: #6b726e; }
.pv-hero { background: linear-gradient(135deg, var(--c), var(--c2)); color: #fff; border-radius: 20px; padding: 14px;
  box-shadow: 0 10px 20px -8px color-mix(in srgb, var(--c) 60%, transparent); }
.pv-kcal { font-size: 26px; font-weight: 700; letter-spacing: -.02em; }
.pv-kcal span { font-size: 12px; font-weight: 500; opacity: .8; }
.pv-bar { height: 6px; border-radius: 99px; background: rgba(255,255,255,.25); margin-top: 8px; }
.pv-bar i { display: block; height: 100%; width: 67%; border-radius: 99px; background: #fff; }
.pv-card { background: #fff; border-radius: 20px; padding: 14px; }
.pv-meal { font-weight: 600; font-size: 13px; margin: 4px 0 10px; color: #1d2320; }
.pv-chip { display: inline-block; background: var(--c); color: #fff; font-size: 12px; font-weight: 600; padding: 6px 14px; border-radius: 99px; }
@media (max-width: 1000px) { .brand-grid { grid-template-columns: 1fr; } .pv-wrap { position: static; } }
@media (max-width: 520px) { .pv { flex-direction: column; align-items: center; } }
/* Sign-up page and the welcome guide shown after it */
.login .alt { margin: 14px 0 0; text-align: center; }
.login a, .welcome a { color: var(--brand); }
label.check { display: flex; gap: 8px; align-items: flex-start; color: var(--ink); }
label.check > input { width: auto; margin: 3px 0 0; flex: none; }
.welcome { border-left: 4px solid var(--brand); }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.step { display: flex; gap: 12px; align-items: flex-start; }
.step p { margin: 4px 0 8px; }
.step-n { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  border: 1.5px solid var(--brand); color: var(--brand); font-weight: 600; font-size: 14px; }
.step.done .step-n { background: var(--brand); color: #fff; }

/* Abbonamento */
.billing-banner {
  display: flex; gap: 12px; align-items: center; justify-content: center; flex-wrap: wrap;
  padding: 6px 16px; font-size: 13px; background: #fbf1d9; color: #6b4d0f; border-bottom: 1px solid #ecd9a8;
}
.billing-banner.expired, .billing-banner.past_due { background: #f8e3df; color: var(--danger); border-color: #ecc5bd; }
.billing-banner button.link { color: inherit; font-weight: 600; font-size: 13px; padding: 2px 4px; }
.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; background: #e7efe9; color: #2f5d50; }
.pill.trial { background: #fbf1d9; color: #6b4d0f; }
.pill.expired, .pill.past_due { background: #f8e3df; color: var(--danger); }
