:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --fg: #16181c;
  --muted: #5b6270;
  --line: #e1e4ea;
  --blue: #0a84e8;
  --blue-soft: rgba(10, 132, 232, .10);
  --red: #d91f2c;
  --red-soft: rgba(217, 31, 44, .09);
  --hero: #0e1014;
  --hero-fg: #f2f4f7;
  --hero-muted: #a6adb9;
  --radius: 14px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1114;
    --surface: #171a1f;
    --fg: #e8eaed;
    --muted: #a3a9b3;
    --line: #2a2e35;
    --blue: #3aa6ff;
    --blue-soft: rgba(58, 166, 255, .12);
    --red: #ff4b57;
    --red-soft: rgba(255, 75, 87, .12);
    --hero: #08090b;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 17px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-text-size-adjust: 100%;
}
img { max-width: 100%; height: auto; }
a { color: var(--blue); overflow-wrap: anywhere; }
h1, h2, h3 { line-height: 1.2; }
h1 { font-size: clamp(1.9rem, 5vw, 2.9rem); margin: 0 0 .4em; letter-spacing: -.01em; }
h2 { font-size: 1.45rem; margin: 1.6em 0 .6em; }
h3 { font-size: 1.1rem; margin: 1.2em 0 .4em; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.center { text-align: center; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; }

/* intestazione */
.site-header {
  position: sticky; top: 0; z-index: 5;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.header-row { display: flex; align-items: center; gap: 16px; min-height: 60px; flex-wrap: wrap; }
.brand { font-weight: 800; font-size: 1.2rem; text-decoration: none; color: var(--fg); letter-spacing: -.01em; }
.brand span { color: var(--blue); }
.main-nav { display: flex; gap: 4px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.main-nav::-webkit-scrollbar { display: none; }
.main-nav a {
  white-space: nowrap; text-decoration: none; color: var(--muted);
  padding: 6px 10px; border-radius: 8px; font-size: .95rem;
}
.main-nav a:hover { color: var(--fg); background: var(--blue-soft); }
.main-nav a[aria-current="page"] { color: var(--fg); font-weight: 600; background: var(--blue-soft); }
.lang select {
  font: inherit; font-size: .9rem; color: var(--fg); background: var(--surface);
  border: 1px solid var(--line); border-radius: 8px; padding: 5px 8px;
}
@media (max-width: 720px) {
  .header-row { gap: 8px; padding-top: 8px; padding-bottom: 8px; }
  .main-nav { order: 3; flex-basis: 100%; }
}

/* hero */
.hero { background: var(--hero); color: var(--hero-fg); padding: 56px 0 48px; }
.hero .lead { color: var(--hero-muted); font-size: 1.2rem; max-width: 36em; }
.hero-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 32px; align-items: center; }
.hero-art { border-radius: var(--radius); box-shadow: 0 20px 60px rgba(0,0,0,.45); }
.hero-icon { width: 160px; border-radius: 36px; margin: 0 auto; display: block; box-shadow: 0 20px 60px rgba(0,0,0,.5); }
.hero-blue { background: radial-gradient(1200px 400px at 80% 50%, rgba(10,132,232,.22), transparent 60%), var(--hero); }
.hero-red { background: radial-gradient(1200px 400px at 80% 50%, rgba(217,31,44,.22), transparent 60%), var(--hero); }
.hero-home { padding-bottom: 72px; background: radial-gradient(900px 360px at 20% 0%, rgba(10,132,232,.25), transparent 60%), radial-gradient(900px 360px at 90% 100%, rgba(217,31,44,.18), transparent 60%), var(--hero); }
@media (max-width: 820px) {
  .hero { padding: 36px 0 32px; }
  .hero-grid { grid-template-columns: 1fr; }
  .hero-media { order: -1; }
  .hero-icon { width: 112px; border-radius: 26px; }
}
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 20px; }

/* pulsanti */
.btn {
  display: inline-block; padding: 11px 20px; border-radius: 10px; font-weight: 600;
  text-decoration: none; border: 1px solid transparent; line-height: 1.3;
}
.btn-blue { background: var(--blue); color: #fff; }
.btn-red { background: var(--red); color: #fff; }
.btn-blue:hover, .btn-red:hover { filter: brightness(1.08); }
.btn-ghost { border-color: currentColor; color: inherit; }
.hero .btn-ghost { color: var(--hero-fg); border-color: rgba(255,255,255,.35); }
.btn-disabled { background: rgba(127,127,127,.18); color: var(--muted); cursor: default; }
.hero .btn-disabled { color: var(--hero-muted); }

/* blocchi */
.band { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 24px 24px; margin-top: 32px;
  width: calc(100% - 32px); max-width: 1048px; margin-left: auto; margin-right: auto; }
@media (max-width: 600px) { .band { padding: 4px 16px 18px; } }
.intro { font-size: 1.1rem; margin-top: 32px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; margin-top: 16px; }
@media (max-width: 820px) { .two-col { grid-template-columns: 1fr; gap: 0; } }
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.feature { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.band .feature { background: var(--bg); }
.feature h3 { margin-top: 0; }
.feature p { margin: 0; color: var(--muted); }
.checks { padding-left: 1.2em; }
.checks li { margin: .35em 0; }
.steps li { margin: .5em 0; }

.app-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; margin-top: -28px; }
.app-card {
  display: flex; gap: 16px; align-items: flex-start; text-decoration: none; color: var(--fg);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px;
  transition: transform .15s ease, border-color .15s ease;
}
.app-card img { border-radius: 16px; flex-shrink: 0; }
.app-card h2 { margin: 0 0 .3em; font-size: 1.2rem; }
.app-card p { margin: 0 0 .6em; color: var(--muted); }
.app-card .more { font-weight: 600; }
.card-blue .more { color: var(--blue); }
.card-red .more { color: var(--red); }
.app-card:hover { transform: translateY(-2px); border-color: var(--blue); }
.card-red:hover { border-color: var(--red); }

.price-band { text-align: center; }
.price { display: flex; flex-direction: column; align-items: center; padding-top: 20px; }
.price .amount { font-size: 2.6rem; font-weight: 800; }

/* documentazione */
.docs-head { padding-top: 36px; }
.search { position: relative; max-width: 640px; }
.search input {
  width: 100%; font: inherit; padding: 12px 14px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--surface); color: var(--fg);
}
.search input:focus { outline: 2px solid var(--blue); outline-offset: 1px; }
#search-status { min-height: 1.6em; margin: 6px 0 0; font-size: .95rem; }
.docs-grid { display: grid; grid-template-columns: 270px 1fr; gap: 36px; align-items: start; margin-top: 12px; }
.toc { position: sticky; top: 76px; max-height: calc(100vh - 96px); overflow: auto; font-size: .93rem; padding-bottom: 24px; }
.toc summary { font-weight: 700; cursor: pointer; margin-bottom: 6px; }
.toc ol { list-style: none; padding-left: 0; margin: 0; }
.toc > details > ol > li { margin: 10px 0; }
.toc > details > ol > li > a { font-weight: 600; color: var(--fg); }
.toc ol ol { padding-left: 12px; border-left: 1px solid var(--line); margin-top: 4px; }
.toc ol ol li { margin: 3px 0; }
.toc a { text-decoration: none; color: var(--muted); }
.toc a:hover, .toc a.active { color: var(--blue); }
.toc li.hidden { display: none; }
.doc-group > h2 { margin-top: 1.2em; padding-top: 8px; border-top: 1px solid var(--line); }
.doc-group:first-child > h2 { border-top: 0; }
.doc-section { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 4px 22px 14px; margin: 14px 0; }
.doc-section.hidden, .doc-group.hidden { display: none; }
.doc-section h3 { position: relative; }
.doc-section .anchor { position: absolute; left: -16px; color: var(--muted); text-decoration: none; opacity: 0; }
.doc-section h3:hover .anchor { opacity: 1; }
.doc-section table { border-collapse: collapse; width: 100%; font-size: .95rem; }
@media (max-width: 600px) { .doc-section table { display: block; overflow-x: auto; } }
.doc-section th, .doc-section td { text-align: left; border-bottom: 1px solid var(--line); padding: 6px 10px 6px 0; vertical-align: top; }
.note { border-left: 3px solid var(--blue); background: var(--blue-soft); padding: 8px 12px; border-radius: 0 8px 8px 0; }
.warn { border-left: 3px solid var(--red); background: var(--red-soft); padding: 8px 12px; border-radius: 0 8px 8px 0; }
.tag { display: inline-block; font-size: .75rem; font-weight: 700; padding: 1px 7px; border-radius: 99px; background: var(--blue-soft); color: var(--blue); vertical-align: middle; }
mark { background: rgba(255, 196, 0, .35); color: inherit; border-radius: 3px; }
@media (max-width: 900px) {
  .docs-grid { grid-template-columns: 1fr; gap: 0; }
  .toc { position: static; max-height: none; border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; background: var(--surface); }
  .doc-section { padding: 4px 16px 12px; }
}

/* piè di pagina */
.site-footer { margin-top: 56px; border-top: 1px solid var(--line); padding: 24px 0 40px; font-size: .92rem; }
.site-footer p { margin: .4em 0; }

/* adattatore consigliato (link Amazon) */
.adapter-box {
  display: flex; gap: 20px; align-items: center; justify-content: space-between; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--line); border-left: 4px solid #ff9900;
  border-radius: var(--radius); padding: 14px 20px; margin: 20px 0;
}
.adapter-box h3 { margin: 0 0 .3em; }
.adapter-box p { margin: .2em 0; }
.doc-section .adapter-box, .band .adapter-box { background: var(--bg); }
.small { font-size: .85rem; }
.btn-amazon { background: #ff9900; color: #111; white-space: nowrap; }
.btn-amazon:hover { filter: brightness(1.05); }
