/* ==========================================================================
   Stili condivisi delle viste + landing/login.
   Le viste con molti stili propri hanno un file in styles/views/<nome>.css.
   ========================================================================== */

.link { color: var(--accent); font-weight: 560; text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.md p { line-height: 1.6; }
.md-list { list-style: disc; padding-left: 20px; margin-top: 8px; }
.md-list li { margin-top: 4px; }

.year-btn { min-height: 38px; padding: 0 14px; font-size: 0.875rem; }
.year-btn svg:last-child { width: 14px; height: 14px; opacity: 0.6; }

.more-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.more-tile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 92px; padding: 12px 6px; border-radius: var(--r-lg); background: var(--fill); text-align: center; }
.more-tile .title-3 { font-size: 0.86rem; font-weight: 600; }
.more-tile:active { background: var(--fill-2); }

/* Statistiche (numeri grandi) */
.stat { display: flex; flex-direction: column; gap: 4px; }
.stat-num { font-family: var(--font-display); font-size: clamp(1.8rem, 1.4rem + 1.4vw, 2.4rem); font-weight: 700; letter-spacing: -0.035em; line-height: 1; font-variant-numeric: tabular-nums; }
.stat-label { font-size: 0.8125rem; color: var(--text-2); }
.stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(92px, 1fr)); gap: 10px; }
.stats-row.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stats-row .stat { padding: 14px; border-radius: var(--r-md); background: var(--fill); min-width: 0; }

/* Barre orizzontali */
.bar { height: 8px; border-radius: 4px; background: var(--fill-2); overflow: hidden; }
.bar > span { display: block; height: 100%; border-radius: inherit; background: var(--accent); transform-origin: left; }

/* Tile di sezione cliccabile */
.tile-link { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--accent); font-weight: 600; font-size: 0.9rem; }
.tile-link svg { width: 16px; height: 16px; }

/* Ricerca */
.search { position: relative; }
.search svg { position: absolute; left: 14px; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.search .field { padding-left: 42px; min-height: 44px; border-radius: var(--r-pill); }

/* ===================== LOGIN / LANDING ===================== */
body.is-login { background: var(--bg); }
.login-brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; letter-spacing: -0.02em; }
.login-brand .logo-img { height: 30px; width: auto; }

/* --- app (Capacitor) --- */
.login-app {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: calc(var(--safe-top) + 12vh) 24px calc(var(--safe-bottom) + 28px);
  text-align: center;
}
.login-app-hero { display: flex; flex-direction: column; align-items: center; gap: 18px; }
.login-app-hero .large-title { font-size: clamp(2.3rem, 9vw, 3rem); }
.login-app-hero { position: relative; }
.login-app-hero::before { content: ""; position: absolute; z-index: -1; top: -60px; left: 50%; width: 340px; height: 340px; transform: translateX(-50%); border-radius: 50%; background: radial-gradient(closest-side, var(--aurora-1), transparent); pointer-events: none; }
.app-icon { width: 112px; height: 112px; border-radius: 26px; box-shadow: 0 16px 40px -14px rgb(255 30 40 / 0.55); }
@keyframes icon-in { from { opacity: 0; transform: scale(0.88); } }
.login-app-hero > * { animation: rise 600ms var(--ease-out) both; }
.login-app-hero > .app-icon { animation: icon-in 700ms var(--ease-out) both; }
.login-app-hero > :nth-child(2) { animation-delay: 80ms; }
.login-app-hero > :nth-child(3) { animation-delay: 160ms; }
.login-app-actions { display: flex; flex-direction: column; gap: 12px; animation: rise 600ms 240ms var(--ease-out) both; }
.spid-btn svg { width: 22px; height: 22px; }

/* --- web --- */
.landing { overflow-x: clip; }
.landing-nav {
  position: fixed;
  z-index: 40;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: min(1120px, calc(100% - 24px));
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px 0 18px;
  border-radius: 20px;
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  transition: background-color var(--dur-base) ease, box-shadow var(--dur-base) ease, border-color var(--dur-base) ease;
}
.landing-nav::before { opacity: 0; transition: opacity var(--dur-base) ease; }
.landing-nav.is-scrolled {
  background: var(--glass-bg);
  border-color: var(--glass-border);
  box-shadow: inset 0 1px 0 var(--glass-hi), var(--glass-shadow);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
}
.landing-nav.is-scrolled::before { opacity: 0.7; }
.landing-nav .btn { min-height: 38px; }

/* Hero: intro compatta in alto, sotto il riquadro di accesso largo (QR + passaggi ben leggibili). */
.hero {
  width: min(1120px, calc(100% - 2 * var(--gutter)));
  margin: 0 auto;
  padding: 92px 0 64px;
  display: grid;
  gap: 22px;
}
.hero-kicker { color: var(--accent); }
.hero-title {
  margin-top: 16px;
  font-family: var(--font-display);
  font-size: clamp(2rem, 1.3rem + 2.4vw, 3.2rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.04;
}
.hero-sub { margin-top: 10px; max-width: 60ch; font-size: clamp(1rem, 0.96rem + 0.2vw, 1.12rem); line-height: 1.5; color: var(--text-2); }
.hero-badges { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 26px; }
.hero-badges .chip { min-height: 32px; padding: 0 12px; font-size: 0.82rem; }
.hero-badges .chip svg { width: 15px; height: 15px; }
/* Entrata dell'hero: una sola volta, in sequenza; il titolo si "materializza". */
.hero-copy > * { animation: hero-in 900ms var(--ease-out) both; }
.hero-copy > :nth-child(2) { animation-delay: 70ms; }
.hero-copy > :nth-child(3) { animation-delay: 140ms; }

.hero-login { animation: card-in 900ms 180ms var(--ease-out) both; }
@keyframes hero-in { from { opacity: 0; transform: translateY(18px); } }
@keyframes card-in { from { opacity: 0; transform: translateY(24px) scale(0.97); } }
/* "Accedi" dalla barra in alto: il riquadro di accesso pulsa una volta (anello che si espande e svanisce). */
.pair-card { position: relative; }
.pair-card::after {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  box-shadow: 0 0 0 3px var(--accent);
  opacity: 0;
  pointer-events: none;
}
.pair-card.is-attention { animation: pair-nudge 520ms cubic-bezier(0.23, 1, 0.32, 1); }
.pair-card.is-attention::after { animation: pair-ring 900ms cubic-bezier(0.23, 1, 0.32, 1); }
@keyframes pair-nudge { 40% { transform: scale(1.015); } }
@keyframes pair-ring { 0% { opacity: 0.9; transform: scale(1); } 100% { opacity: 0; transform: scale(1.06); } }

.pair-card { border-radius: 32px; padding: clamp(20px, 0.9rem + 1.3vw, 32px); display: flex; flex-direction: column; gap: 18px; }
.pair-head { display: flex; align-items: center; gap: 18px; }
.pair-app-icon { flex: none; width: 72px; height: 72px; border-radius: 17px; box-shadow: 0 8px 22px -10px rgb(255 30 40 / 0.5); }
.pair-kicker { color: var(--accent); }
.pair-title {
  margin-top: 4px;
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 1.1rem + 1.7vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.08;
}
.pair-brand { color: var(--accent); }
.pair-warn {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 18px;
  background: color-mix(in srgb, var(--ok) 14%, transparent);
  color: var(--text);
  font-size: clamp(0.98rem, 0.92rem + 0.25vw, 1.12rem);
  line-height: 1.45;
}
.pair-warn svg { flex: none; width: 22px; height: 22px; margin-top: 1px; color: var(--ok); }
.pair-warn strong { font-weight: 650; }
.pair-main { display: grid; grid-template-columns: auto 1fr; gap: 28px; align-items: center; }
.pair-body { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 18px; border-radius: 24px; background: var(--fill); text-align: center; }
.pair-qr { flex: none; width: 200px; height: 200px; padding: 14px; border-radius: 20px; background: #fff; transition: opacity var(--dur-base) ease, filter var(--dur-base) ease; }
.pair-qr svg { width: 100%; height: 100%; }
.pair-qr svg path, .pair-qr svg rect[fill="black"] { fill: #070b12; }
.pair-code-wrap { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; }
.pair-code { font-family: var(--font-mono); font-size: 1.7rem; font-weight: 600; letter-spacing: 0.06em; white-space: nowrap; transition: opacity var(--dur-base) ease; }
.pair-card.is-expired .pair-qr, .pair-card.is-expired .pair-code { opacity: 0.25; filter: blur(2px); }
.pair-card.is-approved .pair-body { outline: 2px solid var(--good); outline-offset: -2px; }
.pair-steps { display: grid; gap: 16px; }
.pair-steps li { display: flex; align-items: flex-start; gap: 16px; font-size: clamp(1.05rem, 0.95rem + 0.45vw, 1.3rem); line-height: 1.4; color: var(--text-2); }
.pair-steps li p { padding-top: 4px; }
.pair-steps li strong { color: var(--text); font-weight: 650; }
.pair-steps li em { font-style: normal; color: var(--text-3); }
.pair-steps li span { flex: none; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink, #fff); font-size: 1.05rem; font-weight: 700; }
.pair-status { min-height: 18px; text-align: center; }
.dev-session summary { cursor: pointer; }

/* --- racconto a scorrimento (telefono fisso + paragrafi) --- */
.story {
  width: min(1120px, calc(100% - 2 * var(--gutter)));
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  padding: 40px 0 80px;
}
.story-phone-wrap { position: sticky; top: calc(50vh - 310px); height: 620px; display: grid; place-items: center; }

/* iPhone finto. Misure da 15 Pro in scala: cornice in titanio (gradiente), bordo nero, schermo che
   ritaglia con clip-path (più affidabile di overflow+radius quando i figli hanno transform). */
.iphone {
  --w: 296px;
  --h: 606px;
  position: relative;
  width: var(--w);
  height: var(--h);
  flex: none;
}
.iphone-body {
  position: absolute;
  inset: 0;
  border-radius: 54px;
  padding: 4px;
  background: linear-gradient(140deg, #d6d6db 0%, #8d8d93 18%, #f4f4f7 38%, #6d6d72 62%, #bfbfc5 82%, #7a7a80 100%);
  box-shadow:
    inset 0 0 0 1px rgb(255 255 255 / 0.35),
    0 1px 1px rgb(0 0 0 / 0.2),
    0 40px 70px -28px rgb(0 0 0 / 0.55),
    0 18px 30px -18px rgb(0 0 0 / 0.35);
}
:root[data-theme="dark"] .iphone-body,
:root:not([data-theme="light"]) .iphone-body {
  background: linear-gradient(140deg, #5c5c62 0%, #2c2c2f 20%, #77777d 40%, #252527 64%, #545459 84%, #2a2a2d 100%);
}
:root[data-theme="light"] .iphone-body {
  background: linear-gradient(140deg, #d6d6db 0%, #8d8d93 18%, #f4f4f7 38%, #6d6d72 62%, #bfbfc5 82%, #7a7a80 100%);
}
/* bordo nero tra cornice e display */
.iphone-body::before {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 50px;
  background: #050505;
}
.iphone-screen {
  position: absolute;
  inset: 11px;
  border-radius: 43px;
  clip-path: inset(0 round 43px);
  overflow: hidden;
  isolation: isolate;
  background: var(--bg);
  color: var(--text);
}
/* riflesso del vetro, sopra tutto */
.iphone-screen::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 10;
  background: linear-gradient(125deg, rgb(255 255 255 / 0.09) 0%, rgb(255 255 255 / 0.03) 30%, transparent 46%);
  pointer-events: none;
}
.iphone-key {
  position: absolute;
  width: 4px;
  border-radius: 2px;
  background: linear-gradient(90deg, #6d6d72, #c7c7cc 60%, #8e8e93);
}
.iphone-key.k-action { left: -2px; top: 112px; height: 26px; }
.iphone-key.k-up { left: -2px; top: 160px; height: 48px; }
.iphone-key.k-down { left: -2px; top: 220px; height: 48px; }
.iphone-key.k-side { right: -2px; top: 178px; height: 78px; }

.iphone-status {
  position: absolute;
  z-index: 5;
  inset: 0 0 auto;
  height: 50px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 20px 0 28px;
  font-size: 0.8rem;
  font-weight: 650;
  letter-spacing: -0.01em;
  background: linear-gradient(var(--bg) 55%, transparent);
}
.iphone-time { font-variant-numeric: tabular-nums; }
.iphone-island { width: 84px; height: 25px; border-radius: 14px; background: #000; }
.iphone-icons { display: flex; justify-content: flex-end; align-items: center; gap: 4px; }
.iphone-icons svg { fill: currentColor; }

.phone-screen {
  position: absolute;
  inset: 0;
  padding: 58px 14px 96px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  opacity: 0;
  transform: translateY(14px) scale(0.985);
  transition: opacity 360ms ease, transform 520ms cubic-bezier(0.23, 1, 0.32, 1);
  will-change: transform, opacity;
  pointer-events: none;
}
.phone-screen.is-active { opacity: 1; transform: none; transition-delay: 60ms; }
/* le righe entrano in cascata quando la schermata diventa attiva */
.phone-screen > * { opacity: 0; transform: translateY(10px); transition: opacity 300ms ease, transform 480ms cubic-bezier(0.23, 1, 0.32, 1); }
.phone-screen.is-active > * { opacity: 1; transform: none; }
.phone-screen.is-active > :nth-child(2) { transition-delay: 40ms; }
.phone-screen.is-active > :nth-child(3) { transition-delay: 80ms; }
.phone-screen.is-active > :nth-child(4) { transition-delay: 120ms; }
.phone-screen.is-active > :nth-child(5) { transition-delay: 160ms; }
.phone-screen.is-active > :nth-child(6) { transition-delay: 200ms; }
.phone-screen.is-active > :nth-child(n + 7) { transition-delay: 240ms; }

.iphone-tabs {
  position: absolute;
  z-index: 5;
  left: 12px;
  right: 12px;
  bottom: 24px;
  height: 58px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 5px;
  border-radius: 29px;
  background: color-mix(in srgb, var(--bg-elev) 78%, transparent);
  -webkit-backdrop-filter: blur(18px) saturate(1.6);
  backdrop-filter: blur(18px) saturate(1.6);
  box-shadow: inset 0 0 0 0.5px var(--hairline), 0 8px 24px -12px rgb(0 0 0 / 0.4);
}
.iphone-tab-pill {
  position: absolute;
  top: 5px;
  bottom: 5px;
  left: 5px;
  width: calc((100% - 10px) / 4);
  border-radius: 24px;
  background: var(--fill-2);
  transform: translateX(calc(var(--tab, 0) * 100%));
  transition: transform 520ms cubic-bezier(0.32, 0.72, 0, 1);
}
.iphone-tab {
  position: relative;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 2px;
  color: var(--text-2);
  transition: color 300ms ease;
}
.iphone-tab svg { width: 20px; height: 20px; }
.iphone-tab small { font-size: 0.56rem; font-weight: 600; }
.iphone-tab.is-on { color: var(--accent); }
.iphone-home {
  position: absolute;
  z-index: 6;
  left: 50%;
  bottom: 8px;
  width: 104px;
  height: 4px;
  margin-left: -52px;
  border-radius: 2px;
  background: var(--text);
  opacity: 0.85;
}
.phone-screen .mock-row { padding-block: 9px; }
.mock-title { font-family: var(--font-display); font-size: 1.6rem; font-weight: 700; letter-spacing: -0.03em; margin-bottom: 4px; }
.mock-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 16px; background: var(--fill); }
.mock-row b { display: block; font-size: 0.82rem; font-weight: 600; }
.mock-row small { display: block; font-size: 0.7rem; color: var(--text-2); }
.mock-hero { display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: 20px; background: var(--accent-soft); }
.mock-hero b { display: block; font-size: 0.9rem; }
.mock-hero small { font-size: 0.72rem; color: var(--text-2); }
.mock-ring { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--great) 0 76%, var(--fill-2) 76% 100%); }
.mock-ring span { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: var(--bg); font-weight: 700; font-size: 0.9rem; }
.mock-days { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.mock-days span { display: grid; place-items: center; padding: 8px 0; border-radius: 14px; background: var(--fill); font-size: 0.7rem; color: var(--text-2); }
.mock-days span b { font-size: 0.95rem; color: var(--text); }
.mock-days span.on { background: var(--accent); color: var(--accent-ink); }
.mock-days span.on b { color: var(--accent-ink); }
.mock-time { font-size: 0.7rem; color: var(--text-2); width: 34px; font-variant-numeric: tabular-nums; }
.mock-bar { width: 3px; align-self: stretch; border-radius: 2px; background: var(--accent); }
.mock-bar.bad { background: var(--bad); }
.mock-bar.ok { background: var(--ok); }
.mock-row .dot.off { background: transparent; }
.mock-grid { display: grid; grid-template-columns: 16px repeat(5, 1fr); gap: 5px; font-size: 0.62rem; }
.mock-grid i { font-style: normal; color: var(--text-3); display: grid; place-items: center; }
.mock-grid span { display: grid; place-items: center; height: 44px; border-radius: 10px; font-weight: 700; }
.mock-grid .c0 { background: rgb(63 214 198 / 0.18); color: var(--great); }
.mock-grid .c1 { background: rgb(107 156 255 / 0.18); color: var(--blue); }
.mock-grid .c2 { background: rgb(167 139 250 / 0.18); color: var(--violet); }
.mock-grid .c3 { background: rgb(251 191 36 / 0.16); color: var(--ok); }
.mock-grid .c4 { background: rgb(251 113 133 / 0.16); color: var(--bad); }
.mock-grid .now { outline: 2px solid var(--accent); outline-offset: 1px; }

.story-steps { display: flex; flex-direction: column; }
.story-step { min-height: 80vh; display: flex; flex-direction: column; justify-content: center; gap: 14px; opacity: 0.28; transition: opacity 500ms var(--ease-out); }
.story-step.is-active { opacity: 1; }
.story-step .overline { color: var(--accent); }
.story-title { font-family: var(--font-display); font-size: clamp(2rem, 1.3rem + 2.4vw, 3.3rem); font-weight: 700; letter-spacing: -0.035em; line-height: 1.04; }
.story-step .body-2 { font-size: 1.1rem; max-width: 40ch; }

.features, .how { width: min(1120px, calc(100% - 2 * var(--gutter))); margin: 0 auto; padding: 80px 0; }
.section-title { font-family: var(--font-display); font-size: clamp(2.2rem, 1.4rem + 3vw, 4rem); font-weight: 700; letter-spacing: -0.04em; line-height: 1.02; margin-bottom: 40px; }
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.feature { padding: 26px; display: flex; flex-direction: column; gap: 10px; }
.feature .row-icon { width: 44px; height: 44px; border-radius: 14px; margin-bottom: 6px; }
.feature .row-icon svg { width: 22px; height: 22px; }
.how-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.landing-foot { width: min(1120px, calc(100% - 2 * var(--gutter))); margin: 0 auto; padding: 32px 0 48px; border-top: 1px solid var(--hairline); display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; color: var(--text-3); font-size: 0.82rem; }

/* Rivelazioni legate allo scroll (solo landing). */
.reveal { transition: opacity 700ms var(--ease-out), transform 700ms var(--ease-out); }
:root:not(.has-scroll-timeline) .reveal:not(.is-in) { opacity: 0; transform: translateY(28px); }
@supports (animation-timeline: view()) {
  .has-scroll-timeline .reveal { transition: none; animation: reveal-scroll linear both; animation-timeline: view(); animation-range: entry 0% cover 28%; }
  @keyframes reveal-scroll { from { opacity: 0; transform: translateY(40px) scale(0.98); } }
  /* L'hero si allontana mentre scorri via. */
  .hero-copy { animation: hero-away linear both; animation-timeline: scroll(root); animation-range: 0 90vh; }
  @keyframes hero-away { to { opacity: 0.15; transform: translateY(-60px) scale(0.96); } }
}

@media (max-width: 960px) {
  .hero { gap: 22px; padding-top: 96px; }
  .pair-main { grid-template-columns: 1fr; gap: 22px; }
  .pair-body { flex-direction: row; text-align: left; justify-content: center; }
  .pair-code-wrap { align-items: flex-start; }
  .story { grid-template-columns: 1fr; gap: 20px; padding-top: 24px; width: 100%; }
  .story-phone-wrap { position: relative; top: auto; height: calc(606px * 0.77); display: flex; justify-content: center; align-items: flex-start; }
  .iphone { transform: scale(0.77); transform-origin: 50% 0; }
  .story-steps {
    flex-direction: row;
    gap: 12px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    padding: 4px var(--gutter) 12px;
    scroll-padding-inline: var(--gutter);
    overscroll-behavior-x: contain;
  }
  .story-steps::-webkit-scrollbar { display: none; }
  .story-step {
    flex: 0 0 min(86%, 420px);
    min-height: 0;
    justify-content: flex-start;
    gap: 8px;
    padding: 20px;
    border-radius: 24px;
    background: var(--bg-elev);
    box-shadow: inset 0 0 0 0.5px var(--hairline);
    scroll-snap-align: center;
    opacity: 0.5;
    transform: scale(0.97);
    transition: opacity 400ms var(--ease-out), transform 500ms var(--ease-out);
  }
  .story-step.is-active { opacity: 1; transform: none; }
  .story-title { font-size: 1.6rem; }
  .story-step .body-2 { font-size: 1rem; }
  .feature-grid, .how-grid { grid-template-columns: 1fr; }
}
@media (max-width: 719px) {
  .pair-body { flex-direction: column; text-align: center; }
  .pair-code-wrap { align-items: center; }
  .pair-qr { width: 184px; height: 184px; }
  .pair-head { align-items: flex-start; gap: 14px; }
  .pair-app-icon { width: 48px; height: 48px; border-radius: 12px; }
  .hero-title { font-size: clamp(1.9rem, 8vw, 2.4rem); }
}
@media (prefers-reduced-motion: reduce) {
  .hero-copy, .has-scroll-timeline .reveal { animation: none !important; }
  .phone-screen, .phone-screen > *, .story-step { transform: none !important; }
  .iphone-tab-pill { transition: none; }
}

/* ===================== OGGI ===================== */
.clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.home-grid { display: grid; gap: 16px; grid-template-columns: repeat(12, 1fr); grid-auto-flow: dense; }
.home-grid > div { min-width: 0; grid-column: span 12; }
.home-grid > div > div, .home-grid > div > div > .card { height: 100%; }
.home-card { display: flex; flex-direction: column; gap: 6px; }
a.home-card { color: inherit; }
.home-card .chev { width: 16px; height: 16px; color: var(--text-3); }
.home-avg-body { display: flex; align-items: center; gap: 22px; margin-top: 14px; }
@media (min-width: 720px) {
  .home-avg, .home-today { grid-column: span 6 !important; }
  .home-next, .home-grades { grid-column: span 6 !important; }
  .home-board, .home-abs { grid-column: span 6 !important; }
}
@media (min-width: 1200px) {
  .home-avg { grid-column: span 4 !important; }
  .home-today { grid-column: span 4 !important; }
  .home-next { grid-column: span 4 !important; }
  .home-grades { grid-column: span 5 !important; }
  .home-board { grid-column: span 4 !important; }
  .home-abs { grid-column: span 3 !important; }
}
.timeline { margin-top: 10px; display: grid; }
.timeline li { position: relative; display: flex; gap: 14px; padding: 10px 0; }
.timeline li + li { border-top: 1px solid var(--hairline); }
.tl-hour { flex: none; width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; background: var(--fill); font-size: 0.8rem; font-weight: 700; color: var(--text-2); }
.agenda-mini { margin-top: 10px; display: grid; }
.agenda-mini li { display: flex; gap: 14px; padding: 10px 0; }
.agenda-mini li + li { border-top: 1px solid var(--hairline); }
.agenda-mini-day { flex: none; width: 74px; display: flex; flex-direction: column; font-weight: 650; font-size: 0.86rem; }
.agenda-mini-day small { color: var(--text-3); font-weight: 500; }
.agenda-mini li.is-hw .agenda-mini-day span { color: var(--accent); }
.agenda-mini li.is-note .agenda-mini-day span { color: var(--ok); }
.home-grade-list { margin-top: 10px; display: grid; }
.home-grade { display: flex; align-items: center; gap: 14px; padding: 8px 0; width: 100%; text-align: left; border-radius: 14px; }
@media (hover: hover) and (pointer: fine) { .home-grade:hover .row-title { color: var(--accent); } }
.home-grade .row-title { transition: color var(--dur-fast) ease; }
.home-grade-list li + li { border-top: 1px solid var(--hairline); }
.board-mini { display: flex; align-items: flex-start; gap: 12px; padding: 10px 12px; border-radius: var(--r-md); background: var(--fill); }
.board-mini .dot { margin-top: 7px; }

/* ===================== VOTI ===================== */
.voti-toolbar { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.voti-toolbar .segmented { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.voti-summary { display: grid; grid-template-columns: auto 1fr; gap: 28px; align-items: center; padding: 24px; }
@media (max-width: 640px) { .voti-summary { grid-template-columns: 1fr; justify-items: center; text-align: center; gap: 18px; } .voti-summary-info { width: 100%; } }
.trend { margin-top: 16px; }
.spark { width: 100%; height: 64px; margin-top: 6px; overflow: visible; }
.spark-line { fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.spark-six { stroke: var(--hairline-strong); stroke-dasharray: 3 4; vector-effect: non-scaling-stroke; }
.subject-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.subject-card { display: flex; flex-direction: column; gap: 14px; padding: 18px; text-align: left; transition: transform var(--dur-press) var(--ease-out), background-color var(--dur-fast) ease; }
@media (hover: hover) and (pointer: fine) { .subject-card:hover { background: var(--card-hover); } }
.subject-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.subject-hero { display: flex; align-items: center; gap: 20px; margin-bottom: 16px; }
.tool { margin-top: 12px; display: flex; flex-direction: column; gap: 12px; }
.tool .title-3 { display: flex; align-items: center; gap: 8px; }
.tool .title-3 svg { width: 18px; height: 18px; color: var(--accent); }
.stepper-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stepper { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 4px; border-radius: var(--r-pill); background: var(--fill); }
.stepper .btn-icon { min-height: 36px; width: 36px; }
.stepper-val { font-weight: 650; }
.need { font-size: 1.05rem; }
.need strong { color: var(--accent); font-size: 1.35rem; font-variant-numeric: tabular-nums; }
.need strong.bad { color: var(--bad); font-size: 1.05rem; }
.sim-keys, .sim-list { display: flex; flex-wrap: wrap; gap: 6px; }
.sim-keys .grade { min-width: 42px; height: 36px; }

/* ===================== PERSONALIZZA ===================== */
.cz-preview { display: grid; gap: 16px; background: linear-gradient(160deg, var(--accent-soft), transparent 60%), var(--card); }
.cz-preview-top { display: flex; align-items: center; gap: 12px; }
.cz-preview-top img { width: 44px; height: 44px; }
.cz-preview-top > div { flex: 1; }
.cz-preview-btn { pointer-events: none; }
.cz-grades { display: flex; gap: 10px; flex-wrap: wrap; padding: 6px 2px; }
.cz-tabs { display: grid; grid-template-columns: repeat(5, 1fr); padding: 6px; border-radius: 26px; background: var(--fill); }
.cz-tabs span { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0; border-radius: 20px; color: var(--text-2); }
.cz-tabs span.on { color: var(--accent); background: var(--fill-2); }
.cz-tabs svg { width: 20px; height: 20px; }
.cz-tabs small { font-size: 0.6rem; font-weight: 650; }
.cz-swatches { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.cz-swatch { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 4px; border-radius: var(--r-md); }
.cz-swatch[aria-checked="true"] { background: var(--fill); }
.cz-dot { width: 34px; height: 34px; border-radius: 50%; background: var(--sw); box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.15); position: relative; }
.cz-swatch[aria-checked="true"] .cz-dot::after { content: ""; position: absolute; inset: -5px; border-radius: 50%; border: 2px solid var(--sw); }
.cz-move { gap: 2px; }
.cz-move .btn-icon { width: 34px; min-height: 34px; }
.cz-move .btn-icon:disabled { opacity: 0.25; }
.cz-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.cz-chip { min-height: 38px; padding: 0 14px; font-size: 0.86rem; color: var(--text); }
.cz-chip svg { width: 16px; height: 16px; color: var(--accent); }
@media (max-width: 380px) { .cz-swatches { grid-template-columns: repeat(4, 1fr); gap: 4px; } }

/* Oggi → Presenze: solo numero e testo, senza riquadri (telefono e PC). */
.home-abs-stats .stat { padding: 0; background: none; border-radius: 0; }
.home-abs-stats .stat-num { font-size: clamp(2rem, 1.5rem + 1.4vw, 2.6rem); }
