:root {
  --bg: #f4f6fc;
  --surface: #ffffff;
  --fg: #1c2240;
  --muted: #535c7c;
  --line: #dde2f1;
  --primary: #3446c9;
  --primary-fg: #ffffff;
  --primary-soft: #e6e9fb;
  --hero-a: #3446c9;
  --hero-b: #232f93;
  --hero-fg: #ffffff;
  --hero-muted: #d7dcff;
  --sun: #ffc83d;
  --danger: #b3261e;
  --pending: #8a5a00;
  --pending-soft: #fdf0cf;
  --done: #1b6a39;
  --done-soft: #dcf3e3;
  --gold: #f2c14e;
  --silver: #c7cedc;
  --bronze: #de9a63;
  --on-medal: #2a2108;
  --gold-text: #7a5600;
  --silver-text: #4d5870;
  --bronze-text: #8a4a1c;
  --ad-bg: #eaedf8;
  --font-display: "Fredoka", "Nunito", system-ui, sans-serif;
  --font-body: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #11152b; --surface: #1a2040; --fg: #eaeefc; --muted: #a4aed0; --line: #2c3562;
    --primary: #93a2ff; --primary-fg: #0d1233; --primary-soft: #252d5a;
    --hero-a: #2b3aa8; --hero-b: #1a2373; --hero-fg: #ffffff; --hero-muted: #cdd3ff;
    --danger: #ff8f86; --pending: #f3c866; --pending-soft: #3b3014; --done: #85d6a0; --done-soft: #153224;
    --gold-text: #f3cf7a; --silver-text: #c3cce0; --bronze-text: #eeb184;
    --ad-bg: #1e2548;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #11152b; --surface: #1a2040; --fg: #eaeefc; --muted: #a4aed0; --line: #2c3562;
  --primary: #93a2ff; --primary-fg: #0d1233; --primary-soft: #252d5a;
  --hero-a: #2b3aa8; --hero-b: #1a2373; --hero-fg: #ffffff; --hero-muted: #cdd3ff;
  --danger: #ff8f86; --pending: #f3c866; --pending-soft: #3b3014; --done: #85d6a0; --done-soft: #153224;
  --gold-text: #f3cf7a; --silver-text: #c3cce0; --bronze-text: #eeb184;
  --ad-bg: #1e2548;
  color-scheme: dark;
}
* { box-sizing: border-box; }
body {
  background: var(--bg); color: var(--fg); font-family: var(--font-body); font-size: 17px; line-height: 1.55;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: 0 56px;
}
.wrap { max-width: 1000px; margin: 0 auto; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; margin: 0; text-wrap: balance; line-height: 1.2; letter-spacing: 0; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.15rem; }
p { margin: 0; }
a { color: var(--primary); }
:focus-visible { outline: 3px solid var(--primary); outline-offset: 3px; }
[hidden] { display: none !important; }

body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--bg); }
header.top {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 9; background: var(--bg);
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding-block: 14px;
}
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 600; font-size: 1.55rem; }
.brand-mark { width: 40px; height: 40px; border-radius: 12px; background: var(--hero-a); display: grid; place-items: center; flex: none; }
.brand-mark svg { display: block; }
.tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.tabs button {
  font: inherit; font-weight: 700; font-size: .95rem; border: 2px solid var(--line); background: var(--surface); color: var(--fg);
  min-height: 44px; padding: 8px 16px; border-radius: 99px; cursor: pointer;
}
.tabs button[aria-selected="true"] { background: var(--primary); border-color: var(--primary); color: var(--primary-fg); }

.demo-note { font-size: .92rem; color: var(--muted); margin-bottom: 14px; }

.hero {
  background: linear-gradient(135deg, var(--hero-a), var(--hero-b)); color: var(--hero-fg); border-radius: 24px;
  padding: 30px; display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 24px; align-items: center;
}
.hero h1 { font-size: clamp(1.8rem, 5.2vw, 2.7rem); }
.hero p { margin-top: 12px; color: var(--hero-muted); font-size: 1.08rem; max-width: 34em; }
.hero .row { margin-top: 20px; }
.hero .btn.ghost { color: var(--hero-fg); border-color: var(--hero-fg); }
.cats { margin-top: 22px; display: flex; flex-direction: column; gap: 12px; }
.cats h2 { font-size: 1.15rem; }
.catgroups { display: flex; flex-direction: column; gap: 14px; }
.catgroup { display: flex; flex-direction: column; gap: 8px; }
.catgroup h3 { font-size: .95rem; color: var(--muted); }
.catlist { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 0; padding: 0; }
.catlist li { margin: 0; }
.catlist button { background: var(--surface); color: inherit; font: inherit; cursor: pointer; border: 2px solid var(--line); border-radius: 99px; padding: 8px 16px; font-weight: 700; font-size: .92rem; min-height: 40px; }
.catlist button:hover, .catlist button:focus-visible { border-color: var(--primary); }
.podium { display: flex; align-items: flex-end; justify-content: center; gap: 8px; min-height: 170px; }
.podium div {
  flex: 1; max-width: 110px; border-radius: 14px 14px 4px 4px; display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
  padding-top: 10px; color: var(--on-medal); font-family: var(--font-display); font-weight: 600; line-height: 1.1;
}
.podium b { font-size: 1.7rem; font-weight: 600; }
.podium span { font-size: .85rem; }
.podium .p1 { background: var(--gold); height: 150px; }
.podium .p2 { background: var(--silver); height: 112px; }
.podium .p3 { background: var(--bronze); height: 84px; }

.panel { background: var(--surface); border: 2px solid var(--line); border-radius: 20px; padding: 22px; }
.grid2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
label { display: flex; flex-direction: column; gap: 6px; font-weight: 700; font-size: .98rem; }
input, select, textarea {
  font: inherit; font-weight: 400; color: var(--fg); background: var(--bg); border: 2px solid var(--line); border-radius: 12px;
  padding: 12px 14px; min-height: 48px; width: 100%; min-width: 0;
}
textarea { resize: vertical; min-height: 96px; }
.btn {
  font: inherit; font-family: var(--font-display); font-weight: 500; font-size: 1.05rem; border: 0; background: var(--primary); color: var(--primary-fg);
  min-height: 50px; padding: 12px 24px; border-radius: 99px; cursor: pointer;
}
.btn.light { background: var(--sun); color: #2a2108; }
.btn.ghost { background: transparent; color: var(--primary); border: 2px solid var(--primary); }
.btn.small { min-height: 42px; padding: 8px 18px; font-size: .95rem; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.err { color: var(--danger); font-weight: 700; font-size: .98rem; }
.ok { color: var(--done); font-weight: 700; font-size: .98rem; }
.hint { color: var(--muted); font-size: .95rem; }

.ad {
  background: var(--ad-bg); border: 2px dashed var(--line); border-radius: 16px; min-height: 96px;
  display: grid; place-items: center; text-align: center; padding: 14px; color: var(--muted); font-size: .9rem;
}
.ad strong { display: block; font-family: var(--font-display); font-weight: 500; color: var(--fg); font-size: .95rem; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 2px; }

.sec-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.badge { display: inline-block; font-size: .8rem; font-weight: 700; padding: 3px 11px; border-radius: 99px; white-space: nowrap; }
.badge.pending { background: var(--pending-soft); color: var(--pending); }
.badge.done { background: var(--done-soft); color: var(--done); }
.badge.example { background: var(--primary-soft); color: var(--primary); }

.req-list { display: flex; flex-direction: column; gap: 10px; list-style: none; margin: 0; padding: 0; }
.req {
  width: 100%; text-align: left; font: inherit; color: inherit; background: var(--surface); border: 2px solid var(--line);
  border-radius: 16px; padding: 14px 18px; cursor: pointer; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: start;
}
.req[aria-current="true"] { border-color: var(--primary); }
.req .t { font-weight: 700; overflow-wrap: anywhere; }
.req .m { color: var(--muted); font-size: .92rem; grid-column: 1 / -1; }
.empty { color: var(--muted); border: 2px dashed var(--line); border-radius: 16px; padding: 24px; text-align: center; }

.tiers { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; align-items: stretch; }
.tier { background: var(--surface); border: 2px solid var(--line); border-radius: 20px; padding: 18px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.tier .top-row { display: flex; align-items: center; gap: 12px; }
.medal { width: 46px; height: 46px; flex: none; border-radius: 50%; display: grid; place-items: center; font-family: var(--font-display); font-weight: 600; font-size: 1.15rem; color: var(--on-medal); }
.tier.good .medal { background: var(--bronze); }
.tier.better .medal { background: var(--silver); }
.tier.best .medal { background: var(--gold); }
.tier .label { font-family: var(--font-display); font-weight: 600; font-size: 1.2rem; }
.tier.good .label { color: var(--bronze-text); }
.tier.better .label { color: var(--silver-text); }
.tier.best .label { color: var(--gold-text); }
.tier.best { border-color: var(--gold); }
.tier .pick { font-size: .8rem; font-weight: 700; color: var(--gold-text); }
.tier .name { font-weight: 700; overflow-wrap: anywhere; }
.tier .price { font-family: var(--font-display); font-weight: 600; font-size: 1.9rem; font-variant-numeric: tabular-nums; }
.tier .why { color: var(--muted); overflow-wrap: anywhere; }
.tier .buy { margin-top: auto; text-decoration: none; text-align: center; font-weight: 700; padding: 12px 14px; border-radius: 99px; border: 2px solid var(--primary); color: var(--primary); }
.tier.best .buy { background: var(--primary); color: var(--primary-fg); }
.tier .aff { font-size: .8rem; color: var(--muted); text-align: center; }
.pnote { font-size: .88rem; font-weight: 700; }
.pnote.ok { color: var(--done); }
.pnote.est { color: var(--pending); }
.glink { font-size: .95rem; font-weight: 700; }
.chk { flex-direction: row; align-items: center; gap: 10px; font-weight: 600; }
.chk input { width: 22px; min-height: 22px; flex: none; }
.levels { border: 0; padding: 0; margin: 0; min-width: 0; }
.levels legend { font-weight: 700; font-size: .98rem; padding: 0; margin-bottom: 8px; }
.opts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.opt { flex-direction: row; align-items: flex-start; gap: 10px; border: 2px solid var(--line); border-radius: 14px; padding: 12px 14px; cursor: pointer; background: var(--bg); }
.opt input { width: 22px; min-height: 22px; flex: none; margin-top: 2px; }
.opt small { display: block; font-weight: 400; color: var(--muted); font-size: .85rem; }
.opt:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.lvlbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.chip { font: inherit; font-weight: 700; font-size: .92rem; min-height: 40px; padding: 6px 16px; border-radius: 99px; border: 2px solid var(--line); background: var(--surface); color: var(--fg); cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--primary); border-color: var(--primary); color: var(--primary-fg); }
.ctx { background: var(--primary-soft); border-radius: 14px; padding: 12px 16px; font-size: .95rem; overflow-wrap: anywhere; }
.more { font-size: .92rem; }
.more summary { cursor: pointer; font-weight: 700; color: var(--primary); min-height: 32px; }
.alt { margin-top: 8px; }
.alt p { color: var(--muted); overflow-wrap: anywhere; }
.avoid { background: var(--pending-soft); border-radius: 12px; padding: 10px 12px; font-size: .92rem; overflow-wrap: anywhere; }
.avoid b { color: var(--pending); }
a.btn { display: inline-flex; align-items: center; text-decoration: none; }
.tier-ask { border-top: 1px solid var(--line); margin-top: 14px; padding-top: 4px; }
.tier-ask summary { cursor: pointer; font-weight: 700; min-height: 44px; display: flex; align-items: center; }
.tier-ask .row { margin-top: 8px; }
.ask { background: var(--primary-soft); border-radius: 18px; padding: 18px 20px; display: flex; flex-direction: column; gap: 12px; }
.badge.declined { background: var(--bg); color: var(--danger); border: 1px solid var(--danger); }

.mgr { display: grid; grid-template-columns: minmax(0, 330px) minmax(0, 1fr); gap: 20px; align-items: start; }
.detail { display: flex; flex-direction: column; gap: 10px; margin-bottom: 18px; }
.detail dl { margin: 0; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 14px; }
.detail dt { color: var(--muted); font-size: .95rem; }
.detail dd { margin: 0; overflow-wrap: anywhere; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.tier-form { border: 2px solid var(--line); border-radius: 16px; padding: 16px; background: var(--bg); display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.tier-form legend { font-family: var(--font-display); font-weight: 600; padding: 0 8px; }
.ai-box { border: 2px dashed var(--primary); background: var(--primary-soft); border-radius: 16px; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.ai-box strong { font-family: var(--font-display); font-weight: 600; font-size: 1.1rem; }

.texts { display: flex; flex-direction: column; gap: 16px; }
.text-card { display: flex; flex-direction: column; gap: 10px; }
.text-card pre {
  margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; font-size: .98rem; background: var(--bg);
  border: 2px solid var(--line); border-radius: 14px; padding: 14px 16px;
}
.notice { background: var(--pending-soft); color: var(--pending); border-radius: 16px; padding: 14px 18px; font-weight: 600; }

footer.foot { margin-top: 28px; color: var(--muted); font-size: .88rem; border-top: 2px solid var(--line); padding-top: 16px; }

@media (max-width: 780px) {
  .hero { grid-template-columns: minmax(0, 1fr); padding: 24px; }
  .grid2, .tiers, .mgr, .opts { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }

/* ---- sito ---- */
.brand { text-decoration: none; color: var(--fg); }
.nav { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.nav a.navlink { font-weight: 700; text-decoration: none; padding: 8px 12px; border-radius: 99px; min-height: 44px; display: inline-flex; align-items: center; }
.nav a.navlink:hover { background: var(--primary-soft); }
.section { margin-top: 32px; }
.section > h2 { margin-bottom: 14px; }
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; list-style: none; margin: 0; padding: 0; }
.steps li { background: var(--surface); border: 2px solid var(--line); border-radius: 18px; padding: 18px; }
.steps b { font-family: var(--font-display); font-weight: 600; font-size: 1.1rem; display: block; margin-bottom: 6px; }
.auth { max-width: 520px; }
.auth-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.auth-tabs button { font: inherit; font-weight: 700; font-size: .95rem; border: 2px solid var(--line); background: var(--surface); color: var(--fg); min-height: 44px; padding: 8px 16px; border-radius: 99px; cursor: pointer; }
.auth-tabs button[aria-selected="true"] { background: var(--primary); border-color: var(--primary); color: var(--primary-fg); }
.prose { max-width: 68ch; display: flex; flex-direction: column; gap: 12px; }
.prose h1 { font-size: clamp(1.7rem, 4.5vw, 2.3rem); }
.prose h2 { font-size: 1.3rem; margin-top: 12px; }
.prose ul { margin: 0; padding-left: 1.2em; }
.draft { background: var(--pending-soft); color: var(--pending); border-radius: 14px; padding: 12px 16px; font-weight: 700; }
footer.foot a { color: inherit; }
footer.foot .links { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 8px; }
.userbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; font-size: .92rem; color: var(--muted); }
.faq details { background: var(--surface); border: 2px solid var(--line); border-radius: 16px; padding: 12px 16px; }
.faq details + details { margin-top: 10px; }
.faq summary { cursor: pointer; font-weight: 700; min-height: 32px; }
.faq p { margin-top: 8px; }
.paste { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .85rem; }
@media (max-width: 780px) { .steps { grid-template-columns: minmax(0, 1fr); } }
