@font-face {
  font-family: "Nova Square";
  src: url("../fonts/NovaSquare-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* ---------------------------------------------------------------- tokens
   Tigerlily #E2583E e' l'accento: azione principale, oggi, elemento attivo.
   I quattro codici hanno un colore ciascuno; --ci e' la versione per icone e testo.
   Una grammatica sola: bordo tiger = oggi; fondo tiger tenue = scelto. */
:root {
  --font: "Nova Square", "Segoe UI", system-ui, sans-serif;

  --bg: #151210;
  --bg-2: #1c1815;
  --card: #221d19;
  --card-2: #2c2621;
  --line: #47302a;
  --text: #f2f0ee;
  --muted: #aaa29b;
  --faint: #7d7166;

  --tiger: #e2583e;
  --tiger-hover: #ec6a50;
  --tiger-ink: #1d1713;
  --tiger-tint: rgba(226, 88, 62, 0.16);

  --sun: #f1c76c;   --sun-ink: #f1c76c;   /* M  mattina    */
  --moon: #95b6dc;  --moon-ink: #95b6dc;  /* P  pomeriggio */
  --po: #a3bf8f;    --po-ink: #a3bf8f;    /* PO ferie      */
  --ps: #eda5ba;    --ps-ink: #eda5ba;    /* PS malattia   */
  --on-pastel: #1d1713;

  --r-s: 12px;
  --r: 20px;
  --sidebar: 240px;
  --band-h: 64px;
  --band-fs: 26px;
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #f6f1ea;
  --bg-2: #efe8df;
  --card: #fffdfa;
  --card-2: #f1eae1;
  --line: #e3d9cd;
  --text: #221b16;
  --muted: #6e6156;
  --faint: #8c7f74;
  --tiger-tint: rgba(226, 88, 62, 0.12);
  --sun: #f3d27c;   --sun-ink: #9a6b00;
  --moon: #b4cdea;  --moon-ink: #34679f;
  --po: #bdd4ab;    --po-ink: #46703a;
  --ps: #f3bdcc;    --ps-ink: #a83c5e;
  color-scheme: light;
}

/* ---------------------------------------------------------------- base
   Scala del testo: 12 / 14 / 15 / 20 / 28 */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { margin: 0; font-weight: 400; line-height: 1.15; }
h1 { font-size: 28px; letter-spacing: -0.01em; }
h2 { font-size: 20px; }
h3 { font-size: 15px; }
p { margin: 0; }
a { color: var(--tiger); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--tiger); outline-offset: 2px; }

.i {
  width: 18px; height: 18px; flex: none; vertical-align: middle;
  fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round;
}
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.row { display: flex; align-items: center; }
.wrap { flex-wrap: wrap; }
.gap-s { gap: 8px; }
.stack { display: grid; gap: 14px; }
.stack-l { display: grid; gap: 20px; align-content: start; }

/* i codici: --c e' il pastello (fondi), --ci il colore di icone e testo */
.code-M  { --c: var(--sun);  --ci: var(--sun-ink); }
.code-P  { --c: var(--moon); --ci: var(--moon-ink); }
.code-PO { --c: var(--po);   --ci: var(--po-ink); }
.code-PS { --c: var(--ps);   --ci: var(--ps-ink); }
.mark { color: var(--ci, var(--muted)); }

/* ---------------------------------------------------------------- shell
   In cima una fascia tigerlily con il nome al centro; sotto, sidebar e contenuto. */
.band {
  position: sticky; top: 0; z-index: 40;
  height: calc(var(--band-h) + env(safe-area-inset-top, 0px)); padding-top: env(safe-area-inset-top, 0px);
  display: grid; place-items: center; background: var(--tiger);
}
.band-title { color: #fff; font-size: var(--band-fs); line-height: 1; letter-spacing: 0.02em; }
.band-title:hover { text-decoration: none; }

.app { min-height: calc(100dvh - var(--band-h)); }
.sidebar {
  border-right: 1px solid var(--line);
  position: fixed; top: var(--band-h); bottom: 0; left: 0; width: var(--sidebar);
  display: flex; flex-direction: column; gap: 20px;
  padding: 24px 16px; background: color-mix(in srgb, var(--tiger) 7%, var(--bg-2));
}
.side-nav { display: grid; gap: 2px; }
.side-nav a {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px;
  border-radius: var(--r-s); color: var(--muted);
}
.side-nav a:hover { color: var(--text); text-decoration: none; }
.side-nav a.is-active { background: var(--tiger-tint); color: var(--text); }
.side-nav a.is-active .i { color: var(--tiger); }
.nav-badge {
  margin-left: auto; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 99px;
  background: var(--tiger); color: var(--tiger-ink); font-size: 12px;
  display: inline-grid; place-items: center;
}

/* l'icona dell'app: tigerlily con la P */
.app-icon {
  width: 56px; height: 56px; border-radius: 16px; background: var(--tiger); color: #fff;
  display: grid; place-items: center; font-size: 30px; line-height: 1;
}

.main {
  margin-left: var(--sidebar);
  padding: 32px clamp(16px, 4vw, 48px) 64px;
  max-width: calc(1120px + var(--sidebar));
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; align-content: start;
}
.main > * { min-width: 0; }
.bottom-nav { display: none; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-head p { margin-top: 6px; }

/* ---------------------------------------------------------------- apertura
   Schermo tigerlily e l'icona con la P; la P si allunga in "ProggoCiok", poi sale e diventa la fascia. */
.has-splash { overflow: hidden; }
.splash {
  position: fixed; inset: 0; z-index: 100; background: var(--tiger);
  clip-path: inset(0 0 0 0);
  transition: clip-path .75s cubic-bezier(.7, 0, .2, 1), opacity .25s ease;
}
.splash-word {
  position: absolute; left: 50%; top: 50%;
  display: flex; align-items: center; color: #fff; font-size: var(--band-fs); line-height: 1;
  letter-spacing: 0.02em; white-space: nowrap;
  transform: translate(-50%, -50%) scale(2.6);
  transition: top .75s cubic-bezier(.7, 0, .2, 1), transform .75s cubic-bezier(.7, 0, .2, 1);
}
.splash-p {
  display: inline-grid; place-items: center;
  padding: .32em .42em; border-radius: .38em; background: var(--tiger);
  box-shadow: 0 0 0 .06em rgba(255, 255, 255, .45), 0 .5em 1.4em -.4em rgba(0, 0, 0, .35);
  transition: padding .6s ease, box-shadow .5s ease;
  animation: splash-pop .55s cubic-bezier(.2, .9, .3, 1.3) both;
}
/* padding verticale: overflow nasconde il testo che entra, ma non deve tagliare le "g" */
.splash-rest {
  display: inline-block; max-width: 0; overflow: hidden; padding: .18em 0;
  transition: max-width .7s cubic-bezier(.6, 0, .2, 1);
}
.splash.is-open .splash-p { padding: 0; box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); }
.splash.is-open .splash-rest { max-width: 10em; }
.splash.is-up { clip-path: inset(0 0 calc(100% - var(--band-h) - env(safe-area-inset-top, 0px)) 0); }
.splash.is-up .splash-word {
  top: calc(env(safe-area-inset-top, 0px) + var(--band-h) / 2);
  transform: translate(-50%, -50%) scale(1);
}
.splash.is-done { opacity: 0; }
@keyframes splash-pop { from { transform: scale(.4); opacity: 0; } }

/* ---------------------------------------------------------------- controlli
   Tre bottoni (primary, ghost, danger) piu' il bottone-icona tondo. */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px; border-radius: 99px; border: 1px solid transparent;
  cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, transform .1s;
}
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--tiger); color: var(--tiger-ink); }
.btn-primary:hover { background: var(--tiger-hover); }
.btn-ghost { background: var(--card-2); color: var(--text); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--tiger); }
.btn-danger { background: transparent; color: var(--tiger); border-color: var(--tiger); }
.btn-danger:hover { background: var(--tiger-tint); }
.btn-sm { min-height: 36px; padding: 0 14px; font-size: 14px; }
.btn-block { width: 100%; }

.icon-btn {
  width: 40px; height: 40px; border-radius: 50%; display: inline-grid; place-items: center; padding: 0;
  background: var(--card-2); border: 1px solid var(--line); color: var(--text); cursor: pointer;
}
.icon-btn:hover { border-color: var(--tiger); color: var(--tiger); }

.field { display: grid; gap: 6px; }
.field > span { font-size: 14px; color: var(--muted); }
input:not([type="radio"]):not([type="checkbox"]), select {
  width: 100%; min-height: 44px; padding: 0 14px;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r-s); color: var(--text);
}
input:focus, select:focus { border-color: var(--tiger); outline: none; }
select option { background: var(--card); }

.seg { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; background: var(--bg-2); border-radius: 99px; }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.seg span { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 99px; color: var(--muted); }
.seg input:checked + span { background: var(--tiger); color: var(--tiger-ink); }
.seg input:focus-visible + span { outline: 2px solid var(--tiger); outline-offset: 2px; }

.switch { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 16px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-track {
  flex: none; width: 48px; height: 28px; border-radius: 99px; background: var(--card-2); border: 1px solid var(--line);
  position: relative; transition: background .2s;
}
.switch-track::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--muted); transition: transform .2s, background .2s;
}
.switch input:checked + .switch-track { background: var(--tiger); border-color: var(--tiger); }
.switch input:checked + .switch-track::after { transform: translateX(20px); background: #fff; }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--tiger); outline-offset: 2px; }
.switch small { display: block; color: var(--muted); font-size: 14px; }

.form-error { padding: 10px 14px; border-radius: var(--r-s); background: var(--tiger-tint); color: var(--text); }

/* ---------------------------------------------------------------- superfici: niente ombre a riposo */
.card { background: var(--card); border-radius: var(--r); padding: 20px; }
.card-head h2 { color: var(--tiger); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }

/* due chip: .chip (codice, pieno o tenue) e .tag (neutro) */
.chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 30px; padding: 0 12px; border-radius: 99px;
  background: var(--c, var(--card-2)); color: var(--on-pastel); font-size: 14px; max-width: 100%; border: 0;
}
.chip-soft { background: color-mix(in srgb, var(--c) 18%, transparent); color: var(--text); }
button.chip { cursor: pointer; }
button.chip:hover { background: color-mix(in srgb, var(--c) 32%, transparent); }
.chip-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip .x {
  display: inline-grid; place-items: center; width: 22px; height: 22px; margin-right: -6px; padding: 0;
  border: 0; border-radius: 50%; background: transparent; color: inherit; cursor: pointer;
}
.chip .x:hover { background: rgba(0, 0, 0, .12); }
.chip .i { width: 15px; height: 15px; }
.tag {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 99px;
  background: var(--card-2); color: var(--muted); font-size: 12px; white-space: nowrap;
}
.tag-accent { background: var(--tiger-tint); color: var(--text); }

.legend { display: flex; flex-wrap: wrap; gap: 8px 18px; color: var(--muted); font-size: 14px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend b { font-weight: 400; color: var(--text); }

/* ---------------------------------------------------------------- home */
.today {
  position: relative; display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 12px 32px;
  min-height: 240px; padding: 36px; border-radius: var(--r);
  background: color-mix(in srgb, var(--c) 18%, var(--card)); border: 2px solid var(--tiger);
}
.today[data-code="none"], .today[data-code="weekend"] { --ci: var(--tiger); background: var(--card); }
.today-icon { display: grid; place-items: center; color: var(--ci); }
.today-icon .i { width: 120px; height: 120px; stroke-width: 1.4; }
.today-label { color: var(--tiger); font-size: 15px; }
.today-text h2 { font-size: 36px; letter-spacing: -0.01em; margin-top: 6px; }
.today-text p { margin-top: 8px; color: var(--muted); }
.today-text #today-sub { color: var(--text); font-size: 20px; }
.today-next { display: inline-flex; align-items: center; gap: 6px; margin-top: 14px; font-size: 15px; }
.today-next .i { width: 18px; height: 18px; }
.today-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; }

/* pausa caffe */
.coffee-head h2 { display: inline-flex; align-items: center; gap: 10px; }
.coffee-head .i { color: var(--tiger); width: 22px; height: 22px; }
.coffee-form { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; }
.coffee-list { display: grid; gap: 6px; margin-top: 14px; }
.coffee-list p { font-size: 14px; color: var(--muted); }

.cal-weekdays, .cal-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.cal-weekdays { margin-bottom: 6px; color: var(--muted); font-size: 12px; text-align: center; }
.cal-cell {
  height: 88px; padding: 8px 8px 26px; border-radius: var(--r-s); border: 2px solid transparent;
  background: var(--bg-2); color: var(--text); cursor: pointer;
  position: relative; display: grid; place-items: center;
}
.cal-cell[class*="code-"] { background: color-mix(in srgb, var(--c) 16%, var(--bg-2)); }
.cal-cell:hover { border-color: color-mix(in srgb, var(--tiger) 60%, transparent); }
.cal-cell.is-blank { visibility: hidden; }
.cal-cell.is-past { opacity: .55; }
.cal-cell.is-today { border-color: var(--tiger); opacity: 1; }
/* il numero sta nell'angolo e fuori dal flusso: l'icona resta al centro esatto della cella */
.cal-num { position: absolute; top: 6px; left: 8px; font-size: 12px; line-height: 1; color: var(--muted); }
.cal-cell.is-today .cal-num { color: var(--text); }
.cal-ico { display: grid; place-items: center; }
.cal-ico .i { width: 24px; height: 24px; }
.cal-cell:not([class*="code-"]) .cal-ico { color: var(--faint); }
.calendar-card .legend { margin-top: 16px; }

/* contratto: una card divisa, etichetta sopra il numero */
.strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 0; }
.strip > div { padding: 18px 20px; display: grid; gap: 4px; }
.strip > div + div { border-left: 1px solid var(--line); }
.strip-label { font-size: 14px; color: var(--muted); }
.strip-value { font-size: 28px; line-height: 1.1; color: var(--tiger); }
.strip-value small { font-size: 15px; color: var(--muted); }
.strip-note { font-size: 12px; color: var(--muted); }
.strip-note.warn { color: var(--tiger); }

/* ---------------------------------------------------------------- planner */
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.times { display: inline-flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.times span { display: inline-flex; align-items: center; gap: 6px; }
.week { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.day { background: var(--card); border-radius: var(--r); padding: 14px; display: grid; gap: 14px; align-content: start; min-width: 0; border: 2px solid transparent; }
.day.is-today { border-color: var(--tiger); }
.day.is-today .day-head .muted { color: var(--tiger); }
.day.is-past { opacity: .55; }
.day-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%;
  padding: 0; border: 0; background: none; color: var(--text); cursor: pointer; text-align: left;
}
.day-head .muted { font-size: 14px; }
.day-head .i { color: var(--faint); width: 16px; height: 16px; }
.day-head:hover .i { color: var(--text); }
.slot { display: grid; gap: 8px; }
.slot-head { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); }
.slot-people { display: flex; flex-wrap: wrap; gap: 6px; }
.slot-add {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 34px; border-radius: 99px;
  border: 1px dashed var(--line); background: transparent; color: var(--muted); cursor: pointer; font-size: 14px;
}
.slot-add:hover { border-color: var(--tiger); color: var(--text); }
.slot-add .i { width: 15px; height: 15px; }
.slot-none { font-size: 14px; color: var(--faint); }

.notice {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 14px 18px; border-radius: var(--r); background: var(--tiger-tint);
}

.swap-list { display: grid; gap: 8px; }
.swap-group-title { font-size: 14px; color: var(--muted); margin: 16px 0 8px; }
.swap-group-title:first-child { margin-top: 0; }
.swap { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 14px; border-radius: var(--r-s); background: var(--bg-2); }
.swap-text { flex: 1 1 260px; display: grid; gap: 8px; }
.swap-flow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.swap-flow > .i { color: var(--muted); }
.swap-actions { display: flex; gap: 6px; }
.empty { color: var(--muted); }

/* ---------------------------------------------------------------- gruppi */
.group-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.group { background: var(--card); border-radius: var(--r); padding: 18px; display: grid; gap: 10px; align-content: start; }
.group-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.group-name { font-size: 20px; word-break: break-word; }
.group-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.time-fields { border: 0; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.time-fields legend { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; margin-bottom: 8px; padding: 0; }

/* ---------------------------------------------------------------- profilo */
.profile-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; max-width: 760px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.table-wrap { overflow-x: auto; }
.summary { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.summary th, .summary td { padding: 9px 8px; text-align: right; border-bottom: 1px solid var(--line); }
.summary th:first-child, .summary td:first-child { text-align: left; }
.summary th { color: var(--muted); font-weight: 400; }
.summary tr.is-current td { color: var(--tiger); }
.summary tfoot td { border-bottom: 0; }

/* ---------------------------------------------------------------- accesso */
.auth { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; }
.auth-card { width: min(420px, 100%); background: var(--card); border-radius: 24px; padding: 28px 24px; display: grid; gap: 16px; }
.auth-switch { text-align: center; }
.auth-brand { display: flex; align-items: center; gap: 14px; font-size: 28px; color: var(--text); }
.auth-brand:hover { text-decoration: none; }

/* ---------------------------------------------------------------- foglio e avvisi (questi fluttuano: ombra) */
.sheet {
  border: 0; padding: 0; background: transparent; color: var(--text);
  width: min(460px, calc(100% - 24px)); max-height: calc(100dvh - 24px);
}
.sheet::backdrop { background: rgba(10, 8, 6, 0.65); }
.sheet-inner {
  background: var(--card); border-radius: 24px; padding: 22px;
  display: grid; gap: 16px; max-height: calc(100dvh - 24px); overflow: auto;
  box-shadow: 0 24px 60px -20px rgba(0, 0, 0, .6);
}
.sheet-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.sheet-head p { margin-top: 4px; }
.sheet-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.sheet-actions .btn-danger { margin-right: auto; }
.code-picker { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.code-option { position: relative; }
.code-option input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.code-option span {
  display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 14px; border-radius: var(--r-s);
  background: var(--bg-2); border: 2px solid transparent; color: var(--text);
}
.code-option .i { color: var(--ci); width: 20px; height: 20px; }
.code-option input:checked + span { background: var(--tiger-tint); border-color: var(--tiger); }
.code-option input:focus-visible + span { outline: 2px solid var(--tiger); outline-offset: 2px; }
.offer-list { display: grid; gap: 8px; max-height: 280px; overflow: auto; }

.toasts {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 50;
  display: grid; gap: 8px; width: min(420px, calc(100% - 32px)); pointer-events: none;
}
.toast {
  padding: 12px 16px; border-radius: var(--r-s); background: var(--card-2); color: var(--text);
  box-shadow: 0 12px 30px -12px rgba(0, 0, 0, .6); animation: toast-in .2s ease-out;
}
.toast.is-error { background: var(--tiger); color: var(--tiger-ink); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1180px) {
  .week { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
}

@media (max-width: 900px) {
  .sidebar { display: none; }
  :root { --band-h: 56px; --band-fs: 22px; }
  .main { margin-left: 0; padding: 12px 16px calc(env(safe-area-inset-bottom, 0px) + 104px); gap: 20px; }
  .bottom-nav {
    position: fixed; z-index: 30; left: 50%; transform: translateX(-50%);
    bottom: calc(env(safe-area-inset-bottom, 0px) + 12px);
    width: min(420px, calc(100% - 24px)); height: 64px; padding: 0 8px;
    display: flex; align-items: center; justify-content: space-around;
    background: #0e0c0a; border-radius: 99px; box-shadow: 0 14px 30px -10px rgba(0, 0, 0, .7);
  }
  .bottom-nav a {
    width: 48px; height: 48px; display: grid; place-items: center; border-radius: 50%;
    color: #a99c90; position: relative;
  }
  .bottom-nav a.is-active { color: var(--tiger); background: var(--tiger-tint); }
  .bottom-nav .i { width: 22px; height: 22px; }
  .bottom-add {
    width: 52px; height: 52px; border-radius: 50%; border: 0; padding: 0;
    background: var(--tiger); color: var(--tiger-ink); display: grid; place-items: center; cursor: pointer;
  }
  .bottom-add .i { width: 24px; height: 24px; }
  .nav-dot { position: absolute; top: 9px; right: 9px; width: 9px; height: 9px; border-radius: 50%; background: var(--tiger); }
  .toasts { bottom: calc(env(safe-area-inset-bottom, 0px) + 92px); }

  .profile-layout { grid-template-columns: 1fr; }
  .week { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  h1 { font-size: 22px; }
  .card { padding: 16px; }
  .today { grid-template-columns: 1fr; min-height: 0; padding: 24px; gap: 8px; }
  .today-icon { justify-content: start; }
  .today-icon .i { width: 72px; height: 72px; }
  .today-text h2 { font-size: 26px; }
  .today-text #today-sub { font-size: 17px; }
  .coffee-form { grid-template-columns: 1fr; }
  .cal-weekdays, .cal-grid { gap: 4px; }
  .cal-cell { height: 66px; padding: 6px 4px 20px; }
  .cal-people { --av: 14px; bottom: 4px; }
  .cal-more { font-size: 10px; }
  .cal-ico .i { width: 20px; height: 20px; }
  .strip > div { padding: 14px 12px; }
  .strip-value { font-size: 20px; }
  .grid-2 { grid-template-columns: 1fr; }
  .sheet { width: 100%; max-width: none; margin: auto 0 0; }
  .sheet-inner { border-radius: 24px 24px 0 0; padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 22px); }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* ---------------------------------------------------------------- persone: foto o iniziali */
.avatar {
  --av: 28px;
  width: var(--av); height: var(--av); flex: none; border-radius: 50%;
  display: inline-grid; place-items: center; overflow: hidden;
  background: var(--tiger); color: #fff; font-size: calc(var(--av) * .4); line-height: 1;
  object-fit: cover;
}
.avatar-lg { --av: 64px; }
.avatar-sm { --av: 22px; }
.hello { display: flex; align-items: center; gap: 16px; }
.home-head { align-items: center; }
.avatar-actions { margin-top: 10px; }
.avatar-actions .btn { cursor: pointer; }

/* i pallini delle persone presenti, in basso nella cella */
.cal-people {
  --av: 18px;
  position: absolute; left: 50%; bottom: 6px; transform: translateX(-50%);
  display: flex; align-items: center;
}
.cal-people .avatar { box-shadow: 0 0 0 2px var(--card); }
.cal-people .avatar + .avatar, .cal-people .avatar + .cal-more { margin-left: -5px; }
.cal-more {
  height: var(--av); min-width: var(--av); padding: 0 4px; border-radius: 99px; display: inline-grid; place-items: center;
  background: var(--card-2); color: var(--muted); font-size: 11px; box-shadow: 0 0 0 2px var(--card);
}

/* chip con la persona: la foto a sinistra */
.chip .avatar { --av: 22px; margin-left: -8px; }
.member-faces { display: flex; align-items: center; }
.member-faces .avatar { --av: 26px; box-shadow: 0 0 0 2px var(--card); }
.member-faces .avatar + .avatar { margin-left: -6px; }
.coffee-list { display: grid; gap: 6px; }
.coffee-list p { font-size: 14px; color: var(--muted); }

@media (max-width: 560px) {
  .cal-people { --av: 14px; bottom: 4px; }
  .cal-more { font-size: 10px; }
  .hello { gap: 12px; }
  .avatar-lg { --av: 52px; }
}

/* due iniziali larghe nei cerchi piccoli: un filo piu' strette */
.avatar { letter-spacing: -0.04em; }
@media (max-width: 560px) {
  .cal-cell { height: 74px; padding-bottom: 24px; }
}

/* ================================================================ rifiniture "fancy"
   Fascia in liquid glass: tigerlily traslucido, sfocatura e riflessi che scorrono piano.
   Sotto passa il contenuto, quindi il vetro si vede mentre si scorre. */
body {
  background:
    radial-gradient(900px 420px at 50% -120px, color-mix(in srgb, var(--tiger) 22%, transparent), transparent 70%),
    var(--bg);
  background-attachment: fixed;
}

.band {
  isolation: isolate; overflow: hidden;
  background: color-mix(in srgb, var(--tiger) 86%, transparent);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
  backdrop-filter: blur(22px) saturate(180%);
  border-bottom: 1px solid rgba(255, 255, 255, .2);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .5),
    inset 0 -1px 0 rgba(255, 255, 255, .12),
    0 14px 34px -16px rgba(226, 88, 62, .75);
}
/* il riflesso del vetro: luce in alto, una linea a meta', un bagliore che si muove */
.band::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(180deg,
    rgba(255, 255, 255, .3) 0%, rgba(255, 255, 255, .1) 48%,
    rgba(255, 255, 255, .03) 52%, rgba(255, 255, 255, .08) 100%);
}
.band::after {
  content: ""; position: absolute; inset: -60% -20%; z-index: -1; pointer-events: none;
  background:
    radial-gradient(35% 110% at 22% 10%, rgba(255, 255, 255, .32), transparent 62%),
    radial-gradient(30% 100% at 80% 95%, rgba(255, 200, 175, .3), transparent 62%);
  animation: band-shine 14s ease-in-out infinite alternate;
}
@keyframes band-shine { from { transform: translateX(-6%); } to { transform: translateX(6%); } }
.band-title {
  text-shadow: 0 1px 0 rgba(0, 0, 0, .12), 0 8px 22px rgba(110, 25, 8, .4);
}

/* superfici: un filo di luce sul bordo alto */
.card, .day, .group, .stat, .auth-card {
  border: 1px solid rgba(255, 255, 255, .05);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05);
}
:root[data-theme="light"] .card, :root[data-theme="light"] .day, :root[data-theme="light"] .group {
  border-color: var(--line); box-shadow: none;
}

/* la card di oggi: alone del colore del turno dietro l'icona */
.today {
  --glow: var(--c);
  background-image: radial-gradient(circle at 14% 50%, color-mix(in srgb, var(--glow) 34%, transparent), transparent 46%);
  box-shadow: 0 0 0 1px rgba(226, 88, 62, .25), 0 30px 70px -36px rgba(226, 88, 62, .7);
}
.today[data-code="none"], .today[data-code="weekend"] { --glow: var(--tiger); }
.today-icon .i { filter: drop-shadow(0 6px 18px color-mix(in srgb, var(--ci) 55%, transparent)); }
@media (max-width: 560px) {
  .today { background-image: radial-gradient(circle at 20% 22%, color-mix(in srgb, var(--glow) 34%, transparent), transparent 52%); }
}

/* bottoni: risposta al tocco */
.btn-primary { box-shadow: 0 8px 22px -12px rgba(226, 88, 62, .9); }
.btn-primary:hover { box-shadow: 0 10px 28px -10px rgba(226, 88, 62, 1); transform: translateY(-1px); }
.btn:active { transform: scale(.97); }

/* calendario e planner: le celle si sollevano */
.cal-cell { transition: transform .15s ease, border-color .15s ease; }
.cal-cell:not(.is-blank):hover { transform: translateY(-2px); }
.cal-cell.is-today { box-shadow: 0 0 0 1px var(--tiger), 0 10px 26px -14px rgba(226, 88, 62, .9); }
.day.is-today { box-shadow: 0 16px 40px -26px rgba(226, 88, 62, .9); }
button.chip { transition: transform .12s ease, background .12s ease; }
button.chip:hover { transform: translateY(-1px); }

/* barra in basso su mobile: vetro scuro */
@media (max-width: 900px) {
  .bottom-nav {
    background: rgba(20, 15, 13, .62);
    -webkit-backdrop-filter: blur(22px) saturate(170%);
    backdrop-filter: blur(22px) saturate(170%);
    border: 1px solid rgba(255, 255, 255, .08);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1), 0 18px 40px -14px rgba(0, 0, 0, .8);
  }
  .bottom-add { box-shadow: 0 8px 22px -6px rgba(226, 88, 62, .9), inset 0 1px 0 rgba(255, 255, 255, .35); }
}

/* finestre e avvisi in vetro */
.sheet::backdrop { background: rgba(10, 8, 6, .45); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.sheet-inner {
  background: color-mix(in srgb, var(--card) 84%, transparent);
  -webkit-backdrop-filter: blur(26px) saturate(160%);
  backdrop-filter: blur(26px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, .08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), 0 30px 70px -24px rgba(0, 0, 0, .7);
}
.sheet[open] .sheet-inner { animation: sheet-in .22s cubic-bezier(.2, .9, .3, 1); }
@keyframes sheet-in { from { opacity: 0; transform: translateY(14px) scale(.98); } }
.toast {
  background: color-mix(in srgb, var(--card-2) 80%, transparent);
  -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, .08);
}

/* ingresso morbido dei blocchi della pagina */
.main > * { animation: rise .45s cubic-bezier(.2, .8, .2, 1) both; }
.main > *:nth-child(2) { animation-delay: .05s; }
.main > *:nth-child(3) { animation-delay: .1s; }
.main > *:nth-child(4) { animation-delay: .15s; }
.main > *:nth-child(5) { animation-delay: .2s; }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }
.has-splash .main > * { animation-delay: 2.3s; }


/* admin: membri del reparto */
.member-rows { display: grid; gap: 6px; }
.member-row { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: var(--r-s); background: var(--bg-2); }
.member-row span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.add-member { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.group .times { display: flex; gap: 14px; }

/* ---------------------------------------------------------------- promemoria documento (ferie / malattia) */
.reminders { display: grid; gap: 8px; }
.reminder {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 14px 14px 18px; border-radius: var(--r);
  background: color-mix(in srgb, var(--tiger) 14%, var(--card));
  border: 1px solid color-mix(in srgb, var(--tiger) 40%, transparent);
}
.reminder > .i { color: var(--tiger); width: 22px; height: 22px; }
.reminder p { flex: 1; min-width: 0; }
.reminder p b { font-weight: 400; color: var(--tiger); }
.reminder a { display: inline-block; white-space: nowrap; } /* l'indirizzo va a capo intero, mai spezzato */
/* il checkmark rotondo: vuoto finche' non lo tocchi, pieno quando e' fatto */
.check-btn {
  flex: none; width: 44px; height: 44px; border-radius: 50%; padding: 0; cursor: pointer;
  display: grid; place-items: center;
  background: transparent; color: var(--tiger); border: 2px solid var(--tiger);
  transition: background .15s, color .15s, transform .15s;
}
.check-btn .i { width: 22px; height: 22px; stroke-width: 2.4; }
.check-btn:hover { background: var(--tiger-tint); }
.check-btn.is-done { background: var(--tiger); color: var(--tiger-ink); transform: scale(1.08); }
.sheet-actions a.btn:hover { text-decoration: none; }

/* ================================================================ fascia che si spezza scorrendo
   --ph (0..1): le due meta' si separano dal centro e si stringono verso i lati;
   --pv (0..1): poi diventano due barre sottili e corte, centrate in verticale ai bordi;
   --pt (0..1): il titolo sfuma per primo. I valori li aggiorna lo script mentre scorri. */
:root { --ph: 0; --pv: 0; --pt: 0; --py: 0; --bar-w: 4px; --bar-h: 34vh; }
.app { padding-top: calc(var(--band-h) + env(safe-area-inset-top, 0px)); }
.band {
  position: fixed; top: 0; left: 0; right: 0; z-index: 40;
  background: none; border: 0; box-shadow: none; overflow: visible; pointer-events: none;
  -webkit-backdrop-filter: none; backdrop-filter: none;
}
.band::before, .band::after { content: none; }
.band-title {
  position: relative; z-index: 2; pointer-events: auto;
  opacity: calc(1 - var(--pt));
  transform: translateY(calc(var(--pt) * -8px)) scale(calc(1 - var(--pt) * .08));
}
.band.is-split .band-title { pointer-events: none; }

.band-half {
  position: fixed; z-index: 1; pointer-events: none; overflow: hidden;
  /* da barre: partono in alto e scendono lungo il bordo man mano che si legge la pagina (--py) */
  top: calc(var(--pv) * (12px + (100dvh - var(--bar-h) - 24px) * var(--py)));
  width: calc(50vw - (50vw - var(--bar-w)) * var(--ph));
  height: calc(var(--band-h) + env(safe-area-inset-top, 0px)
    + (var(--bar-h) - var(--band-h) - env(safe-area-inset-top, 0px)) * var(--pv));
  background: color-mix(in srgb, var(--tiger) 86%, transparent);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
  backdrop-filter: blur(22px) saturate(180%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .5),
    inset 0 -1px 0 rgba(255, 255, 255, .12),
    0 14px 34px -16px rgba(226, 88, 62, .75);
}
/* il riflesso del vetro su ogni meta' */
.band-half::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg,
    rgba(255, 255, 255, .3) 0%, rgba(255, 255, 255, .1) 48%,
    rgba(255, 255, 255, .03) 52%, rgba(255, 255, 255, .08) 100%);
}
.band-l { left: 0; border-radius: 0 calc(var(--ph) * 99px) calc(var(--ph) * 99px) 0; }
.band-r { right: 0; border-radius: calc(var(--ph) * 99px) 0 0 calc(var(--ph) * 99px); }

/* la barra laterale del menu sale al posto della fascia */
.sidebar { top: calc(var(--band-h) * (1 - var(--ph))); }

/* su mobile la pausa caffe' e' il tasto centrale: niente doppione accanto al saluto */
@media (max-width: 900px) {
  .coffee-head-btn { display: none; }
}
.cal-hint { margin-top: 4px; }

/* ---------------------------------------------------------------- sezione admin */
.account-list { display: grid; gap: 8px; }
.account {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 12px 14px; border-radius: var(--r-s); background: var(--bg-2);
}
.account .avatar { --av: 40px; }
.account-info { flex: 1 1 220px; min-width: 0; display: grid; gap: 3px; }
.account-info b { font-weight: 400; display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.account-actions { display: flex; gap: 6px; margin-left: auto; }
.admin-link { display: flex; align-items: center; gap: 14px; color: var(--text); }
.admin-link:hover { text-decoration: none; border-color: var(--tiger); }
.admin-link > .i { color: var(--tiger); width: 24px; height: 24px; }
.admin-link > span:nth-child(2) { display: grid; gap: 2px; flex: 1; }
.admin-link b { font-weight: 400; }
.auth-done { display: grid; gap: 8px; padding: 14px 16px; border-radius: var(--r-s); background: var(--tiger-tint); }
.auth-done b { font-weight: 400; }

/* ================================================================ fascia leggera (mobile)
   Le due meta' hanno sempre la stessa geometria (mezza fascia in alto) e si trasformano solo con
   transform: scala e spostamento, calcolati dallo script. Niente animazione di width/height/top. */
.band-half {
  top: 0;
  width: 50vw;
  height: calc(var(--band-h) + env(safe-area-inset-top, 0px));
  border-radius: 0;
  will-change: transform;
  backface-visibility: hidden;
}
.band-l { transform-origin: left top; border-radius: 0; }
.band-r { transform-origin: right top; border-radius: 0; }
.band-title { opacity: 1; transform: none; will-change: opacity, transform; }
/* mentre e' spezzata: tigerlily pieno, senza sfocatura ne' alone (costosi da ridisegnare in movimento) */
.band.is-split .band-half {
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  background: color-mix(in srgb, var(--tiger) 94%, transparent);
  box-shadow: none;
}
.band.is-split .band-half::before { display: none; }
.sidebar { top: var(--band-h); }
