/* ── TheLover.ai — design system: Apple-like, pulito, adulto ───────────────── */

:root {
  --bg: #ffffff;
  --bg-alt: #f5f5f7;
  --fg: #1d1d1f;
  --muted: #6e6e73;
  --accent: #c41e63;        /* rosso porpora amore */
  --accent-deep: #a8154f;
  --card: #ffffff;
  --line: #e3e3e8;
  --ok: #1d8a4e;
  /* type Apple: SF Pro via stack di sistema, niente serif */
  --serif: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", system-ui, sans-serif;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", system-ui, "Segoe UI", Roboto, sans-serif;
  /* iMessage — bolle inviate in rosso porpora */
  --imsg-in: #e9e9eb;
  --imsg-in-fg: #1d1d1f;
  --imsg-out-1: #e0457f;
  --imsg-out-2: #c01e63;
}

* { box-sizing: border-box; }
/* `hidden` deve nascondere anche elementi con display:flex (es. .chat, .app-composer):
   senza questo le regole di display vincono sullo stile UA di [hidden]. */
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font: 17px/1.6 var(--sans);
  background: var(--bg);
  color: var(--fg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── layout ── */
.wrap { max-width: 680px; margin: 0 auto; padding: 1.6rem 1.2rem 4rem; }
.wide { max-width: 980px; padding-top: 0; }

/* ── header / footer ── */
.site-header {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: .7rem max(1.2rem, calc(50% - 540px));
  background: rgba(255, 255, 255, .72);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid rgba(0, 0, 0, .07);
}
.brand {
  font-family: var(--serif);
  font-size: 1.3rem; font-weight: 600; letter-spacing: -.02em;
  color: var(--fg); text-decoration: none;
}
.brand em { color: var(--accent); font-style: normal; }
.brand-logo { height: 30px; width: auto; display: block; }
.gate .brand-logo { height: 38px; }
.site-nav a {
  color: var(--fg); text-decoration: none; font-size: .9rem; margin-left: 1.4rem; opacity: .82;
}
.site-nav a:hover { opacity: 1; color: var(--accent); }
.site-nav a.nav-login {
  opacity: 1; color: #fff; background: var(--accent);
  padding: .42rem 1.05rem; border-radius: 999px; font-weight: 600;
}
.site-nav a.nav-login:hover { background: var(--accent-deep); color: #fff; }

.site-footer {
  max-width: 980px; margin: 3rem auto 0; padding: 1.6rem 1.2rem 2.4rem;
  border-top: 1px solid var(--line);
  color: var(--muted); font-size: .82rem;
  display: flex; flex-wrap: wrap; gap: .4rem 1.4rem; justify-content: space-between;
}
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--accent); }

/* ── tipografia ── */
h1, h2, h3 { font-family: var(--serif); line-height: 1.07; letter-spacing: -.025em; font-weight: 700; }
h1 { font-size: clamp(2.6rem, 7vw, 4.2rem); margin: .4rem 0 1rem; }
h2 { font-size: clamp(1.9rem, 4vw, 2.6rem); margin: 0 0 .6rem; letter-spacing: -.022em; }
h3 { font-size: 1.18rem; margin: 1rem 0 .35rem; font-weight: 600; letter-spacing: -.01em; }
.lead { color: var(--muted); font-size: clamp(1.12rem, 2vw, 1.3rem); max-width: 34em; line-height: 1.5; }
.hint { color: var(--muted); font-size: .88rem; margin: .3rem 0 0; }
a { color: var(--accent); }

/* ── hero ── */
.hero { padding: 4.5rem 0 2rem; }
.hero-grid {
  display: grid; grid-template-columns: 1.05fr .95fr; gap: 2rem; align-items: center;
}
.hero-copy { max-width: 30em; }
.hero .lead { text-align: left; margin: 0; }
.hero .kicker {
  text-transform: uppercase; letter-spacing: .12em; font-size: .78rem;
  color: var(--accent); font-weight: 600;
}
.hero .actions { margin-top: 1.8rem; display: flex; gap: .7rem; flex-wrap: wrap; align-items: center; }
.hero-art { display: flex; justify-content: center; }

/* ── sezioni: centratura Apple-style + larghezza ── */
section { padding: 1.4rem 0; }
section > h2 { text-align: center; margin-top: 1.5rem; }
section > .lead { margin: 0 auto 1.6rem; text-align: center; }

/* ── sezioni landing ── */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.1rem; margin: 1.6rem 0; }
.step {
  background: var(--bg-alt); border: 1px solid transparent; border-radius: 22px;
  padding: 1.6rem 1.4rem;
}
.step .n {
  display: inline-grid; place-items: center;
  width: 2rem; height: 2rem; border-radius: 50%;
  background: var(--accent); color: #fff;
  font-weight: 600; font-size: .95rem;
  margin-bottom: .7rem;
}
.step p { margin: .2rem 0 0; color: var(--muted); font-size: .96rem; }

.rules { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin: 1.6rem 0; max-width: 820px; margin-inline: auto; }
.rule {
  display: flex; gap: .75rem; align-items: flex-start;
  background: var(--bg-alt); border-radius: 20px; padding: 1.3rem 1.4rem;
}
.rule .dot {
  flex: 0 0 auto; width: .55rem; height: .55rem; border-radius: 50%;
  background: var(--accent); margin-top: .55rem;
}
.rule p { margin: 0; font-size: 1rem; }
.rule p strong { display: block; margin-bottom: .15rem; }
.rule p span { color: var(--muted); font-size: .94rem; }

/* ── faq ── */
#faq { max-width: 720px; margin-inline: auto; }
details {
  border-bottom: 1px solid var(--line); padding: 1rem .2rem;
}
details summary {
  cursor: pointer; font-weight: 600; list-style: none;
  display: flex; justify-content: space-between; align-items: center;
}
details summary::after { content: "+"; color: var(--accent); font-size: 1.2rem; }
details[open] summary::after { content: "–"; }
details p { color: var(--muted); margin: .55rem 0 .2rem; }

/* ── card / form ── */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 1.6rem;
  margin: 1.1rem 0;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 18px 50px -28px rgba(0, 0, 0, .22);
}
#iscriviti { max-width: 460px; margin-inline: auto; }
#iscriviti .card { border-radius: 26px; }
fieldset { border: 1px solid var(--line); border-radius: 12px; margin: 1.1rem 0; padding: .9rem 1.05rem 1.05rem; }
legend { font-weight: 600; padding: 0 .45rem; font-family: var(--serif); font-size: 1.05rem; }
label { display: block; margin: .65rem 0; font-size: .98rem; }
label.check, label.radio { display: flex; gap: .55rem; align-items: flex-start; }
label.radio span { flex: 1; }
input[type=text], input[type=email], input[type=number], input[type=time], select, textarea {
  width: 100%;
  padding: .65rem .7rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  font: inherit;
  background: #fff;
  margin-top: .25rem;
}
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 1px;
}
input[type=range] { width: 100%; accent-color: var(--accent); }
input[type=checkbox], input[type=radio] { accent-color: var(--accent); margin-top: .3rem; }
.days { display: flex; flex-wrap: wrap; gap: .4rem 1rem; }

button, .cta {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  border: 0;
  border-radius: 999px;
  padding: .8rem 1.7rem;
  font: inherit;
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: -.01em;
  cursor: pointer;
  text-decoration: none;
  transition: background .2s ease, transform .08s ease, box-shadow .2s ease;
}
button:hover, .cta:hover { background: var(--accent-deep); }
button:active, .cta:active { transform: scale(.98); }
.cta.ghost { background: var(--bg-alt); color: var(--accent); }
.cta.ghost:hover { background: #ececf0; }

/* ── stati ── */
.alert {
  background: #fbeae6; border: 1px solid #e7b9aa; color: #8a2f1c;
  padding: .75rem .95rem; border-radius: 12px; margin-bottom: 1rem;
}
.ok { color: var(--ok); }
.summary, .diverge { padding-left: 1.1rem; }
.diverge li { color: var(--accent-deep); }

/* ── age gate ─────────────────────────────────────────────────────────────── */
.gate-body {
  min-height: 100dvh;
  background: radial-gradient(120% 90% at 50% -10%, #fdeef4 0%, #f5f5f7 45%, #fff 100%);
}
.gate {
  min-height: 100dvh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 1.4rem; padding: 2rem 1.2rem;
}
.gate .brand { font-size: 1.5rem; }
.gate-card {
  max-width: 440px; width: 100%; text-align: center;
  padding: 2.2rem 1.8rem;
}
.gate-card h1 { font-size: clamp(1.8rem, 5vw, 2.3rem); margin: .4rem 0 .6rem; }
.gate-card .lead { margin: 0 auto 1.4rem; font-size: 1.05rem; }
.gate-card .check { text-align: left; font-size: .96rem; margin: 0 0 1.2rem; }
.gate-badge {
  display: inline-grid; place-items: center;
  width: 3.2rem; height: 3.2rem; border-radius: 50%;
  background: var(--accent); color: #fff;
  font-weight: 700; font-size: 1.05rem; letter-spacing: -.01em;
  box-shadow: 0 10px 24px -10px var(--accent);
}
.gate-actions { display: flex; flex-direction: column; gap: .6rem; }
.gate-actions form { width: 100%; margin: 0; }
.gate-actions button { width: 100%; }
.gate-actions .ghost { width: 100%; }
.gate-card .hint { margin-top: 1.1rem; }
.gate-foot { color: var(--muted); font-size: .82rem; margin: 0; }
.gate-foot a { color: var(--muted); }

/* ── mockup iPhone + iMessage ─────────────────────────────────────────────── */
.phone {
  position: relative;
  width: 300px; max-width: 80vw;
  aspect-ratio: 300 / 620;
  background: #0a0a0c;
  border-radius: 46px;
  padding: 11px;
  box-shadow:
    0 2px 4px rgba(0, 0, 0, .3),
    0 30px 70px -30px rgba(0, 0, 0, .55),
    inset 0 0 0 2px #2a2a2e;
}
.phone-screen {
  position: relative;
  height: 100%;
  background: #fff;
  border-radius: 36px;
  overflow: hidden;
  display: flex; flex-direction: column;
}
.phone-notch {
  position: absolute; top: 9px; left: 50%; transform: translateX(-50%);
  width: 110px; height: 26px; background: #0a0a0c; border-radius: 14px; z-index: 4;
}
.imsg-bar {
  display: flex; flex-direction: column; align-items: center; gap: .25rem;
  padding: 2.4rem .5rem .55rem;
  background: rgba(245, 245, 247, .85);
  backdrop-filter: blur(12px);
  border-bottom: .5px solid rgba(0, 0, 0, .12);
}
.imsg-avatar {
  width: 42px; height: 42px; border-radius: 50%;
  background: linear-gradient(160deg, #e0457f, #a8154f);
  display: grid; place-items: center; font-size: 1.25rem;
}
.imsg-trio { display: flex; }
.imsg-avatar.sm {
  width: 30px; height: 30px; font-size: .9rem;
  border: 2px solid #f5f5f7;
}
.imsg-avatar.sm.a1 { background: linear-gradient(160deg, #f6a5c0, #d36a8e); }
.imsg-avatar.sm.a2 { background: linear-gradient(160deg, #8fb8e6, #5a7fb5); margin-left: -10px; }
.imsg-avatar.sm.a3 { background: linear-gradient(160deg, #e0457f, #a8154f); margin-left: -10px; }
.imsg-name { font-size: .8rem; font-weight: 600; color: #1d1d1f; letter-spacing: -.01em; }
.imsg-name span { color: var(--muted); font-weight: 400; }
.imsg-from {
  font-size: .6rem; font-weight: 600; color: #8a8a8e;
  margin: .3rem 0 1px .55rem; letter-spacing: -.01em;
}
.imsg-from + .imsg-bubble { margin-top: 0; }
.imsg-thread {
  flex: 1; overflow: hidden;
  display: flex; flex-direction: column; gap: 3px;
  padding: .8rem .7rem;
  background: #fff;
}
.imsg-day { text-align: center; font-size: .62rem; color: #8a8a8e; margin: .2rem 0 .5rem; font-weight: 600; }
.imsg-bubble {
  max-width: 78%; padding: .42rem .72rem;
  font-size: .82rem; line-height: 1.32; letter-spacing: -.01em;
  border-radius: 18px; position: relative;
}
.imsg-bubble.in {
  align-self: flex-start; background: var(--imsg-in); color: var(--imsg-in-fg);
  border-bottom-left-radius: 5px;
}
.imsg-bubble.out {
  align-self: flex-end; color: #fff;
  background: linear-gradient(160deg, var(--imsg-out-1), var(--imsg-out-2));
  border-bottom-right-radius: 5px;
}
.imsg-bubble + .imsg-bubble { margin-top: 1px; }
.imsg-gap { height: .5rem; }
.imsg-composer {
  display: flex; align-items: center; gap: .4rem;
  padding: .45rem .6rem calc(.45rem + 6px);
  border-top: .5px solid rgba(0, 0, 0, .1);
  background: #fff;
}
.imsg-composer .field {
  flex: 1; border: 1px solid #d8d8dd; border-radius: 999px;
  padding: .3rem .7rem; font-size: .74rem; color: #9a9a9f;
}
.imsg-composer .send {
  width: 26px; height: 26px; border-radius: 50%; flex: 0 0 auto;
  background: linear-gradient(160deg, var(--imsg-out-1), var(--imsg-out-2));
  display: grid; place-items: center; color: #fff; font-size: .8rem;
}

/* ── chat dev ── */
.chat { display: flex; flex-direction: column; gap: .5rem; margin: 1rem 0; }
.bubble {
  max-width: 80%;
  padding: .6rem .85rem;
  border-radius: 16px;
  white-space: pre-wrap;
  line-height: 1.45;
}
.bubble.user { align-self: flex-end; background: var(--accent); color: #fff; border-bottom-right-radius: 5px; }
.bubble.ai { align-self: flex-start; background: var(--card); border: 1px solid var(--line); border-bottom-left-radius: 5px; }
.chat-input { display: flex; gap: .5rem; position: sticky; bottom: 0; padding: .6rem 0; background: var(--bg); }
.chat-input input { flex: 1; margin-top: 0; }
/* Composer WhatsApp: box unica arrotondata con textarea + emoji DENTRO. */
.app-composer { position: relative; align-items: flex-end; }
.composer-field {
  flex: 1; display: flex; align-items: flex-end; gap: .25rem;
  background: #fff; border: 1px solid var(--line); border-radius: 22px;
  padding: .2rem .55rem .2rem .85rem;
}
.composer-field:focus-within { border-color: var(--accent); }
.composer-field textarea {
  flex: 1; margin: 0; border: 0; background: transparent; outline: none;
  resize: none; overflow-y: auto; border-radius: 0;
  padding: .5rem 0; line-height: 1.35; min-height: 1.4rem; max-height: 160px;
}
.composer-emoji {
  flex: 0 0 auto; background: none; border: 0; cursor: pointer;
  line-height: 0; padding: .25rem; align-self: flex-end;
  color: #b8bdc4; transition: color .15s ease;
}
.composer-emoji:hover { background: none; color: #9aa0a8; }
.composer-emoji:active { background: none; transform: none; }
.composer-emoji svg { display: block; }
.emoji-panel {
  position: absolute; left: 0; right: 0; bottom: calc(100% + .4rem);
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  box-shadow: 0 12px 40px -16px rgba(0, 0, 0, .3);
  padding: .5rem; max-height: 220px; overflow-y: auto;
  display: grid; grid-template-columns: repeat(8, 1fr); gap: .1rem;
}
.emoji-panel .emoji {
  background: none; border: 0; cursor: pointer; border-radius: 10px;
  font-size: 1.5rem; line-height: 1; padding: .35rem 0;
}
.emoji-panel .emoji:hover { background: var(--bg-alt); }

/* ── app PWA ── */
.app-body { display: flex; flex-direction: column; min-height: 100dvh; position: relative; }
/* Pattern di sfondo della chat: il logo, piccolo, in diagonale, molto tenue. */
.app-body::before {
  content: ""; position: fixed; inset: -25%;
  background: url('/static/group.png') repeat; background-size: 62px;
  transform: rotate(-18deg);
  opacity: .045; z-index: -1; pointer-events: none;
}
/* Nelle impostazioni lo sfondo è neutro (niente pattern). */
.app-body.in-settings::before { display: none; }
/* Header stile WhatsApp: foto del gruppo al centro (tap → impostazioni),
   freccia indietro a sinistra nelle impostazioni. */
.app-header {
  position: sticky; top: 0; z-index: 5;
  display: flex; justify-content: center; align-items: center;
  min-height: 56px; padding: .5rem 3rem;
  background: rgba(255, 255, 255, .82);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--line);
}
.head-center {
  display: flex; align-items: center; gap: .6rem;
  background: none; border: 0; padding: .2rem .4rem; cursor: pointer; color: var(--fg);
}
.head-center:hover, .head-center:active { background: none; transform: none; }
.head-avatar {
  width: 38px; height: 38px; border-radius: 50%; flex: 0 0 auto;
  background: #fff url('/static/group.png') center / 84% no-repeat;
  border: 1px solid var(--line);
}
.head-title { font-weight: 600; font-size: 1.05rem; letter-spacing: -.01em; }
.head-status { color: var(--muted); font-weight: 400; font-size: .82rem; margin-left: .35rem; }
.head-back {
  position: absolute; left: .4rem; top: 50%; transform: translateY(-50%);
  background: none; border: 0; cursor: pointer;
  color: var(--accent); font-size: 1.9rem; line-height: 1; padding: .1rem .6rem;
  transition: color .15s ease;
}
.head-back:hover { background: none; color: var(--accent-deep); }
.head-back:active { background: none; transform: translateY(-50%); }
.head-center-title { font-size: 1.1rem; }
.app-main { flex: 1; padding: 1rem 1rem 0; max-width: 680px; width: 100%; margin: 0 auto; }
.bubble.partner {
  align-self: flex-start; background: var(--bg-alt);
  border: 1px solid var(--line); border-bottom-left-radius: 5px;
}
.bubble-name {
  align-self: flex-start;
  font-size: .72rem; font-weight: 600; color: var(--muted);
  margin: .35rem 0 -.15rem .25rem;
}
/* Indicatore "sta scrivendo": tre puntini che pulsano. */
.bubble.typing { display: inline-flex; gap: .28rem; align-items: center; padding: .7rem .85rem; }
.bubble.typing span {
  width: .5rem; height: .5rem; border-radius: 50%;
  background: var(--muted); opacity: .45;
  animation: typing-bounce 1.2s infinite ease-in-out;
}
.bubble.typing span:nth-child(2) { animation-delay: .2s; }
.bubble.typing span:nth-child(3) { animation-delay: .4s; }
@keyframes typing-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: .35; }
  30% { transform: translateY(-3px); opacity: .85; }
}
.control-tools { display: flex; flex-wrap: wrap; gap: .5rem; margin: .8rem 0; }
/* ── pannello Impostazioni: liste raggruppate (stile iOS) ── */
/* ── Impostazioni — stile iOS, mobile-first ──────────────────────────────── */
.settings-panel { padding: .2rem 0 3rem; }
/* scorre dentro da destra quando si apre (stile WhatsApp) */
@keyframes settings-slide-in { from { transform: translateX(26px); opacity: .35; } to { transform: none; opacity: 1; } }
.settings-panel:not([hidden]) { animation: settings-slide-in .22s ease both; }

/* Hero: avatar grande + nome del gruppo modificabile */
.set-hero {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: .6rem 0 1.2rem;
}
.set-hero-avatar {
  width: 84px; height: 84px; border-radius: 50%; flex: 0 0 auto;
  background: #fff url('/static/group.png') center / 84% no-repeat;
  border: 1px solid var(--line); box-shadow: 0 10px 28px -14px rgba(0, 0, 0, .35);
}
.set-hero-field {
  display: inline-flex; align-items: center; gap: .4rem;
  margin-top: .95rem; cursor: text; max-width: 78vw;
}
.set-hero-name {
  border: 0; background: transparent; text-align: center;
  font: inherit; font-size: 1.35rem; font-weight: 700; letter-spacing: -.02em;
  color: var(--fg); padding: .05rem .1rem; min-width: 0; width: 100%;
}
.set-hero-name:focus { outline: none; }
.set-hero-edit { color: var(--muted); display: inline-flex; flex: 0 0 auto; }
.set-hero-edit svg { width: 15px; height: 15px; }
.set-hero-field:focus-within .set-hero-edit { color: var(--accent); }
.set-hero-sub { color: var(--muted); font-size: .9rem; margin: .25rem 0 0; }

/* Titoli di sezione */
.set-title {
  text-transform: uppercase; letter-spacing: .05em; font-size: .72rem;
  color: var(--muted); font-weight: 600; margin: 1.5rem .9rem .5rem;
}
/* Card raggruppata */
.set-card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 18px; overflow: hidden;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .03);
}
.set-card > * + * { border-top: 1px solid var(--line); }

/* Riga */
.set-row {
  display: flex; align-items: center; gap: .8rem;
  width: 100%; padding: .72rem .85rem; margin: 0;
  font: inherit; font-size: 1.02rem; font-weight: 400; letter-spacing: 0;
  color: var(--fg); background: transparent; border: 0;
  border-radius: 0; text-align: left;
}
.set-icon {
  flex: 0 0 auto; width: 30px; height: 30px; border-radius: 9px;
  display: inline-flex; align-items: center; justify-content: center; color: #fff;
}
.set-icon svg { width: 18px; height: 18px; }
.set-icon-tone { background: #5b8def; }
.set-icon-length { background: #34a36b; }
.set-icon-intensity { background: linear-gradient(135deg, #e0457f, #c01e63); }
.set-icon-bell { background: #f0922b; }
.set-icon-danger { background: #e0573f; }
.set-icon-pause { background: #8e8e93; }
.set-icon-play { background: #34a36b; }
.set-icon-stop { background: #c0341d; }
.set-label { flex: 1 1 auto; min-width: 0; }
.set-control { flex: 0 0 auto; display: inline-flex; align-items: center; gap: .5rem; margin-left: auto; }
.set-value { color: var(--muted); font-size: .92rem; flex: 0 0 auto; display: inline-flex; align-items: center; gap: .15rem; }
.set-chevron { color: #c2c2c7; font-size: 1.3rem; line-height: 1; flex: 0 0 auto; }
.set-row > .set-chevron { margin-left: auto; }

/* Righe tappabili (feedback uniforme, niente sfondo accento) */
.set-tap { cursor: pointer; transition: background .12s ease; }
.set-tap:hover { background: var(--bg-alt); }
.set-tap:active { background: #ececf0; transform: none; }
.set-row.danger .set-label { color: #c0341d; }
.set-row.danger.set-tap:hover { background: rgba(192, 52, 29, .06); }

/* Select inline custom (freccetta a destra) */
.set-select {
  appearance: none; -webkit-appearance: none;
  border: 0; background: transparent; cursor: pointer; margin: 0;
  font: inherit; font-size: .98rem; color: var(--muted);
  text-align: right; text-align-last: right;
  max-width: 46vw; padding: 0 1.05rem 0 0; border-radius: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23c2c2c7' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right center; background-size: 14px;
}
.set-select:focus { outline: none; color: var(--accent); }

/* Coinvolgimento: riga a colonna con slider */
.set-row-col { flex-direction: column; align-items: stretch; gap: .75rem; padding-bottom: .95rem; }
.set-row-head { display: flex; align-items: center; gap: .8rem; }
.set-range {
  -webkit-appearance: none; appearance: none; width: 100%; margin: 0;
  height: 5px; border-radius: 999px; background: var(--line); cursor: pointer;
}
.set-range::-webkit-slider-thumb {
  -webkit-appearance: none; width: 24px; height: 24px; border-radius: 50%;
  background: #fff; border: .5px solid rgba(0, 0, 0, .12);
  box-shadow: 0 2px 6px rgba(0, 0, 0, .25); cursor: pointer;
}
.set-range::-moz-range-thumb {
  width: 24px; height: 24px; border-radius: 50%; background: #fff;
  border: .5px solid rgba(0, 0, 0, .12); box-shadow: 0 2px 6px rgba(0, 0, 0, .25); cursor: pointer;
}
.set-range::-moz-range-track { height: 5px; border-radius: 999px; background: var(--line); }

/* Salvataggio: pulsante pieno larghezza */
.set-save { display: flex; flex-direction: column; align-items: center; gap: .55rem; margin: 1.1rem .9rem 0; }
.set-save-btn {
  width: 100%; display: block; background: var(--accent); color: #fff; border: 0;
  border-radius: 14px; padding: .85rem 1rem; font: inherit; font-size: 1rem; font-weight: 600;
  letter-spacing: -.01em; cursor: pointer; transition: background .15s ease, transform .1s ease;
}
.set-save-btn:hover { background: var(--accent-deep); }
.set-save-btn:active { transform: scale(.99); }
.set-save-btn:disabled { opacity: .55; }
.set-saved { color: var(--ok); font-weight: 600; font-size: .9rem; }

/* Pill "Attiva" + badge "Attive" (push) */
.set-pill {
  background: var(--accent); color: #fff; border: 0; border-radius: 999px;
  padding: .38rem .95rem; font: inherit; font-size: .88rem; font-weight: 600; cursor: pointer;
  transition: background .15s ease, transform .1s ease;
}
.set-pill:hover { background: var(--accent-deep); }
.set-pill:active { transform: scale(.97); }
.set-badge { color: var(--ok); font-weight: 600; font-size: .92rem; }

/* Note esplicative sotto le card */
.set-note {
  color: var(--muted); font-size: .82rem; line-height: 1.45;
  margin: .5rem .9rem 0; padding: 0;
}
.chip {
  background: var(--card); color: var(--fg);
  border: 1px solid var(--line); border-radius: 999px;
  padding: .45rem 1rem; font-size: .92rem; font-weight: 600;
}
.chip:hover { background: var(--bg-alt); }
.chip.danger { color: #8a2f1c; border-color: #e7b9aa; }
.app-composer {
  position: sticky; bottom: 0; z-index: 5;
  max-width: 680px; width: 100%; margin: 0 auto;
  padding: .6rem 1rem calc(.6rem + env(safe-area-inset-bottom));
  background: var(--bg); border-top: 1px solid var(--line);
}

/* ── responsive ── */
@media (max-width: 820px) {
  .hero { padding: 2.6rem 0 1rem; text-align: center; }
  .hero-grid { grid-template-columns: 1fr; gap: 2.4rem; }
  .hero-copy { max-width: 100%; margin-inline: auto; }
  .hero .lead { text-align: center; margin-inline: auto; }
  .hero .actions { justify-content: center; }
}
@media (max-width: 640px) {
  .steps { grid-template-columns: 1fr; }
  .rules { grid-template-columns: 1fr; }
  .site-nav a { margin-left: .9rem; }
}
