/* LiftApp — design system.
   Stile iOS nativo, light: sfondo grouped, card bianche, accento ROSSO LiftUp.
   Brand: rosso #D60707 (primario sito), scuro #9B0014. Font di sistema Apple. */

:root {
  --bg: #F2F2F7;                    /* iOS systemGroupedBackground */
  --surface: #FFFFFF;
  --surface-2: #F2F2F7;
  --fill: rgba(118, 118, 128, 0.12);/* iOS systemFill */
  --border: rgba(60, 60, 67, 0.12);
  --text: #1C1C1E;
  --muted: #6E6E73;
  --faint: #A5A5AA;
  --accent: #D60707;                /* rosso LiftUp */
  --accent-dark: #9B0014;
  --accent-soft: rgba(214, 7, 7, 0.09);
  --on-accent: #FFFFFF;
  --danger: #FF3B30;
  --ok: #34C759;
  --warn: #FF9500;
  --r-lg: 20px;
  --r-md: 14px;
  --r-sm: 10px;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 4px 16px rgba(0, 0, 0, 0.05);
  --tabbar-h: 76px;
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { height: 100%; }
body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.45;
  overscroll-behavior-y: none;
  -webkit-font-smoothing: antialiased;
  user-select: none;
  -webkit-user-select: none;
}
input, textarea { user-select: text; -webkit-user-select: text; }
img { max-width: 100%; display: block; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

#app { max-width: 560px; margin: 0 auto; min-height: 100%; }

/* ---------- Screens ---------- */
.screen {
  min-height: 100vh; min-height: 100dvh;
  padding: calc(var(--sat) + 14px) 16px calc(var(--tabbar-h) + var(--sab) + 28px);
  animation: screenIn 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}
.screen.no-tabbar { padding-bottom: calc(var(--sab) + 28px); }
@keyframes screenIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* Large title alla iOS */
.topbar { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; min-height: 44px; }
.topbar h1 {
  font-size: 32px; font-weight: 800; letter-spacing: -0.01em; flex: 1;
  font-family: -apple-system, "SF Pro Display", sans-serif;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0;
}
/* Saluto in home: si adatta ai nomi lunghi invece di andare a capo */
.topbar h1.greet { font-size: clamp(22px, 7.2vw, 32px); }
.topbar .sub { color: var(--muted); font-size: 14px; margin-top: 1px; font-weight: 500; }
.back-btn {
  width: 38px; height: 38px; border-radius: 50%; background: var(--fill);
  display: grid; place-items: center; flex-shrink: 0; color: var(--accent);
  transition: transform 0.15s, opacity 0.15s;
}
.back-btn:active { transform: scale(0.9); opacity: 0.7; }

.icon-btn {
  position: relative; width: 38px; height: 38px; border-radius: 50%;
  background: var(--fill); color: var(--accent);
  display: grid; place-items: center; transition: transform 0.15s, opacity 0.15s;
}
.icon-btn:active { transform: scale(0.9); opacity: 0.7; }
.icon-btn .badge {
  position: absolute; top: -3px; right: -3px; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 700;
  display: grid; place-items: center; border: 2px solid var(--bg);
}

/* ---------- Cards / rows ---------- */
.card {
  background: var(--surface); border-radius: var(--r-lg);
  padding: 16px; margin-bottom: 12px; box-shadow: var(--shadow);
}
.card.tappable { transition: transform 0.15s, opacity 0.15s; }
.card.tappable:active { transform: scale(0.98); opacity: 0.85; }

.section-title {
  font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--muted); margin: 20px 16px 8px;
  display: flex; align-items: center; justify-content: space-between;
}
.section-title .link { color: var(--accent); text-transform: none; letter-spacing: 0; font-size: 14px; font-weight: 600; }

.row { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 0.5px solid var(--border); }
.row:last-child { border-bottom: 0; }
.row .grow { flex: 1; min-width: 0; }
.row .title { font-weight: 600; font-size: 15.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .meta { color: var(--muted); font-size: 13px; margin-top: 1px; }
.row .end { text-align: right; flex-shrink: 0; }
.row .chev { color: #C7C7CC; flex-shrink: 0; }

.avatar {
  width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0;
  display: grid; place-items: center; font-weight: 700; font-size: 14px;
  background: var(--fill); color: var(--text); position: relative;
}
.avatar.sm { width: 32px; height: 32px; font-size: 12px; }
.avatar.accent { background: var(--accent-soft); color: var(--accent); }
.avatar .crown { position: absolute; top: -11px; right: -7px; font-size: 15px; transform: rotate(20deg); }
.avatar .online {
  position: absolute; bottom: -1px; right: -1px; width: 12px; height: 12px; border-radius: 50%;
  background: var(--ok); border: 2.5px solid var(--surface);
}

.dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; display: inline-block; }

.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px; border-radius: 999px;
  background: var(--fill); font-size: 13.5px; font-weight: 600; color: var(--text);
  transition: transform 0.12s, background 0.15s, color 0.15s;
}
.chip:active { transform: scale(0.95); }
.chip.on { background: var(--accent); color: var(--on-accent); }
.chip-wrap { display: flex; flex-wrap: wrap; gap: 8px; }

.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.pill.open { background: var(--accent-soft); color: var(--accent); }
.pill.done { background: rgba(52, 199, 89, 0.13); color: #248A3D; }
.pill.pending { background: rgba(255, 149, 0, 0.14); color: #C93400; }
.pill.role { background: var(--fill); color: var(--muted); }

/* ---------- Buttons ---------- */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 15px 20px; border-radius: var(--r-md);
  font-size: 16.5px; font-weight: 600; transition: transform 0.15s, opacity 0.15s;
}
.btn:active { transform: scale(0.97); opacity: 0.85; }
.btn:disabled { opacity: 0.4; pointer-events: none; }
.btn.primary { background: var(--accent); color: var(--on-accent); box-shadow: 0 6px 18px rgba(214, 7, 7, 0.25); }
.btn.ghost { background: var(--fill); color: var(--text); }
.btn.tint { background: var(--accent-soft); color: var(--accent); }
.btn.danger-ghost { background: rgba(255, 59, 48, 0.1); color: var(--danger); }
.btn.sm { width: auto; padding: 9px 16px; font-size: 14.5px; border-radius: 12px; }
.btn-row { display: flex; gap: 10px; }
.btn-row .btn { flex: 1; }

.fab {
  position: fixed; right: calc(50% - 280px + 16px); bottom: calc(var(--tabbar-h) + var(--sab) + 16px);
  width: 56px; height: 56px; border-radius: 50%; background: var(--accent); color: var(--on-accent);
  display: grid; place-items: center; box-shadow: 0 8px 24px rgba(214, 7, 7, 0.4);
  transition: transform 0.15s; z-index: 40;
}
@media (max-width: 596px) { .fab { right: 16px; } }
.fab:active { transform: scale(0.9); }

/* ---------- Forms ---------- */
.field { margin-bottom: 13px; }
.field label { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 6px; margin-left: 4px; }
.input, textarea.input {
  width: 100%; padding: 14px 16px; border-radius: var(--r-md);
  background: var(--surface); border: 1px solid var(--border); color: var(--text);
  font-size: 16px; outline: none; transition: border-color 0.15s, box-shadow 0.15s;
}
.sheet .input, .sheet textarea.input { background: var(--surface-2); border-color: transparent; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea.input { resize: none; min-height: 88px; font-family: inherit; }
.input.code { text-align: center; font-size: 20px; letter-spacing: 0.2em; font-weight: 700; text-transform: uppercase; }

.segmented {
  display: flex; background: var(--fill);
  border-radius: 10px; padding: 2px; margin-bottom: 14px;
}
.segmented button {
  flex: 1; padding: 8px; border-radius: 8px; font-size: 14px; font-weight: 600; color: var(--text);
  transition: background 0.2s, box-shadow 0.2s;
}
.segmented button.on { background: var(--surface); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12); }

.stepper { display: flex; align-items: center; gap: 2px; }
.stepper button {
  width: 34px; height: 34px; border-radius: 10px; background: var(--fill);
  font-size: 18px; font-weight: 700; display: grid; place-items: center; color: var(--accent);
}
.stepper button:active { transform: scale(0.9); }
.stepper .val { min-width: 58px; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }

/* ---------- Progress / stats ---------- */
.progress { height: 10px; border-radius: 999px; background: var(--fill); overflow: hidden; position: relative; }
.progress .fill {
  height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--accent), #F03B2E);
  transition: width 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}
.progress .fill.bad { background: var(--warn); }
.progress .thresh { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--text); opacity: 0.4; border-radius: 2px; }

.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat { background: var(--surface-2); border-radius: var(--r-md); padding: 13px 14px; }
.stat .num { font-size: 23px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stat .lbl { font-size: 12px; color: var(--muted); font-weight: 600; margin-top: 2px; }

.bar-row { margin-bottom: 12px; }
.bar-row .bar-top { display: flex; justify-content: space-between; font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.bar-row .bar-top .v { color: var(--muted); font-variant-numeric: tabular-nums; }
.bar-row .bar { height: 12px; border-radius: 999px; background: var(--fill); overflow: hidden; }
.bar-row .bar > div { height: 100%; border-radius: 999px; transition: width 0.8s cubic-bezier(0.22, 1, 0.36, 1); }

/* ---------- LAB ring ---------- */
.lab-ring-wrap { display: grid; place-items: center; padding: 26px 0 20px; }
.lab-ring {
  width: 248px; height: 248px; border-radius: 50%; display: grid; place-items: center;
  background: var(--surface); box-shadow: var(--shadow); position: relative;
  transition: transform 0.15s;
}
.lab-ring:active { transform: scale(0.96); }
/* Anello tratteggiato esterno */
.lab-ring::before {
  content: ""; position: absolute; inset: -10px; border-radius: 50%;
  border: 2.5px dashed rgba(214, 7, 7, 0.28);
}
/* Anello interno sottile: dà il respiro che mancava al testo */
.lab-ring::after {
  content: ""; position: absolute; inset: 14px; border-radius: 50%;
  border: 1px solid var(--border);
}
.lab-ring.live { background: radial-gradient(circle at 50% 32%, rgba(214, 7, 7, 0.09), var(--surface) 72%); }
.lab-ring.live::before { border-style: solid; border-color: var(--accent); animation: ringPulse 2.4s ease-in-out infinite; }
.lab-ring.live::after { border-color: rgba(214, 7, 7, 0.16); }
@keyframes ringPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.035); opacity: 0.55; }
}
.lab-ring .inner {
  text-align: center; position: relative; z-index: 1;
  width: 63%; display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.lab-ring .ico { color: var(--accent); line-height: 0; margin-bottom: 8px; }
.lab-ring .big {
  font-size: 36px; font-weight: 800; letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums; line-height: 1.05;
}
.lab-ring .big.sm { font-size: 23px; letter-spacing: -0.02em; }
.lab-ring .small { font-size: 12.5px; color: var(--muted); font-weight: 600; line-height: 1.35; }
.lab-ring .eyebrow {
  font-size: 11px; font-weight: 800; letter-spacing: 0.12em; color: var(--accent);
  text-transform: uppercase; margin-bottom: 2px;
}
.ring-cap {
  margin-top: 16px; text-align: center; font-size: 12.5px; color: var(--faint);
  font-weight: 600; max-width: 250px; line-height: 1.4;
}

/* ---------- Tab bar ---------- */
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 50;
  height: calc(var(--tabbar-h) + var(--sab));
  padding: 10px 8px calc(var(--sab) + 10px);
  background: rgba(255, 255, 255, 0.82);
  -webkit-backdrop-filter: blur(24px) saturate(1.6); backdrop-filter: blur(24px) saturate(1.6);
  border-top: 0.5px solid var(--border);
}
.tabbar .inner { max-width: 560px; margin: 0 auto; display: flex; align-items: center; }
.tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
  color: #999BA0; font-size: 10.5px; font-weight: 600; transition: color 0.2s, transform 0.12s;
}
.tab:active { transform: scale(0.92); }
.tab.on { color: var(--accent); }
.tab svg { width: 24px; height: 24px; }
.tab.center { flex: 0 0 76px; }
.tab.center .orb {
  width: 58px; height: 58px; border-radius: 50%;
  background: linear-gradient(160deg, #E81212, var(--accent-dark)); color: #fff;
  display: grid; place-items: center; margin-top: -26px;
  box-shadow: 0 8px 22px rgba(214, 7, 7, 0.45);
  border: 4px solid #fff; transition: transform 0.15s;
}
.tab.center:active .orb { transform: scale(0.92); }
.tab.center .orb svg { width: 26px; height: 26px; }

/* ---------- Sheet (modale bottom) ---------- */
.sheet-backdrop {
  position: fixed; inset: 0; z-index: 90; background: rgba(0, 0, 0, 0.35);
  opacity: 0; transition: opacity 0.25s;
}
.sheet-backdrop.in { opacity: 1; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 91;
  max-width: 560px; margin: 0 auto;
  background: var(--surface); border-radius: 22px 22px 0 0;
  box-shadow: 0 -10px 44px rgba(0, 0, 0, 0.16);
  padding: 8px 18px calc(var(--sab) + 20px);
  transform: translateY(105%); transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
  max-height: 88vh; max-height: 88dvh; overflow-y: auto; overscroll-behavior: contain;
}
.sheet.in { transform: none; }
.sheet .handle { width: 38px; height: 5px; border-radius: 3px; background: #D8D8DC; margin: 6px auto 16px; }
.sheet h2 { font-size: 21px; font-weight: 800; letter-spacing: -0.01em; margin-bottom: 15px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + var(--sab) + 18px); z-index: 120;
  transform: translate(-50%, 20px); opacity: 0;
  background: rgba(28, 28, 30, 0.94); color: #fff;
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  padding: 12px 20px; border-radius: 999px; font-size: 14px; font-weight: 600;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.3s;
  max-width: 85vw; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.toast.in { transform: translate(-50%, 0); opacity: 1; }
.toast.err { background: rgba(180, 20, 20, 0.96); }

/* ---------- Auth ---------- */
.auth-hero { text-align: center; padding: 8vh 0 30px; }
.auth-logo { width: 170px; margin: 0 auto 6px; }
.auth-hero h1 { font-size: 33px; font-weight: 800; letter-spacing: -0.02em; }
.auth-hero h1 .red { color: var(--accent); }
.auth-hero p { color: var(--muted); margin-top: 3px; font-size: 15px; }

/* ---------- Comments / feed ---------- */
.comment { display: flex; gap: 10px; margin-bottom: 13px; }
.comment .bubble {
  background: var(--surface-2); border-radius: 4px 16px 16px 16px; padding: 10px 13px; flex: 1; min-width: 0;
}
.comment .who { font-size: 13px; font-weight: 700; margin-bottom: 2px; }
.comment .when { color: var(--faint); font-size: 11.5px; font-weight: 500; margin-left: 6px; }
.comment .body { font-size: 14.5px; word-wrap: break-word; }
.comment img.ph { border-radius: 12px; margin-top: 8px; max-height: 260px; object-fit: cover; }

.composer { display: flex; gap: 8px; align-items: flex-end; margin-top: 14px; }
.composer .input { flex: 1; min-height: 44px; max-height: 110px; padding: 11px 14px; background: var(--surface-2); border-color: transparent; }
.composer .icon-btn, .composer .send { flex-shrink: 0; height: 44px; }
.composer .icon-btn { width: 44px; border-radius: 14px; }
.composer .send {
  width: 44px; border-radius: 14px; background: var(--accent); color: var(--on-accent);
  display: grid; place-items: center;
}
.composer .send:active { transform: scale(0.92); }

.empty { text-align: center; color: var(--muted); padding: 32px 20px; font-size: 14.5px; }
.empty .big { font-size: 40px; margin-bottom: 10px; }

.medal { font-size: 20px; width: 32px; text-align: center; flex-shrink: 0; }
.pos { width: 32px; text-align: center; color: var(--faint); font-weight: 700; flex-shrink: 0; }

.notif.unread .title::before { content: "●  "; color: var(--accent); font-size: 10px; vertical-align: 2px; }

.hint { color: var(--faint); font-size: 13px; text-align: center; margin-top: 12px; line-height: 1.5; }
.spacer { height: 8px; }
a { color: var(--accent); text-decoration: none; }

/* ---------- Calendario ---------- */
.cal-head { display: flex; align-items: center; gap: 6px; margin-bottom: 12px; }
.cal-head .m {
  flex: 1; font-size: 19px; font-weight: 800; letter-spacing: -0.01em; text-transform: capitalize;
}
.cal-nav {
  width: 34px; height: 34px; border-radius: 50%; background: var(--fill); color: var(--accent);
  display: grid; place-items: center; transition: transform 0.15s, opacity 0.15s;
}
.cal-nav:active { transform: scale(0.88); opacity: 0.6; }

/* minmax(0,1fr): senza questo il testo lungo degli impegni allarga le colonne */
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; }
.cal-dow {
  text-align: center; font-size: 11px; font-weight: 700; color: var(--faint);
  text-transform: uppercase; letter-spacing: 0.04em; padding-bottom: 6px;
}
.cal-day {
  position: relative; aspect-ratio: 1 / 1; border-radius: 12px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  font-size: 15.5px; font-weight: 600; color: var(--text);
  transition: background 0.18s, color 0.18s, transform 0.12s;
  min-width: 0; overflow: hidden;
}
.cal-day:active { transform: scale(0.9); }
.cal-day.out { color: var(--faint); opacity: 0.45; }
.cal-day.today { color: var(--accent); font-weight: 800; }
.cal-day.today::after {
  content: ""; position: absolute; inset: 3px; border-radius: 12px;
  border: 1.5px solid var(--accent); opacity: 0.45;
}
.cal-day.sel { background: var(--accent); color: #fff; font-weight: 800; }
.cal-day.sel::after { display: none; }
.cal-day.sel .cal-dots i { background: rgba(255, 255, 255, 0.95) !important; }
.cal-dots { display: flex; gap: 3px; height: 5px; align-items: center; }
.cal-dots i { width: 5px; height: 5px; border-radius: 50%; display: block; }

/* Planner: la casella del giorno mostra già gli impegni, come Calendario/Google */
.cal-grid.planner .cal-day {
  aspect-ratio: auto; min-height: 62px; justify-content: flex-start; padding: 4px 2px 3px; gap: 2px;
}
.cal-grid.planner .cal-day .n { font-size: 13.5px; line-height: 1.1; }
.cal-grid.planner .cal-day.today .n {
  background: var(--accent); color: #fff; border-radius: 50%;
  width: 21px; height: 21px; display: grid; place-items: center; font-size: 12.5px;
}
.cal-grid.planner .cal-day.today::after { display: none; }
.cal-grid.planner .cal-day.sel { background: var(--accent-soft); }
.cal-grid.planner .cal-day.sel .n { color: var(--accent); }
.cal-grid.planner .cal-day.sel.today .n { color: #fff; }
.cal-bars { display: flex; flex-direction: column; gap: 1.5px; width: 100%; min-width: 0; padding: 0 1px; }
.cal-bars i {
  display: block; font-style: normal; font-size: 9px; font-weight: 700; line-height: 1.4;
  padding: 1px 2px; border-radius: 3px; text-align: center;
  font-variant-numeric: tabular-nums;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  max-width: 100%; min-width: 0;
}
.cal-bars i.more { background: transparent; color: var(--faint); padding-left: 3px; }

/* Timeline del giorno */
.timeline { position: relative; }
.tl-hour {
  position: absolute; left: 0; right: 0; height: 0;
  border-top: 1px solid var(--border);
}
.tl-hour span {
  position: absolute; top: -8px; left: 0; width: 44px; text-align: right;
  font-size: 11px; font-weight: 600; color: var(--faint);
  font-variant-numeric: tabular-nums; background: var(--surface); padding-right: 4px;
}
.tl-ev {
  position: absolute; border-radius: 9px; border-left: 3.5px solid var(--accent);
  padding: 5px 8px; overflow: hidden; text-align: left;
  transition: transform 0.12s;
}
.tl-ev:active { transform: scale(0.98); }
.tl-ev.mine { box-shadow: inset 0 0 0 1px currentColor; }
.tl-ev .t {
  font-size: 12.5px; font-weight: 700; line-height: 1.25; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.tl-ev .s {
  font-size: 11px; color: var(--muted); font-weight: 500; margin-top: 1px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tl-now { position: absolute; left: 44px; right: 0; height: 2px; background: var(--accent); border-radius: 2px; }
.tl-now::before {
  content: ""; position: absolute; left: -5px; top: -3px;
  width: 8px; height: 8px; border-radius: 50%; background: var(--accent);
}

.day-head {
  display: flex; align-items: baseline; gap: 8px; margin: 20px 4px 8px;
}
.day-head .d { font-size: 17px; font-weight: 800; letter-spacing: -0.01em; text-transform: capitalize; }
.day-head .n { color: var(--muted); font-size: 13.5px; font-weight: 600; }

/* Card prenotazione con fascia oraria a sinistra */
.bk {
  display: flex; gap: 12px; background: var(--surface); border-radius: var(--r-lg);
  padding: 14px 16px; margin-bottom: 10px; box-shadow: var(--shadow);
  border-left: 4px solid var(--accent);
}
.bk .time { flex: 0 0 52px; text-align: center; }
.bk .time .h { font-size: 15.5px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.bk .time .e { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.bk .time .dur { font-size: 11px; color: var(--faint); font-weight: 600; margin-top: 2px; }
.bk .body { flex: 1; min-width: 0; }
.bk .work { font-size: 15.5px; font-weight: 700; letter-spacing: -0.01em; }
.bk .who { color: var(--muted); font-size: 13px; margin-top: 4px; }
.bk .tag { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; margin-bottom: 3px; }
.bk .x { color: #C7C7CC; font-size: 15px; padding: 0 2px; align-self: flex-start; }
.bk.mine { background: linear-gradient(180deg, rgba(214, 7, 7, 0.045), var(--surface) 60%); }

/* ---------- Sheet prenotazione (redesign) ---------- */
.sheet-hero {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--surface-2); border-radius: var(--r-md); padding: 13px 16px; margin-bottom: 14px;
}
.sheet-hero .lbl { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.sheet-hero .val { font-size: 17px; font-weight: 800; letter-spacing: -0.01em; text-transform: capitalize; margin-top: 1px; }
.sheet-hero input[type="date"] {
  background: none; border: 0; color: var(--accent); font-size: 15px; font-weight: 700;
  font-family: inherit; text-align: right; padding: 0;
}

.time-row { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.time-box {
  flex: 1; background: var(--surface-2); border-radius: var(--r-md); padding: 11px 14px; text-align: center;
}
.time-box .lbl { font-size: 11.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.time-box input[type="time"] {
  background: none; border: 0; color: var(--text); font-size: 21px; font-weight: 800;
  font-family: inherit; text-align: center; width: 100%; padding: 2px 0 0;
  font-variant-numeric: tabular-nums; letter-spacing: -0.02em;
}
.time-arrow { color: var(--faint); font-size: 15px; font-weight: 700; }
.dur-badge {
  text-align: center; font-size: 12.5px; font-weight: 700; color: var(--accent);
  background: var(--accent-soft); border-radius: 999px; padding: 5px 12px;
  display: inline-block; margin: -4px 0 14px;
}

.person-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 10px; }
.person {
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  padding: 8px 2px; border-radius: 14px; transition: background 0.15s, transform 0.12s;
}
.person:active { transform: scale(0.92); }
.person .pic {
  width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center;
  font-weight: 700; font-size: 15px; background: var(--fill); color: var(--text);
  position: relative; transition: box-shadow 0.18s;
}
.person .nm { font-size: 11.5px; font-weight: 600; text-align: center; line-height: 1.15;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person.on .pic { box-shadow: 0 0 0 2.5px var(--accent); }
.person.on .pic::after {
  content: "✓"; position: absolute; right: -3px; bottom: -3px;
  width: 19px; height: 19px; border-radius: 50%; background: var(--accent); color: #fff;
  font-size: 11px; font-weight: 800; display: grid; place-items: center; border: 2px solid var(--surface);
}
.person.on .nm { color: var(--accent); font-weight: 700; }

/* ---------- Accesso social ---------- */
.social-col { display: flex; flex-direction: column; gap: 10px; margin-bottom: 18px; }
.btn.social { font-size: 15.5px; font-weight: 600; gap: 10px; }
.btn.social.apple { background: #000; color: #fff; }
.btn.social.google { background: var(--surface); color: #1F1F1F; border: 1px solid rgba(60,60,67,0.18); }
.or {
  display: flex; align-items: center; gap: 12px; color: var(--faint);
  font-size: 12.5px; font-weight: 600; margin: 4px 0 16px;
}
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--border); }

.waiting-badge {
  width: 84px; height: 84px; border-radius: 50%; background: var(--accent-soft);
  display: grid; place-items: center; margin: 0 auto 16px; font-size: 36px;
  animation: waitPulse 2.6s ease-in-out infinite;
}
@keyframes waitPulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(214, 7, 7, 0.18); }
  50% { transform: scale(1.04); box-shadow: 0 0 0 14px rgba(214, 7, 7, 0); }
}

/* Splash */
#splash {
  position: fixed; inset: 0; z-index: 200; background: var(--surface);
  display: grid; place-items: center; transition: opacity 0.35s;
}
#splash img { width: 150px; animation: splashIn 0.7s cubic-bezier(0.22, 1, 0.36, 1); }
@keyframes splashIn { from { opacity: 0; transform: translateY(14px) scale(0.96); } to { opacity: 1; transform: none; } }
#splash.out { opacity: 0; pointer-events: none; }
