/* TrendScan Hub – stile "rivista" (ispirato ai magazine tech: card con immagini grandi, titoli forti, accento arancio-rosso) */
:root { --brand: #e8412c; --brand-dark: #c23422; }
html { scroll-behavior: smooth; font-size: 100%; }
body { font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; }

.brand-bg { background: var(--brand); }
.brand-text { color: var(--brand); }
.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { scrollbar-width: none; }

/* Navigazione */
.nav-link { padding: .5rem .85rem; border-radius: 999px; color: #374151; transition: all .15s; }
.nav-link:hover { color: var(--brand); background: #fff1ee; }
.nav-link.active { background: var(--brand); color: #fff; }

/* Titoli di sezione */
.section-title { display: flex; align-items: center; gap: .9rem; margin-bottom: 1.1rem; }
.section-title h1, .section-title h2 { font-weight: 900; letter-spacing: -.02em; font-size: 1.35rem; line-height: 1.15; white-space: nowrap; position: relative; padding-left: .8rem; }
.section-title h1::before, .section-title h2::before { content: ''; position: absolute; left: 0; top: .12em; bottom: .12em; width: 5px; border-radius: 3px; background: var(--brand); }
.section-bar { flex: 1; height: 1px; background: #d9dce1; }

/* Chip categorie */
.chip { padding: .4rem .85rem; border-radius: 999px; background: #f1f2f4; color: #374151; transition: all .15s; border: 1px solid transparent; }
.chip:hover { border-color: var(--brand); color: var(--brand); }
.chip.active { background: #111; color: #fff; }

.btn-ghost { padding: .5rem 1rem; border-radius: 999px; background: #fff; border: 1px solid #d1d5db; font-weight: 700; font-size: .8rem; transition: all .15s; }
.btn-ghost:hover { border-color: var(--brand); color: var(--brand); }

/* Card articolo */
.card { background: #fff; border-radius: 1rem; overflow: hidden; border: 1px solid #e5e7eb; transition: transform .2s, box-shadow .2s; display: flex; flex-direction: column; }
.card:hover { transform: translateY(-3px); box-shadow: 0 14px 28px -12px rgba(0,0,0,.25); }
.card:hover .card-title { color: var(--brand); }
.thumb { position: relative; overflow: hidden; background: #e5e7eb; }
.thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.card:hover .thumb img, .tile:hover img { transform: scale(1.05); }
.thumb-emoji { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 3.2rem; opacity: .85; }
.cat-badge { position: absolute; left: .7rem; top: .7rem; z-index: 2; padding: .2rem .6rem; border-radius: 6px; background: var(--brand); color: #fff; font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }

/* Gradienti di riserva (se l'immagine non carica si vede questo + emoji) */
.g-risparmio { background: linear-gradient(135deg, #10b981, #0f766e); }
.g-investimenti { background: linear-gradient(135deg, #6366f1, #4338ca); }
.g-pensione { background: linear-gradient(135deg, #f59e0b, #b45309); }
.g-casa { background: linear-gradient(135deg, #0ea5e9, #1d4ed8); }
.g-tasse { background: linear-gradient(135deg, #f43f5e, #9f1239); }
.g-banche { background: linear-gradient(135deg, #8b5cf6, #5b21b6); }
.g-default { background: linear-gradient(135deg, #475569, #1e293b); }

/* Hero */
.hero-main { position: relative; border-radius: 1.25rem; overflow: hidden; min-height: 380px; display: block; color: #fff; }
.hero-main img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .6s; }
.hero-main:hover img { transform: scale(1.04); }
.hero-main .shade { position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,.88) 0%, rgba(0,0,0,.35) 55%, rgba(0,0,0,.05) 100%); }
.hero-side { display: flex; gap: .8rem; background: #fff; border: 1px solid #e5e7eb; border-radius: 1rem; padding: .6rem; transition: box-shadow .2s; }
.hero-side:hover { box-shadow: 0 10px 22px -12px rgba(0,0,0,.3); }
.hero-side:hover .side-title { color: var(--brand); }

/* Tile argomenti */
.tile { position: relative; border-radius: 1rem; overflow: hidden; aspect-ratio: 4/3; display: block; color: #fff; }
.tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.tile .shade { position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,.75), rgba(0,0,0,.05) 70%); }

/* Coda video */
.queue-item { display: flex; gap: .7rem; padding: .6rem .8rem; text-align: left; width: 100%; transition: background .15s; }
.queue-item:hover { background: #f9fafb; }
.queue-item.playing { background: #fff1ee; box-shadow: inset 3px 0 0 var(--brand); }

.vcard { position: relative; display: block; text-align: left; }
.vcard .play { position: absolute; right: .5rem; bottom: .5rem; width: 2.2rem; height: 2.2rem; border-radius: 999px; background: var(--brand); display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 10px rgba(0,0,0,.4); }

/* ==== Isola scura per le Guide (contenuti educativi) ==== */
.glass-panel { background: rgba(17, 24, 39, 0.85); border: 1px solid rgba(255, 255, 255, 0.08); }
.academy-banner { background: linear-gradient(135deg, rgba(147,51,234,.18), rgba(59,130,246,.18)); border: 1px solid rgba(147,51,234,.3); }
.animate-fade-in { animation: fadeIn .3s cubic-bezier(.16,1,.3,1) forwards; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

input[type=range] { -webkit-appearance: none; background: transparent; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; height: 18px; width: 18px; border-radius: 50%; background: #3b82f6; cursor: pointer; margin-top: -6px; box-shadow: 0 0 8px rgba(59,130,246,.6); }
input[type=range]::-webkit-slider-runnable-track { width: 100%; height: 6px; cursor: pointer; background: #1f2937; border-radius: 3px; }
input[type=range]::-moz-range-thumb { height: 18px; width: 18px; border: 0; border-radius: 50%; background: #3b82f6; cursor: pointer; }
input[type=range]::-moz-range-track { height: 6px; background: #1f2937; border-radius: 3px; }

.view.hidden { display: none; }

/* le ancore delle guide non devono finire sotto l'header fisso */
[id^="guide-"] { scroll-margin-top: 150px; }


/* ==== Modalità scura (le Guide sono già scure) ==== */
html.dark body { background: #0a0d14; color: #e5e7eb; }
html.dark #themeToggle { background: #1a2030; border-color: #2b3347; }
html.dark header, html.dark .bg-white:not(#academyRoot *) { background: #121826; }
html.dark .bg-\[\#f4f5f7\] { background: #0a0d14; }
html.dark .bg-gray-100:not(#academyRoot *), html.dark .bg-gray-200:not(#academyRoot *), html.dark .chip { background: #1c2335; color: #d1d5db; }
html.dark .chip.active { background: #e5e7eb; color: #111; }
html.dark .border-gray-100:not(#academyRoot *), html.dark .border-gray-200:not(#academyRoot *), html.dark .border-gray-300:not(#academyRoot *),
html.dark .card, html.dark .hero-side, html.dark .btn-ghost { border-color: #2b3347; }
html.dark .divide-gray-100 > :not([hidden]) ~ :not([hidden]) { border-color: #2b3347; }
html.dark .card, html.dark .hero-side, html.dark .btn-ghost { background: #121826; color: #e5e7eb; }
html.dark .text-gray-900:not(#academyRoot *) { color: #f3f4f6; }
html.dark .text-gray-700:not(#academyRoot *), html.dark .nav-link { color: #d1d5db; }
html.dark .text-gray-600:not(#academyRoot *) { color: #aab2c0; }
html.dark .text-gray-500:not(#academyRoot *) { color: #8b94a7; }
html.dark .nav-link:hover { background: #2a1a17; color: #ff7b66; }
html.dark .nav-link.active { background: var(--brand); color: #fff; }
html.dark .section-bar { background: #2b3347; }
html.dark .thumb { background: #1c2335; }
html.dark .queue-item:hover { background: #1a2030; }
html.dark .queue-item.playing { background: #2a1a17; }
html.dark input, html.dark select { color-scheme: dark; color: #e5e7eb; }
html.dark .focus\:bg-white:focus { background: #1c2335; }
html.dark #academyRoot { border: 1px solid #1f2937; }
html.dark code.bg-gray-100 { background: #1c2335 !important; }

/* ==== Pubblicità (attiva solo da ads.js, dopo il consenso) ==== */
.ad-slot { min-height: 120px; text-align: center; }
.ad-slot::before { content: 'Pubblicità'; display: block; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: #9ca3af; margin-bottom: 2px; }
.ad-slot.hidden { display: none; }


/* ==== Guide: capitoli, sommario e dimensione del testo ==== */
#academyRoot { zoom: var(--guide-zoom, 1); }
[id^="guide-"] { scroll-margin-top: 84px; }
.guide-tools { position: fixed; right: 12px; bottom: 16px; z-index: 30; display: flex; gap: 6px; padding: 6px; border-radius: 999px; background: rgba(17,24,39,.92); border: 1px solid #374151; box-shadow: 0 8px 24px rgba(0,0,0,.35); }
.guide-tools button { min-width: 38px; height: 38px; padding: 0 10px; border-radius: 999px; color: #fff; font-weight: 900; font-size: 14px; background: #1f2937; }
.guide-tools button:hover { background: #4f46e5; }
.guide-tools button[disabled], .fs-btn[disabled] { opacity: .35; cursor: not-allowed; }
.view.hidden .guide-tools { display: none; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }


/* ==== Lettura dentro TrendScan (vista articolo) ==== */
.reader { max-width: 46rem; margin: 0 auto; }
.reader-bar { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin-bottom: 1.25rem; }
.reader-back { display: inline-flex; align-items: center; gap: .35rem; padding: .55rem 1.05rem; border-radius: 999px; background: #fff; border: 1px solid #d1d5db; font-weight: 800; font-size: .82rem; color: #374151; transition: all .15s; }
.reader-back:hover { border-color: var(--brand); color: var(--brand); }
.reader-back-home { background: var(--brand); border-color: var(--brand); color: #fff; }
.reader-back-home:hover { background: var(--brand-dark); border-color: var(--brand-dark); color: #fff; }
.reader-article { background: #fff; border: 1px solid #e5e7eb; border-radius: 1.25rem; padding: 1.4rem 1.25rem 1.6rem; }
@media (min-width: 640px) { .reader-article { padding: 2rem 2.25rem 2.25rem; } }
.reader-cat { display: inline-block; padding: .25rem .7rem; border-radius: 6px; color: #fff; font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.reader-title { margin-top: .85rem; font-weight: 900; letter-spacing: -.02em; line-height: 1.15; font-size: 1.65rem; outline: none; }
@media (min-width: 640px) { .reader-title { font-size: 2.15rem; } }
.reader-meta { display: flex; flex-wrap: wrap; gap: .25rem 1rem; margin-top: .8rem; font-size: .8rem; color: #6b7280; }
.reader-meta b { color: #111827; }
.reader-figure { margin-top: 1.25rem; }
.reader-figure .thumb { aspect-ratio: 16 / 9; border-radius: .9rem; }
.reader-figure figcaption { margin-top: .4rem; font-size: 11px; color: #9ca3af; }
.reader-summary { margin-top: 1.4rem; padding: 1rem 1.15rem; border-left: 4px solid var(--brand); background: #fff7f5; border-radius: 0 .75rem .75rem 0; }
.reader-summary p { font-size: 1.1rem; line-height: 1.65; margin-top: .3rem; }
.reader-label { font-size: 10px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--brand); }
.reader-cta { display: flex; align-items: center; justify-content: center; gap: .5rem; margin-top: 1.5rem; padding: .95rem 1.2rem; border-radius: .9rem; background: #111827; color: #fff; font-weight: 800; font-size: .98rem; text-align: center; transition: background .15s; }
.reader-cta:hover { background: var(--brand); }
.reader-note { margin-top: 1rem; font-size: .75rem; line-height: 1.55; color: #6b7280; }
.reader-related { margin-top: 2.25rem; }
.reader-bottom { margin-top: 1.75rem; text-align: center; }
.reader-related .card { text-align: left; }
@media (min-width: 1024px) { .reader-related { max-width: none; } }
/* le "altre notizie" possono usare piu' larghezza della colonna di lettura */
#view-articolo .reader { max-width: 64rem; }
#view-articolo .reader-bar, #view-articolo .reader-article, #view-articolo .reader-bottom { max-width: 46rem; margin-left: auto; margin-right: auto; }
#view-articolo .reader-bar { margin-bottom: 1rem; }

/* ==== Home: titoli per argomento ==== */
.topic-box { background: #fff; border: 1px solid #e5e7eb; border-radius: 1rem; overflow: hidden; display: flex; flex-direction: column; }
.topic-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .65rem .9rem; color: #fff; font-weight: 900; font-size: .9rem; }
.topic-all { font-size: .72rem; font-weight: 800; opacity: .9; text-decoration: underline; text-underline-offset: 2px; }
.topic-all:hover { opacity: 1; }
.topic-list { display: flex; flex-direction: column; }
.topic-link { display: block; padding: .7rem .9rem; border-top: 1px solid #f1f2f4; transition: background .15s; }
.topic-link:first-child { border-top: 0; }
.topic-link:hover { background: #fff7f5; }
.topic-link:hover .topic-title { color: var(--brand); }
.topic-title { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; font-weight: 800; font-size: .92rem; line-height: 1.3; transition: color .15s; }
.topic-meta { display: block; margin-top: .25rem; font-size: 11px; color: #6b7280; }

/* modalita' scura per le nuove parti */
html.dark .reader-back { background: #121826; border-color: #2b3347; color: #d1d5db; }
html.dark .reader-back-home { background: var(--brand); border-color: var(--brand); color: #fff; }
html.dark .reader-article, html.dark .topic-box { background: #121826; border-color: #2b3347; color: #e5e7eb; }
html.dark .reader-meta, html.dark .reader-note, html.dark .topic-meta { color: #8b94a7; }
html.dark .reader-meta b { color: #f3f4f6; }
html.dark .reader-summary { background: #1c1f2e; }
html.dark .reader-cta { background: #e5e7eb; color: #111827; }
html.dark .reader-cta:hover { background: var(--brand); color: #fff; }
html.dark .topic-link { border-color: #1f2740; }
html.dark .topic-link:hover { background: #1a2030; }

/* ==== Telefoni: niente scorrimento orizzontale (campo di ricerca nell'header e titoli di sezione lunghi) ==== */
@media (max-width: 639px) {
  header .ml-auto:has(#searchInput) { flex: 1 1 auto; min-width: 0; justify-content: flex-end; }
  header .relative:has(> #searchInput) { flex: 1 1 0; min-width: 0; max-width: 14rem; }
  #searchInput { width: 100%; min-width: 0; }
  .section-title { flex-wrap: wrap; gap: .35rem .9rem; }
  .section-title h1, .section-title h2 { white-space: normal; }
  .section-bar { display: none; }
}


/* ==== Mercati: cambi BCE + Termometro TrendScan ==== */
.mk-tile { display: flex; flex-direction: column; gap: .15rem; background: #fff; border: 1px solid #e5e7eb; border-radius: 1rem; padding: .85rem 1rem; transition: border-color .15s, box-shadow .15s; min-width: 0; }
.mk-tile:hover { border-color: var(--brand); box-shadow: 0 4px 14px rgba(0,0,0,.06); }
.mk-label { font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: #6b7280; }
.mk-rate { font-size: 1.45rem; font-weight: 900; letter-spacing: -.02em; line-height: 1.15; font-variant-numeric: tabular-nums; }
.mk-chg { font-size: .8rem; font-weight: 800; font-variant-numeric: tabular-nums; color: #6b7280; }
.mk-sub { font-size: 11px; color: #6b7280; }
.mk-up { color: #059669; }
.mk-down { color: #dc2626; }
.mk-sparkwrap { margin-top: auto; padding-top: .35rem; color: #6b7280; }
.mk-sparkwrap.mk-up, .mk-trend.mk-up { color: #059669; }
.mk-sparkwrap.mk-down, .mk-trend.mk-down { color: #dc2626; }
.mk-spark { display: block; width: 100%; height: 28px; }
.mk-credit { margin-top: .6rem; font-size: 11px; line-height: 1.5; color: #6b7280; }
.mk-thermo-row { display: flex; align-items: baseline; flex-wrap: wrap; gap: .35rem .5rem; margin-top: .1rem; }
.mk-score { font-size: 2.1rem; font-weight: 900; line-height: 1; font-variant-numeric: tabular-nums; }
.mk-score-xl { font-size: 3.4rem; }
.mk-of { font-size: .85rem; font-weight: 700; color: #9ca3af; }
.mk-tone { margin-left: auto; font-size: .8rem; font-weight: 900; padding: .15rem .6rem; border-radius: 999px; background: #f3f4f6; }
.mk-t1 { color: #dc2626; } .mk-t2 { color: #b45309; } .mk-t3 { color: #059669; }
.mk-tone.mk-t1 { background: #fee2e2; } .mk-tone.mk-t2 { background: #fef3c7; } .mk-tone.mk-t3 { background: #d1fae5; }
.mk-gauge { margin-top: .55rem; }
.mk-gauge-bar { position: relative; display: flex; height: .6rem; border-radius: 999px; overflow: visible; }
.mk-gauge-bar > span { display: block; height: 100%; }
.mk-gauge-bar > span:first-of-type { border-radius: 999px 0 0 999px; }
.mk-gauge-bar > span:last-of-type { border-radius: 0 999px 999px 0; }
.mk-z1 { background: #fca5a5; } .mk-z2 { background: #fcd34d; } .mk-z3 { background: #6ee7b7; }
.mk-marker { position: absolute; top: -.3rem; width: .9rem; height: 1.2rem; margin-left: -.45rem; border-radius: 999px; background: #111827; border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.35); }
.mk-gauge-scale { display: flex; justify-content: space-between; margin-top: .3rem; font-size: 10px; color: #9ca3af; }
/* vista Mercati */
.mk-page { max-width: 56rem; margin: 0 auto; }
.mk-head h1 { font-size: 2rem; font-weight: 900; letter-spacing: -.02em; }
.mk-head p { margin-top: .3rem; font-size: .9rem; color: #6b7280; }
.mk-card { margin-top: 1.25rem; background: #fff; border: 1px solid #e5e7eb; border-radius: 1.25rem; padding: 1.25rem 1.25rem 1.4rem; }
@media (min-width: 640px) { .mk-card { padding: 1.6rem 1.9rem 1.8rem; } }
.mk-h2 { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; font-size: 1.25rem; font-weight: 900; }
.mk-badge { font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; padding: .15rem .55rem; border-radius: 999px; background: #f3f4f6; color: #4b5563; }
.mk-lead { margin-top: .5rem; font-size: .92rem; line-height: 1.6; color: #4b5563; }
.mk-big { margin-top: 1rem; }
.mk-facts { margin-top: 1rem; display: grid; gap: .3rem; font-size: .88rem; color: #374151; }
.mk-facts b { font-weight: 800; }
.mk-histwrap { margin-top: 1rem; }
.mk-hist { display: block; width: 100%; height: 60px; color: #6366f1; margin-top: .3rem; }
.mk-note { margin-top: 1rem; font-size: 12px; line-height: 1.6; color: #6b7280; }
.mk-disclaimer { margin-top: 1.25rem; font-size: 12px; line-height: 1.6; color: #6b7280; text-align: center; }
.mk-tablewrap { margin-top: 1rem; overflow-x: auto; }
.mk-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.mk-table th, .mk-table td { padding: .65rem .5rem; border-bottom: 1px solid #f1f2f4; text-align: left; white-space: nowrap; vertical-align: middle; }
.mk-table thead th { font-size: 11px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: #6b7280; }
.mk-table .mk-num { text-align: right; font-variant-numeric: tabular-nums; }
.mk-trend { width: 8rem; color: #6b7280; }
.mk-trend .mk-spark { height: 32px; }
.mk-table tbody tr:last-child th, .mk-table tbody tr:last-child td { border-bottom: 0; }
@media (max-width: 639px) { .mk-score-xl { font-size: 2.8rem; } .mk-head h1 { font-size: 1.6rem; } .mk-trend { display: none; } .mk-table thead th:last-child { display: none; } }

html.dark .mk-tile, html.dark .mk-card { background: #121826; border-color: #2b3347; color: #e5e7eb; }
html.dark .mk-label, html.dark .mk-sub, html.dark .mk-credit, html.dark .mk-note, html.dark .mk-disclaimer, html.dark .mk-head p, html.dark .mk-table thead th { color: #8b94a7; }
html.dark .mk-lead, html.dark .mk-facts { color: #c3c9d6; }
html.dark .mk-tone, html.dark .mk-badge { background: #1c2438; color: #c3c9d6; }
html.dark .mk-tone.mk-t1 { background: #4c1d1d; color: #fca5a5; } html.dark .mk-tone.mk-t2 { background: #4a3a14; color: #fcd34d; } html.dark .mk-tone.mk-t3 { background: #11392c; color: #6ee7b7; }
html.dark .mk-t1 { color: #f87171; } html.dark .mk-t2 { color: #fbbf24; } html.dark .mk-t3 { color: #34d399; }
html.dark .mk-up { color: #34d399; } html.dark .mk-down { color: #f87171; }
html.dark .mk-sparkwrap.mk-up, html.dark .mk-trend.mk-up { color: #34d399; } html.dark .mk-sparkwrap.mk-down, html.dark .mk-trend.mk-down { color: #f87171; }
html.dark .mk-marker { background: #f3f4f6; border-color: #121826; }
html.dark .mk-table th, html.dark .mk-table td { border-color: #1f2740; }
html.dark .mk-hist { color: #818cf8; }

/* ==== Menu: con la voce "Mercati" le etichette non devono andare a capo ==== */
.nav-link { white-space: nowrap; }
.mk-thermo { grid-column: span 2; }
@media (min-width: 1024px) and (max-width: 1439px) {
  #mainNav .nav-link { padding-left: .6rem; padding-right: .6rem; }
  #searchInput { width: 11rem; }
}
@media (min-width: 1280px) and (max-width: 1439px) { #searchInput { width: 14rem; } }
/* tra 1024 e 1279px sei voci non entrano nell'intestazione: "Chi siamo" resta raggiungibile dal piè di pagina */
@media (min-width: 1024px) and (max-width: 1279px) {
  #mainNav a[href="/chi-siamo"] { display: none; }
  #searchInput { width: 9rem; }
}
@media (min-width: 1024px) and (max-width: 1099px) {
  #mainNav { font-size: 12px; margin-left: .25rem; }
  #searchInput { width: 7rem; }
}
@media (max-width: 639px) {
  .mk-table { font-size: .82rem; }
  .mk-table th, .mk-table td { padding: .6rem .3rem; }
  .mk-table thead th { font-size: 10px; letter-spacing: 0; }
}
@media (max-width: 639px) {
  .mk-table tbody th { white-space: normal; max-width: 5.6rem; }
  .mk-table tbody th .mk-sub { white-space: normal; line-height: 1.25; }
}
@media (max-width: 639px) {
  .mk-card { padding: 1.1rem .9rem 1.25rem; }
  .mk-table th, .mk-table td { padding: .6rem .2rem; }
  .mk-table tbody th { max-width: 5rem; }
}


/* ==== Pagina Criptovalute (guida per principianti) ==== */
.cx-lead { font-size: 1.1rem; line-height: 1.65; color: #374151; margin-top: .9rem; }
.cx-updated { display: inline-block; margin-top: .9rem; padding: .2rem .7rem; border-radius: 999px; background: #f3f4f6; color: #4b5563; font-size: 12px; font-weight: 700; }
.cx-warn, .cx-note { margin-top: 1.25rem; padding: 1rem 1.15rem; border-radius: .9rem; font-size: .95rem; line-height: 1.6; }
.cx-warn { background: #fef2f2; border: 1px solid #fecaca; color: #7f1d1d; }
.cx-warn strong:first-child, .cx-note strong:first-child { display: block; margin-bottom: .2rem; font-size: 1rem; }
.cx-note { background: #fff7f5; border: 1px solid #fbd5cc; color: #374151; border-left: 4px solid var(--brand); }
.cx-toc { margin-top: 1.5rem; padding: 1rem 1.15rem; border-radius: .9rem; background: #f9fafb; border: 1px solid #e5e7eb; }
.cx-toc b { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: #6b7280; }
.cx-toc ol { margin-top: .5rem; padding-left: 1.2rem; list-style: decimal; display: grid; gap: .25rem; font-weight: 700; font-size: .92rem; }
.cx-toc a { color: var(--brand); }
.cx-toc a:hover { text-decoration: underline; }
.cx-h3 { margin-top: 1.4rem; font-size: 1.05rem; font-weight: 900; color: #111827; }
.cx-stats { margin-top: 1rem; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
@media (min-width: 640px) { .cx-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.cx-stat { padding: .85rem .9rem; border-radius: .9rem; background: #f9fafb; border: 1px solid #e5e7eb; }
.cx-stat b { display: block; font-size: 1.5rem; font-weight: 900; letter-spacing: -.02em; line-height: 1.1; color: #111827; }
.cx-stat span { display: block; margin-top: .25rem; font-size: 12px; line-height: 1.4; color: #6b7280; }
.cx-tablewrap { margin-top: 1rem; overflow-x: auto; border: 1px solid #e5e7eb; border-radius: .9rem; }
.cx-table { width: 100%; min-width: 34rem; border-collapse: collapse; font-size: .9rem; line-height: 1.5; }
.cx-table th, .cx-table td { padding: .75rem .85rem; text-align: left; vertical-align: top; border-bottom: 1px solid #f1f2f4; }
.cx-table thead th { background: #f9fafb; font-size: 11px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: #6b7280; }
.cx-table tbody th { font-weight: 900; color: #111827; width: 7.5rem; }
.cx-table.cx-t4 { min-width: 35rem; }
.cx-table tbody tr:last-child th, .cx-table tbody tr:last-child td { border-bottom: 0; }
.cx-pills { margin-top: .9rem; display: flex; flex-wrap: wrap; gap: .5rem; }
.cx-pill { padding: .4rem .8rem; border-radius: 999px; background: #f3f4f6; border: 1px solid #e5e7eb; font-size: .85rem; font-weight: 700; color: #1f2937; }
.cx-pill small { font-weight: 600; color: #6b7280; }
.cx-cards { margin-top: 1rem; display: grid; gap: .9rem; }
@media (min-width: 640px) { .cx-cards.cols2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.cx-card { padding: 1rem 1.1rem; border-radius: .9rem; border: 1px solid #e5e7eb; background: #fff; }
.cx-card h4 { font-weight: 900; font-size: 1rem; color: #111827; }
.cx-card p, .cx-card li { margin-top: .4rem; font-size: .9rem; line-height: 1.55; color: #4b5563; }
.cx-card ul { list-style: disc; padding-left: 1.1rem; }
.cx-tag { display: inline-block; margin-bottom: .35rem; padding: .1rem .55rem; border-radius: 999px; font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; background: #f3f4f6; color: #4b5563; }
.cx-tag.ok { background: #d1fae5; color: #065f46; } .cx-tag.mid { background: #fef3c7; color: #92400e; } .cx-tag.no { background: #fee2e2; color: #991b1b; }
.cx-steps { margin-top: .9rem; padding-left: 1.3rem; list-style: decimal; display: grid; gap: .5rem; color: #374151; line-height: 1.6; }
.cx-small { margin-top: .9rem; font-size: 12px; line-height: 1.6; color: #6b7280; }
.cx-sources { margin-top: .6rem; padding-left: 1.2rem; list-style: disc; display: grid; gap: .3rem; font-size: .85rem; color: #4b5563; }
.cx-sources a, .cx-link { color: var(--brand); font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }

html.dark .cx-lead { color: #c3c9d6; }
html.dark .cx-updated, html.dark .cx-pill, html.dark .cx-tag { background: #1c2438; color: #c3c9d6; border-color: #2b3347; }
html.dark .cx-warn { background: #3b1414; border-color: #6b2323; color: #fecaca; }
html.dark .cx-note { background: #1c1f2e; border-color: #3a2a2a; color: #d1d5db; }
html.dark .cx-toc, html.dark .cx-stat, html.dark .cx-card { background: #121826; border-color: #2b3347; }
html.dark .cx-toc b, html.dark .cx-stat span, html.dark .cx-small, html.dark .cx-pill small { color: #8b94a7; }
html.dark .cx-h3, html.dark .cx-stat b, html.dark .cx-card h4, html.dark .cx-table tbody th { color: #f3f4f6; }
html.dark .cx-card p, html.dark .cx-card li, html.dark .cx-sources, html.dark .cx-steps { color: #b8c0cf; }
html.dark .cx-tablewrap { border-color: #2b3347; }
html.dark .cx-table thead th { background: #121826; color: #8b94a7; }
html.dark .cx-table th, html.dark .cx-table td { border-color: #1f2740; }
html.dark .cx-table td { color: #c3c9d6; }
html.dark .cx-tag.ok { background: #11392c; color: #6ee7b7; } html.dark .cx-tag.mid { background: #4a3a14; color: #fcd34d; } html.dark .cx-tag.no { background: #4c1d1d; color: #fca5a5; }
/* le sezioni raggiunte dall'indice non devono finire sotto l'intestazione fissa */
article h2[id], article h3[id] { scroll-margin-top: 5.5rem; }

/* su telefono e tablet stretti le tabelle diventano schede impilate: niente colonne tagliate */
@media (max-width: 719px) {
  .cx-tablewrap { border: 0; overflow: visible; }
  .cx-table, .cx-table.cx-t4 { min-width: 0; }
  .cx-table thead { display: none; }
  .cx-table, .cx-table tbody, .cx-table tr, .cx-table th, .cx-table td { display: block; width: auto; }
  .cx-table tr { margin-top: .75rem; padding: .85rem 1rem; border: 1px solid #e5e7eb; border-radius: .9rem; background: #fff; }
  .cx-table tbody th { padding: 0 0 .35rem; border: 0; font-size: 1rem; width: auto; }
  .cx-table td { padding: .45rem 0 0; border: 0; }
  .cx-table td::before { content: attr(data-label); display: block; margin-bottom: .1rem; font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: #6b7280; }
  html.dark .cx-table tr { background: #121826; border-color: #2b3347; }
  html.dark .cx-table td::before { color: #8b94a7; }
}

/* pagine statiche su telefono e tablet stretti: logo e interruttore del tema sulla stessa riga, menu a tutta larghezza sotto */
@media (max-width: 819px) {
  header > div.max-w-5xl { row-gap: .35rem; }
  header > div.max-w-5xl > #themeToggle { order: 2; }
  header > div.max-w-5xl > nav { order: 3; flex: 1 0 100%; }
}


/* ==== Trend Radar (dentro Mercati) ==== */
/* le tre misure hanno ciascuna colore, icona e nome: mai solo il colore */
.rd-badge { display: inline-flex; align-items: center; gap: .3rem; padding: .15rem .6rem; border-radius: 999px; font-size: 11px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; }
.rd-badge.rd-m-interest { background: #e0e7ff; color: #3730a3; }
.rd-badge.rd-m-news { background: #ffedd5; color: #9a3412; }
.rd-badge.rd-m-price { background: #d1fae5; color: #065f46; }
.rd-badge.rd-m-na { background: #f3f4f6; color: #4b5563; }
.rd-sub { font-size: 11px; line-height: 1.45; color: #6b7280; }
.rd-h3 { margin-top: 0; font-size: 1.1rem; font-weight: 900; color: #111827; }
#trendRadar { scroll-margin-top: 5.5rem; }
.rd-note { margin-top: 1rem; padding: .8rem 1.1rem; border-radius: .9rem; background: #fffbeb; border: 1px solid #fde68a; color: #78350f; font-size: .88rem; line-height: 1.55; }
.rd-note p + p { margin-top: .35rem; }
.rd-section .rd-legend, .rd-section .rd-board { margin-top: 1.7rem; padding-top: 1.4rem; border-top: 1px solid #e5e7eb; }
.rd-legend-grid { margin-top: 1rem; display: grid; gap: .9rem; }
@media (min-width: 820px) { .rd-legend-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.rd-legend-card { padding: 1rem 1.05rem; border-radius: .9rem; border: 1px solid #e5e7eb; border-top: 4px solid #9ca3af; }
.rd-legend-card.rd-m-interest { border-top-color: #6366f1; } .rd-legend-card.rd-m-news { border-top-color: #f97316; } .rd-legend-card.rd-m-price { border-top-color: #10b981; }
.rd-legend-card h4 { margin-top: .55rem; font-weight: 900; font-size: 1rem; color: #111827; }
.rd-legend-card p { margin-top: .4rem; font-size: .88rem; line-height: 1.55; color: #4b5563; }
.rd-legend-card p.rd-sub { font-size: 12px; color: #6b7280; }
.rd-sort { margin-top: .9rem; display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; font-size: .82rem; font-weight: 700; color: #6b7280; }
.rd-sort button { padding: .35rem .8rem; border-radius: 999px; border: 1px solid #d1d5db; background: #fff; font-weight: 800; color: #374151; transition: all .15s; }
.rd-sort button:hover { border-color: var(--brand); color: var(--brand); }
.rd-sort button.on { background: #111827; border-color: #111827; color: #fff; }
.rd-tablewrap { margin-top: .9rem; overflow-x: auto; border: 1px solid #e5e7eb; border-radius: .9rem; }
.rd-table { width: 100%; min-width: 40rem; border-collapse: collapse; font-size: .9rem; }
.rd-table th, .rd-table td { padding: .75rem .85rem; text-align: left; vertical-align: top; border-bottom: 1px solid #f1f2f4; }
.rd-table thead th { background: #f9fafb; vertical-align: bottom; }
.rd-th-sub { display: block; margin-top: .25rem; font-size: 10px; font-weight: 700; letter-spacing: 0; text-transform: none; color: #6b7280; }
.rd-table tbody th { font-weight: 900; color: #111827; min-width: 8rem; }
.rd-table tbody tr:last-child th, .rd-table tbody tr:last-child td { border-bottom: 0; }
.rd-rank { width: 2rem; font-weight: 900; color: #9ca3af; font-variant-numeric: tabular-nums; }
.rd-cell { min-width: 10rem; }
.rd-num { font-size: 1.05rem; font-weight: 900; font-variant-numeric: tabular-nums; color: #111827; }
.rd-chg { display: block; margin-top: .15rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.rd-dash { font-weight: 900; color: #9ca3af; }
.rd-na .rd-sub, .rd-block { display: block; margin-top: .15rem; }
.rd-spark { display: block; margin-top: .3rem; width: 90px; color: #6b7280; }
.rd-spark.mk-up { color: #059669; } .rd-spark.mk-down { color: #dc2626; }
.rd-spark .mk-spark { height: 22px; }
.rd-more { margin-top: .9rem; }
.rd-more summary, .rd-method summary { cursor: pointer; font-size: .85rem; font-weight: 800; color: var(--brand); }
.rd-empty { margin-top: .9rem; padding: .9rem 1rem; border-radius: .9rem; background: #f9fafb; border: 1px dashed #d1d5db; font-size: .88rem; color: #6b7280; }
.rd-unavail { margin-top: .9rem; padding: 1rem 1.15rem; border-radius: .9rem; background: #f9fafb; border: 1px dashed #9ca3af; font-size: .9rem; line-height: 1.6; color: #374151; }
.rd-unavail strong { display: block; margin-bottom: .2rem; font-size: 1rem; color: #111827; }
.rd-stories { margin-top: .9rem; display: grid; gap: .6rem; }
.rd-story { display: flex; gap: .9rem; align-items: flex-start; padding: .8rem .95rem; border: 1px solid #e5e7eb; border-radius: .9rem; }
.rd-story-n { flex: none; width: 3.2rem; text-align: center; padding: .35rem 0; border-radius: .7rem; background: #ffedd5; color: #9a3412; }
.rd-story-n b { display: block; font-size: 1.35rem; font-weight: 900; line-height: 1; }
.rd-story-n span { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.rd-story-title { font-weight: 800; line-height: 1.35; color: #111827; }
a.rd-story-title:hover { color: var(--brand); }
.rd-chip { display: inline-block; margin: .3rem .3rem 0 0; padding: .1rem .55rem; border-radius: 999px; background: #f3f4f6; font-size: 11px; font-weight: 700; color: #4b5563; }
.rd-prices { margin-top: .9rem; display: grid; gap: .4rem; }
.rd-price { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .6rem .9rem; border: 1px solid #e5e7eb; border-radius: .8rem; font-size: .92rem; }
.rd-price .rd-chg { margin: 0; }
.rd-method { margin-top: 1.7rem; padding: 1rem 1.2rem; border: 1px solid #e5e7eb; border-radius: 1rem; }
.rd-method ul { margin-top: .7rem; display: grid; gap: .5rem; padding-left: 1.1rem; list-style: disc; font-size: .86rem; line-height: 1.6; color: #4b5563; }
.rd-method p { margin-top: .7rem; }

/* blocco compatto nella home, dentro la sezione Mercati */
.rd-strip { margin-top: 1.5rem; padding: 1.1rem 1.15rem 1rem; background: #fff; border: 1px solid #e5e7eb; border-radius: 1.1rem; }
.rd-strip-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: .3rem .8rem; }
.rd-strip-head h3 { font-size: 1.2rem; font-weight: 900; letter-spacing: -.01em; }
.rd-strip-link { margin-left: auto; font-size: .85rem; font-weight: 800; color: var(--brand); white-space: nowrap; }
.rd-mini-grid { margin-top: .8rem; display: grid; gap: .7rem; grid-template-columns: 1fr; }
@media (min-width: 700px) { .rd-mini-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .rd-mini-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.rd-mini { display: flex; flex-direction: column; gap: .35rem; padding: .85rem .95rem; border: 1px solid #e5e7eb; border-radius: .9rem; background: #fafafa; min-width: 0; }
.rd-mini-head { display: flex; flex-direction: column; align-items: flex-start; gap: .4rem; }
.rd-mini-head h4 { font-size: .92rem; font-weight: 900; line-height: 1.25; color: #111827; }
.rd-mini ul { display: grid; gap: .3rem; font-size: .88rem; }
.rd-mini li { display: flex; justify-content: space-between; gap: .6rem; align-items: baseline; }
.rd-mini li span { font-weight: 700; color: #374151; }
.rd-mini li b { white-space: nowrap; font-variant-numeric: tabular-nums; }
.rd-mini-empty { font-size: .84rem; line-height: 1.5; color: #4b5563; }
.rd-mini-na { background: #fff; border-style: dashed; }
.rd-mini-stories li { flex-direction: column; gap: .1rem; align-items: flex-start; }
.rd-mini-stories a { font-weight: 700; line-height: 1.3; color: #1f2937; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rd-mini-stories a:hover { color: var(--brand); }
.rd-mini-stories b { font-size: 11px; color: #9a3412; }

@media (max-width: 819px) {
  .rd-table { min-width: 0; }
  .rd-tablewrap { border: 0; overflow: visible; }
  .rd-table thead, .rd-rank { display: none; }
  .rd-table, .rd-table tbody, .rd-table tr, .rd-table th, .rd-table td { display: block; width: auto; }
  .rd-table tr { margin-top: .75rem; padding: .85rem 1rem; border: 1px solid #e5e7eb; border-radius: .9rem; background: #fff; }
  .rd-table tbody th { padding: 0 0 .35rem; border: 0; font-size: 1rem; }
  .rd-table td { padding: .5rem 0 0; border: 0; min-width: 0; }
  .rd-table td::before { display: block; width: fit-content; margin-bottom: .1rem; padding: .05rem .5rem; border-radius: 999px; font-size: 10px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
  .rd-table td[data-label="Interesse"]::before { background: #e0e7ff; color: #3730a3; content: "🔎 Interesse"; }
  .rd-table td[data-label="Notizie"]::before { background: #ffedd5; color: #9a3412; content: "📰 Notizie"; }
  .rd-table td[data-label="Prezzo"]::before { background: #d1fae5; color: #065f46; content: "💹 Prezzo"; }
  .rd-table td > .rd-num, .rd-table td > .rd-dash { display: inline; }
}

html.dark .rd-strip, html.dark .rd-method, html.dark .rd-story, html.dark .rd-price { background: #121826; border-color: #2b3347; color: #e5e7eb; }
html.dark .rd-mini { background: #0f1420; border-color: #2b3347; } html.dark .rd-mini-na { background: #121826; }
html.dark .rd-mini-head h4, html.dark .rd-h3, html.dark .rd-legend-card h4, html.dark .rd-num, html.dark .rd-table tbody th, html.dark .rd-story-title, html.dark .rd-unavail strong { color: #f3f4f6; }
html.dark .rd-mini li span, html.dark .rd-mini-stories a { color: #d1d5db; } html.dark .rd-mini-empty { color: #b8c0cf; }
html.dark .rd-mini-stories b { color: #fdba74; }
html.dark .rd-legend-card { border-color: #2b3347; } html.dark .rd-legend-card p, html.dark .rd-method ul, html.dark .rd-unavail { color: #b8c0cf; }
html.dark .rd-sub, html.dark .rd-th-sub, html.dark .rd-sort { color: #8b94a7; }
html.dark .rd-badge.rd-m-interest { background: #1e1b4b; color: #c7d2fe; } html.dark .rd-badge.rd-m-news { background: #431407; color: #fed7aa; } html.dark .rd-badge.rd-m-price { background: #052e22; color: #a7f3d0; } html.dark .rd-badge.rd-m-na { background: #1c2438; color: #c3c9d6; }
html.dark .rd-note { background: #2a2210; border-color: #5b4a1a; color: #fde68a; }
html.dark .rd-section .rd-legend, html.dark .rd-section .rd-board { border-color: #2b3347; }
html.dark .rd-sort button { background: #121826; border-color: #2b3347; color: #d1d5db; } html.dark .rd-sort button.on { background: #e5e7eb; border-color: #e5e7eb; color: #111827; }
html.dark .rd-tablewrap { border-color: #2b3347; } html.dark .rd-table thead th { background: #121826; color: #8b94a7; }
html.dark .rd-table th, html.dark .rd-table td { border-color: #1f2740; }
html.dark .rd-empty, html.dark .rd-unavail { background: #0f1420; border-color: #3a4256; }
html.dark .rd-story-n { background: #431407; color: #fed7aa; }
html.dark .rd-chip { background: #1c2438; color: #c3c9d6; }
html.dark .rd-spark.mk-up { color: #34d399; } html.dark .rd-spark.mk-down { color: #f87171; }
@media (max-width: 819px) {
  html.dark .rd-table tr { background: #121826; border-color: #2b3347; }
  html.dark .rd-table td[data-label="Interesse"]::before { background: #1e1b4b; color: #c7d2fe; }
  html.dark .rd-table td[data-label="Notizie"]::before { background: #431407; color: #fed7aa; }
  html.dark .rd-table td[data-label="Prezzo"]::before { background: #052e22; color: #a7f3d0; }
}


/* ============ Home per chi parte da zero ============ */
/* Benvenuto */
.welcome { position: relative; overflow: hidden; border-radius: 1.5rem; padding: 2rem 1.4rem; color: #fff; background: linear-gradient(135deg, #111827 0%, #1f2937 55%, #7f1d1d 130%); }
@media (min-width: 640px) { .welcome { padding: 3rem 2.6rem; } }
.welcome::after { content: ''; position: absolute; right: -90px; top: -90px; width: 320px; height: 320px; border-radius: 50%; background: var(--brand); opacity: .22; filter: blur(60px); pointer-events: none; }
.welcome > * { position: relative; z-index: 1; }
.welcome-badge { display: inline-block; padding: .25rem .7rem; border-radius: 6px; background: var(--brand); font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.welcome h1 { margin-top: .9rem; max-width: 40rem; font-size: 1.9rem; line-height: 1.12; font-weight: 900; letter-spacing: -.02em; }
@media (min-width: 640px) { .welcome h1 { font-size: 3rem; } }
.welcome h1 span { color: #ff9b8a; }
.welcome-sub { margin-top: .9rem; max-width: 40rem; color: #d1d5db; font-size: 1rem; line-height: 1.55; }
.welcome-cta { margin-top: 1.4rem; display: flex; flex-wrap: wrap; gap: .7rem; }
.welcome-btn { padding: .8rem 1.3rem; border-radius: 999px; font-weight: 800; font-size: .95rem; transition: transform .15s, background .15s; }
.welcome-btn:hover { transform: translateY(-2px); }
.welcome-btn-main { background: var(--brand); color: #fff; }
.welcome-btn-main:hover { background: var(--brand-dark); }
.welcome-btn-alt { background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.35); color: #fff; }
.welcome-btn-alt:hover { background: rgba(255,255,255,.2); }
.welcome-trust { margin-top: 1.4rem; display: flex; flex-direction: column; gap: .3rem; font-size: .8rem; color: #cbd5e1; }
@media (min-width: 900px) { .welcome-trust { flex-direction: row; flex-wrap: wrap; gap: .4rem 1.4rem; } }
.welcome-trust a { text-decoration: underline; color: #fff; }

/* Percorso in 5 passi */
.path-card { position: relative; display: flex; flex-direction: column; padding: 1rem; background: #fff; border: 1px solid #e5e7eb; border-radius: 1rem; transition: transform .2s, box-shadow .2s, border-color .2s; }
.path-card:hover { transform: translateY(-3px); border-color: var(--brand); box-shadow: 0 14px 28px -14px rgba(0,0,0,.25); }
.path-card:hover .card-title { color: var(--brand); }
.path-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: .7rem; }
.path-num { width: 1.9rem; height: 1.9rem; border-radius: 999px; background: var(--brand); color: #fff; font-weight: 900; font-size: .9rem; display: flex; align-items: center; justify-content: center; }
.path-icon { width: 2.6rem; height: 2.6rem; border-radius: .75rem; display: flex; align-items: center; justify-content: center; font-size: 1.4rem; }
html.dark .path-card { background: #121826; border-color: #2b3347; color: #e5e7eb; }

/* Mini-glossario e tooltip */
.glossary { background: #fff; border: 1px solid #e5e7eb; border-radius: 1rem; }
.glossary > summary { cursor: pointer; padding: .9rem 1.1rem; font-weight: 800; font-size: .95rem; list-style: none; }
.glossary > summary::-webkit-details-marker { display: none; }
.glossary > summary::after { content: '＋'; float: right; color: var(--brand); }
.glossary[open] > summary::after { content: '－'; }
.glossary-list { display: grid; gap: .8rem 1.6rem; padding: 0 1.1rem 1.1rem; grid-template-columns: 1fr; }
@media (min-width: 768px) { .glossary-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.glossary-list dt { font-weight: 900; font-size: .9rem; color: var(--brand); }
.glossary-list dd { font-size: .85rem; color: #4b5563; line-height: 1.45; }
html.dark .glossary { background: #121826; border-color: #2b3347; }
html.dark .glossary-list dd { color: #aab2c0; }
abbr.gl { position: relative; text-decoration: underline dotted; text-underline-offset: 3px; cursor: help; }
abbr.gl:focus { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 2px; }

/* Mini-simulatore */
.hsim { padding: 1.4rem; background: #fff; border: 1px solid #e5e7eb; border-radius: 1.5rem; }
@media (min-width: 640px) { .hsim { padding: 1.8rem; } }
.hsim-badge { display: inline-block; padding: .2rem .6rem; border-radius: 6px; background: #ecfdf5; color: #047857; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.hsim h2 { margin-top: .6rem; font-size: 1.5rem; font-weight: 900; letter-spacing: -.02em; line-height: 1.15; }
.hsim-sub { margin-top: .3rem; font-size: .85rem; color: #6b7280; }
.hsim-inputs { margin-top: 1.1rem; display: grid; gap: .35rem; }
.hsim-inputs label { display: flex; justify-content: space-between; gap: 1rem; font-size: .9rem; font-weight: 600; margin-top: .5rem; }
.hsim-inputs label b { color: #047857; font-weight: 900; }
.hsim-inputs input[type=range] { width: 100%; accent-color: #10b981; }
.hsim-res { margin-top: 1.2rem; display: grid; gap: .6rem; grid-template-columns: 1fr; }
@media (min-width: 640px) { .hsim-res { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.hsim-res > div { padding: .8rem .9rem; border-radius: .9rem; background: #f3f4f6; display: flex; flex-direction: column; gap: .2rem; }
.hsim-res > div:last-child { background: #ecfdf5; }
.hsim-res span { font-size: 11px; color: #6b7280; line-height: 1.3; }
.hsim-res b { font-size: 1.35rem; font-weight: 900; }
.hsim-note { margin-top: .9rem; font-size: 11px; line-height: 1.5; color: #6b7280; }
.hsim-note button { color: var(--brand); }
html.dark .hsim { background: #121826; border-color: #2b3347; }
html.dark .hsim-res > div { background: #1c2335; }
html.dark .hsim-res > div:last-child { background: #0f2a22; }
html.dark .hsim-badge { background: #0f2a22; color: #6ee7b7; }
html.dark .hsim-inputs label b { color: #34d399; }
html.dark .hsim-sub, html.dark .hsim-res span, html.dark .hsim-note { color: #8b94a7; }

/* Regalo Excel */
.gift { display: flex; flex-direction: column; justify-content: center; gap: .6rem; padding: 1.5rem; border-radius: 1.5rem; color: #fff; background: linear-gradient(135deg, #065f46, #10b981); border: 1px solid rgba(52, 211, 153, .6); transition: transform .2s; }
.gift:hover { transform: translateY(-3px); }
.gift-btn { align-self: flex-start; margin-top: .4rem; padding: .7rem 1.2rem; border-radius: .8rem; background: #fff; color: #065f46; font-weight: 800; font-size: .9rem; }

/* Radar: frase in italiano semplice */
.rd-plain { margin-top: .6rem; font-size: .9rem; color: #374151; }
html.dark .rd-plain { color: #d1d5db; }

.home-latest { margin-top: 1.25rem; }

#glTip { position: fixed; z-index: 60; display: none; width: max-content; max-width: min(18rem, calc(100vw - 16px)); padding: .55rem .7rem; border-radius: .6rem; background: #111827; color: #f3f4f6; font-size: .75rem; font-weight: 500; line-height: 1.4; box-shadow: 0 10px 25px -8px rgba(0,0,0,.5); pointer-events: none; }
html.dark #glTip { background: #f3f4f6; color: #111827; }
